Development method and system of virtualized relay protection device

By simulating the input and output of actual devices through virtualized relay protection devices, the problem of dependence on prototypes in the development of relay protection devices is solved, enabling more efficient development and testing, and providing an intuitive operating interface and logic testing environment.

CN121636046APending Publication Date: 2026-03-10XUCHANG XJ SOFTWARE TECHNOLOGIES LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

The reliance on prototypes during the development of relay protection devices leads to long hardware development cycles, affecting project progress, and also results in low efficiency and resource waste due to multi-person collaboration.

Method used

Virtualized relay protection devices are adopted, and the input and output of the actual device are simulated through a human-machine interface. Shared memory and interface functions are used to achieve seamless connection with the actual device, providing an intuitive operation interface and logic testing.

Benefits of technology

It reduces reliance on prototypes, shortens the development cycle, improves development efficiency, and provides an intuitive user interface and logic testing environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121636046A_ABST
    Figure CN121636046A_ABST
Patent Text Reader

Abstract

The invention relates to a development method and system of a virtualized relay protection device, and belongs to the field of relay protection development. Loading the virtualization development device into the engineering code, compiling and then testing, wherein the virtualization development device is provided with a human-computer interaction interface after running; according to the method, input of the actual relay protection device is simulated by setting input setting and / or analog quantity numerical values through a human-computer interaction interface, the input setting is correspondingly converted into integer data, the analog quantity numerical values are correspondingly converted into AD sampling values to be written into corresponding memory positions, and engineering codes access the data in the corresponding memory positions and then are correspondingly processed. Writing the processed data into a corresponding memory position; and the virtualization development device accesses the processed data in the corresponding memory position and correspondingly displays the processed data on the human-computer interaction interface to simulate the output of the actual relay protection device. According to the invention, the debugging of the engineering code can be completed without a prototype, and the man-machine interaction interface provides a more intuitive operation interface.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to a virtualized development method and system of a relay protection device, and belongs to the field of relay protection development. BACKGROUND

[0002] With the increasing scale of power systems and the continuous maturity of technology, the reliability and timeliness of relay protection development are increasingly required. As is known to all, relay protection devices have many functions and complex logic, and a prototype is needed to debug the engineering code during development or after development. The hardware development cycle is relatively long, which often lags behind software development and debugging, affecting project progress. In addition, relay protection device development requires the cooperation of multiple people, modular development, and a relatively immature prototype, and too many prototypes will cause a certain degree of waste. SUMMARY

[0003] The purpose of the present application is to provide a virtualized development method and system of a relay protection device to solve the problem of dependence on a prototype when developing and testing the engineering code of a relay protection device.

[0004] To achieve the above-mentioned purpose, the scheme of the present application includes:

[0005] The virtualized development method of a relay protection device loads a virtualized development device into the engineering code related to the relay protection, compiles and tests it, and the virtualized development device has a man-machine interface after running. The input of the actual relay protection device is simulated by setting the input bit and / or analog value through the man-machine interface, and the input bit is converted into integer data and the analog value is converted into AD sampling value and written into the corresponding memory location. The data in the corresponding memory location is accessed by the engineering code, and the processed data is written into the corresponding memory location. The virtualized development device accesses the processed data in the corresponding memory location and displays the corresponding output on the man-machine interface to simulate the output of the actual relay protection device.

[0006] Further, when the engineering code accesses the memory location related to the input, the input signal is read, and then the corresponding code logic is executed to write data to the memory location related to the output. The virtualized development device calls the corresponding interface function to read the memory data related to the output, decodes it, and then displays the corresponding output state through the man-machine interface.

[0007] Further, the setting of the input bit is realized through the keys on the man-machine interface.

[0008] Further, when the analog quantity value is set through the man-machine interface, the virtualization development device writes data to the memory location related to the sampling value after obtaining the AD sampling value through reverse calculation, the engineering code reads the AD sampling value after accessing the memory location related to the analog quantity, then writes data to the memory location related to the analog quantity output after executing the corresponding code logic, and the virtualization development device reads the memory data related to the analog quantity output through the corresponding interface function, and then displays the corresponding state through the man-machine interface.

[0009] Further, the AD sampling value of the alternating current analog quantity is obtained by reverse calculation of the analog quantity value using an alternating current analog quantity reverse calculation formula, and the alternating current analog quantity reverse calculation formula is:

[0010]

[0011] Wherein, smpVal1[smpRat] is the AD sampling value when the sampling rate is equal to smpVal, samRat is the sampling rate, inVal is the input analog quantity value, maxVal is the maximum value of the set analog quantity value, smpBit is the AD sampling precision, and i is 0 to samRat-1.

[0012] Further, the AD sampling value of the direct current analog quantity is obtained by reverse calculation of the analog quantity value using a direct current analog quantity reverse calculation formula, and the direct current analog quantity reverse calculation formula is:

[0013]

[0014] Wherein, smpVal2[smpRat] is the AD sampling value when the sampling rate is equal to smpVal, samRat is the sampling rate, inVal is the input analog quantity value, maxVal is the maximum value of the set analog quantity value, smpBit is the AD sampling precision, and RanVal is the zero drift.

[0015] Further, when the virtualization development device is initialized, the corresponding interface function is called to allocate memory of a corresponding length according to the requirements, and the data in the file is written into the memory after being read; when the memory data is to be read, the corresponding interface function is called to copy data of a corresponding length to a buffer according to the starting address of the allocated memory as a memory offset; when data is to be written into the memory, the corresponding interface function is called to erase data of a length consistent with the data to be written after the starting address of the allocated memory is taken as a memory offset, and then the data to be written is copied to the corresponding memory location.

[0016] Further, the human-computer interaction interface further comprises a state lamp, the state lamp is used for simulating the state of the actual relay protection device lamp; the data corresponding to the state of the state lamp is stored in a global array in a corresponding memory location, and the virtual development device switches the state of the state lamp according to the state data in the global array; the state data in the global array is written by the virtual development device or the engineering code according to the test.

[0017] Further, the human-computer interaction interface further comprises a display area, the engineering code writes the content to be displayed into a corresponding memory location according to a pre-defined coding rule, and calls a corresponding interface function of the virtual development device to access the corresponding memory location, and then displays the content to be displayed on the display area.

[0018] Further, the human-computer interaction interface further comprises a keyboard, the keyboard comprises a key used for simulating the input of the actual relay protection device, the key is defined in an enumeration type, when the key is pressed through the human-computer interaction interface, the virtual development device writes the enumeration type corresponding to the key into a corresponding global variable in a corresponding memory location, the engineering code accesses the global variable to perform a corresponding operation, and calls a corresponding interface function of the virtual development device to display the corresponding operation on the display area.

[0019] The development system of the virtual relay protection device of the application comprises a processor, and the processor is used for executing a computer program to realize the steps of the development method of the virtual relay protection device.

[0020] The application has the following beneficial effects: the application is an open invention, the virtual development device is loaded into the engineering code related to the relay protection for testing, the virtual development device has a human-computer interaction interface after running, the input of the actual relay protection device is set through the human-computer interaction interface, the input is converted into shaping data and AD sampling values, and the shaping data and the AD sampling values are written into corresponding memory locations at the same time, the engineering code accesses the data in the corresponding memory locations to perform corresponding processing, and writes the processed data into corresponding memory, the virtual development device accesses the processed data in the corresponding memory locations to perform corresponding display on the human-computer interaction interface to simulate the output of the actual relay protection device. The application simulates the actual relay protection device through the virtual development device to test the code logic related to the relay protection, and avoids the dependence on the relay protection prototype; and the application provides an intuitive operation interface through the human-computer interaction interface. BRIEF DESCRIPTION OF DRAWINGS

[0021] Figure 1 is a graphical interface schematic diagram of the virtual development device of the application. DETAILED DESCRIPTION

[0022] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0023] The concept of this invention is to use a virtualization development device instead of an actual relay protection device when developing and debugging engineering code related to relay protection, and to simulate the input and output of the actual relay protection device through a visual interface.

[0024] Method Implementation Examples:

[0025] This embodiment provides a development method for a virtualized relay protection device. The hardware of a relay protection device typically consists of input channels, output channels, analog channels, and communication interfaces. When developing engineering code related to relay protection, different protection logic is built according to different types of relay protection devices. Therefore, to facilitate the development and debugging of engineering code for relay protection devices, a virtualized development device suitable for relay protection development has been developed, providing general input and output functions. By loading this virtualized development device into the engineering code, the development and debugging of the engineering code can be conveniently performed. To ensure an intuitive operating interface and portability, the graphical user interface (GUI) of the virtualized development device is developed using the QT framework. Taking some common functions as examples, such as... Figure 1 As shown, the graphical user interface includes a display area, a keyboard (up, down, left, right, +, -, cancel, confirm, zone number, reset), status lights, a print area, output channels, input channels, and analog signal channels. Clicking the corresponding functions in this graphical user interface simulates the LCD display, key input, receiving and sending digital signals, analog signal acquisition, communication, and flash management functions of an actual relay protection device. The virtualization development device of this invention supports a maximum of 8 output channels, 32 input channels, and 8 analog signal channels. The number of input, output, and analog signal channels displayed and their instantiation are automatically loaded and displayed based on the specific project code.

[0026] In order to realize the same effect of the virtual development device and the actual relay protection device in developing and debugging the engineering code, the virtual development device provides the corresponding interface matched with the actual relay protection device. In order to ensure the clear separation and effective interaction between the engineering code and the virtual development device, the responsibilities and interfaces of the engineering code and the virtual development device need to be clearly divided. The virtual development device realizes the seamless connection with the actual relay protection device by using the shared memory and the interface function consistent with the interface of the actual relay protection device. When defining the interface between the virtual development device and the engineering code, the data type, data format, communication protocol and interface function of both parties need to be defined according to the actual demand. For example, when the analog quantity acquisition module in the engineering code calls the interface function provided by the virtual development device to interact data, the data interaction format, calling time and communication protocol in the analog quantity channel interface function of the virtual development device need to be defined. After the debugging of the engineering code using the virtual development device is completed, the protection logic tested in the virtual development device can be migrated to the actual relay protection device by replacing the dynamic library and recompiling the engineering code.

[0027] Specifically, the display area in the graphical user interface can display two types of characters, Chinese and English, according to specific needs. The Chinese type of character is encoded according to the GBK two-byte encoding rule, and the Chinese character dot matrix data is generated according to the dot matrix setting. The English type of character is encoded according to the ASCII one-byte encoding rule, and the English character dot matrix data is generated according to the dot matrix setting. The mapping of the character encoding and its corresponding dot matrix data is completed through a mapping table. When some content needs to be displayed, the engineering code puts the display content into the corresponding memory according to the corresponding encoding rule, and calls the corresponding interface function provided by the virtual development device. The interface function accesses the corresponding memory to find the content to be displayed. The virtual development device first finds the encoding corresponding to the content to be displayed, and then finds the corresponding dot matrix data through the mapping table. Finally, the dot matrix data is displayed. The directory structure, paging display, pop-up window and other functions in the display area of the actual relay protection device are implemented in the engineering code, and are displayed in the display area of the graphical user interface by calling the corresponding interface function provided by the virtual development device.

[0028] The virtualization development device has the same flash management function as the actual relay protection device. The flash is an important hardware resource of the relay protection, and is mainly used for saving setting values, system parameters, permission management, log recording, etc. The virtualization development device uses the same interface function as the flash drive in the actual relay protection device to simulate the functions of flash writing, reading, erasing, etc. The flash management function is realized by reading and writing binary files. When initializing the virtualization development device, the flash management function allocates memory of a corresponding length according to specific requirements by calling the corresponding interface function, writes data into the memory after reading the engineering file, and then simulates the reading and writing of the flash. For example, for the flash reading function, the starting address of the allocated memory is used as the memory offset, and the interface function related to reading data is called to copy the corresponding length of data to the buffer in the memory for easy reading by the engineering code. For the flash writing function, the starting address of the allocated memory is used as the memory offset, and the interface function related to writing is called to erase the corresponding length of data and then copy the data to the corresponding memory. When the virtual device is closed, the data in the memory is written to the file in binary form to realize the saving of data.

[0029] The keyboard is an important input method of the actual relay protection device, and is often used in conjunction with the liquid crystal display to browse the interface and set parameters. The virtualization development device is provided with nine virtual keys for simulating the input of the actual relay protection device, i.e. "up", "down", "left", "right", "+", "-", "confirm", "cancel", and "reset". The specific association with the liquid crystal display content is realized in the engineering code, so the enumeration type of all the keys can be defined. When a key in the graphical user interface is clicked, the function corresponding to the key is assigned to a global variable. After the engineering code reads the global variable stored in the corresponding memory location, the corresponding code logic is executed according to the actual requirements, and the display-related interface function is called to display on the display area.

[0030] Eight status lights are arranged below the liquid crystal display, including one "running" status light, one "trip" status light, one "jump position" status light, one "close position" status light, one "warning" status light, and three "spare" status lights. These status lights are used to simulate the status of the lights of the actual relay protection device. Except for the "warning" status light which is red, the other status lights are green. The status of the lights is stored in a global array in the virtualization development device. The status data in the global array can be defined by the virtualization development device at initialization, or can be accessed and modified by the engineering code stored in the corresponding memory location. The virtualization development device lights or extinguishes the corresponding status lights according to the global array stored in the corresponding memory location, thereby simulating the status lights of the actual relay protection device in turn.

[0031] The input channel is used to receive external signals, such as switch input, circuit breaker position, etc.; the output channel is used to output control signals, such as trip signal, alarm signal, etc. In the graphical user interface, green light represents no input or output, and red light represents input or output. The input and output are coded by 8421. When setting the input, you only need to click the corresponding light state in the graphical user interface to set the input bit, and then the input status light changes from green to red, and the corresponding interface function is called to convert the input into shaped data according to the code and put it into the memory related to the input, so as to simulate the input signal of the actual relay protection device. Then the engineering code accesses the memory location related to the input, reads the input signal, and then executes the corresponding code logic to write data to the memory location related to the output. The output is a virtual development device that calls the corresponding interface function to read the memory data related to the output and then decodes it. If the bit is "1", the output status light is red, and if it is "0", the output status light is green, so as to simulate the output signal of the actual relay protection device. For example, if the memory data read by the output is unsigned int DO = 0x03, the output 1 and output 2 are red, and the rest are green; if unsigned int DO = 0x04, the output 3 is red, and the rest are green.

[0032] The analog channel is used to receive and process continuous physical quantities in the power system, such as voltage, current, etc., for protection judgment. In the graphical user interface, the actual display value is filled in. The virtual development device reversely calculates the AD sampling value according to the sampling rate, maximum sampling value and AD sampling accuracy of the analog channel of the corresponding actual relay protection development device, and then writes the calculation result into the corresponding memory. Then the actual engineering code reads the AD sampling value in the corresponding memory and executes the related code logic, and then writes the corresponding processing result to the corresponding memory location. The virtual development device reads the corresponding processing result and displays the corresponding state through the graphical user interface. Among them, the analog channel is used to simulate the collection of AC analog and DC analog. Taking the actual display value of the current signal (AC analog) as an example, the AD sampling value of the AC analog in the corresponding memory (AD cache area) is:

[0033]

[0034] Wherein, smpVal1[smpRat] is the AD sampling value when the sampling rate is equal to samRat, inVal is the actual display value filled in, maxVal is the maximum value that can be displayed by the analog channel, smpBit is the AD sampling precision, i is the loop number, and the AD sampling values of each point are calculated from 0 to (samRat-1) respectively, and the calculated AD sampling values of each point are placed in the shared memory. When the corresponding A, B and C three-phase in the three-phase power is involved, the calculated AD sampling values are respectively moved in the array by samRat / 3 positions, so as to achieve the purpose of 120 degrees phase difference.

[0035] The direct current channel is used to transmit direct current signals. According to the input value, the maximum sampling value, the AD sampling precision, and the appropriate zero drift, the direct current signal is reversely calculated, and the calculation result is written into the corresponding memory. The AD sampling value of the direct current analog quantity in the corresponding memory (AD cache area) is:

[0036]

[0037] Wherein, smpVal2[smpRat] is the AD sampling value when the sampling rate is equal to samRat, and RanVal is the zero drift, which is a random value not greater than 10. The value that does not exceed 10 is obtained according to engineering experience, and is used to simulate the zero drift generated by the actual relay protection device when collecting direct current signals.

[0038] After the virtualization development device executes the corresponding code logic according to the AD sampling value of the AD cache area, it writes the corresponding data into the corresponding memory. For example, after the opening channel 1 outputs the circuit breaker tripping action and writes into the corresponding memory of the display area, the virtualization development device is called with the corresponding interface function. After reading the tripping signal, the state lamp of the corresponding opening channel is turned red, and after reading the display content "protection tripping action", the display area of the virtualization development device is displayed.

[0039] The virtualization development device is configured with serial port and network port communication functions, which are used to initialize, open and close the hardware ports of the computer used in the engineering code, such as opening the network port of the notebook computer, communicating through the network port of the notebook computer, and then performing simulation test. The specific communication content is realized in the engineering code according to the demand.

[0040] The virtualization development device includes a printing area for simulating the operation of actual relay protection devices. This printing area is configured with four log types: "Driver," "Platform," "Application," and "Other." Each log type has three interface functions: "General Information," "Alarm Information," and "Fault Information," based on the alarm level. This allows developers to write the information to be printed into the corresponding interface functions provided by the virtualization development device during project code development. When selecting the appropriate alarm level and log type through the graphical user interface, the virtualization development device will filter the alarm levels under the selected log type and then display them in the printing area of ​​the graphical user interface.

[0041] System Implementation Example:

[0042] This embodiment provides a development system for a virtualized relay protection device. When developing and testing the engineering code related to relay protection in the system, the method described in the method embodiment is adopted. Since the description of the method is clear enough, it will not be repeated here.

[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for developing a virtualized protective relay device, characterized by, The virtualization development device is loaded into the engineering code related to the relay protection and is compiled and tested, and the virtualization development device has a human-computer interaction interface after running; the input of the actual relay protection device is simulated by setting the input bit and / or the analog quantity value through the human-computer interaction interface, and the input bit is converted into an integer type data and the analog quantity value is converted into an AD sampling value and written into the corresponding memory location; the engineering code accesses the data in the corresponding memory location and processes accordingly, and writes the processed data into the corresponding memory location; The virtualization development device accesses the processed data in the corresponding memory location and displays accordingly on the human-computer interaction interface to simulate the output of the actual relay protection device.

2. The method of claim 1, wherein the virtualized protective relay device is developed by, When the engineering code accesses the memory location related to the input, the input signal is read, and then the corresponding code logic is executed to write data to the memory location related to the output, the virtualization development device calls the corresponding interface function to read the memory data related to the output and decodes, and then displays the corresponding output state through the human-computer interaction interface.

3. The method of claim 2, wherein the virtualized protective relay device is developed by: The setting of the input bit is realized through the keys on the human-computer interaction interface.

4. The method of claim 3, wherein the virtualized protective relay device is developed by: When the analog quantity value is set through the human-computer interaction interface, the virtualization development device obtains the AD sampling value by reverse calculation and writes data to the memory location related to the sampling value, the engineering code accesses the memory location related to the analog quantity and reads the AD sampling value, then executes the corresponding code logic to write data to the memory location related to the analog quantity output, the virtualization development device calls the corresponding interface function to read the memory data related to the analog quantity output, and displays the corresponding state through the human-computer interaction interface.

5. The method of claim 4, wherein the virtualized protective relay device is developed by: The analog quantity value is reverse calculated using the AC analog quantity reverse calculation formula to obtain the AD sampling value of the AC analog quantity, and the AC analog quantity reverse calculation formula is: Wherein, smpVal1[smpRat] is the AD sampling value when the sampling rate is equal to smpVal, samRat is the sampling rate, inVal is the input analog quantity value, maxVal is the maximum value of the set analog quantity value, smpBit is the AD sampling precision, and i is 0 to samRat-1.

6. The method of claim 4, wherein the virtualized protective relay device is developed by: The analog quantity value is reverse calculated using the DC analog quantity reverse calculation formula to obtain the AD sampling value of the DC analog quantity, and the DC analog quantity reverse calculation formula is: Wherein, smpVal2[smpRat] is the AD sampling value when the sampling rate is equal to smpVal, samRat is the sampling rate, inVal is the input analog quantity value, maxVal is the maximum value of the set analog quantity value, smpBit is the AD sampling precision, and RanVal is the zero drift.

7. The method of claim 2 or 3, wherein the virtualized protective relay device is developed by, In initializing the virtualization development device, a memory of corresponding length is allocated according to requirements, and data in the file is written into the memory after being read; when the memory data is to be read, the corresponding interface function is called to copy data of corresponding length to the buffer according to the start address of the allocated memory as the memory offset; when data is to be written into the memory, the corresponding interface function is called to erase data of consistent length with the data to be written, and then the data to be written is copied to the corresponding memory position according to the start address of the allocated memory as the memory offset.

8. The method of claim 1, wherein the virtualized protective relaying device is developed by: The human-computer interaction interface further comprises a state lamp, which is used to simulate the state of the actual relay protection device lamp; data corresponding to the state of the state lamp is stored in a global array in a corresponding memory position, and the virtualization development device switches the state of the state lamp according to the state data in the global array; the state data in the global array is written by the virtualization development device or the engineering code according to the test.

9. The method of claim 1, wherein the virtualized protective relaying device is developed by: The human-computer interaction interface further comprises a display area, and the engineering code writes the content to be displayed into a corresponding memory position according to a pre-defined coding rule, and then accesses the corresponding memory position by calling the corresponding interface function of the virtualization development device, so as to display the content to be displayed on the display area.

10. The method of claim 9, wherein the virtualized protective relay device is developed by: The human-computer interaction interface further comprises a keyboard, and the keyboard comprises keys used to simulate the input of the actual relay protection device, and the keys are defined in an enumeration type; when the keys are pressed through the human-computer interaction interface, the virtualization development device writes the enumeration type corresponding to the keys into a corresponding global variable in a corresponding memory position, and the engineering code accesses the global variable to perform corresponding operations, and then calls the corresponding interface function of the virtualization development device to display the corresponding operations on the display area.

11. A development system of a virtualized protection device, comprising a processor, characterized in that The processor is used to execute a computer program to realize the steps of the development method of the virtualized relay protection device according to any one of claims 1-10.