MES system user interface multi-language switching method and system based on WCF protocol

文档序号:7275 发布日期:2021-09-17 浏览:24次 中文

1. A method for switching multiple languages of a user interface of an MES system based on a WCF protocol is characterized by comprising the following steps:

the local cache stores a multinational language table; language tags of a user interface are stored in the multi-country language table, each language tag corresponds to a tag text of a plurality of languages, and each language corresponds to a preset language mark;

acquiring a language switching instruction; the language switching instruction comprises the corresponding language mark or the language switching instruction is the corresponding language mark;

inquiring the language tag corresponding to the user interface in the multi-country language table cached locally according to the language switching instruction;

and selecting a corresponding language based on the language tag, and replacing the tag text of each language tag in the user interface with the tag text of the corresponding language in the multi-country language table in the local cache.

2. The method as claimed in claim 1, further comprising, after said querying said language tags corresponding to user interfaces from said locally cached multilingual table according to said language switching instructions:

when a language tag of a user interface needing replacing a tag text is absent in the locally cached multi-national language table, sending a corresponding query request to the WCF server (2) according to the absent language tag;

acquiring a newly added language tag transmitted by the WCF server (2) based on the query request and newly added tag texts corresponding to a plurality of languages;

storing the newly added language tags and the newly added tag texts corresponding to a plurality of languages in a locally cached multinational language table;

and replacing the tag text of the corresponding language tag in the user interface with the newly added tag text.

3. The method as claimed in claim 1, wherein the method comprises, before storing the language table in the local cache:

acquiring MES login interface operation information and transmitting access information to the WCF server (2);

-responding to said multinational language table transmitted by said WCF server (2) according to said access information;

storing the multi-national language table in a local cache;

after the obtaining of the MES login interface operation information, the method comprises the following steps:

acquiring MES user exit information and MES program closing information;

and releasing the multinational language table in the local cache after acquiring the MES user exit information or the MES program closing information.

4. The method as claimed in claim 3, further comprising after obtaining the MES user exit information or the MES program closing information:

storing the language switching instruction of the last time before closing the MES program in a registry of the MES program;

after the storing the multi-lingual table in a local cache, further comprising:

and replacing the label text of the language label of the user interface according to the language switching instruction stored in the MES program registry for the last time.

5. The method as claimed in claim 1, wherein the language switching instruction is obtained at or after the MES account is logged in.

6. A method for switching multiple languages of a user interface of an MES system based on a WCF protocol is characterized by comprising the following steps:

after the access information transmitted by the MES client (1) is acquired, a multinational language table in an MES database (3) is called;

transmitting the multinational language form to the MES client (1).

7. The method for switching between languages of a MES System User Interface (UI) based on WCF protocol according to claim 6, wherein said transmitting said language table to said MES client (1) comprises:

after acquiring the query request transmitted by the MES client (1), calling a newly added language tag corresponding to the query request and newly added tag texts of a plurality of languages corresponding to the newly added language tag in the MES database (3);

and transmitting the newly added language tags and the newly added tag texts corresponding to a plurality of languages to the MES client (1).

8. A MES system user interface multi-language switching system based on WCF protocol is characterized in that: the MES system comprises an MES client (1) and a server, wherein the MES client is used for outputting access information when an MES login interface runs;

the system comprises a WCF server (2) and an MES database (3), wherein the MES database (3) is used for storing a multi-language table; language tags of a user interface are stored in the multi-country language table, each language tag corresponds to a tag text of a plurality of languages, and each language corresponds to a preset language mark;

the WCF server (2) is used for responding to the access information transmitted by the MES client (1), calling a multi-national language table in the MES database (3) and transmitting the multi-national language table to the MES client (1);

the MES client (1) is used for receiving the multinational language table transmitted by the WCF server (2) and storing the multinational language table in a local cache; the MES client (1) is further configured to obtain a language switching instruction, query the language tag corresponding to the user interface in the locally cached multi-country language table based on the language switching instruction, and replace the tag text corresponding to the language tag in the user interface with the tag text of the language type corresponding to the language tag in the multi-country language table.

9. The WCF protocol based MES system user interface multi-lingual switching system of claim 8 wherein: the MES client (1) is used for generating a query request based on a language tag which is absent when a language tag of a user interface needing replacing a tag text is absent in the multi-national language table cached locally, and transmitting the query request to the WCF server (2);

the WCF server (2) is used for responding to the query request and calling a new language tag corresponding to the query request and new tag texts of a plurality of languages corresponding to the new language tag from the MES database (3); the WCF server (2) is also used for transmitting the newly added language tags and the newly added tag texts corresponding to a plurality of languages to the MES client (1);

the MES client (1) is used for responding to the newly added language tags and the newly added tag texts corresponding to the languages, storing the newly added language tags and the newly added tag texts corresponding to the languages in a local cache, and replacing the corresponding tag texts in a user interface with the newly added tag texts.

10. The WCF protocol based MES system user interface multi-lingual switching system of claim 8 wherein: the languages include english, simplified chinese, traditional chinese, japanese, korean, german, french, and vietnamese.

Background

The WCF communication protocol is a series of application program frameworks developed by microsoft and supporting data communication, which integrates all the technologies related to the distributed system under the Net platform, such as Net remoting, ASMX, WSE and MSMQ. The WCF is a technology in the Net framework, which is a Windows communication development platform used to create service-oriented applications, exchange messages in different communication schemes, and execute workflows generated by service operations.

The MES System is defined by the International Manufacturing Execution System Association (MESA) as: the system can carry out optimized management on the whole production process of products from the order issuing to the product finishing through the information transmission, timely make corresponding reaction and report on real-time events occurring in factories, and carry out corresponding guidance and processing on the real-time events by using current accurate data. Namely, the MES system is a management system for the manufacturing industry, and is crucial to the production management activities of the manufacturing industry.

With the increasing international influence of china, many enterprises in china are going out of the country at present, factories are built in countries and regions other than china, and the MES system needs to be locally deployed in the countries and regions where the factories are located, so as to improve the automation and intelligence of production management of overseas factories.

However, after the MES system is deployed outside china, the main users of the MES system are front-line workers in enterprise workshops and plant employees such as team leaders. Most of the employees are local personnel in the country and region of the factory, and the Chinese language understanding degree is limited, so that the MES system cannot be well used.

Disclosure of Invention

In order to facilitate the use of the MES system by personnel in different countries, the application provides an MES system user interface multi-language switching method and system based on the WCF protocol.

In a first aspect, the method for switching the multiple languages of the user interface of the MES system based on the WCF protocol adopts the following technical scheme:

a method for switching multiple languages of a user interface of an MES system based on a WCF protocol comprises the following steps:

the local cache stores a multinational language table; language tags of a user interface are stored in the multi-country language table, each language tag corresponds to a tag text of a plurality of languages, and each language corresponds to a preset language mark;

acquiring a language switching instruction; the language switching instruction comprises the corresponding language mark or the language switching instruction is the corresponding language mark;

inquiring the language tag corresponding to the user interface in the multi-country language table cached locally according to the language switching instruction;

and selecting a corresponding language based on the language tag, and replacing the tag text of each language tag in the user interface with the tag text of the corresponding language in the multi-country language table in the local cache.

By adopting the technical scheme, the language tags in the user interface are stored in the multi-country language table, and each language tag of the multi-country language table corresponds to a tag text of a plurality of languages. And when the user of the MES system cannot understand the label text of each language label of the user interface, initiating a language switching instruction. At the moment, the MES client receives the language switching instruction, queries the language tags on the user interface in the multi-language table cached locally according to the language switching instruction, and then replaces each tag text of the user interface based on the language tags.

For example, if the user is korean and the user interface displays english, the korean user initiates a language switching command corresponding to korean. And the MES client side knows that the language mark corresponds to the Korean language according to the language switching instruction, and replaces the label text in the user interface with the Korean language label text in the multinational language table, so that the Korean user can conveniently operate and look up the MES system. Because each language label in the multi-country language table corresponds to a label text of a plurality of languages, the MES system can be conveniently used by personnel in different countries.

Optionally, after the querying the language tag corresponding to the user interface in the locally cached multi-national language table according to the language switching instruction, the method further includes:

when a language tag of a user interface needing replacing a tag text is absent in the locally cached multi-country language table, sending a corresponding query request to the WCF server according to the absent language tag;

acquiring a newly added language tag transmitted by the WCF server based on the query request and newly added tag texts corresponding to a plurality of languages;

storing the newly added language tags and the newly added tag texts corresponding to a plurality of languages in a locally cached multinational language table;

and replacing the tag text of the corresponding language tag in the user interface with the newly added tag text.

By adopting the technical scheme, when the label text of the language label needing to be replaced by the user interface does not exist in the multinational language table in the local cache, the MES client communicates with the WCF server, the WCF server calls the newly added language label and the corresponding label text which are lacked in the local cache from the MES database, and transmits the newly added language label and the corresponding label text to the MES client. And the MES client stores the newly added language tags and the corresponding tag texts and replaces the tag texts of the user interface. Firstly, after a new language tag is updated in an MES database, even if the updated language tag does not exist in a local cache of an MES client, the updated language tag and a corresponding tag text can still be quickly transmitted to the MES client through the WCF server, so that the MES client replaces the tag text of a user interface and converts the tag text into a language known by a user, and personnel in different countries can conveniently use the MES system. And secondly, when the data of the multi-country language table in the local cache is lost, the communication between the MES client and the WCF server is convenient for supplementing the data in the multi-country language table and switching the languages of the user interface, so that the personnel in different countries can use the MES system conveniently. Moreover, when the language tags of the user interface needing replacing the tag texts can be searched in the multinational language table, the MES client and the WCF server cannot communicate, and network occupation and data reading and writing times are reduced.

Optionally, before the local cache stores the multi-language table, the method includes:

acquiring MES login interface operation information and transmitting access information to the WCF server;

responding to the multi-country language table transmitted by the WCF server according to the access information;

storing the multi-national language table in a local cache;

after the obtaining of the MES login interface operation information, the method comprises the following steps:

acquiring MES user exit information and MES program closing information;

and releasing the multinational language table in the local cache after acquiring the MES user exit information or the MES program closing information.

By adopting the technical scheme, the MES login interface operation information represents that the MES login program is operated, at the moment, the access information is transmitted to the WCF server, and then the multi-country language table is responded, and stored in the local cache. The label text can be replaced conveniently by a user at the MES login interface, and the user can log in conveniently. The release of the multinational language tables in the local cache is beneficial to improving the available space in the local cache and reducing the occupation of the local cache.

Optionally, after the MES user exit information or the MES program closing information is obtained, the method further includes:

storing the language switching instruction of the last time before closing the MES program in a registry of the MES program;

after the storing the multi-lingual table in a local cache, further comprising:

and replacing the label text of the language label of the user interface according to the language switching instruction stored in the MES program registry for the last time.

By adopting the technical scheme, the language switching instruction stored in the registry of the MES program for the last time, namely the language used in the last time when the MES program logs in the last time, and the label text replacement is carried out on the newly opened user interface according to the language switching instruction stored in the registry of the MES program for the last time, so that the language used in the last time is automatically switched, and the operation of switching the label text language by using a user is reduced.

Optionally, the language switching instruction is obtained when the MES account logs in or after the MES account logs in.

By adopting the technical scheme, the language switching instruction can be acquired when the MES account logs in and also can be acquired after the MES account logs in. The language of the label text can be switched on the MES account login interface by the user, and the language of the label text can also be switched on other interfaces after login is successful. The flexibility of language switching is improved, so that the MES system is convenient to use by users.

In a second aspect, the method for switching the multiple languages of the user interface of the MES system based on the WCF protocol adopts the following technical scheme:

a method for switching multiple languages of a user interface of an MES system based on a WCF protocol comprises the following steps:

after the access information transmitted by the MES client is acquired, calling a multinational language table in an MES database;

and transmitting the multinational language table to the MES client.

By adopting the technical scheme, the language tags and the corresponding tag texts of the user interface in the MES system are both stored in the multi-language form, and the multi-language form is transmitted to the MES client after the WCF server acquires the access information, so that the interaction of network information is reduced, and unnecessary resource occupation and waste are reduced. The multinational language table stores label texts of a plurality of languages, so that personnel in different countries can use the MES system conveniently.

Optionally, after the transmitting the multinational language form to the MES client, the method further comprises:

after the query request transmitted by the MES client is obtained, a newly added language tag corresponding to the query request and newly added tag texts of a plurality of languages corresponding to the newly added language tag in the MES database are called;

and transmitting the newly added language tags and the newly added tag texts corresponding to the languages to the MES client.

By adopting the technical scheme, after the user interface is updated in the MES system, the language label in the updated user interface and the corresponding label text are both stored in the MES database, namely the newly added language label and the newly added label text. However, the WCF server does not actively transmit the newly added tags and the newly added tag texts to the MES client, and transmits the newly added language tags and the tag texts to the MES client only when the MES client has requirements, so that the occupation of network resources is reduced conveniently.

In a third aspect, the MES system user interface multi-language switching system based on the WCF protocol provided by the present application adopts the following technical solution:

an MES system user interface multi-language switching system based on WCF protocol comprises an MES client used for outputting access information when an MES login interface runs;

the system comprises a WCF server and an MES database, wherein the MES database is used for storing a multi-country language table; language tags of a user interface are stored in the multi-country language table, each language tag corresponds to a tag text of a plurality of languages, and each language corresponds to a preset language mark;

the WCF server is used for responding to the access information transmitted by the MES client, calling a multinational language table in the MES database and transmitting the multinational language table to the MES client;

the MES client is used for receiving the multinational language table transmitted by the WCF server and storing the multinational language table in a local cache; the MES client is further configured to obtain a language switching instruction, query the language tag corresponding to the user interface in the locally cached multi-country language table based on the language switching instruction, and replace the tag text corresponding to the language tag in the user interface with the tag text of the language corresponding to the language tag in the multi-country language table.

By adopting the technical scheme, the language label of the MES system user interface and the label texts of a plurality of languages corresponding to the language label are stored in the multi-country language table, and when a user cannot smoothly or skillfully translate other languages, a language switching instruction can be initiated by the MES client. And after receiving the language switching instruction, the MES client replaces the language text in the user interface according to the language switching instruction. The MES system can be conveniently used by people in different countries.

Optionally, the MES client is configured to, when a language tag of a user interface to replace a tag text is absent from the locally cached multi-national language table, generate a query request based on the absent language tag, and transmit the query request to the WCF server;

the WCF server is used for responding to the query request and calling a newly added language tag corresponding to the query request and newly added tag texts of a plurality of languages corresponding to the newly added language tag from the MES database; the WCF server is also used for transmitting the newly added language tags and the newly added tag texts corresponding to a plurality of languages to the MES client;

and the MES client is used for responding to the newly added language tags and the newly added tag texts corresponding to the languages, storing the newly added language tags and the newly added tag texts corresponding to the languages in a local cache, and replacing the corresponding tag texts in a user interface with the newly added tag texts.

By adopting the technical scheme, when the updated user interface exists in the MES system, the language label and the label text in the updated user interface are stored in the MES database, namely the newly added language label and the corresponding newly added language text. On one hand, the WCF server does not automatically transmit the newly added language tags in the MES data and the corresponding newly added tag texts to the MES client, which is beneficial to reducing unnecessary occupation of network resources; on the other hand, when the MES client needs to use the newly added language tags and the corresponding newly added tag texts, the WCF server transmits the corresponding data to the MES client, so that the user can browse and use the updated user interface conveniently. The newly added language tags are also corresponding to newly added tag texts in a plurality of languages, so that personnel in different countries can use the MES system conveniently.

Optionally, the languages include english, simplified chinese, traditional chinese, japanese, korean, german, french, and vietnamese.

By adopting the technical scheme, the number of languages is reasonably controlled, the space occupation of the multi-language table is reduced, and on one hand, the resource occupation of the multi-language table during transmission in a network is conveniently reduced; and on the other hand, occupation of local cache of the multi-country language form at the MES client side is reduced conveniently. In addition, the network jamming is reduced when the WCF server transmits the multinational language tables or the newly added labels and the texts of the newly added labels to the MES client.

In summary, the present application includes at least one of the following beneficial technical effects:

the method comprises the following steps that 1, a multi-country language table is stored in a local cache of an MES client, language tags in a user interface and tag texts of a plurality of languages corresponding to the language tags are stored in the multi-country language table, and when personnel in different countries use the MES system, the tag texts of the language tags on the user interface can be replaced by the tag texts of the language tags which can be understood by the personnel, so that the personnel in different countries can use the MES system conveniently;

2. when the MES login interface runs, the WCF server transmits the multinational language form to the MES client; the MES client stores the multinational language table in a local cache, so that the language of the label text of the user interface can be switched by one key conveniently, the MES program does not need to be quitted, and frequent data transmission between the MES client and the WCF server can be reduced conveniently;

3. the language switching instruction can be obtained when the MES account logs in or after the MES account logs in, so that a user can conveniently switch languages of the user interface at any time.

Drawings

FIG. 1 is a block diagram illustrating a user interface multi-language switching system of an MES system based on WCF protocol according to an embodiment of the present application;

FIG. 2 is a flowchart of a method for switching languages of a user interface of an MES system based on WCF protocol in a multi-language switching system according to an embodiment of the present application;

FIG. 3 is a flow chart of the absence of a language tag in the local cache of the MES client that the user interface needs to replace the text of the tag;

FIG. 4 is a flowchart of the MES user after exit or MES program shutdown;

FIG. 5 is a flowchart of another method for switching languages of a user interface of an MES system based on WCF protocol according to an embodiment of the present application.

Description of reference numerals: 1. an MES client; 2. a WCF server; 3. an MES database.

Detailed Description

The present application is described in further detail below with reference to figures 1-5.

The embodiment of the application discloses an MES system user interface multi-language switching system based on a WCF protocol.

Referring to fig. 1, the MES system user interface multi-language switching system based on the WCF protocol includes an MES client 1, a WCF server 2 and an MES database 3. The MES client 1 refers to equipment held by a user in an MES system, and can be a smart phone, a PC (personal computer) terminal or a Pad; the user can view, update, delete and modify the data in the MES system through the MES client 1, and the user of the MES system is usually a front-line worker and a team leader in a factory or a production workshop, and the user can also be a supplier or a client. The WCF server 2 is a server set up based on the WCF protocol and plays a role in information interaction in an MES system; the WCF server 2 may be a PC side, or may be a virtualization server, that is, a WEB server set based on the PC side. The MES database 3 is used for storing data in the MES system, and specifically, the MES database 3 stores a multinational language table. The MES database 3 is arranged in the PC end; therefore, in this embodiment, the WCF server 2 and the MES database 3 share one PC, that is, the WCF server 2 is a virtualized server.

Referring to fig. 1, an MES client 1 is used for outputting access information when an MES login interface is operated. Wherein, the MES login interface refers to the login interface of the MES program in the MES system, and the MES program is stored in the MES client 1. And browsing and deleting the data in the MES system by using the user through the MES program. And a link port linked with the WCF server 2 is arranged on the MES login interface. After the MES login interface is started, the WCF server 2 is automatically linked, and the MES client 1 is considered to output access information to the WCF server 2.

The WCF server 2 is used for responding to the access information transmitted by the MES client 1, calling the multinational language table in the MES database 3 and transmitting the multinational language table to the MES client 1. Specifically, in the present embodiment, an IIS application service program of the WCF is created under the IIS Server of the Windows Server, and the MES database 3 is designated and the multinational language table is connected.

It should be noted that the language tags of the user interface are stored in the multi-country language table, each language tag corresponds to a tag text of a plurality of languages, and each language corresponds to a preset language tag. The user interface refers to an interface in the MES system, and comprises a login interface of an MES program in the MES client 1 and all interfaces which can be browsed by a user after the MES program is logged in. The language tag refers to a tag used for displaying a tag text in a user interface, that is, when the user interface is designed, a text box is arranged at a position in a certain user interface, which should be specified in a program, and the text box is used for displaying a specific character, that is, the language tag, and the specific character is the tag text. The text box may be in the form of a drop-down list, and each option in the drop-down list is also considered as a label text corresponding to one language label. For example, the insertion tag in the EXCEL form is a language tag, "insert" is the tag text of the language tag, and the language is chinese.

In this embodiment, each tag text is provided with 8 languages, which are english, simplified chinese, traditional chinese, japanese, korean, german, french, and vietnamese, respectively. It is understood that both simplified and traditional Chinese are Chinese, but for convenience of description, simplified and traditional Chinese are considered as two languages in the present application. In this embodiment, the language corresponding to each language is labeled with Arabic numerals 1-8; the language sign of English is 1, the language sign of simplified Chinese is 2, and so on, and the description is omitted. In another embodiment, the language tag corresponding to each language may be 8 different symbols, or 8 different letters. The label texts of the same language corresponding to different language labels use the same language label, as follows:

1 2 3
language label A Create Creating construction
Language label B Delete Deleting Deleting

Referring to fig. 1, the MES client 1 is configured to receive the multi-national language table transmitted by the WCF server 2 and store the multi-national language table in a local cache; the MES client 1 is further configured to obtain the language switching instruction, query a language tag corresponding to the user interface in the multi-country language table in the local cache based on the language switching instruction, and replace a tag text of a language tag corresponding to the language tag in the multi-country language table with a tag text of a language tag corresponding to the language tag in the user interface. And after the MES program is started, displaying the label text in the user interface according to the preset language. In this embodiment, the default display is english, that is, the languages of the tag texts corresponding to the language tags in the user interface are all english.

When the user needs to switch the language of the user interface label text, the language to be switched is selected, and at this time, the MES client 1 obtains the corresponding language switching instruction. The language switching instruction comprises two forms, wherein one form is that the language switching instruction comprises a corresponding language mark; for example, when the user needs to switch to simplified Chinese, the language switching instruction includes a language tag corresponding to simplified Chinese, i.e., "2"; the other is that the language switching instruction is a corresponding language tag, i.e. the language switching instruction is "2". In this embodiment, the language switching instruction is in the second form.

After receiving the language switching instruction, the MES client 1 knows which language the tag text in the user interface needs to be replaced with because the language switching instruction itself is a language tag. And then, the MES client 1 acquires all the language tags in the user interface, inquires corresponding language tags in the multi-national language table in the local cache according to the language tags in the user interface, and replaces the tag texts in the user interface. For example, the default label text language in the user interface is english, and the user interface includes language label a, language label B, and language label C. When the user needs to switch to simplified Chinese, the MES client 1 obtains a language switching instruction "2" and searches the language tag A, the language tag B and the language tag C in the multi-national language table cached locally. And after the language tag A is found, replacing the tag text corresponding to the language tag A in the user interface with the tag text corresponding to the language tag A in the simplified Chinese corresponding to the language tag A.

It will be appreciated that the replacement of the tab text in the user interface for easy viewing and manipulation of the user interface by the user includes the replacement of an open user interface in the MES client 1 and the default replacement of the tab text in the newly opened user interface. The language of the label text replacement is defaulted to the last received language switching instruction no matter the user interface is opened or the user interface is opened newly. The method and the device are beneficial to reducing the operation of the user, and the phenomenon that the language switching operation is required every time the user opens a new user interface is avoided.

Referring to fig. 1, the MES client 1 is configured to generate a query request based on a language tag missing when a language tag whose user interface needs to replace tag text is missing in the locally cached multi-national language table, and transmit the query request to the WCF server 2. For example, if the MES client 1 cannot search for the language tag C in the locally cached multinational language table, it generates a query request corresponding to the language tag C. The query request may contain information of the language tag C, or may be the language tag C itself. In this embodiment, the query request is the language tag C itself, that is, the MES client 1 sends a piece of information with "language tag C" to the WCF server 2, and the information is the query request.

The WCF server 2 is used for responding to the query request and calling a new language tag corresponding to the query request and a plurality of new tag texts in languages corresponding to the new language tag from the MES database 3. For example, the WCF server 2 receives the query request about the language tag C, and the WCF server 2 calls the language tag C and the tag texts of all languages corresponding to the language tag C from the MES database 3. The language tag C is not in the local cache of the MES client 1, so the language tag C is the new language tag, and the corresponding tag text is the new tag text. It should be noted that the new language tags that are not involved in the query request are not called by the WCF server 2.

The MES client 1 is configured to respond to the newly added language tag and the newly added tag texts corresponding to the languages, store the newly added language tag and the newly added tag texts corresponding to the languages in a local cache, and replace the corresponding tag texts in the user interface with the newly added tag texts. The MES client 1 preferentially stores the newly added language tags and the corresponding newly added tag texts, so that the newly added language tags and the corresponding newly added tag texts can be reused subsequently, and the reduction of the communication times between the MES client 1 and the WCF server 2 is facilitated.

The following combines the above system to the MES system user interface multinational language switching method based on WCF protocol. Referring to fig. 2, the method for switching the multi-language of the MES system user interface based on the WCF protocol includes:

s100, obtaining MES login interface operation information and transmitting access information to the WCF server 2.

And popping up an MES login interface after the MES program of the MES client 1 runs. After the MES login interface operates, the MES client 1 acquires the operation information of the MES login interface and represents that the MES login interface is in an operating state.

And S200, responding to the multi-country language table transmitted by the WCF server 2 according to the access information.

The MES client 1 responds to the multinational language form, i.e. receives the multinational language form transmitted by the WCF server 2. The multi-country language table stores language tags of a user interface, each language tag corresponds to a tag text of a plurality of languages, and each language corresponds to a preset tag mark.

And S300, storing the multinational language table in a local cache.

And the subsequent query and call of the data in the multi-national language table are facilitated. It should be noted that, after the multinational language table is stored in the local cache, the multinational language table is stored in the local cache.

S400, replacing the label text of the language label of the user interface according to the language switching instruction stored in the MES program registry for the last time.

It should be noted that, if the language switching instruction is stored in the registry of the MES program, after step S300 is executed, the MES client 1 automatically replaces the tag text of the user interface according to the language switching instruction in the registry of the MES program. The MES system is convenient to use by the same user or the user in the same country. And if the language switching instruction is not stored in the registry of the MES program, replacing the label text of the language label of the user interface, and waiting for the generation of the language switching instruction.

And S500, acquiring a language switching instruction.

The language switching instruction comprises a corresponding language mark or the language switching instruction is a corresponding language mark. The language switching instruction in this step may be obtained from a registry of the MES program, or may be generated when the user switches the languages of the user interface, and the language switching instruction is obtained by the MES client 1 after being generated.

In addition, after the MES program is started, the MES login interface needs to use a user selected language tag in addition to the user input account number and password. And generating a corresponding language switching instruction after the user selects the language mark. Besides the language can be switched on the MES login interface, other user interfaces after login can also be switched. Namely, language switching buttons are arranged on other user interfaces except the MES login interface, and the user selects different language marks to realize the switching of the corresponding languages. The language switching instruction is thus obtained at or after the MES account login.

And S600, inquiring a language tag corresponding to the user interface in the multi-country language table cached locally according to the language switching instruction.

The language label corresponding to the user interface refers to a language label with the same name as the user interface in the multi-country language table. In addition, the number of user interfaces in the MES system is more, and can reach dozens or even hundreds, and each user interface also comprises more language tags, and the number of the language tags is more than ten and is different from hundreds. Therefore, when the language tag corresponding to the user interface is queried, the query can be performed according to the owner, the module and the control of the language tag. That is, language tags with the same name in the same control of the same module belonging to the same owner are regarded as corresponding language tags. The data are mainly laid out according to the structure of the multi-country language table, and the data can be uniquely corresponding to the language tags in the user interface, so that the probability of the occurrence of the situation that one language tag in one user interface corresponds to two or more language tags in the multi-country language table is reduced.

S700, selecting the corresponding language based on the language tags, and replacing the tag text of each language tag in the user interface with the tag text of the corresponding language in the multi-national language table in a local cache.

Referring to FIG. 3, because MES systems are used to manage data throughout a production plant, MES systems often add new user interfaces or update existing user interfaces. For example, when a new product is produced in a production workshop, a user interface related to the new product needs to be added in the MES system so as to manage the production data of the new product; for another example, when a new device is introduced at a manufacturing plant, a user interface for the new device needs to be added to the MES system to facilitate management of the operating parameters of the new device. Therefore, no matter a new user interface is added or the original user interface is updated, a new language tag is generated, namely the language tag is added; and the label text in the newly added language label is the newly added label text. The newly added label text can be input into the MES database 3 in a manual translation mode; the translation can also be carried out through an internet translation machine, and the manual proofreading is recorded in the MES database 3.

In order to not affect the MES client 1 to switch the languages of the newly added tag texts of the newly added language tags, after the newly added language tags are used by the related responsible persons, the newly added language tags and the newly added tag texts corresponding to a plurality of languages are stored in the MES database 3.

And when the MES client 1 does not inquire the language tags in one or more user interfaces in the locally cached multi-national language table, the MES client executes S800, and when the language tags of the text of the user interfaces needing replacing the tags are absent in the locally cached multi-national language table, the MES client sends corresponding inquiry requests to the WCF server 2 according to the absent language tags.

The corresponding query request refers to the information of the missing language tags contained in the query request, for example, in this embodiment, the query request includes owner information, module information and control information of the missing language tags. For ease of understanding, for example, the owner information represents information of the user interface to which the missing language tag belongs; the module information represents the information of a certain module in the user interface to which the missing language tag belongs; the control represents the information of a certain control under a certain module in the user interface to which the absent language label belongs; the WCF server 2 is facilitated to inquire the new language label uniquely corresponding to the lacked language label in the MES database 3 according to the inquiry request, and the probability of occurrence of data transmission error is reduced conveniently.

And after the query request is transmitted to the WCF server 2, executing S900, and obtaining a newly added language tag and a newly added tag text corresponding to a plurality of languages, which are transmitted by the WCF server 2 based on the query request.

And transmitting the newly added label texts of all languages corresponding to the newly added language label to the MES client 1, which is beneficial to reducing the network interaction times.

S1000, storing the newly added language tags and the newly added tag texts corresponding to a plurality of languages in a locally cached multinational language table.

And S1100, replacing the tag text of the corresponding language tag in the user interface with the newly added tag text.

Referring to fig. 4, after acquiring the MES login interface operation information, the method further includes:

and S10, acquiring MES user exit information and MES program closing information.

MES user exit information, namely exit of an account number logged in by the MES program; and the MES program closing information, namely the MES program is closed in the process and is in a non-running state.

And S20, releasing the multinational language table in the local cache after acquiring MES user exit information or MES program closing information.

After the MES user exit information is acquired, the MES program automatically jumps to an MES program login interface, at this time, the MES client 1 releases the multinational language table in the local cache, and then the WCF server 2 is linked in the MES program login interface, so that the access information is transmitted to the WCF server 2, and then the step S200 is executed. I.e. equivalent to one update of the multinational language table in the local cache.

After the closing information of the MES program is acquired, the MES program stops running, no user interface is in an opening or running state, and the multi-language table in the local cache is released. Releasing the multinational language tables in the local cache means deleting the multinational language tables from the local cache.

S30, storing the last language switching instruction before closing the MES program in the register table of the MES program.

That is, each time the MES client 1 acquires the language switching instruction, the language switching instruction is stored in the registry of the MES program.

The implementation principle of the MES system user interface multi-language switching method based on the WCF protocol in the embodiment of the application is as follows: after the MES program in the MES client 1 runs, the MES client 1 transmits access information to the WCF server 2, and the WCF server 2 stores the multi-language table transmitted according to the access information in a local cache. And then, inquiring a language switching instruction stored last time in a registry of the MES program, and replacing the label text in the user interface according to the language switching instruction.

And then acquiring a language switching instruction selected by a user on an MES login interface, and if the language switching instruction is a language switching instruction corresponding to the same language as the language switching instruction inquired in the registry, not replacing the label text of the user interface again. And if the language switching instruction inquired in the registry is not the language switching instruction corresponding to the same language, replacing the label text in the user interface according to the language switching instruction selected by the user in the MES login interface.

In the replacement process, the MES client 1 preferentially inquires corresponding language tags in a multi-country language table of a local cache according to the language tags in the user interface, and if the language tags are inquired, the MES client directly replaces tag texts in the user interface according to data in the multi-country language table; if the queried language tag exists, the MES client 1 generates a query request according to the queried language tag, stores the newly added language tag transmitted by the WCF server 2 according to the query request and newly added tag texts corresponding to a plurality of languages in a multinational language table cached at present, and then replaces the corresponding tag text in the user interface.

The embodiment of the application also discloses an MES system user interface multi-language switching method based on the WCF protocol. Referring to fig. 5, the method for switching the multi-language of the MES system user interface based on the WCF protocol includes:

and S1, after the access information transmitted by the MES client 1 is acquired, calling the multinational language table in the MES database 3.

S2, transmitting the multinational language list to the MES client 1.

S3, after the query request transmitted by the MES client 1 is obtained, a newly added language tag corresponding to the query request and newly added tag texts of a plurality of languages corresponding to the newly added language tag in the MES database 3 are called.

And S4, transmitting the newly added language tags and the newly added tag texts corresponding to a plurality of languages to the MES client 1.

The above embodiments are preferred embodiments of the present application, and the protection scope of the present application is not limited by the above embodiments, so: all equivalent changes made according to the structure, shape and principle of the present application shall be covered by the protection scope of the present application.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种时间邮局运营系统及其使用方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!