Distributed data and message interaction method of lightweight relay protection device

By dividing business components and building a data bus in the relay protection device, and adopting the publish and subscribe mechanism, the data interaction problem of the relay protection device in the multi-service function integration scenario is solved, and safer, more flexible and efficient data interaction is achieved, and the adaptability Meet the needs of multi-core heterogeneous and distributed devices.

CN118573731APending Publication Date: 2024-08-30NANJING SIFANG EPOWER ELECTRIC POWER AUTOMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410645120.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the multi-service function integration scenario of existing relay protection devices, the data interaction mechanism based on shared memory has security, flexibility and consistency issues, and cannot meet the needs of data exchange between multi-core heterogeneous, virtualized containers and distributed devices. interaction requirements.

Method used

Adopting a lightweight distributed data and message interaction method, by dividing business components into different control areas, building a data bus, abstracting data into standardized interfaces, using the publish and subscribe mechanism for data transmission, and realizing cross-business and cross-hardware module data and messages Interaction.

Benefits of technology

It improves the integration and operating efficiency of the relay protection system, solves the problems of data interaction security, flexibility and efficiency, adapts to the trend of hardware plug-in, and realizes efficient data transmission across devices and high-speed data access within the same device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118573731A
    Figure CN118573731A
Patent Text Reader

Abstract

The invention discloses a distributed data and message interaction method of a lightweight relay protection device, and belongs to the technical field of calculation, reckoning or counting. The method comprises the following steps: dividing each pair of service components in the relay protection device into different control areas, constructing a bottom chip hardware architecture of each control area, and configuring a data bus for each control area; abstracting the data of each service component into a data model and packaging the data model into a standardized interface; the source end service component calls a standardized interface to generate a configuration file; based on published and subscribed messages and a data transmission mechanism, data interaction between a source end service component and a destination end service component is achieved through a data bus. Through a data modeling method and a distributed bus technology, functional modules of various relay protection products can realize rapid, safe and efficient data and message intercommunication on different levels, different types of operating systems and different hardware platforms, and the integration level, the intelligent level and the overall operation efficiency of the relay protection system are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to power system distribution automation technology, and specifically discloses a distributed data and message interaction method for a lightweight relay protection device, which involves the perception of business components going online, realizes cross-component and cross-platform data communication and business distribution functions, and belongs to the technical field of calculation, estimation or counting. Background Art

[0002] With the rapid development of smart distribution networks and the Internet of Things, computer technology, control technology and other technologies have been cross-integrated to realize the automated monitoring, protection, control and management of distribution networks, and improve the safety, reliability and economy of distribution networks. Smart distribution networks have evolved from a single centralized type to a multi-integrated distributed type. Relay protection devices have also gradually evolved from single-core single-service functions to multi-core heterogeneous architectures and multi-service integration. The integration of multiple services needs to take into account the security and stability of each service, so security isolation is required between services. The development of container technology solves the above problems.

[0003] With the development of electric power, the capacity of power equipment is getting larger and larger. The circuit board of the relay protection device is gradually developing into a combination of a main control board and a multi-business functional sub-board. Then how to solve the interaction of data information between the main control board and the sub-board becomes a difficult point. The interaction between the business data of the relay protection device is usually achieved through shared memory. However, the continuous growth of the demand for multi-business integration of a single device and the expansion of multiple hardware plug-ins of a single device have led to high data pressure, slow access and complex upgrade operations in the centralized business data processing center based on shared memory. The solution of realizing business data interaction through shared memory can no longer meet the needs of business data interaction between the main control board and the sub-board of the relay protection device in the multi-business function integration scenario.

[0004] In addition, in the scenario of multiple business function integration, the shared memory method has the following obvious shortcomings: (1) Security: Since all processes in the shared memory space can read and write the same data, there is a lack of effective permission management and isolation mechanism, which can easily lead to data competition and conflict, affecting the overall security and stability of the system; (2) Flexibility and scalability: When the device hardware is plug-in-based, different business functions may be distributed in different plug-ins or boards, while shared memory is limited to process communication within the same physical machine, and is powerless for cross-board or cross-plug-in business data interaction; (3) Consistency and synchronization complexity: When multiple businesses access shared memory concurrently, complex synchronization mechanisms such as lock mechanisms are required to ensure data consistency. Such complex synchronization mechanisms increase the complexity of the system and are prone to deadlock and other problems.

[0005] On the other hand, with the development of technology and the evolution of architecture, computing power is no longer concentrated in a single device, but a large task is sent to different devices for calculation in a slicing manner, and the results are finally aggregated. A cross-platform and cross-system data interaction communication framework is required between different devices and boards, and different businesses of relay protection devices need to interact and access data. The traditional publish-subscribe data interaction communication architecture has the problem of mutual coupling of processing logic when processing such interactive data, and is not convenient for debugging and problem tracking. Therefore, the existing communication architecture that realizes data interaction through shared memory can no longer meet the needs of multi-core heterogeneity, virtualized containers, and distributed device data access.

[0006] Therefore, in response to new demands under the current development trend of power equipment, the present invention aims to propose a lightweight bus technology for data and messages inside and outside the relay protection device, in order to replace the data and information interaction mechanism based on shared memory, so as to overcome the limitations of the shared memory-based interaction mechanism in the interaction of business data and messages of relay protection devices in multi-business function integration scenarios. Summary of the invention

[0007] The purpose of the present invention is to address the deficiencies of the above-mentioned background technology and provide a distributed data and message interaction method for a lightweight relay protection device, so as to solve the technical problem that the interaction mechanism based on shared memory is limited in the interaction of business data and messages of relay protection devices in the scenario of multi-business function integration, and to achieve the purpose of the invention of data and message interaction across businesses and hardware modules of relay protection devices in a safer, more flexible and efficient manner.

[0008] The present invention adopts the following technical solutions to achieve the above-mentioned invention object:

[0009] A distributed data and message interaction method for a lightweight relay protection device comprises the following steps:

[0010] Step 1: According to the real-time requirements of each business component in the relay protection device for data, the business components are divided into different control areas, the underlying chip hardware architecture of each control area is constructed, and a data bus is configured for each control area;

[0011] Step 2: abstract the data of each business component into a data model and encapsulate it into a standardized interface;

[0012] Step 3: The source-side business component calls the standardized interface to generate a configuration file;

[0013] Step 4: Based on the publish-subscribe message and data transmission mechanism, the configuration file of the source-side business component is transmitted to the destination-side business component through the data bus.

[0014] As a further optimization scheme for the distributed data and message interaction method of a lightweight relay protection device, the specific method of dividing the business components into different control areas in step 1 is: dividing the business components that do not have strict requirements on data real-time performance into the first control area, and dividing the business components that have strict requirements on data real-time performance into the second control area.

[0015] As a further optimization scheme for the distributed data and message interaction method of a lightweight relay protection device, the business components in step 1 that do not have strict requirements on data real-time performance include but are not limited to: LCD display, PMU, and data transmission from the master station; the business components that have strict requirements on data real-time performance include but are not limited to: metering, monitoring, and 5G differential; the business is deployed in a container or a functional plug-in.

[0016] As a further optimization scheme for the distributed data and message interaction method of a lightweight relay protection device, the specific method of abstracting the data of each business component into a data model in step 2 is: first, create a new business component name, business component id, table name and table id through the modeling tool; then create a new field name, field id and field length according to the specific function of the business component; then, assign the table to the business component requesting the table data according to the data request of other business components, and the tool generates an .ini file describing the data of each business component.

[0017] As a further optimization scheme for the distributed data and message interaction method of a lightweight relay protection device, the .ini files generated by the tool to describe the data of each business component include: a .ini file that describes the basic information of the business component itself and other business components used, and a group of .ini files that describe the specific configuration information of the data interaction between the business component and each other business component; the specific configuration information of the data interaction between the business component and each other business component includes but is not limited to: the table configuration information of the data required by the business component, the configuration information of the default keys of the attributes of each table except the default keys, the table configuration information of the data required by the business component includes but is not limited to: table name, item attribute, value type, number of records in the table, maximum number of items, the configuration information of the default keys of the attributes of each table except the default keys includes but is not limited to the id of the business component, the English meaning of the business component, the Chinese descriptor of the business component, the type of configuration data describing the startup / shutdown status of the business component, the value of the configuration data describing the startup / shutdown status of the business component, and the message subject describing the data required by the business component.

[0018] As a further optimization scheme for the distributed data and message interaction method of a lightweight relay protection device, the source-side business component in step 3 calls the standardized interface to generate a configuration file as follows:

[0019] When the source-side business component does not have strict requirements on data real-time performance, fill in the table field information in the source-side business component data model and configure the properties of the message topic that describes the data required by this business component so that no subscriber response is required;

[0020] When the source-side business component has strict requirements on data real-time performance, fill in the table field information in the source-side business component data model, and configure the properties of the message topic that describes the data required by this business component to require subscribers to respond accurately.

[0021] As a further optimization scheme for the distributed data and message interaction method of a lightweight relay protection device, when the source-end business component has strict requirements on data real-time performance, step 4 is based on the point-to-point communication mode under the publish-subscribe message and data transmission mechanism, and transmits the configuration file of the source-end business component to the destination-end business component through the data bus. Specifically, the source-end component configuration file is published to the designated destination-end business component through the data bus in the control area to which the source-end component belongs, and the data bus in the control area to which at least one designated destination-end business component belongs parses and processes the received message to generate information on data reception and processing status, and the data reception and processing status information is fed back to the source-end component via the message bus.

[0022] As a further optimization scheme for the distributed data and message interaction method of a lightweight relay protection device, when the source-end business component does not have strict requirements on data real-time performance, step 4 transmits the configuration file of the source-end business component to the destination-end business component through the data bus based on the broadcast communication mode under the publish-subscribe message and data transmission mechanism. Specifically, the source-end component configuration file is published to all destination-end business components through the data bus in the control area to which the source-end component belongs, and the data bus in the control area to which at least one destination-end business component belongs parses the received message, and the destination-end business component discards or processes the data pushed by the data bus in its control area according to its own business needs.

[0023] As a further optimization scheme for the distributed data and message interaction method of a lightweight relay protection device, when the data bus within the control area to which at least one designated destination business component belongs fails to parse and process the received message, at least one designated destination business component rolls back to the state before the data processing transaction is executed. If the initial rollback operation fails, the rollback operation is executed again and the source business component feeds back a notification of the data processing failure of the destination business component.

[0024] As a further optimization scheme for the distributed data and message interaction method of a lightweight relay protection device, regardless of whether the destination business component discards the data pushed by the data bus within its control area according to its own business needs or feeds back information on the data reception and processing status after processing, the source business component records the successful processing of the data by the destination business component.

[0025] The present invention adopts the above technical solution and has the following beneficial effects:

[0026] (1) The data and message interaction method proposed in the present invention, through data modeling methods and distributed bus technology, enables the functional modules of various relay protection products to achieve fast, safe and efficient data and message intercommunication at different levels, different types of operating systems and different hardware platforms, greatly improving the integration, intelligence level and overall operation efficiency of the relay protection system, and successfully breaking through the inherent limitations of the traditional data interaction method based on shared memory, especially in dealing with the problem of business data communication interaction between multiple business containers and deployed on different boards. It can not only effectively eliminate the cross-container data communication barriers caused by business isolation, but also adapt to the trend of hardware plug-in, ensuring that business systems deployed on different boards can smoothly achieve data interaction without being restricted by shared memory solutions. Specifically, for data transmission scenarios involving cross-devices, this technology makes full use of the advantages of Ethernet communication to ensure that data can be efficiently and reliably circulated between different devices; and within the same device, for data interaction within the same process that does not need to cross process boundaries, it can be directly referenced by memory addresses, for example, by means of hanging pointers, thereby maintaining high-speed and low-latency data access characteristics. In short, this lightweight bus technology is not only inclusive, but can also realize cross-device data transmission at the Ethernet level, while taking into account efficient memory access within the same device, thereby greatly improving the flexibility and efficiency of data exchange while ensuring the security and stability of data communication.

[0027] (2) The present invention proposes a streamlined and efficient communication protocol stack designed specifically for relay protection equipment to achieve a lightweight communication architecture, reduce unnecessary overhead, improve real-time performance and stability, and meet the protection system's strict requirements for data transmission speed and reliability.

[0028] (3) The present invention implements model-driven development through modeling tools. By separating business and data and establishing a separate data model for each business component, a customized data interaction model can be easily created. The completed data model settings are then encapsulated in a standardized interface. The system will automatically generate corresponding resource configuration files and source code based on the model, realizing an integrated conversion from model to implementation, greatly reducing the workload of manual coding and shortening the product launch cycle.

[0029] (4) The lightweight data bus communication framework proposed in the present invention takes into account the needs of different application scenarios. The communication bus technology has good scalability and is not limited to the communication within the relay protection equipment. It can also be seamlessly connected to external systems and other types of intelligent devices, providing a unified standard and efficient data exchange platform for cross-domain device interconnection, broadening its application prospects in the fields of industrial Internet, Internet of Things, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a flow chart of a distributed data and message interaction method of a lightweight relay protection device proposed in the present invention.

[0031] Figure 2 It is a schematic diagram of the API interface of the data bus in the lightweight data communication interaction framework proposed in the present invention.

[0032] Figure 3 4 is a system architecture diagram of a relay protection device in an embodiment of the present invention.

[0033] Figure 4 It is a schematic diagram of business message subscription and publishing under the lightweight data communication interaction framework proposed in the present invention.

[0034] Figure 5 It is a schematic diagram of business modeling through a data interaction bus under the lightweight data communication interaction framework proposed in the present invention.

[0035] Figure 6 It is a schematic diagram of data and message exchange between internal and external services of a relay protection device through a data exchange bus in an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The technical solution of the invention is described in detail below with reference to the accompanying drawings.

[0037] The present invention provides a distributed data and message interaction method for a lightweight relay protection device, such as Figure 1 As shown, it includes the following 4 steps.

[0038] Step 1: According to the real-time requirements of each business component in the relay protection device for data, the business components are divided into different control areas, the underlying chip hardware architecture of each control area is constructed, and the data bus is configured for each control area.

[0039] The system architecture of the relay protection device exemplified in this embodiment is as follows Figure 3As shown, the processor of the relay protection device is a 4-core processor, which includes two 860 cores and two 810 cores; the main frequency of the two 860 cores reaches about 1.2G, which is mainly used to process communication services, and the main frequency of the two 810 cores is about 720MHz, which has good real-time performance and is mainly used to process control and protection logic services. Control area I mainly runs services with operating systems, which are not very demanding for real-time requirements, such as: LCD display, PMU, and data transmission from the master station. The business functions of control area I are realized through chip 1 composed of two 860 cores and DDR area 1. Control area II basically runs bare core services, which have high real-time requirements, such as: measurement, monitoring, 5G differential, and the business functions of control area II are realized through chip 2 composed of two 810 cores and DDR area 2.

[0040] In order to meet the needs of multiple services running simultaneously on one device, in addition to partition isolation on the hardware, container technology is also used to place a service in a container for resource isolation to ensure that the operation of each service does not interfere with each other. At the same time, data interaction is required between different services. In order to meet this demand, the present invention has developed a lightweight data communication interaction framework for the relay protection device, and provides a set of public data sending and receiving interfaces for the data communication interaction framework. The component APP used to implement business functions can exist in any form, such as threads and processes, and can be deployed in containers or in functional plug-ins. The APP can run on the operating system or in a container. The APP can be deployed in the same core or in partitions between cores.

[0041] The lightweight data communication interaction framework provided by this implementation is as follows Figure 4 As shown, the data communication interaction framework includes three parts: message center, publisher and subscriber. The present invention designs each core business component of the relay protection device as an independent microservice unit. Each microservice unit is responsible for a specific function and can be independently deployed, upgraded and maintained. Each microservice unit can be either a publisher or a subscriber under the data communication framework.

[0042] The message center, i.e., the message registration machine Broker, is deployed on the central side and is responsible for storing messages published by producers and managing consumer subscription information. According to consumer subscription information, the message content published by producers is pushed to consumers. The message center is essentially a group of servers to implement a service registration and discovery mechanism. When the present invention starts each core business component of the relay protection device as a microservice, each core business component actively sends a registration request including its own service ID, interface address, metadata and other information to the message center to realize dynamic registration of service instances. The central side continuously senses the online status of each business component through heartbeat detection or other means. When a business component goes online, offline or fails, the registration information of the business component can be updated in real time to ensure the accuracy and reliability of the service list. In addition, the message center also undertakes the functions of service governance and routing, including but not limited to load balancing, fuse downgrade, service version management, etc., to ensure that the relay protection system can still perform data communication stably and efficiently under large-scale concurrent access or network instability.

[0043] The publisher is responsible for publishing messages to the message center, and the message center pushes the publisher's data to the subscriber based on the subscription relationship. The subscriber subscribes to the message center for the messages they need, and analyzes and processes the data after obtaining it. This design achieves system decoupling, facilitates maintenance, and improves the management efficiency of event messages. The publisher is only responsible for publishing messages, and does not need to pay attention to the subscriber's identity information and the time when the message is published. The subscriber does not need to know the time when the publisher publishes the message. The publisher and the subscriber are independent of each other, which realizes system decoupling. Each part can be deployed and maintained independently, reducing the impact of the coupling between the two, realizing asynchronous execution, and avoiding high load. The publisher can attach attribute information representing the message subject and real-time requirements to the message sent to the message center according to the real-time requirements of the information to be published. After the message center parses the message from the publisher, it sends the parsed information to the destination subscriber based on the subscription relationship. That is, when the real-time nature of the message published by the publisher is high, the destination subscriber needs to process and reply in time. When the real-time nature of the message published by the publisher is not high, the destination subscriber does not need to process and reply in time. The message center becomes a cache pool between the publisher and the subscriber, making the data interaction between the two smoother.

[0044] like Figure 5 As shown in the figure, each microservice exchanges data through a lightweight message bus, and adopts an asynchronous communication mode to implement event-driven and message passing to ensure loose coupling between business components. For example, using the message queue service, when a business event occurs, the publisher only needs to push the event to the message queue, and the subscriber receives and processes the corresponding data according to the topic it subscribes to.

[0045] In one embodiment of the present invention, Figure 4 The lightweight data communication interaction framework shown also adopts a distributed memory database storage mode, that is, the storage of message data adopts a one-master-one-backup method, that is, a copy of the message data is stored on each end of the publisher and the subscriber. When the message data of one of the modules is lost or damaged, the data can be restored from the other end. When the system loses power and restarts, the business can read the memory database in its own control area to restore the business function, ensuring the reliability of the entire system.

[0046] Step 2: Abstract the data of each business component into a data model and encapsulate it into a standardized interface

[0047] In order to reduce the development difficulty of each business function module and the workload of code development, the present invention has developed a set of modeling tools, which provides a set of public API interfaces for lightweight data communication interaction framework through data modeling. Figure 2 , as shown in Tables 1 to 3. Business components automatically generate table names and ids as well as corresponding field names, field ids, and field lengths by calling the API interface of the lightweight data communication interaction framework to achieve data transfer and use between business components. For example, the power plug-in and the communication management module plug-in need to upload data to the LCD for display. At this time, the LCD module only needs to subscribe to the data tables of the power plug-in and the communication management module plug-in, and this data interaction framework will obtain the data that the LCD module wants. The specific implementation of providing a set of public API interfaces for the lightweight data communication interaction framework through data modeling is as follows:

[0048] First, separate the business logic processing from the data required by the business, that is, abstract the data from the software code, establish a data model, and realize the reference and transmission between data through the message bus. The business is only responsible for the processing of its own business logic. The user creates a new business component name, business component id, table name and table id through the modeling tool, and then creates a new field name, field id and field length according to the specific function of the business; then, according to the data request of other business components, the table is assigned to the business component requesting the table data. The tool generates an .ini file, which is the data model. The data model is expressed in json format. Using this modeling method, the data required by each independent business component can be digitized into a series of mathematical models according to a unified mode; finally, the model of the data required by each business component is encapsulated as an API interface. After the developer calls the API interface to fill in the table field information in the data model, the configuration file of each business component can be obtained. The subsequent framework transmits the configuration file to the destination message bus through the data bus. After the destination message bus parses the configuration file, it records the data of table A in business component AppA and transmits it to business component AppB or more business component App. The business component App that receives the table processes the data recorded in the received table according to its own business needs. The design of the model of the data required by the business components is shown in Tables 1 and 2 below:

[0049] Publisher A DataWriter Topic1 DataReader Subscriber A1 Publisher B DataWriterb Topic2 DataReaderb Subscriber B1 Publisher C DataWriterc Topic3 DataReaderc Subscriber C1

[0050] Table 1

[0051] Table 1 shows the overall schematic diagram of the lightweight data communication interaction framework. This framework is an asynchronous communication mode. In this mode, publishers, also known as producers A, B, and C, publish their own messages, which are sent to the message center. Subscribers, also known as consumers A1, B1, and C1, subscribe to the topics they are interested in from the message center. When a publisher sends a message to the message center, the message center will push the message to all subscribers interested in the topic based on the subscriber's subscription information. In this way, publishers and subscribers do not need to know each other's existence and details, and only need to interact through the message center.

[0052]

[0053] Table 2

[0054] Table 2 shows the files configured for each business component App. The configuration file of each business component consists of a new_apptbl.ini file and a group of appn_....ini files. Among them, the new_apptbl.ini file describes the component information of the APP itself and the basic information of other APP components used, and the appn_....ini file configures the specific configuration information of the data interaction between the APP and each other app; the specific configuration information of the data interaction between the APP and each other app includes but is not limited to: the table configuration information of the data required by the APP, and the configuration information of the default keys of the attributes of each table except the default keys; the table configuration information of the data required by the APP includes but is not limited to: table name, Item attribute, value type, number of records in the table, and the maximum number of items; the table includes fixed items fixItem and dynamic items varItem; the fixed item fixItem is added by the IsDB module according to the configuration file during the initialization phase, and the value of a single field of each item can be modified during operation, but the item cannot be added or deleted; the dynamic item varItem adds the item as a whole and covers it cyclically, but does not support the modification of the value of a single field; the configuration information of the default keys of the attributes of each table except the default keys includes but is not limited to: appid, key, name, dt, value, Topic.

[0055] In Table 2, appid represents the id of this business component, which is a globally unique id. After the component is started, it actively sends registration information to the center. key is the English meaning of the business component, name is the Chinese descriptor of this business component, dt represents the type of configuration data of the startup / shutdown state of this business component, and value represents the configuration data value of the startup / shutdown state of this business component. The message interaction method between each app and the bus is partitioned by message topic. The topic is mainly divided into the following two categories: notify and request. Notify does not require a reply, but request requires a reply. cfgFile is the configuration file for each business component. The content of cfg mainly includes the local business component id, the peer business component id, the table name of the interaction data between components, the field name and the length of each field. The specific table and field information model is shown in Table 3:

[0056]

[0057] Table 3

[0058] Table 3 shows an analog quantity status table, which means that the current values ​​of three phases A, B, and C of a circuit are counted; appid represents the business component id, which in this embodiment represents the business component differential App with id 3, key represents the field name established according to the business component differential App to implement the function of counting the three-phase current size, name represents the Chinese identifier of the field name, dt represents the type of configuration data of the function of opening or relating to the business component differential App counting the current of a certain phase, value represents the value of the configuration data of the function of opening the business component differential App counting the current of a certain phase, dimension, attr and other information represent the configuration information corresponding to each field of the business component differential App, dimension represents that the unit of the current of each phase is A, and the type of the current value of each phase is float type. The table contains three fields Ia1, Ib1 and Ic1, and the type of each field is float type.

[0059] By modeling, business data model information and table field information are generated, and the data that needs to be interacted between businesses is converted into table field information. The developer fills in the values ​​of the fields in the table at the source end to complete the configuration of each business component in the relay protection device. The modeling tool automatically generates a header file named db_data_pub.h, which contains structures that correspond to the database tables one by one. The design of each structure accurately reflects the structural layout of the original database table. Its various member variables are directly mapped to the field names in the table, and its data type strictly matches the size of the corresponding field. In this way, when all businesses perform data interaction processing, they only need to simply include and directly reference the structure type in this predefined header file, without manually repeatedly building the data structure, effectively eliminating the problems caused by inconsistent data parsing between different modules. At the same time, by accurately controlling the size and boundary of the data structure, potential memory out-of-bounds access and memory anomalies are eliminated from the source, thereby improving the stability and security of the entire system; then, the data is sent to the destination business component through the lightweight data communication interaction framework proposed by the present invention. After receiving and processing the information pushed by the message bus, the destination business component feeds back a response message to the message bus according to the attributes of the topic information in the message published by the source component. Therefore, the data model proposed in the present invention can be used for the scenario of cross-platform interaction of data and messages inside and outside the relay protection device, and is applicable to the universal cross-platform software library of systems such as Linux, Windows, and SyliXOS. It has high versatility and compatibility. Through this set of software components, users can realize data interaction and resource sharing on different platforms, thereby improving the flexibility and scalability of the system.

[0060] By using the above data modeling method to model the data of independent or distributed functional plug-ins or functional modules, the attributes, parameters, inputs, outputs and events of each functional plug-in or module can be abstracted into tables and fields and solidified into configuration files. Under the lightweight data communication interaction framework proposed by the present invention, data and message interaction inside and outside the relay protection device can be realized.

[0061] In addition, the modeling tool integrates a rigorous duplication detection and verification mechanism. During the user input process, the modeling tool will automatically check for possible duplicate component names, component IDs or table names and table IDs, and report errors in a timely manner when duplication is detected to prevent potential data conflicts. When duplicate IDs are detected, the modeling tool provides new ID options for users to select and confirm, thereby effectively avoiding naming confusion and resource overlays, greatly reducing the complexity of the development process, and improving the overall controllability and consistency of the project.

[0062] Through the above series of functional designs, the deep abstraction and rational classification of business distribution types have effectively improved the system's resource utilization efficiency and developer work efficiency, effectively reduced the difficulty of framework development and significantly optimized the user experience.

[0063] Step 3: The source-side business component calls the standardized interface to generate a configuration file

[0064] When the source-side business component does not have strict requirements on data real-time performance, fill in the table field information in the source-side business component data model and configure the attribute of the message topic that describes the data required by this business component to notify;

[0065] When the source-side business component has strict requirements on data real-time performance, fill in the table field information in the source-side business component data model and configure the attribute of the message topic that describes the data required by this business component to request.

[0066] Step 4: Based on the publish-subscribe message and data transmission mechanism, the configuration file of the source business component is transmitted to the destination business component through the data bus.

[0067] In one embodiment of the present invention, a comprehensive data processing pipeline is introduced under the above-mentioned lightweight data communication interaction framework, which not only includes a variety of data sending mechanisms, but also fully reflects the concept of decoupling and collaborative work between microservices. Specifically, a modular data transmission strategy is proposed under the above-mentioned lightweight data communication interaction framework, in which the framework kernel provides a point-to-point communication mode and a broadcast communication mode. These two modes can be flexibly selected and switched according to the needs of different business scenarios.

[0068] First of all, the point-to-point data communication mode aims to achieve efficient and accurate message transmission. This design idea is particularly suitable for situations where only a single specific subscriber needs to respond. In this model, a publisher sends a targeted message, and a pre-set unique / group of subscribers will receive and process the message. The subtlety of this strategy is that it can significantly reduce the communication burden of the entire system, especially when there are a large number of concurrent messages. Through one-to-one precise matching, it effectively avoids unnecessary resource consumption and ensures that the system will not degrade due to overloaded message processing pressure. In the point-to-point data communication mode, the attribute information of the topic in the configuration file of the microservice unit / business component as the publisher is configured as request, that is, the subscriber needs to accurately reply after receiving and processing the message consistent with the publisher's Topic information. Therefore, point-to-point communication is suitable for one-to-one service interaction, ensuring high-efficiency, low-latency and accurate data transmission.

[0069] On the other hand, the broadcast communication mode presents a completely different application scenario. This mode makes full use of the message subscription mechanism, allowing components to broadcast notifications throughout the system, so that all relevant online components can receive the same table data updates. In the broadcast communication mode, the attribute information of the topic in the business component configuration file as the publisher is configured as notify, that is, the business component as the subscriber does not need to reply after receiving the message published by the publisher. This design gives each business component full autonomy. They can flexibly filter and process the received information according to their own needs, and can actively choose to ignore irrelevant broadcast data. This global communication method greatly enhances the system's collaborative ability and real-time performance, and is particularly suitable for scenarios that require multiple modules to respond or synchronize status at the same time. Therefore, the broadcast method is suitable for one-to-many or many-to-many notification scenarios, and can synchronize data to multiple subscription services at one time, greatly improving the coverage and efficiency of information publishing.

[0070] The framework further integrates the construction logic of these two communication modes. During the modeling phase, users only need to focus on the core attributes of business entities, such as defining key elements such as table names, field names, and their field lengths. Based on this information, the framework automatically generates a series of highly abstract and unified customized interfaces, including interfaces for point-to-point message sending and receiving, as well as interfaces for broadcast data sending and receiving. This allows all microservices to use the same standards and protocols for parsing and processing when receiving data. This automated process greatly reduces the coding tasks of the development team, allowing them to freely call the corresponding sending interfaces based on the characteristics of their own business logic, and focus more on the innovation and improvement of business logic rather than the implementation details of the underlying communication mechanism, thereby achieving the goal of quickly building and deploying business. Figure 2As shown, the standardized API interface provided by the calling framework can realize the sending and receiving of messages in different communication modes.

[0071] In the point-to-point data communication mode, after the peer service completes the link it is responsible for, it must send a clear response confirmation message to the source component to feedback the result that the current instruction has been successfully executed. At this stage, the source component is responsible for collecting the processing status information of all peer services. Only when all participating components successfully process the instruction can the successful completion of this global operation be confirmed.

[0072] However, in the actual execution process, it is inevitable that some components will fail when processing business data. In response to this, the framework has designed a rigorous rollback mechanism. Once a processing failure is detected, a rollback operation will be triggered immediately to try to restore to the state before the transaction was executed. If the re-execution after the initial rollback still fails to solve the problem, the framework will perform the rollback operation again and send a notification of execution failure to the system to guide developers to investigate and fix specific problems.

[0073] At the same time, in order to cope with various complex scenarios, the present invention also provides a "best effort" policy option for the broadcast communication mode. In this case, after the source component sends data to the target component, it does not rely too much on the confirmation information returned by the target component on success or failure. Even if the target component does not return the correct status code when processing the data, the source component will assume that its processing logic has been executed as expected. This strategy is mainly suitable for scenarios with relatively loose requirements on data accuracy, such as the transmission of log information and diagnostic information. In these cases, even if transmission errors or losses occur occasionally, it will not have a serious impact on the overall operation of the system. Therefore, the use of a "best effort" strategy helps to improve the system's fault tolerance and operating efficiency. In short, while ensuring the accurate processing of critical business data, the invention takes into account the flexibility and robustness of non-critical data transmission to meet the needs of diversified application scenarios.

[0074] In this embodiment, Figure 6The example shows that each business component in the relay protection device realizes data and information interaction through the data interaction bus, and divides APP1~APP3 that do not have strict requirements on the real-time transmission of messages into partition I. The business data read by APP1~APP3 from the shared memory is used to establish a business data configuration file through the API interface of the pre-packaged data model, and the business data of each APP in partition I is published through the bus IsDB1 or the business data from partition II is subscribed; APP7~APP8 that have high requirements on the real-time transmission of messages are divided into partition II, and the business data read by APP7~APP8 from the shared memory is used to establish a business data configuration file through the API interface of the pre-packaged data model, and the business data of each APP in partition II is published through the bus IsDB2 or the business data from partition I is subscribed. The business data configuration files of APP1~APP3 and APP7~APP8 are based on Figure 4 The lightweight data communication interaction mechanism transmission is shown.

[0075] In one embodiment of the present invention, a lightweight data interaction framework designed for efficient and flexible data exchange is illustrated. The framework, with its detailed description of the implementation principle and implementation method, enables ordinary technicians in this field to clearly understand and grasp its essential connotation. The above implementation method is used as a specific example to deeply analyze how the framework works in actual application scenarios, including but not limited to the adaptation of different types of services, the reasonable division and utilization of hardware resources, and the use of container technology to ensure smooth data interaction between services.

[0076] The framework cleverly copes with the need for real-time data interaction when multiple services are running in parallel in complex systems such as relay protection devices. Whether it is a business application running at the operating system level or an independent business unit effectively isolated by container technology, this framework can achieve seamless data transmission and collaboration. In control area I, it supports non-real-time services such as LCD display and data upload; while in control area II, which has strict real-time requirements, it ensures the efficient operation of services such as metering, monitoring and 5G differential. Whether it is different plug-ins inside the protection device such as human-machine interface, protection logic processor, communication module, or the interaction between other external systems, this technology can effectively transmit various key information. This information covers various real-time parameters, set values, sensor input signals, protection algorithm calculation results, alarm event reports, and even necessary configuration files and other data files.

[0077] It is worth noting that although specific implementation cases are listed in this specification, the core idea of ​​the present invention is not limited thereto. In fact, any technician familiar with the art can make adaptive adjustments and expansions for different specific scenarios and technical conditions in actual applications based on the basic concept of the present invention. In other words, the data interaction framework disclosed in the present invention has strong universality and scalability, and its application range is wide and is not limited to the specific implementation methods detailed in the text.

[0078] In summary, although this specification describes the data interaction framework of the present invention and its practical applications in detail, we do not want to use this to frame all its possibilities. On the contrary, technical personnel are encouraged to explore more diversified and targeted implementation plans based on the concept of the present invention, combined with their respective professional backgrounds and actual needs, in order to give full play to the value and advantages of the present invention in a broader scope. Therefore, please understand that the content presented in this specification is not a limitation on the scope of protection of the claims of the present invention, but should be regarded as an inspiration and guidance to promote continuous innovation and development in related technical fields.

Claims

1. A distributed data and message interaction method for a lightweight relay protection device, characterized in that: The steps include: Step 1: According to the real-time requirements of each business component in the relay protection device for data, the business components are divided into different control areas, the underlying chip hardware architecture of each control area is constructed, and a data bus is configured for each control area; Step 2: abstract the data of each business component into a data model and encapsulate it into a standardized interface; Step 3: The source-side business component calls the standardized interface to generate a configuration file; Step 4: Based on the publish-subscribe message and data transmission mechanism, the configuration file of the source-side business component is transmitted to the destination-side business component through the data bus.

2. According to claim 1, a distributed data and message interaction method for a lightweight relay protection device is characterized in that: The specific method of dividing the business components into different control areas in step 1 is: dividing the business components that do not require data real-time performance into the first control area, and dividing the business components that require data real-time performance into the second control area.

3. According to claim 2, a distributed data and message interaction method for a lightweight relay protection device is characterized in that: In step 1, the business components that do not require real-time data include but are not limited to: LCD display, PMU, and master station data transmission; the business components that require real-time data include but are not limited to: metering, monitoring, and 5G differential; the business is deployed in a container or a functional plug-in.

4. The distributed data and message interaction method of a lightweight relay protection device according to claim 3 is characterized in that: The specific method of step 2 for abstracting the data of each business component into a data model is: first, create a new business component name, business component id, table name and table id through the modeling tool; then create a new field name, field id and field length according to the specific function of the business component; then, according to the data request of other business components, assign the table to the business component requesting the table data, and the tool generates an .ini file that describes the data of each business component.

5. A distributed data and message interaction method for a lightweight relay protection device according to claim 4, characterized in that: The .ini files generated by the tool that describe the data of each business component include: a .ini file that describes the basic information of the business component itself and other business components used, and a group of .ini files that describe the specific configuration information of the data interaction between the business component and each other business component; the specific configuration information of the data interaction between the business component and each other business component includes but is not limited to: table configuration information of the data required by the business component, configuration information of the default keys of the attributes of each table except the default keys, the table configuration information of the data required by the business component includes but is not limited to: table name, Item attribute, value type, number of records in the table, maximum number of Item entries, the configuration information of the default keys of the attributes of each table except the default keys includes but is not limited to the id of the business component, the English meaning of the business component, the Chinese descriptor of the business component, the type of configuration data describing the startup / shutdown status of the business component, the value of the configuration data describing the startup / shutdown status of the business component, and the message subject describing the data required by the business component.

6. A distributed data and message interaction method for a lightweight relay protection device according to claim 5, characterized in that: In step 3, the source-side business component calls the standardized interface to generate a configuration file as follows: When the source-side business component does not have strict requirements on data real-time performance, fill in the table field information in the source-side business component data model and configure the properties of the message topic that describes the data required by this business component so that no subscriber response is required; When the source-side business component has strict requirements on data real-time performance, fill in the table field information in the source-side business component data model, and configure the properties of the message topic that describes the data required by this business component to require subscribers to respond accurately.

7. A distributed data and message interaction method for a lightweight relay protection device according to claim 6, characterized in that: When the source-end business component has strict requirements on data real-time performance, step 4 transmits the configuration file of the source-end business component to the destination-end business component through the data bus based on the point-to-point communication mode under the publish-subscribe message and data transmission mechanism. Specifically, the source-end component configuration file is published to the designated destination-end business component through the data bus in the control area to which the source-end component belongs, and the data bus in the control area to which at least one designated destination-end business component belongs parses and processes the received message to generate information on data reception and processing status, and the information on data reception and processing status is fed back to the source-end component via the message bus.

8. A distributed data and message interaction method for a lightweight relay protection device according to claim 6, characterized in that: When the source-end business component does not have strict requirements on data real-time performance, step 4 transmits the configuration file of the source-end business component to the destination-end business component through the data bus based on the broadcast communication mode under the publish-subscribe message and data transmission mechanism. Specifically, the source-end component configuration file is published to all destination-end business components through the data bus in the control area to which the source-end component belongs, and the data bus in the control area to which at least one destination-end business component belongs parses the received message, and the destination-end business component discards or processes the data pushed by the data bus in its control area according to its own business needs.

9. A distributed data and message interaction method for a lightweight relay protection device according to claim 7, characterized in that: When the data bus within the control area to which at least one designated destination business component belongs fails to parse and process the received message, at least one designated destination business component rolls back to the state before the data processing transaction is executed. If the initial rollback operation fails, the rollback operation is executed again and the source business component feeds back a notification of the destination business component's data processing failure.

10. A distributed data and message interaction method for a lightweight relay protection device according to claim 8, characterized in that: Regardless of whether the destination business component discards the data pushed by the data bus in its control area according to its own business needs or feeds back information on the data reception and processing status after processing, the source business component records the successful processing of the data by the destination business component.