Relay protection device interface language switching method and system based on hot loading mechanism

By introducing a hot loading mechanism and a variable-length language storage structure into the relay protection device, the problem of requiring a device restart to switch interface languages ​​is solved, achieving instant language updates and efficient multi-language support.

CN120631324APending Publication Date: 2025-09-12NANJING GUODIAN NANZI WEIMEIDE AUTOMATION CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510778600.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Switching the interface language of existing relay protection devices requires restarting the device, which is complicated to operate and affects the user experience and system real-time performance, and cannot meet the requirements of high real-time performance and operational continuity.

Method used

A method based on the hot loading mechanism is adopted to realize the dynamic binding of interface elements and language pack files by constructing a variable-length language storage structure and dynamic memory management, allowing language switching without restarting the device.

Benefits of technology

It realizes the instant loading and display update of the interface language of the relay protection device, improves the real-time performance of interface language switching and system continuity, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120631324A_ABST
    Figure CN120631324A_ABST
Patent Text Reader

Abstract

The invention provides a relay protection device interface language switching method and system based on a hot loading mechanism, and the method comprises the steps: constructing a variable-length language storage structural body under a C language according to the variable-length text characteristics of multiple languages in a language text file, so as to generate an instantiated object, and further binding an interface element of a relay protection device; under the condition that an operation signal of switching languages of the user interface is detected, obtaining a user target language according to the interface element index so as to read a corresponding language text file; pointing a first-level pointer corresponding to the instantiated object to the read language text file, and pointing a second-level pointer corresponding to the instantiated object to the first-level pointer so as to bind the interface element and the target language text file; analyzing a second-level pointer corresponding to the instantiated object, and mapping the second-level pointer to a first-level pointer corresponding to the instantiated object to obtain target language text information pointed by the first-level pointer. According to the method, interface language switching can be completed without restarting equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of human-machine interface language management, and in particular relates to a method and system for switching the interface language of a relay protection device based on a hot loading mechanism. Background Art

[0002] With the development of smart grids and the widespread adoption of domestic relay protection devices in the global market, human-machine interfaces (HMIs) for relay protection devices are required to support multiple languages ​​to meet the localization needs of users in different countries or regions. Currently, multilingual implementation primarily relies on a language pack mechanism. This mechanism uses language pack files to decouple interface text from source code, and then controls language loading through language configuration files. Existing mainstream solutions typically load language pack content at device startup. To switch languages, the configuration file must be modified and the device restarted to reload the language data.

[0003] This process has significant drawbacks: language switching requires a device reboot, which is complex and time-consuming. It can also cause interruptions to the device's current operating state or data loss, impacting user experience and system real-time performance. Therefore, existing solutions rely on a "cold reload" model and cannot meet the higher demands for real-time performance and operational continuity. Summary of the Invention

[0004] In view of the deficiencies in the prior art, the present invention provides a method and system for switching the interface language of a relay protection device based on a hot loading mechanism.

[0005] In a first aspect, the present invention provides a method for switching the interface language of a relay protection device based on a hot loading mechanism, comprising: Constructing a language pack file structure to store multi-language text information; wherein the language pack file includes a language text file; According to the characteristics of variable-length text in multiple languages ​​in the language text file, a variable-length language storage structure in C language is constructed, including C language first-level pointers and C language second-level pointers; Generate instantiation objects based on the constructed variable-length language storage structure to bind interface elements of the relay protection device; When an operation signal for switching the language of the user interface is detected, the user target language is obtained according to the interface element index; Read the corresponding language text file according to the user's target language; Point the primary pointer corresponding to the instantiated object to the read language text file, and point the secondary pointer corresponding to the instantiated object to the primary pointer to bind the interface element to the target language text file; When the user switches the language and jumps to the interface menu, the secondary pointer corresponding to the instantiated object is parsed and mapped to the primary pointer corresponding to the instantiated object according to the secondary pointer to obtain the target language text information pointed to by the primary pointer.

[0006] Optionally, the language pack file also includes a language configuration file for recording the types of languages ​​currently supported by the system, the current language type, and the 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; The HMI static text file is used to store text information that is fixedly displayed in the relay protection device interface; The HMI dynamic text file is used to store text information dynamically displayed in the relay protection device interface; The HMI print text file is used to store text information that needs to be printed in the relay protection device interface printing function.

[0007] Optionally, the C language first-level pointer points to a memory area dynamically allocated according to the length of the language text; the memory area is used to store the text content of the currently selected language; The C language secondary pointer points to the C language primary pointer and is used to dynamically bind interface elements and language text.

[0008] Optionally, when an operation signal for switching the user interface language is detected, obtaining the user target language according to the interface element index includes: Get the language item clicked or selected by the user, and obtain the target language encoding through the interface element index corresponding to the language item; Open and read the current language encoding contained in the language configuration file in the language pack file; When the target language encoding is the current language encoding contained in the language configuration file, modify the current language identifier field recorded in the language configuration file.

[0009] In a second aspect, the present invention provides a relay protection device interface language switching system based on a hot loading mechanism, comprising: A first construction module is configured to construct a language pack file structure to store multi-language text information; wherein the language pack file includes a language text file; The second construction module is used to construct a variable-length language storage structure in C language according to the characteristics of variable-length text in multiple languages ​​in the language text file, including a C language first-level pointer and a C language second-level pointer; A first binding module is used to generate an instantiation object according to the constructed variable-length language storage structure to bind the interface elements of the relay protection device; A first acquisition module is configured to acquire a user target language according to an interface element index when an operation signal for switching the user interface language is detected; The second acquisition module is used to read the corresponding language text file according to the user's target language; A second binding module is used to point the primary pointer corresponding to the instantiated object to the read language text file, and to point the secondary pointer corresponding to the instantiated object to the primary pointer, so as to bind the interface element to the target language text file; The third acquisition module is used to parse the secondary pointer corresponding to the instantiated object and map it to the primary pointer corresponding to the instantiated object according to the secondary pointer when the user switches the language and jumps to the interface menu, so as to obtain the target language text information pointed to by the primary pointer.

[0010] Optionally, the language package file in the first building module further includes a language configuration file for recording the types of languages ​​currently supported by the system, the current language type, and the 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; The HMI static text file is used to store text information that is fixedly displayed in the relay protection device interface; The HMI dynamic text file is used to store text information dynamically displayed in the relay protection device interface; The HMI print text file is used to store text information that needs to be printed in the relay protection device interface printing function.

[0011] Optionally, the C language first-level pointer in the second building block points to a memory area dynamically allocated according to the length of the language text; the memory area is used to store the text content of the currently selected language; The C language secondary pointer points to the C language primary pointer and is used to dynamically bind interface elements and language text.

[0012] Optionally, the first acquisition module includes: An acquisition unit, configured to acquire the language item clicked or selected by the user, and obtain the target language encoding through the interface element index corresponding to the language item; The reading unit is used to open and read the current language encoding contained in the language configuration file in the language pack file; The modification unit is used to modify the current language identification field recorded in the language configuration file when the target language encoding is the current language encoding contained in the language configuration file.

[0013] In a third aspect, the present invention provides a computer device comprising a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the steps of the method for switching the interface language of a relay protection device based on a hot loading mechanism described in the first aspect are implemented.

[0014] In a fourth aspect, the present invention provides a computer-readable storage medium for storing a computer program; when the computer program is executed by a processor, the steps of the method for switching the interface language of a relay protection device based on a hot loading mechanism described in the first aspect are implemented.

[0015] The present invention provides a method and system for switching the interface language of a relay protection device based on a hot loading mechanism. In the method, a variable-length language storage structure under the C language is designed, and the dynamic binding between the interface elements and the language package file is realized by instantiating the structure object. When performing a language switching operation, the text file of the target language can be reloaded so that the interface elements are automatically bound to the text content of the target language, thereby realizing instant updating of the interface language. The present invention adopts a hot loading mechanism, and by introducing a variable-length language structure and combining it with dynamic memory management, the switching process of the interface language of the relay protection device can be completed without restarting the device, thereby realizing instant loading and display updating of multiple languages. Compared with the existing solution based on cold loading, the present invention significantly improves the real-time performance of interface language switching and the continuity of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 A flowchart of a method for switching the interface language of a relay protection device based on a hot loading mechanism provided by an embodiment of the present invention; Figure 2 A variable-length language storage structure definition diagram provided by an embodiment of the present invention; Figure 3 A diagram showing the structure of a language package file provided by an embodiment of the present invention; Figure 4 A logic diagram for implementing language switching in the interface of a relay protection device provided by an embodiment of the present invention; Figure 5 A schematic diagram of the structure of a relay protection device interface language switching system based on a hot loading mechanism is provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0019] Example 1

[0020] like Figure 1 As shown, an embodiment of the present invention provides a method for switching the interface language of a relay protection device based on a hot loading mechanism, comprising: Step 101: construct a language pack file structure to store multi-language text information; wherein the language pack file includes a language text file.

[0021] According to the requirements of multi-language switching, the language package file structure is designed to store multi-language text information. Figure 3 As shown, a language pack file includes a language configuration file and multiple language text files. The language configuration file records the languages ​​supported by the current system, the current language type, and the text file name corresponding to each language. Language text files are divided into three categories: HMI (Human-Machine Interface) static text files, HMI dynamic text files, and HMI print text files. HMI static text files are used to store text information that is permanently displayed on the relay protection device interface, such as menus and status bars; HMI dynamic text files are used to store text information that is dynamically displayed on the relay protection device interface, such as pop-up windows and dialog boxes; and HMI print text files are used to store text information that needs to be printed using the relay protection device interface printing function, such as communication parameters and set value information. These three types of text are further divided into multiple subfiles based on language (such as Chinese, English, Spanish, Russian, etc.). All file contents are stored in the form of "section-key-value pairs", where a section is set for each functional module (information viewing, operation, report query, set value setting and other functional modules in the relay protection device HMI). Each multilingual variable involved in each functional module (such as analog and switch quantities in the information viewing module, action reports and operation reports in the report query module) is set as a key-value pair under the section to facilitate program reading by module.

[0022] Step 102 : constructing a variable-length language storage structure in C language according to the characteristics of variable-length text in multiple languages ​​in the language text file, including a C language primary pointer and a C language secondary pointer.

[0023] The structure here is a user-defined data type in C language. It can combine multiple variables of different types to form a whole, which is used to describe an entity type with multiple attributes. Taking "student" as an example, a student has multiple attributes such as age, height, gender and grades, and the data types of these attributes are different. Through the structure, these attributes can be integrated into a unified data structure, so that we can use one variable to represent a complete student. Figure 2 As shown, in order to realize the dynamic replacement and memory management of multi-language texts during program execution, the present invention designs a variable-length language storage structure in C language, which includes the following main members: A primary pointer points to a dynamically allocated memory area based on the length of the language text. This memory is used to store the text content in the currently selected language. This memory allocation uses the heap space (a memory area used by C language programs at runtime), ensuring scalability and cross-module accessibility while also preventing memory overflows and wasted memory in the relay protection device.

[0024] Secondary pointers point to primary pointers and are used to dynamically bind interface elements (such as buttons, labels, and tooltips) to language text. By maintaining a reference to the primary pointer, each interface element can directly respond to language text updates caused by language switching.

[0025] Unsigned integer variable: Records the number of bytes of memory occupied by the current language text, including the terminator. This field provides support for memory management and out-of-bounds detection to prevent memory leaks and illegal access.

[0026] Constructors and destructors: Constructors initialize structure members, allocate initial memory space, and set default text. Destructors release memory resources allocated within the structure, clear pointer references, and prevent memory leaks.

[0027] Assignment function: writes the specified language text into the memory area pointed to by the structure object and reallocates the memory according to the length of the new text.

[0028] The variable-length language storage structure supports adaptive management of different language lengths and allows reassignment during program runtime, ensuring that interface text is instantly refreshed after language switching.

[0029] Step 103: Generate an instantiation object according to the constructed variable-length language storage structure to bind the interface elements of the relay protection device.

[0030] 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. "Instantiation" here refers to creating actually usable variables based on the template of the structure type. The result of structure instantiation is a structure object, and each attribute of the object is clearly assigned an initial value. Taking students as an example, two objects, student Zhang San and student Li Si, are created using this template. They are the instantiation objects of the structure. Each object has its own age, height, gender, grades and other information, which are independent of each other and do not affect each other. Then use the secondary pointer member variable of the generated structure object to replace the text variable in the interface program source code to realize the binding of interface elements and structure objects.

[0031] Step 104 : When an operation signal for switching the language of the user interface is detected, the user target language is obtained according to the interface element index.

[0032] After completing steps 101 through 103 and receiving a language switching signal from the user interface, the interface program captures the language item clicked or selected by the user, obtains the target language encoding from the interface element index, then opens and reads the configuration file information in the language pack, including the list of supported languages, the language file name mapping table, and the current language encoding. The program then verifies whether the target language is within the supported range of the configuration file's language type (i.e., if the target language encoding is the current language encoding contained in the language configuration file). If the target language is valid, the current language identifier field recorded in the configuration file is modified, and the language pack text file path corresponding to that language is retrieved.

[0033] Step 105: Read the corresponding language text file according to the user's target language.

[0034] The interface program reads the language pack text file corresponding to the target language according to the language pack text file path obtained in step 104. The program sequentially opens and reads the HMI static text file, HMI dynamic text file, and HMI print text file in the target language. The program reads the key-value pairs in each section, following the functional module sequence. For each key-value pair, the program dynamically allocates the corresponding memory space on the heap based on the length of the string to the right of the equal sign and stores it, automatically loading and injecting language resources from the file into memory.

[0035] Step 106 : Point the primary pointer corresponding to the instantiated object to the read language text file, and point the secondary pointer corresponding to the instantiated object to the primary pointer, so as to bind the interface element to the target language text file.

[0036] In this step, the interface program uses the first-level pointers of the structure objects of all interface elements constructed in step 103 to point to the language package text information memory obtained in step 105, and uses the second-level pointer of the structure object to point to the first-level pointer, thereby realizing the decoupling and dynamic binding of the interface elements and the target language text file. Figure 4 As shown. Here, we can use A, B, and C as an example. C often moves due to job transfers, so A often doesn't know C's situation. Now, the three of them agree that every time C moves, they must tell B their new address, and B won't move. This way, every time C moves, A can find C through B, enabling A to track C's situation in real time. In the above example, A corresponds to the interface element in this embodiment, B corresponds to the secondary pointer in this embodiment, C corresponds to the primary pointer in this embodiment, and C's situation corresponds to the multilingual text in this embodiment.

[0037] Step 107 , when the user switches the language and jumps to the interface menu, the secondary pointer corresponding to the instantiated object is parsed and mapped to the primary pointer corresponding to the instantiated object according to the secondary pointer to obtain the target language text information pointed to by the primary pointer.

[0038] This step ultimately implements the hot-loading language switching mechanism, greatly improving the human-computer interaction efficiency and user experience of the multi-language interface of the relay protection device.

[0039] In summary, this embodiment provides a method for switching the interface language of a relay protection device based on a hot loading mechanism, designs a variable-length language storage structure under the C language, and realizes the dynamic binding between the interface elements and the language package file through the instantiation of the structure object. When performing a language switching operation, the text file of the target language can be reloaded so that the interface elements are automatically bound to the text content of the target language, thereby realizing instant updating of the interface language. The present invention adopts a hot loading mechanism, and by introducing a variable-length language structure and combining it with dynamic memory management, the switching process of the interface language of the relay protection device can be completed without restarting the device, thereby realizing instant loading and display updating of multiple languages. Compared with the existing solution based on cold loading, the present invention significantly improves the real-time performance of interface language switching and the continuity of the system.

[0040] Example 2

[0041] Based on the same inventive concept as Example 1, this embodiment provides a relay protection device interface language switching system based on a hot loading mechanism. Since the principle of solving the problem of this system is similar to the relay protection device interface language switching method based on a hot loading mechanism provided in the aforementioned Example 1, the implementation of this system can refer to the implementation of the relay protection device interface language switching method based on a hot loading mechanism provided in Example 1.

[0042] like Figure 5As shown, the interface language switching system of the relay protection device based on the hot loading mechanism includes: The first constructing module 10 is used to construct a language package file structure to store multi-language text information; wherein the language package file includes a language text file.

[0043] The second construction module 20 is used to construct a variable-length language storage structure in C language according to the characteristics of variable-length text in multiple languages ​​in the language text file, including a C language primary pointer and a C language secondary pointer.

[0044] The first binding module 30 is used to generate an instantiation object according to the constructed variable-length language storage structure to bind the interface elements of the relay protection device.

[0045] The first acquisition module 40 is configured to acquire the user target language according to the interface element index when an operation signal for switching the user interface language is detected.

[0046] The second acquisition module 50 is configured to read a language text file corresponding to the user's target language.

[0047] The second binding module 60 is used to point the primary pointer corresponding to the instantiated object to the read language text file, and to point the secondary pointer corresponding to the instantiated object to the primary pointer, so as to bind the interface element to the target language text file.

[0048] The third acquisition module 70 is used to parse the secondary pointer corresponding to the instantiated object and map the secondary pointer to the primary pointer corresponding to the instantiated object to obtain the target language text information pointed to by the primary pointer when the user switches the language and jumps to the interface menu.

[0049] Exemplarily, the language pack file in the first construction module further includes a language configuration file for recording the types of languages ​​currently supported by the system, the current language type, and the text file name corresponding to each language.

[0050] The language text files include HMI static text files, HMI dynamic text files and HMI print text files.

[0051] The HMI static text file is used to store text information that is fixedly displayed in the relay protection device interface.

[0052] The HMI dynamic text file is used to store text information dynamically displayed in the relay protection device interface.

[0053] The HMI print text file is used to store text information that needs to be printed in the relay protection device interface printing function.

[0054] Exemplarily, the C language first-level pointer in the second building block points to a memory area dynamically allocated according to the length of the language text; the memory area is used to store the text content of the currently selected language.

[0055] The C language secondary pointer points to the C language primary pointer and is used to dynamically bind interface elements and language text.

[0056] Exemplarily, the first acquisition module includes: The acquiring unit is used to acquire the language item clicked or selected by the user, and to acquire the target language encoding through the interface element index corresponding to the language item.

[0057] The reading unit is used to open and read the current language encoding contained in the language configuration file in the language pack file.

[0058] The modification unit is used to modify the current language identification field recorded in the language configuration file when the target language encoding is the current language encoding contained in the language configuration file.

[0059] For more specific working processes of the above modules, please refer to the corresponding content disclosed in Example 1, which will not be repeated here.

[0060] Example 3

[0061] This embodiment provides a computer device, including a processor and a memory; wherein, when the processor executes a computer program stored in the memory, the steps of the method for switching the interface language of a relay protection device based on a hot loading mechanism described in Example 1 are implemented.

[0062] For more specific details about the above method, please refer to the corresponding content disclosed in Example 1, which will not be repeated here.

[0063] Example 4

[0064] This embodiment provides a computer-readable storage medium for storing a computer program; when the computer program is executed by a processor, the steps of the method for switching the interface language of a relay protection device based on a hot loading mechanism described in Example 1 are implemented.

[0065] For more specific details about the above method, please refer to the corresponding content disclosed in Example 1, which will not be repeated here.

[0066] Example 5

[0067] This embodiment provides a computer program product, including computer executable instructions or a computer program. When the computer executable instructions or the computer program are executed by a processor, the steps of the method for switching the interface language of a relay protection device based on a hot loading mechanism described in Example 1 are implemented.

[0068] For more specific details about the above method, please refer to the corresponding content disclosed in Example 1, which will not be repeated here.

[0069] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. References to the same or similar parts between the various embodiments will be sufficient. The systems, devices, storage media, and computer program products disclosed in the embodiments correspond to the methods disclosed in the embodiments, so their descriptions are relatively simplified. For relevant details, refer to the method descriptions.

[0070] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software and a necessary general-purpose hardware platform. Based on this understanding, the technical solutions in the embodiments of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, or an optical disk, and includes instructions for enabling a computer device (such as a personal computer, server, or network device) to execute the methods described in various embodiments of the present invention, or portions thereof.

[0071] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0072] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0073] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.

[0074] The present invention has been described in detail above with reference to specific embodiments and exemplary examples. However, these descriptions should not be construed as limiting the present invention. Those skilled in the art will appreciate that various equivalent substitutions, modifications, or improvements may be made to the technical solutions and implementations of the present invention without departing from the spirit and scope of the present invention, all of which fall within the scope of the present invention. The scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A method for switching the interface language of a relay protection device based on a hot loading mechanism, characterized in that: include: Build language pack file structure to store multilingual text information; The language pack file includes the language text file; According to the characteristics of variable-length text in multiple languages ​​in the language text file, a variable-length language storage structure in C language is constructed, including C language first-level pointers and C language second-level pointers; Generate instantiation objects based on the constructed variable-length language storage structure to bind interface elements of the relay protection device; When an operation signal for switching the language of the user interface is detected, the user target language is obtained according to the interface element index; Read the corresponding language text file according to the user's target language; Point the primary pointer corresponding to the instantiated object to the read language text file, and point the secondary pointer corresponding to the instantiated object to the primary pointer to bind the interface element to the target language text file; When the user switches the language and jumps to the interface menu, the secondary pointer corresponding to the instantiated object is parsed and mapped to the primary pointer corresponding to the instantiated object according to the secondary pointer to obtain the target language text information pointed to by the primary pointer.

2. The method for switching the interface language of a relay protection device according to claim 1, characterized in that: The language pack file also includes a language configuration file for recording the types of languages ​​currently supported by the system, the current language type, and the 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; The HMI static text file is used to store text information that is fixedly displayed in the relay protection device interface; The HMI dynamic text file is used to store text information dynamically displayed in the relay protection device interface; The HMI print text file is used to store text information that needs to be printed in the relay protection device interface printing function.

3. The method for switching the interface language of a relay protection device according to claim 1, characterized in that: The C language first-level pointer points to a memory area dynamically allocated according to the length of the language text; the memory area is used to store the text content of the currently selected language; The C language secondary pointer points to the C language primary pointer and is used to dynamically bind interface elements and language text.

4. The method for switching the interface language of a relay protection device according to claim 2, characterized in that: The step of acquiring the user target language according to the interface element index when an operation signal for switching the user interface language is detected includes: Get the language item clicked or selected by the user, and obtain the target language encoding through the interface element index corresponding to the language item; Open and read the current language encoding contained in the language configuration file in the language pack file; When the target language encoding is the current language encoding contained in the language configuration file, modify the current language identifier field recorded in the language configuration file.

5. A relay protection device interface language switching system based on a hot loading mechanism, characterized in that: include: A first building module is used to build a language pack file structure to store multilingual text information; The language pack file includes the language text file; The second construction module is used to construct a variable-length language storage structure in C language according to the characteristics of variable-length text in multiple languages ​​in the language text file, including a C language first-level pointer and a C language second-level pointer; A first binding module is used to generate an instantiation object according to the constructed variable-length language storage structure to bind the interface elements of the relay protection device; A first acquisition module is configured to acquire a user target language according to an interface element index when an operation signal for switching the user interface language is detected; The second acquisition module is used to read the corresponding language text file according to the user's target language; A second binding module is used to point the primary pointer corresponding to the instantiated object to the read language text file, and to point the secondary pointer corresponding to the instantiated object to the primary pointer, so as to bind the interface element to the target language text file; The third acquisition module is used to parse the secondary pointer corresponding to the instantiated object and map it to the primary pointer corresponding to the instantiated object according to the secondary pointer when the user switches the language and jumps to the interface menu, so as to obtain the target language text information pointed to by the primary pointer.

6. The relay protection device interface language switching system according to claim 5, characterized in that: The language pack file in the first building module also includes a language configuration file for recording the types of languages ​​currently supported by the system, the current language type, and the 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; The HMI static text file is used to store text information that is fixedly displayed in the relay protection device interface; The HMI dynamic text file is used to store text information dynamically displayed in the relay protection device interface; The HMI print text file is used to store text information that needs to be printed in the relay protection device interface printing function.

7. The relay protection device interface language switching system according to claim 5, characterized in that: The C language first-level pointer in the second building block points to a memory area dynamically allocated according to the length of the language text; the memory area is used to store the text content of the currently selected language; The C language secondary pointer points to the C language primary pointer and is used to dynamically bind interface elements and language text.

8. The relay protection device interface language switching system according to claim 6, characterized in that: The first acquisition module includes: An acquisition unit, configured to acquire the language item clicked or selected by the user, and obtain the target language encoding through the interface element index corresponding to the language item; A reading unit, used to open and read the current language encoding contained in the language configuration file in the language pack file; The modification unit is used to modify the current language identification field recorded in the language configuration file when the target language encoding is the current language encoding contained in the language configuration file.

9. A computer device, characterized in that: It comprises a processor and a memory; wherein, when the processor executes the computer program stored in the memory, it implements the steps of the method for switching the interface language of a relay protection device based on a hot loading mechanism as described in any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that Used to store computer programs; when the computer programs are executed by the processor, the steps of the method for switching the interface language of a relay protection device based on a hot loading mechanism as described in any one of claims 1 to 4 are implemented.

Citation Information

Cited By

  • Multi-language implementation method and system for relay protection device

    CN121070508A