Multi-node data redundancy synchronization method for user-level intelligent micro-grid monitoring system

By designing a lightweight embedded file management system and data access interface, the problem of data inconsistency between multiple nodes of user-level intelligent microgrid monitoring system is solved, real-time data consistency and system stability are achieved, and maintenance costs are reduced.

CN119945886AInactive Publication Date: 2025-05-06SOUTHEAST UNIV

Patent Information

Application Number
CN202411767940.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-05-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Due to the limitations of scale and construction costs of user-level integrated energy intelligent microgrid monitoring systems, it is difficult to support mainstream commercial database products to perform data redundancy synchronization, resulting in inconsistent data from multiple nodes.

Method used

Design a lightweight embedded file management system and a general data access interface to realize data redundancy synchronization between power grid models, topology structures, alarm information, historical operation data and statistical data. Through the heartbeat mechanism and automatic fault transfer mechanism, ensure data consistency and system stability.

Benefits of technology

Real-time consistency of multi-node data of user-level intelligent microgrid monitoring system is achieved, reducing the operating and maintenance costs of the system, and improving the safety, stability and reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119945886A_ABST
    Figure CN119945886A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-node data redundancy synchronization method for a user-level intelligent micro-grid monitoring system, and the method comprises the steps: deploying a file library server process on each file library server of an embedded file management system, and setting a one-main multi-standby architecture; a host concurrently monitors a data request message from a monitoring system client in real time, a data request service is executed in a local file database, and a file library server process adds the request message into a data synchronization buffer area; and the host file library server process sends the request message to all standby file library servers in real time. The lightweight embedded file management system and a universal data access interface are designed to realize data redundancy synchronization of a power grid model, a topological structure, alarm information, historical operation data and statistical data, so that the integrity and consistency of the data are guaranteed, and the operation and maintenance cost of the system is reduced; and the safe, stable and reliable operation level of the household-level comprehensive energy micro-grid system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of power system automation, and in particular relates to a multi-node data redundancy synchronization method for a user-level intelligent microgrid monitoring system. Background Art

[0002] The integrated energy intelligent microgrid monitoring system can realize functions such as data collection and detection, fault recording and alarm event recording, remote control and optimized scheduling, which can greatly improve the efficiency of operation and maintenance. In order to improve the safety and stability of system operation, multi-node operation is generally adopted. However, when multiple nodes independently process related business data, data inconsistency may occur, which will have an adverse impact on other subsequent businesses. Therefore, it is necessary to keep the data on multi-node servers consistent. In order to ensure the integrity and consistency of data, data synchronization of structured data such as power grid CIM model, topology structure, and historical operation data of measurement points is required between multiple nodes. Traditionally, mainstream commercial database products can be used to achieve the above functions, such as Oracle RAC cluster technology and SQL Server database cluster. However, due to the limitations of its scale and construction cost, the hardware and software configuration used by the user-level integrated energy microgrid monitoring system is difficult to support mainstream commercial database products for data redundancy synchronization. Summary of the invention

[0003] The purpose of the present invention is to provide a multi-node data redundancy synchronization method for a user-level intelligent microgrid monitoring system, design a lightweight embedded file management system and a universal data access interface to realize data redundancy synchronization of power grid models, topological structures, alarm information, historical operating data and statistical data, ensure data integrity and consistency, reduce the system's operating and maintenance costs, and improve the safe, stable and reliable operation level of household-level integrated energy microgrid systems.

[0004] In order to achieve the above object, the solution of the present invention is:

[0005] A multi-node data redundancy synchronization method for a user-level smart microgrid monitoring system comprises the following steps:

[0006] Step 1: deploy a file database server process on each file database server of the embedded file management system, set one server as the master server, and the remaining servers as backup servers, connect the physical links between the master server and the backup servers, and establish a heartbeat mechanism;

[0007] Step 2, the host starts a monitoring network service process and uses a message bus to monitor data request messages from the monitoring system client in real time;

[0008] Step 3, the host verifies the legitimacy and validity of the data request message according to the designed message structure, and then determines the API to be called according to the parsed status code;

[0009] Step 4, the host executes the data request service in the local file database, returns the execution result to the monitoring system client, and then the file database server process adds the request message to the data synchronization buffer;

[0010] Step 5: When the host file database server process detects that there is a new record in the data synchronization buffer, the request message in the data synchronization buffer is sent to all standby file database servers in real time;

[0011] Step 6: Each standby file database server process monitors the quality of the local database file in real time. When a damaged data file is found, an incremental dump is used to compare the difference between the standby and host database files, and then the difference data files are transmitted, received and persistently stored.

[0012] Step 7: monitor the running service status of the main machine and the backup machine in real time. When a failure of the main machine is detected, a new main machine is selected from the servers, and the remaining servers are set as backup machines.

[0013] The specific process of the above step 3 is that the host verifies the legality and validity of the data request message, parses and judges the data request message according to the designed message structure, and the designed message structure at least includes a message identification flag, a message index, a system version, a message status flag, an execution status code, a timestamp, a message length, an endian mode, and information data; after verification, if the data request message is an illegal message, the abnormal event is recorded and the error code is returned to the monitoring system client; if the data request message is a legal and valid message, the corresponding file database interface API is selected according to the parsed execution status code.

[0014] The specific process of the above step 4 is that the host performs a modification operation in the local file database according to the data request. If the execution is successful, the modification request is added to the host data synchronization buffer. Otherwise, it is determined whether the data synchronization buffer is empty. If it is empty, the modification operation is performed again according to the data request. If it is not empty, the modification of the host file database is completed.

[0015] The specific process of step 5 above is:

[0016] Step 51, when the host file database server process detects that there is a new record in the data synchronization buffer, the data request message in the data synchronization buffer is sent in real time to all standby file database servers through the file database network management service;

[0017] Step 52, each slave machine verifies the legality and validity of the data request message, parses and judges the data request message according to the designed message structure, and the designed message structure at least includes a message identification flag, a message index, a system version, a message status flag, an execution status code, a timestamp, a message length, an endian mode, and information data; after verification, if the data request message is an illegal message, the abnormal event is recorded, and the error code is returned to the host file database server process through the local file database network management service; if the data request message is a legal and valid message, the corresponding file database interface API is selected according to the parsed execution status code, and the relevant request is executed in the local file database to complete the modification of the local file database of the standby machine.

[0018] The embedded file management system data database includes a file database server process, a file database interface service and a file database network management service. The embedded file management system data database is stored on a disk in the form of multiple files; wherein the file database server process is used by various application programs; the file database interface service provides read and write operations on local file database disk files, and the file database network management service remotely implements read and write operations on file databases on other redundant node servers;

[0019] The file database network management service encapsulates the network service based on the file database interface service, including service monitoring, request message parsing, reply message framing and response, wherein the type of message is determined by the status code, and both the request message and the response message contain the status code, which occupies one byte;

[0020] The file database interface service and file database network management service are provided in the form of DLL dynamic library, SDK, API, WebSocket, Web Service, Web API, Http Restful, and intermediate library.

[0021] In the above step 4, for the client's read request operation, a load balancing method is used to distribute the network request to multiple servers. The load balancing scheduling algorithms used are polling method, least connection method, IP hash method, and weight method.

[0022] In the above step 1, a heartbeat mechanism is established, and each file database server sends a heartbeat check to other servers at a specified interval T1, and marks the server that does not reply to the message after T2 as unavailable.

[0023] In the above step 1, the file database server process is deployed according to the configuration information of the embedded file management system of the host and the backup machine; wherein the configuration information includes the node serial number, and the serial number is not allowed to be repeated, and the smaller the node serial number, the higher the priority.

[0024] In step 7 above, the method for electing a new host is:

[0025] Calculate the service status score of each file database server in real time; the service status score is calculated based on CPU usage, memory usage, disk free space capacity, current database read and write network traffic size, and concurrent connection number;

[0026] When it is detected that the server currently serving as the host fails, the server with the highest service status score among the remaining servers is selected as the new host, and the remaining servers are set as backup servers; if there are multiple servers with the highest service status scores, the server with the smallest file database sequence number is selected as the new host;

[0027] The service status score of the file database server is calculated according to the following formula:

[0028]

[0029] Among them, n=5, which refers to the five factors that affect the service status score: CPU usage, memory usage, disk free space capacity ratio, current database read and write network traffic size, and concurrent connection number; F i is the score of each factor, F1 is the CPU usage score, F2 is the memory usage score, F3 is the disk remaining space capacity score, F4 is the current read and write network traffic size score, and F5 is the concurrent connection number score; β i is the weight of each factor; CPU self is the CPU usage of the server itself, CPU min Mem is the minimum CPU usage of each server in the system. self is the memory usage of the server itself, Mem min The minimum memory usage of each server in the system, Disk self The remaining space capacity ratio of the server's disk. max is the maximum disk remaining space capacity ratio of each server in the system, Net self For the server's own read and write network traffic, Net max is the maximum read and write network traffic of each server in the system, Conn self Conn is the number of concurrent connections of the server itself. max The maximum number of concurrent connections for each server in the system.

[0030] In the above step 2, the message structure of the request and response interaction between the host and the monitoring system client includes at least a message identification flag, a message index, a system version, a message status flag, an execution status code, a timestamp, a message length, an endian mode, and information data.

[0031] After adopting the above scheme, the present invention has the following advantages:

[0032] (1) The present invention designs a lightweight embedded file management system, including a file library server process, a file library interface service, and a file library network management service. The system configuration parameter information is obtained, the host starts the monitoring service, and after completing the modification of the local file library, the request message is pushed into the synchronization buffer, and then distributed to all slave nodes. The sampling message queue is used to achieve peak shaving and valley filling, and the multi-node structured data redundancy synchronization of the user-level integrated energy intelligent microgrid monitoring system is completed, which strictly guarantees the real-time and consistency of the data, and the data in the target database can timely reflect the changes in the source database;

[0033] (2) The present invention designs a heartbeat mechanism, which supports automatically calculating the service status score of each node according to the set rules to elect a new host node when the host node fails, and completes the automatic transfer of the database failure;

[0034] (3) The equipment hardware and software performance required by the present invention is relatively low, and there is no need for the complex configuration of traditional commercial database clusters. The overall construction cost of the system is low, the system structure is simple, and maintenance is convenient. It not only meets the monitoring system's needs for data redundancy and synchronization to the greatest extent, but also ensures data consistency and security. It has high use value and promotion value. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a schematic flow chart of the method of the present invention;

[0036] Figure 2 is a schematic diagram of a multi-node redundant arrangement structure in an embodiment of the present invention;

[0037] Figure 3 It is a schematic diagram of the file library network management service structure in the present invention;

[0038] Figure 4 It is a schematic diagram of a detailed execution flow of data redundancy synchronization of the master and standby nodes in the present invention;

[0039] Figure 5 It is a schematic diagram of the message structure definition in the present invention. DETAILED DESCRIPTION

[0040] The technical solutions and beneficial effects of the present invention will be described in detail below with reference to the accompanying drawings.

[0041] like Figure 1 As shown, the present invention provides a multi-node structured data redundancy synchronization method, device and storage medium for a user-level integrated energy intelligent microgrid monitoring system, which specifically includes the following steps:

[0042] S101: Obtain configuration information of the embedded file management system of the host and the backup machine, complete the deployment of the file database server process on multiple servers, including at least one host and multiple backup machines. Complete the connection of the physical link between the host and each backup machine, establish a heartbeat mechanism, and start the master and backup monitoring modules of the host and the backup machine.

[0043] S102: Start a monitoring network service process on the host, and use a message bus to monitor in real time data request messages from the monitoring system client, which includes a host computer, various application processes, and a standby computer.

[0044] S103: The host verifies the legality and validity of the data request message from the client according to the designed message structure, and then determines the relevant API to be called according to the parsed status code.

[0045] S104: For the client's operation request to write to the database, the host executes the relevant data request service on the local file database, completes the persistent storage of the data, collects the execution results and returns them to the sending source, and then the file database server process adds the above request message to the data synchronization buffer.

[0046] S105: When the host file database server process detects that there is a new record in the data synchronization buffer, it automatically sends the request in the synchronization buffer to all standby file library servers in real time.

[0047] S106: The standby file database server process monitors the quality of the local database files in real time. When a damaged data file is found, an incremental dump is used to compare the difference between the standby and host database files, and then the difference data files are transmitted, received and persistently stored.

[0048] S107: The system's active and standby monitoring modules monitor the operating service status of the host and standby machines in real time. When a host failure is detected, a new host is automatically selected to continue the above steps S101 to S106 to complete the automatic failure transfer of the embedded file management system database.

[0049] Furthermore, the above multi-node structured data redundancy synchronization method of the user-level integrated energy intelligent microgrid monitoring system is implemented based on a lightweight embedded file management system.

[0050] The designed embedded file management system database includes file database server process, file database interface service and file database network management service. The embedded file management system database is stored on the disk in the form of multiple files. When the database adopts multi-node redundant layout, the encapsulated file database server process realizes the various business operations of the household-level integrated energy smart microgrid monitoring system on the database service. The file database server process is used by various applications. The file database interface service provides read and write operations on the local database disk files, and the file database network management service remotely realizes the read and write operations on the database on other redundant node servers.

[0051] like Figure 2 The figure shows a schematic diagram of the multi-node redundant arrangement structure in the present invention, which adopts a one-master and two-backup arrangement. The various processes in the figure include the processes of the host computer, the file database server processes of the backup computer, and the processes of various application programs of the local computer, such as data collection and detection, fault recording and alarm event recording, remote control and optimization scheduling, system configuration and power grid topology connection, historical operation data and statistical information data, etc.

[0052] For the historical operation data of the measuring point, a file is generated every day with the date as the file name. For other structured information, the project category name is used as the file name to generate the respective files. The database samples the efficient B-tree storage structure as the storage engine and retrieval engine to provide higher performance under limited hardware resources.

[0053] The designed embedded file management system supports SQL statements to realize the processing of structured data.

[0054] The designed embedded file management system provides file locks of different granularities to control concurrent reading and writing.

[0055] In particular, when the database runs independently on a single machine, there is no need to configure a server process. Neither the independent server process of a traditional relational database management system is required, nor does it need to rely on any external library. The application process can directly access the database file.

[0056] Optionally, the file database interface service and the file database network management service can be provided in the form of DLL dynamic library, SDK, API, WebSocket, Web Service, Web API, Http Restful, or intermediate library.

[0057] Preferably, the file database interface service and the file database network management service can be provided in the form of a DLL dynamic library.

[0058] like Figure 3The figure shows a schematic diagram of the file database network management service structure in the present invention.

[0059] The file database network management service encapsulates the network service based on the file database interface service, including service monitoring, parsing of request messages, framing and response of reply messages. The status code is used to determine the type of message. Both the request message and the response message should contain a status code, which occupies one byte.

[0060] The file database interface service consists of two parts: editor and database retrieval. The editor includes lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization and target code generation. The database retrieval includes the B-tree retrieval engine, which first searches for relevant data in the memory. If it cannot be found, it searches the disk and finally calls the interface of the relevant operating system to complete the extraction of the target record.

[0061] The data in each file database's data file is divided into several pages of equal size for storage, and the relationship between these pages is organized and managed by the B-tree structure. To avoid frequent disk operations, the file database engine opens a cache in the memory to temporarily store the data pages in the file database, that is, to load the data from the disk file into the cache in the memory. In this way, when calling the interface to read and write the file database server process, it first searches in the memory. If there are relevant records in the memory, it directly operates the memory, and then regularly synchronizes it to the disk file of the file database. If there are no relevant records in the memory, it directly operates the disk file. This can minimize the number of disk I / O operations and further improve the overall performance of the file database.

[0062] Furthermore, for the client's read request operation, a load balancing method is used to disperse the network request to multiple nodes, so as to improve the availability, reliability and user experience of the network service. The load balancing scheduling algorithm used can be polling method, least connection method, IP hash method, and weight method.

[0063] Furthermore, the heartbeat mechanism is as follows: each node in the system sends a heartbeat check to other member nodes at a specified interval T1. After T2 time has passed, the node that does not reply to the message is marked as unavailable. The optional T1=2 seconds and T2=6 seconds.

[0064] Furthermore, the configuration information of the master and backup machines includes the node serial number, and the serial number is not allowed to be repeated. The smaller the node needs, the higher the priority; each node calculates the service status score based on the CPU occupancy rate, memory occupancy rate, disk remaining space capacity rate, current database read and write network traffic size and concurrent connection number. After the master node goes down, the node with the highest service status score is elected as the master. When there are multiple nodes with the highest score, the node with the smallest serial number is elected as the master. The score objective function of each node is as follows:

[0065]

[0066] In the formula, n=5, F1 is the CPU usage score, F2 is the memory usage score, F3 is the disk remaining space capacity score, F4 is the current read and write network traffic size score, F5 is the concurrent connection number score, CPU usage score, β i is the weight of each factor, CPU self is the CPU usage of the node itself, CPU min Mem is the minimum CPU usage of each node in the system. self Mem is the memory usage of the node itself. min is the minimum memory usage of each node in the system, Disk self The remaining space capacity ratio of the node's own disk. max is the maximum disk remaining space capacity ratio of each node in the system, Net self The read and write network traffic of the node itself, Net max is the maximum read and write network traffic of each node in the system, Conn self Conn is the number of concurrent connections of the node itself. max The maximum number of concurrent connections for each node in the system.

[0067] like Figure 4 The figure is a schematic diagram of the detailed execution flow of data redundancy synchronization of the master and standby nodes in the present invention, and the specific steps are as follows:

[0068] S201: Each process and server on each node of the system is initialized and started.

[0069] S202: Set and obtain the configuration information of the host and standby machines, including the file database serial number. The smaller the serial number, the higher the priority of the node. The system includes at least one host node and multiple standby nodes. Start the network data monitoring service of the host and standby servers, and use the message bus to monitor the data request message from the monitoring system client in real time. The client includes the host computer, various application processes and standby machines. In this way, peak shaving, asynchronous processing and module decoupling can be achieved.

[0070] S203: Start the master-slave monitoring module, establish a heartbeat connection and a data synchronization link between the master and the slave, and calculate the service status score of each node in real time. Each node calculates the service status score based on the CPU occupancy rate, memory occupancy rate, disk remaining space capacity rate, current database read and write network traffic size, and concurrent connection number. After the master node goes down, the node with the highest service status score is elected as the master. When there are multiple nodes with the highest score, the node with the smallest serial number is elected as the master.

[0071] S204: Establish a connection between the host server and the client to ensure that the monitoring service is normal.

[0072] S205: When the host receives a request from other processes to add, delete, query or modify the database, it proceeds to step S206, otherwise it proceeds to step S204 and continues to wait for a connection request from the client.

[0073] S206: Verify the legitimacy and validity of the request message. Figure 5 The message structure shown parses and judges the request message. Factors that need to be considered during parsing include message identification flag, message index, system version, message status flag, execution status code, timestamp, message length, and big-endian and little-endian modes.

[0074] S207: Following step S206, after verification, if the request message is an illegal message, the abnormal event is recorded and the error code is returned to the source process.

[0075] S208: Following step S206, after verification, if the request message is a legal and valid message, the corresponding file library interface API is selected according to the execution status code parsed in step S206 to execute the relevant request.

[0076] S209: Following step S208, the modification operation is performed in the local file database. If the execution is successful, the process proceeds to step S210; otherwise, the process proceeds to step S211.

[0077] S210: Add the modification request to the local synchronization buffer of the host.

[0078] S211: If the synchronization buffer is empty, proceed to step S209, otherwise proceed to step S212.

[0079] S212: The host node forwards the client's data synchronization request message to all slave nodes through the file database network management service.

[0080] S213: The slave verifies the legality and validity of the request message forwarded by the master.

[0081] S214: Following step S213, after verification, if the request message is an illegal message, the standby node records the abnormal event and returns the error code to the file database server process of the host node through the local file database network management service.

[0082] S215: Following step S213, after verification by the standby node, if the request message is a legal and valid message, the standby node selects the corresponding file library interface API to execute the relevant request in the local file management system file database according to the execution status code parsed in step S213.

[0083] S216: Complete the modification of the local file database of the standby machine.

[0084] Furthermore, the message structure of request and response interaction between the host and the monitoring system client includes at least a message identification flag, a message index, a system version, a message status flag, an execution status code, a timestamp, a message length, an endian mode and information data.

[0085] An embodiment of the present invention further provides a device, comprising:

[0086] one or more processors;

[0087] a memory for storing one or more programs,

[0088] When the one or more programs are executed by the one or more processors, the one or more processors execute the multi-node structured data redundancy synchronization method of the user-level integrated energy intelligent microgrid monitoring system as described above.

[0089] Furthermore, the processor may be a server chip, a desktop chip, a mobile chip, an embedded microprocessor, or a DSP chip; optionally, the device may be a server, a workstation, a minicomputer, a notebook computer, an industrial computer, or an embedded development board.

[0090] An embodiment of the present invention also provides a computer-readable and writable storage medium storing a computer program, which is used to store data files of a file library management system and structured files of an integrated energy smart microgrid. The program is executed by a processor as described above in the method for redundant synchronization of multi-node structured data of a user-level integrated energy smart microgrid monitoring system.

[0091] The above embodiments are only for illustrating the technical idea of ​​the present invention, and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.

Claims

1. A multi-node data redundancy synchronization method for a user-level smart microgrid monitoring system, characterized in that The steps include: Step 1: deploy a file database server process on each file database server of the embedded file management system, set one server as the master server, and the remaining servers as backup servers, connect the physical links between the master server and the backup servers, and establish a heartbeat mechanism; Step 2, the host starts a monitoring network service process and uses a message bus to monitor data request messages from the monitoring system client in real time; Step 3, the host verifies the legitimacy and validity of the data request message according to the designed message structure, and then determines the API to be called according to the parsed status code; Step 4, the host executes the data request service in the local file database, returns the execution result to the monitoring system client, and then the file database server process adds the request message to the data synchronization buffer; Step 5: When the host file database server process detects that there is a new record in the data synchronization buffer, the request message in the data synchronization buffer is sent to all standby file database servers in real time; Step 6: Each standby file database server process monitors the quality of the local database file in real time. When a damaged data file is found, an incremental dump is used to compare the difference between the standby and host database files, and then the difference data files are transmitted, received and persistently stored. Step 7: monitor the running service status of the host and the backup server in real time. When a failure of the host is detected, a new host is selected from the servers, and the remaining servers are set as backup servers.

2. A method for synchronizing multi-node data redundancy in a user-level smart microgrid monitoring system according to claim 1, characterized in that: The specific process of step 3 is that the host verifies the legality and validity of the data request message, parses and judges the data request message according to the designed message structure, and the designed message structure at least includes a message identification flag, a message index, a system version, a message status flag, an execution status code, a timestamp, a message length, a big-endian mode, and information data; After verification, if the data request message is an illegal message, the abnormal event is recorded and an error code is returned to the monitoring system client; If the data request message is a legal and valid message, the corresponding file database interface API is selected according to the parsed execution status code.

3. A method for synchronizing multi-node data redundancy in a user-level smart microgrid monitoring system according to claim 1, characterized in that: The specific process of step 4 is that the host performs a modification operation on the local file database according to the data request. If the execution is successful, the modification request is added to the host data synchronization buffer. Otherwise, it is determined whether the data synchronization buffer is empty. If it is empty, the modification operation is performed again according to the data request. If it is not empty, the modification of the host file database is completed.

4. A method for synchronizing multi-node data redundancy in a user-level smart microgrid monitoring system according to claim 1, characterized in that: The specific process of step 5 is: Step 51, when the host file database server process detects that there is a new record in the data synchronization buffer, the data request message in the data synchronization buffer is sent in real time to all standby file database servers through the file database network management service; Step 52, each slave verifies the legality and validity of the data request message, parses and judges the data request message according to the designed message structure, and the designed message structure at least includes a message identification flag, a message index, a system version, a message status flag, an execution status code, a timestamp, a message length, a big-endian mode, and information data; After verification, if the data request message is an illegal message, the abnormal event is recorded and the error code is returned to the host file database server process through the local file database network management service; if the data request message is a legal and valid message, the corresponding file database interface API is selected according to the parsed execution status code, and the relevant request is executed in the local file database to complete the modification of the local file database of the standby machine.

5. A method for synchronizing multi-node data redundancy in a user-level smart microgrid monitoring system according to claim 1, characterized in that: The embedded file management system data database includes a file database server process, a file database interface service and a file database network management service. The embedded file management system data database is stored on a disk in the form of multiple files; wherein the file database server process is used by various application programs; the file database interface service provides read and write operations on local file database disk files, and the file database network management service remotely implements read and write operations on file databases on other redundant node servers; The file database network management service encapsulates the network service based on the file database interface service, including service monitoring, request message parsing, reply message framing and response, wherein the type of message is determined by the status code, and both the request message and the response message contain the status code, which occupies one byte; The file database interface service and file database network management service are provided in the form of DLL dynamic library, SDK, API, WebSocket, Web Service, Web API, Http Restful, and intermediate library.

6. A method for synchronizing multi-node data redundancy in a user-level smart microgrid monitoring system according to claim 1, characterized in that: In step 4, for the client's read request operation, a load balancing method is used to distribute the network request to multiple servers, and the load balancing scheduling algorithms used are polling method, least connection method, IP hash method, and weight method.

7. A method for synchronizing multi-node data redundancy in a user-level smart microgrid monitoring system according to claim 1, characterized in that: In step 1, a heartbeat mechanism is established, and each file database server sends a heartbeat check to other servers at a specified interval T1, and marks the server that does not reply to the message after T2 as unavailable.

8. A method for synchronizing multi-node data redundancy in a user-level smart microgrid monitoring system according to claim 1, characterized in that: In step 1, the deployment of the file database server process is completed according to the configuration information of the embedded file management system of the host and the backup machine; wherein the configuration information includes the node serial number, and the serial number is not allowed to be repeated, and the smaller the node serial number, the higher the priority.

9. A method for synchronizing multi-node data redundancy in a user-level smart microgrid monitoring system according to claim 1, characterized in that: In step 7, the method of electing a new host is: Calculate the service status score of each file database server in real time; the service status score is calculated based on CPU usage, memory usage, disk free space capacity, current database read and write network traffic size, and concurrent connection number; When it is detected that the server currently serving as the host fails, the server with the highest service status score among the remaining servers is selected as the new host, and the remaining servers are set as backup servers; if there are multiple servers with the highest service status scores, the server with the smallest file database sequence number is selected as the new host; The service status score of the file database server is calculated according to the following formula: st, Among them, n=5, which refers to the five factors that affect the service status score: CPU usage, memory usage, disk free space capacity ratio, current database read and write network traffic size, and concurrent connection number; F i is the score of each factor, F1 is the CPU usage score, F2 is the memory usage score, F3 is the disk remaining space capacity score, F4 is the current read and write network traffic size score, and F5 is the concurrent connection number score; β i is the weight of each factor; CPU self is the CPU usage of the server itself, CPU min Mem is the minimum CPU usage of each server in the system. self is the memory usage of the server itself, Mem min The minimum memory usage of each server in the system, Disk self The remaining space capacity ratio of the server's disk. max is the maximum disk remaining space capacity ratio of each server in the system, Net self For the server's own read and write network traffic, Net max is the maximum read and write network traffic of each server in the system, Conn self Conn is the number of concurrent connections of the server itself. max The maximum number of concurrent connections for each server in the system.

10. A method for synchronizing multi-node data redundancy in a user-level smart microgrid monitoring system according to claim 1, characterized in that: In step 2, the message structure of the request and response interaction between the host and the monitoring system client includes at least a message identification flag, a message index, a system version, a message status flag, an execution status code, a timestamp, a message length, an endian mode, and information data.

Citation Information

Patent Citations

  • Method and system for dynamic data synchronization

    CN101446972A

  • Master-standby redundancy replication method based on SQLite databases

    CN102945195A

  • Data synchronization method between servers in multi-server redundancy system

    CN109547532A

  • Electric energy quality management system multi-machine main / standby realization method

    CN110351139A

  • Data synchronization method of redundant server, electronic equipment and storage medium

    CN115633047A

Cited By

  • Software detection and master-slave switching method for low-voltage interconnection system

    CN120915651A