CN120631324A - Relay protection device interface language switching method and system based on hot loading mechanism - Google Patents
Relay protection device interface language switching method and system based on hot loading mechanismInfo
- Publication number
- CN120631324A CN120631324A CN202510778600.9A CN202510778600A CN120631324A CN 120631324 A CN120631324 A CN 120631324A CN 202510778600 A CN202510778600 A CN 202510778600A CN 120631324 A CN120631324 A CN 120631324A
- Authority
- CN
- China
- Prior art keywords
- language
- interface
- file
- protection device
- text file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Stored Programmes (AREA)
Abstract
The invention provides a relay protection device interface language switching method and system based on a hot loading mechanism, wherein the method comprises the steps of constructing a variable-length language storage structure body under a C language according to the variable-length text characteristics of multiple languages in a language text file to generate an instantiation object and further bind interface elements of a relay protection device, acquiring a user target language according to an interface element index under the condition that an operation signal of switching the language of a user interface is detected to read a corresponding language text file, pointing a first-level pointer corresponding to the instantiation object to the read language text file, pointing a second-level pointer corresponding to the instantiation object to the first-level pointer to bind the interface element and the target language text file, analyzing the second-level pointer corresponding to the instantiation object and mapping the second-level pointer to the first-level pointer corresponding to the instantiation object according to the second-level pointer to acquire target language text information pointed by the first-level pointer. The invention can complete interface language switching without restarting the equipment.
Description
Technical Field
The invention belongs to the technical field of man-machine interface language management, and particularly relates to a relay protection device interface language switching method and system based on a hot loading mechanism.
Background
With the development of smart grids and the wide application of domestic relay protection devices in global markets, human-machine interfaces (HMI) of the relay protection devices are required to support multi-language display so as to meet localization requirements of users in different countries or regions. At present, the multi-language implementation mainly depends on a language package mechanism, namely interface text and source code are decoupled through a language package file, and language loading is controlled through a language configuration file. Existing mainstream schemes typically load language package content at device start-up, and once a language switch is required, the configuration file must be modified and the device restarted to reload the language data.
The method has the obvious disadvantages that language switching is required to be dependent on equipment restarting, operation is complex, time consumption is long, and the current operation state of the equipment is possibly interrupted or data is possibly lost, so that user experience and system instantaneity are affected. Therefore, the existing scheme belongs to a 'cold loading' mode, and cannot meet the higher requirements on real-time performance and operation continuity.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a relay protection device interface language switching method and system based on a hot loading mechanism.
In a first aspect, the present invention provides a relay protection device interface language switching method based on a hot loading mechanism, including:
Constructing a language pack file structure to store multi-language text information, wherein the language pack file comprises a language text file;
Constructing a variable-length language storage structure body under a C language according to the characteristics of the variable-length texts of multiple languages in the language text file, wherein the variable-length language storage structure body comprises a C language primary pointer and a C language secondary pointer;
Generating an instantiation object according to the constructed variable-length language storage structure body so as to bind interface elements of the relay protection device;
under the condition that an operation signal for switching the language of the user interface is detected, acquiring a user target language according to the interface element index;
reading a corresponding language text file according to a user target language;
directing a first-level pointer corresponding to the instantiation object to the read language text file, and directing a second-level pointer corresponding to the instantiation object to the first-level pointer so as to bind interface elements and the target language text file;
Under the condition that the user switches languages and performs interface menu jump, analyzing a secondary pointer corresponding to the instantiation object and mapping the secondary pointer to a primary pointer corresponding to the instantiation object according to the secondary pointer so as to acquire target language text information pointed by the primary pointer.
Optionally, the language package file further includes a language configuration file, configured to record a language type supported by the current system, a current language type, and a text file name corresponding to each language;
the language text file comprises an HMI static text file, an HMI dynamic text file and an HMI printing text file;
The HMI static text file is used for storing text information fixedly displayed in the relay protection device interface;
The HMI dynamic text file is used for storing text information dynamically displayed in the relay protection device interface;
the HMI printing text file is used for storing text information to be printed in the relay protection device interface printing function.
Optionally, the C language primary pointer points to a memory area dynamically allocated according to the length of the language text, wherein the memory area is used for storing the text content of the currently selected language;
The C language secondary pointer points to the C language primary pointer and is used for dynamically binding interface elements and language texts.
Optionally, in the case that the operation signal of switching the language of the user interface is detected, acquiring the user target language according to the interface element index includes:
Acquiring language items clicked or selected by a user, and acquiring target language codes through interface element indexes corresponding to the language items;
opening and reading a current language code contained in a language configuration file in a language package file;
In the case where the target language code is the current language code contained in the language profile, the current language identification field recorded in the language profile is modified.
In a second aspect, the present invention provides a relay protection device interface language switching system based on a hot loading mechanism, including:
the first construction module is used for constructing a language package file structure to store multi-language text information, wherein the language package file comprises a language text file;
The second construction module is used for constructing a variable-length language storage structure body under the C language according to the characteristics of the variable-length texts of multiple languages in the language text file, and comprises a C language primary pointer and a C language secondary pointer;
the first binding module is used for generating an instantiation object according to the constructed variable-length language storage structure body so as to bind interface elements of the relay protection device;
the first acquisition module is used for acquiring a user target language according to the interface element index under the condition that an operation signal of switching the language of the user interface is detected;
the second acquisition module is used for reading the corresponding language text file according to the target language of the user;
the second binding module is used for directing a primary pointer corresponding to the instantiation object to the read language text file and directing a secondary pointer corresponding to the instantiation object to the primary pointer so as to bind the interface element and the target language text file;
And the third acquisition module is used for analyzing the secondary pointer corresponding to the instantiation object and mapping the secondary pointer to the primary pointer corresponding to the instantiation object according to the secondary pointer under the condition that the user switches the languages and performs interface menu jump so as to acquire the text information of the target language pointed by the primary pointer.
Optionally, the language pack file in the first building module further includes a language configuration file, configured to record a language type supported by a current system, a current language type, and a text file name corresponding to each language;
the language text file comprises an HMI static text file, an HMI dynamic text file and an HMI printing text file;
The HMI static text file is used for storing text information fixedly displayed in the relay protection device interface;
The HMI dynamic text file is used for storing text information dynamically displayed in the relay protection device interface;
the HMI printing text file is used for storing text information to be printed in the relay protection device interface printing function.
Optionally, the C language primary pointer in the second construction module points to a memory area dynamically allocated according to the length of the language text, wherein the memory area is used for storing the text content of the currently selected language;
The C language secondary pointer points to the C language primary pointer and is used for dynamically binding interface elements and language texts.
Optionally, the first acquisition module includes:
the acquisition unit is used for acquiring language items clicked or selected by a user so as to acquire target language codes through interface element indexes corresponding to the language items;
The reading unit is used for opening and reading the current language codes contained in the language configuration file in the language package file;
and the modifying unit is used for modifying the current language identification field recorded in the language configuration file under the condition that the target language code is the current language code contained in the language configuration file.
In a third aspect, the present invention provides a computer device, including a processor and a memory, where the processor implements the steps of the interface language switching method of the relay protection device based on the hot loading mechanism described in the first aspect when executing the computer program stored in the memory.
In a fourth aspect, the present invention provides a computer readable storage medium, configured to store a computer program, where the computer program when executed by a processor implements the steps of the method for switching interface languages of a relay protection device based on a hot loading mechanism according to the first aspect.
The invention provides a relay protection device interface language switching method and a system based on a hot loading mechanism, wherein a variable-length language storage structure under a C language is designed in the method, and through instantiation of the structure object, dynamic binding between the interface element and the language pack file is realized. When the language switching operation is carried out, the text file of the target language can be reloaded, so that the interface element is automatically bound to the text content of the target language, and the instant updating of the interface language is realized. The invention adopts a hot loading mechanism, and by introducing a variable-length language structure body and combining dynamic memory management, the switching process of interface languages of the relay protection device can be completed without restarting equipment, so that the instant loading and display updating of multiple languages are realized.
Drawings
In order to more clearly illustrate the technical solutions of the present invention, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a relay protection device interface language switching method based on a hot loading mechanism according to an embodiment of the present invention;
FIG. 2 is a diagram of a definition of a variable length language memory structure according to an embodiment of the present invention;
FIG. 3 is a diagram of defining a language pack file structure according to an embodiment of the present invention;
FIG. 4 is a logic diagram for implementing interface language switching of a relay protection device according to an embodiment of the present invention;
Fig. 5 is a schematic structural diagram of an interface language switching system of a relay protection device based on a hot loading mechanism according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
As shown in fig. 1, an embodiment of the present invention provides a relay protection device interface language switching method based on a hot loading mechanism, including:
step 101, constructing a language pack file structure to store multi-language text information, wherein the language pack file comprises a language text file.
According to the multi-language switching requirement, a language pack file structure is designed to store multi-language text information. As shown in fig. 3, the language pack file includes a language configuration file and a plurality of language text files. The language configuration file records the types of languages supported by the current system, the types of the current languages and the text file names corresponding to each language. The language text files are classified into an HMI (Human-MACHINE INTERFACE ) static text file, an HMI dynamic text file and an HMI printing text file, wherein the HMI static text file is used for storing text information fixedly displayed in the relay protection device interface, such as text information of a menu, a status bar and the like, the HMI dynamic text file is used for storing text information dynamically displayed in the relay protection device interface, such as text information of a popup window, a dialog box and the like, and the HMI printing text file is used for storing text information to be printed in a printing function of the relay protection device interface, such as communication parameters, fixed value information and the like. The three types of text are divided into a plurality of subfiles according to languages (such as Chinese, english, spanish, russian, etc.). All file contents are stored in a node-key value pair mode, wherein a node is set according to each functional module (functional modules such as information checking, operation running, report inquiring, setting value setting and the like in the relay protection device HMI), and each multi-language variable (such as analog quantity and switching value in the information checking module and action report and operation report in the report inquiring module) related in each functional module is set as one key value pair under the node, so that a program can be conveniently read according to the modules.
Step 102, constructing a variable-length language storage structure body under the C language according to the characteristics of the variable-length texts of multiple languages in the language text file, wherein the variable-length language storage structure body comprises a C language primary pointer and a C language secondary pointer.
The structure is a user-defined data type in the C language, which can combine a plurality of different types of variables together to form a whole for describing an entity type with a plurality of attributes. Taking "student" as an example, one student has multiple attributes of age, height, sex, performance, etc., and the data types of these attributes are different. By means of the structure, these properties can be integrated into a unified data structure, enabling us to represent a complete student with one variable. As shown in fig. 2, in order to realize dynamic replacement and memory management of multilingual text in the process of program operation, the invention designs a variable-length language storage structure under C language, which comprises the following main members:
And the first-level pointer points to a memory area dynamically allocated according to the length of the language text. The memory is used to store text content of the currently selected language. The memory allocation adopts heap space (one of memory areas during the running of the C language program), so that the expandability and the cross-module accessibility are ensured, and the memory overflow and the memory waste of the relay protection device are avoided.
The primary pointer is used for realizing the dynamic binding of interface elements (such as buttons, labels, prompt boxes and the like) and language texts. By maintaining a reference to the primary pointer, each interface element can directly respond to language text updates brought about by the language switch operation.
And (3) an unsigned integer variable, which records the number of memory bytes occupied by the text of the current language and contains a terminator. The field provides support for memory management and out-of-range detection, and memory leakage and illegal access are avoided.
Constructing function and destructor, initializing structural member by constructing function, distributing initial memory space and setting default text. The destructor releases the memory resources allocated in the structure, clears the pointer references, and prevents memory leakage.
And (3) assigning a function, namely writing the text of the appointed language into a memory area pointed by the structural object, and reallocating the memory according to the length of the new text.
The variable-length language storage structure body supports self-adaptive management of different language lengths, allows re-assignment when the program runs, and ensures that interface texts are refreshed immediately after the languages are switched.
And step 103, generating an instantiation object according to the constructed variable-length language storage structure body so as to bind interface elements of the relay protection device.
In this step, the structure is instantiated using the text content of the default language, and a corresponding structure object is generated for each interface element. "instantiating" herein refers to creating the actual available variables from the template of the structure type. The result of the instantiation of the structure is a structure object whose respective attributes are explicitly assigned initial values. Also taking students as an example, two objects, namely, a student Zhang three object and a student Lisi four object, are respectively created by using the template, and are instantiation objects of the structural body. Each object has information such as age, height, sex, performance and the like, and is independent of each other and not affected by each other. And then, replacing text variables in the source codes of the interface program by using the generated secondary pointer member variables of the structural object to realize the binding of the interface elements and the structural object.
Step 104, under the condition that the operation signal of switching the language of the user interface is detected, acquiring the user target language according to the interface element index.
After the interface program completes steps 101 to 103, after receiving an operation signal from the user interface to switch languages, the program captures a language item clicked or selected by the user, obtains a target language code through an index of an interface element, then opens and reads configuration file information in a language package, reads a support language list, a language file name mapping table and a current language code contained in the configuration file, and verifies whether the target language is within a support range of a language type of the configuration file (namely, in the case that the target language code is the current language code contained in the language configuration file). If the target language is effective, modifying the current language identification field recorded in the configuration file, and extracting a language package text file path corresponding to the language.
And 105, reading the corresponding language text file according to the target language of the user.
And the interface program reads the corresponding language package text file according to the language package text file path under the target language obtained in the step 104. The program opens and reads the HMI static text file, HMI dynamic text file and HMI printing text file in the target language in turn. And reading key value pair information in each section by section according to the sequence of the functional modules. For each key value pair, the program dynamically allocates the corresponding memory space on the heap according to the character string length on the right side of the equal sign, and stores the corresponding memory space, thereby realizing the automatic loading and injection of the language resource from the file to the memory.
And 106, pointing the primary pointer corresponding to the instantiation object to the read language text file, and pointing the secondary pointer corresponding to the instantiation object to the primary pointer so as to bind the interface element and the target language text file.
In this step, the interface program redirects the language package text information memory obtained in step 105 by using the primary pointers of the structure objects of all the interface elements constructed in step 103, and uses the secondary pointers of the structure objects to point to the primary pointers, so as to implement decoupling and dynamic binding of the interface elements and the target language text file, as shown in fig. 4. Three people, namely, a first person, a second person and a third person can be used for example, and the third person can often move the house when working and mobilizing, so that the first person does not know the condition of the third person. Three people now agree that every time the third person moves, he will tell the new address and he will not move. Therefore, after the third party is moved, the third party can find the third party through the fourth party, so that the real-time tracking of the third party on the third party is realized. The first example corresponds to the interface element in the embodiment, the second example corresponds to the second pointer in the embodiment, the third example corresponds to the first pointer in the embodiment, and the third example corresponds to the multilingual text in the embodiment.
Step 107, under the condition that the user switches the language and makes interface menu jump, analyzing the secondary pointer corresponding to the instantiation object and mapping to the primary pointer corresponding to the instantiation object according to the secondary pointer so as to obtain the text information of the target language pointed by the primary pointer.
The method and the device realize a hot loading language switching mechanism finally, and greatly improve the man-machine interaction efficiency and user experience of the multi-language interface of the relay protection device.
In summary, the embodiment provides a relay protection device interface language switching method based on a hot loading mechanism, designs a variable-length language storage structure body under a C language, and realizes dynamic binding between interface elements and a language package file through instantiation of a structure body object. When the language switching operation is carried out, the text file of the target language can be reloaded, so that the interface element is automatically bound to the text content of the target language, and the instant updating of the interface language is realized. The invention adopts a hot loading mechanism, and by introducing a variable-length language structure body and combining dynamic memory management, the switching process of interface languages of the relay protection device can be completed without restarting equipment, so that the instant loading and display updating of multiple languages are realized.
Example 2
Based on the same inventive concept as embodiment 1, this embodiment provides a relay protection device interface language switching system based on a heat loading mechanism, and since the principle of solving the problem of the system is similar to that of the relay protection device interface language switching method based on the heat loading mechanism provided in the foregoing embodiment 1, the implementation of the system can be referred to the implementation of the relay protection device interface language switching method based on the heat loading mechanism provided in embodiment 1.
As shown in fig. 5, the relay protection device interface language switching system based on the hot loading mechanism includes:
A first construction module 10 for constructing a language pack file structure to store multi-language text information, wherein the language pack file comprises a language text file.
The second construction module 20 is configured to construct a variable-length language storage structure body under the C language according to the variable-length text characteristics of multiple languages in the language text file, including a C language primary pointer and a C language secondary pointer.
The first binding module 30 is configured to generate an instantiation object according to the constructed variable-length language storage structure, so as to bind interface elements of the relay protection device.
The first obtaining module 40 is configured to obtain, according to the interface element index, the user target language when the operation signal for switching the language of the user interface is detected.
The second obtaining module 50 is configured to read the corresponding language text file according to the target language of the user.
A second binding module 60, configured to direct the primary pointer corresponding to the instantiation object to the read language text file, and direct the secondary pointer corresponding to the instantiation object to the primary pointer, so as to bind the interface element and the target language text file.
The third obtaining module 70 is configured to parse the secondary pointer corresponding to the instantiated object and map the secondary pointer to the primary pointer corresponding to the instantiated object, so as to obtain the text information of the target language pointed by the primary pointer, where the user switches languages and performs interface menu jump.
Illustratively, the language pack file in the first building module further includes a language configuration file for recording a language category supported by the current system, a current language type, and a text file name corresponding to each language.
The language text files include HMI static text files, HMI dynamic text files, and HMI print text files.
And the HMI static text file is used for storing text information fixedly displayed in the relay protection device interface.
The HMI dynamic text file is used for storing text information dynamically displayed in the relay protection device interface.
The HMI printing text file is used for storing text information to be printed in the relay protection device interface printing function.
The C language level pointer in the second construction module points to a memory area dynamically allocated according to the length of language text, and the memory area is used for storing text content of a currently selected language.
The C language secondary pointer points to the C language primary pointer and is used for dynamically binding interface elements and language texts.
Illustratively, the first acquisition module includes:
the acquisition unit is used for acquiring the language item clicked or selected by the user so as to acquire the target language code through the interface element index corresponding to the language item.
And the reading unit is used for opening and reading the current language codes contained in the language configuration file in the language package file.
And the modifying unit is used for modifying the current language identification field recorded in the language configuration file under the condition that the target language code is the current language code contained in the language configuration file.
For more specific working procedures of the above modules, reference may be made to the corresponding contents disclosed in embodiment 1, and no further description is given here.
Example 3
The embodiment provides a computer device, which comprises a processor and a memory, wherein the processor executes a computer program stored in the memory to realize the steps of the relay protection device interface language switching method based on the hot loading mechanism described in the embodiment 1.
For more specific procedures regarding the above method, reference may be made to the corresponding contents disclosed in embodiment 1, and no further description is given here.
Example 4
The embodiment provides a computer readable storage medium for storing a computer program, which when executed by a processor implements the steps of the relay protection device interface language switching method based on the hot loading mechanism described in embodiment 1.
For more specific procedures regarding the above method, reference may be made to the corresponding contents disclosed in embodiment 1, and no further description is given here.
Example 5
The present embodiment provides a computer program product, which includes computer executable instructions or a computer program, where the computer executable instructions or the computer program implement the steps of the relay protection device interface language switching method based on the hot loading mechanism described in embodiment 1 when the computer executable instructions or the computer program are executed by a processor.
For more specific procedures regarding the above method, reference may be made to the corresponding contents disclosed in embodiment 1, and no further description is given here.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the system, apparatus, storage medium and computer program product of the embodiment disclosure, the description is relatively simple, and relevant places refer to the description of the method section, since it corresponds to the method of the embodiment disclosure.
It will be apparent to those skilled in the art that the techniques of embodiments of the present invention may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in essence or what contributes to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present invention.
In some embodiments, computer-executable instructions may be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, in the form of programs, software modules, scripts, or code, and they may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
As an example, computer-executable instructions may, but need not, correspond to files in a file system, may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext markup language (Hyper Text Markup Language, HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, computer-executable instructions may be deployed to be executed on one electronic device or on multiple electronic devices located at one site or distributed across multiple sites and interconnected by a communication network.
The invention has been described in detail in connection with the specific embodiments and exemplary examples thereof, but such description is not to be construed as limiting the invention. It will be understood by those skilled in the art that various equivalent substitutions, modifications or improvements may be made to the technical solution of the present invention and its embodiments without departing from the spirit and scope of the present invention, and these fall within the scope of the present invention. The scope of the invention is defined by the appended claims.
Claims (10)
1. A relay protection device interface language switching method based on a hot loading mechanism is characterized by comprising the following steps:
Constructing a language pack file structure to store multi-language text information, wherein the language pack file comprises a language text file;
Constructing a variable-length language storage structure body under a C language according to the characteristics of the variable-length texts of multiple languages in the language text file, wherein the variable-length language storage structure body comprises a C language primary pointer and a C language secondary pointer;
Generating an instantiation object according to the constructed variable-length language storage structure body so as to bind interface elements of the relay protection device;
under the condition that an operation signal for switching the language of the user interface is detected, acquiring a user target language according to the interface element index;
reading a corresponding language text file according to a user target language;
directing a first-level pointer corresponding to the instantiation object to the read language text file, and directing a second-level pointer corresponding to the instantiation object to the first-level pointer so as to bind interface elements and the target language text file;
Under the condition that the user switches languages and performs interface menu jump, analyzing a secondary pointer corresponding to the instantiation object and mapping the secondary pointer to a primary pointer corresponding to the instantiation object according to the secondary pointer so as to acquire target language text information pointed by the primary pointer.
2. The relay protection device interface language switching method according to claim 1, wherein the language package file further comprises a language configuration file for recording a language type supported by a current system, a current language type and a text file name corresponding to each language;
the language text file comprises an HMI static text file, an HMI dynamic text file and an HMI printing text file;
The HMI static text file is used for storing text information fixedly displayed in the relay protection device interface;
The HMI dynamic text file is used for storing text information dynamically displayed in the relay protection device interface;
the HMI printing text file is used for storing text information to be printed in the relay protection device interface printing function.
3. The relay protection device interface language switching method according to claim 1, wherein the C-language primary pointer points to a memory area dynamically allocated according to a language text length;
The C language secondary pointer points to the C language primary pointer and is used for dynamically binding interface elements and language texts.
4. The method for switching interface languages of a relay protection device according to claim 2, wherein, in the case that an operation signal for switching the languages of the user interface is detected, obtaining a target language of the user according to an interface element index comprises:
Acquiring language items clicked or selected by a user, and acquiring target language codes through interface element indexes corresponding to the language items;
opening and reading a current language code contained in a language configuration file in a language package file;
In the case where the target language code is the current language code contained in the language profile, the current language identification field recorded in the language profile is modified.
5. A relay protection device interface language switching system based on a hot loading mechanism is characterized by comprising:
the first construction module is used for constructing a language package file structure to store multi-language text information, wherein the language package file comprises a language text file;
The second construction module is used for constructing a variable-length language storage structure body under the C language according to the characteristics of the variable-length texts of multiple languages in the language text file, and comprises a C language primary pointer and a C language secondary pointer;
the first binding module is used for generating an instantiation object according to the constructed variable-length language storage structure body so as to bind interface elements of the relay protection device;
the first acquisition module is used for acquiring a user target language according to the interface element index under the condition that an operation signal of switching the language of the user interface is detected;
the second acquisition module is used for reading the corresponding language text file according to the target language of the user;
the second binding module is used for directing a primary pointer corresponding to the instantiation object to the read language text file and directing a secondary pointer corresponding to the instantiation object to the primary pointer so as to bind the interface element and the target language text file;
And the third acquisition module is used for analyzing the secondary pointer corresponding to the instantiation object and mapping the secondary pointer to the primary pointer corresponding to the instantiation object according to the secondary pointer under the condition that the user switches the languages and performs interface menu jump so as to acquire the text information of the target language pointed by the primary pointer.
6. The relay protection device interface language switching system according to claim 5, wherein the language pack file in the first construction module further includes a language configuration file for recording a language type supported by a current system, a current language type, and a text file name corresponding to each language;
the language text file comprises an HMI static text file, an HMI dynamic text file and an HMI printing text file;
The HMI static text file is used for storing text information fixedly displayed in the relay protection device interface;
The HMI dynamic text file is used for storing text information dynamically displayed in the relay protection device interface;
the HMI printing text file is used for storing text information to be printed in the relay protection device interface printing function.
7. The relay protection device interface language switching system according to claim 5, wherein the C-language primary pointer in the second construction module points to a memory area dynamically allocated according to a language text length, and the memory area is used for storing text content of a currently selected language;
The C language secondary pointer points to the C language primary pointer and is used for dynamically binding interface elements and language texts.
8. The relay protection device interface language switching system of claim 6, wherein the first acquisition module comprises:
the acquisition unit is used for acquiring language items clicked or selected by a user so as to acquire target language codes through interface element indexes corresponding to the language items;
The reading unit is used for opening and reading the current language codes contained in the language configuration file in the language package file;
and the modifying unit is used for modifying the current language identification field recorded in the language configuration file under the condition that the target language code is the current language code contained in the language configuration file.
9. The computer equipment is characterized by comprising a processor and a memory, wherein the processor executes a computer program stored in the memory to realize the steps of the relay protection device interface language switching method based on the hot loading mechanism as set forth in any one of claims 1-4.
10. A computer readable storage medium for storing a computer program, which when executed by a processor implements the steps of the method for switching interface languages of a relay protection device based on a hot loading mechanism according to any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202510778600.9A CN120631324A (en) | 2025-06-11 | 2025-06-11 | Relay protection device interface language switching method and system based on hot loading mechanism |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202510778600.9A CN120631324A (en) | 2025-06-11 | 2025-06-11 | Relay protection device interface language switching method and system based on hot loading mechanism |
Publications (1)
Publication Number | Publication Date |
---|---|
CN120631324A true CN120631324A (en) | 2025-09-12 |
Family
ID=96973410
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202510778600.9A Pending CN120631324A (en) | 2025-06-11 | 2025-06-11 | Relay protection device interface language switching method and system based on hot loading mechanism |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN120631324A (en) |
-
2025
- 2025-06-11 CN CN202510778600.9A patent/CN120631324A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6493661B1 (en) | Reusable multi-language support facility for software | |
CN102096588B (en) | Control-containing page establishing method | |
EP4475014A2 (en) | Method and terminal device for extracting web page content | |
US6523171B1 (en) | Enhanced source code translator from procedural programming language (PPL) to an object oriented programming language (OOPL) | |
CN109564608A (en) | Updating virtual memory addresses of target application functions for updated versions of application binary code | |
CN109086215B (en) | Embedded software unit test case generation method and system | |
US11301366B2 (en) | Test automation systems and methods using logical identifiers | |
CN108920566B (en) | Method, device and equipment for operating SQLite database | |
CN112818176B (en) | Data processing method, device, equipment and storage medium | |
CN112732254A (en) | Webpage development method and device, computer equipment and storage medium | |
US7555716B2 (en) | Terminology customization in a processing environment | |
CN110727429A (en) | Front-end page generation method, device and equipment | |
CN103136100A (en) | Method and system for Android test | |
Sänger et al. | A qualitative assessment of using ChatGPT as large language model for scientific workflow development | |
EP1909170B1 (en) | Method and system for automatically generating a communication interface | |
CN115617338A (en) | Method and device for quickly generating service page and readable storage medium | |
CN112698819A (en) | Method, device and storage medium for designing tree-oriented object programming program | |
KR20150041352A (en) | Apparatus and Method for creating web application | |
CN120631324A (en) | Relay protection device interface language switching method and system based on hot loading mechanism | |
Levin et al. | owlcpp: a C++ library for working with OWL ontologies | |
CN114817403B (en) | Block chain deployment method, device, equipment and storage medium | |
CN117708385A (en) | Operation method and device of resource character string and electronic equipment | |
CN117170640A (en) | A component management method, device and readable storage medium for a low-code platform | |
CN113342399B (en) | Method and device for configuring structure of application program and readable storage medium | |
CN113608726B (en) | Code generation method, device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination |