A method and system for automatically synchronizing configuration data
By combining XXL-JOB and Redis delayed tasks with DM database triggers, automatic synchronization of power equipment configuration data was achieved, solving the omission problem caused by manual operation in the existing technology and improving the system's automation level and data consistency.
Patent Information
- Application Number
- CN202310776325.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-28
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2043-06-28
AI Technical Summary
Existing technical solutions lack automation capabilities, which can easily lead to omissions when synchronizing power equipment configuration data, affecting SOE information parsing and system stability, and requires maintenance personnel to perform manual operations multiple times.
The XXL-JOB timer program periodically scans the Redis database to proactively detect changes in configuration data. It also uses Zeroc ICE to call microservices to achieve automatic synchronization between the model service and the Redis cache database. Combined with Redis delayed tasks and DM database triggers, it dynamically detects changes in configuration data and reduces manual intervention.
It enables automated synchronization of configuration data, reduces the number of manual operations by maintenance personnel, avoids data inconsistencies, and improves the stability and accuracy of the system.
Smart Images

Figure CN116881358B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a method and system for automatically synchronizing configuration data, and belongs to the technical field of computers. BACKGROUND
[0002] Power equipment is a key component of a power system, and the normal operation of the power equipment is crucial to ensuring the safe and reliable power supply of the power grid. When remote signaling of the power equipment changes, such as switch position change, the power protection equipment or intelligent power meter will automatically record the change time, change reason, and corresponding remote measurement values (such as corresponding three-phase current, active power, etc.) when the switch trips, and form an SOE record to be sent to the master station. It is very important for the master station to accurately and completely analyze the SOE information in a timely manner. In addition, when the model of the substation changes, the cache module of the master station related to the model data needs to be loaded and updated with the latest model data in a timely manner, otherwise the master station may not correctly or even be unable to analyze the SOE information. Especially when a system has both model services for a communication platform and Redis cache databases for a micro-service end, after the configuration data of the power station changes, it is the primary task to ensure that the model services and the Redis cache databases automatically load the latest configuration data in a timely and accurate manner to ensure the effective and stable operation of the master station system.
[0003] For newly connected substations or substations with changed configuration information, the modeling tool needs to be used to manually click the configuration update menu to select the power station name that needs to be updated, and then click 'configuration update'. At this time, the modeling tool end will send a configuration update message to Kafka, the model service will receive and analyze the Kafka message, and at the same time, the latest configuration data of the power station will be loaded. In addition, the operation and maintenance personnel also need to click the data synchronization menu in the modeling tool to synchronize the latest configuration information of the power station to the Redis cache database.
[0004] After the configuration information of the substation changes, the existing scheme needs the operation and maintenance personnel to manually click the configuration update and data synchronization menus in the modeling tool. Since it is a manual operation, there may be omissions, which may cause the data in the cache module to be inconsistent with the data in the configuration library, resulting in the SOE information sent by the substation end not being able to be completely displayed on the master station end, and further affecting the use of the master station system by dispatchers or operation and maintenance personnel to check relevant SOE information or fault information.
[0005] The existing technical scheme does not have the ability to actively detect and perceive configuration data changes. When the configuration data changes, manual intervention by the operation and maintenance personnel is required, and the configuration data synchronization of the same power station needs to be manually clicked twice (synchronized to the model service and the Redis cache database respectively), which has a low degree of automation. SUMMARY
[0006] The application aims to provide a method and system for realizing automatic synchronization of configuration data, so as to solve the problem that manual synchronization of configuration data may be missed.
[0007] To achieve the above-mentioned purpose, the application provides a method for realizing automatic synchronization of configuration data, which comprises the following steps:
[0008] The method for realizing automatic synchronization of configuration data comprises the following steps:
[0009] 1) A first timing program is started through XXL-JOB to periodically scan the power stations in which the configuration data in a Redis database is changed and not completely synchronized.
[0010] 2) The scanned power stations are synchronized with model service data and the Redis cache database, and the corresponding fields in a synchronization record table are modified. The model service is a service used by a communication platform on a master station.
[0011] Through the first timing program, the power stations in which the configuration data in the Redis database is not completely synchronized are periodically scanned and synchronized, which can effectively prevent the problem that manual synchronization of configuration data may be missed. On the other hand, the periodic scanning further improves the degree of automation of the synchronization of configuration data.
[0012] Further, in step 2), a message is actively pushed to a modeling tool for the scanned power stations to pop up a prompt for whether to immediately automatically synchronize:
[0013] If the feedback is "immediately automatically synchronize", the model service data and the Redis cache database are immediately synchronized, and the corresponding fields in the synchronization record table are modified. The model service is a service used by a communication platform on a master station.
[0014] If the feedback is "delayed automatic synchronization", the model service data and the Redis cache database are synchronized by using a Redis database key value expiration callback mechanism.
[0015] Through periodic scanning, the problem of system lag caused by frequent synchronization of backend data can be reduced.
[0016] Further, the modeling tool comprises a configuration update and data synchronization menu.
[0017] Further, in step 1), the configuration data in the Redis database is obtained through the following steps: a second timing program configured through XXL-JOB is used to periodically count the synchronization records of the configuration data of each power station with a model service and a Redis cache database; meanwhile, the latest records of the power stations are written into the Redis database,
[0018] The second timing program periodically writes the synchronization records of each plant station into the Redis database, so that the Redis database obtains the latest records of the plant station synchronization information at the statistical time.
[0019] Further, in the Redis database, the key is the plant station name, and the value records the plant station name, the configuration data change time, and the automatic synchronization state bit value.
[0020] Further, the fields recorded in the synchronization records include the plant station name, the configuration data change time, the model service synchronization state, the Redis database synchronization state, the automatic synchronization state bit, the model service synchronization start time, the model service synchronization end time, the Redis database synchronization start time, the Redis database synchronization end time, and the delay processing time.
[0021] Further, the configuration data change time field in the synchronization records is obtained through the configuration update record table of the Dream database, and the Dream database records and updates all operation instructions in the plant station configuration table in real time to the configuration update record table.
[0022] The trigger feature of the Dream database can ensure that the plant station configuration data is updated in time, and then the synchronization record data at the statistical time of the second timing program is up-to-date.
[0023] Further, in step 2), the corresponding fields in the synchronization record table are modified, including the model service synchronization start time and the Redis cache database synchronization start time; after the synchronization is completed, the model service synchronization end time and the Redis cache database synchronization end time are modified again; only when the model service synchronization and the Redis cache database synchronization are both successful, the automatic synchronization state is modified, and the model service synchronization state and the Redis cache database synchronization state are also modified.
[0024] After each synchronization, whether completed or not, it is recorded in the synchronization record table to prevent omission or repeated processing of the plant station during the next scanning.
[0025] Further, the Redis database key value expiration callback mechanism, through the third timing program, listens to the expired key values in real time. The expired key values can be compared with the delay processing time according to the change time difference formed by the current system time and the configuration data change time. If the change time difference is greater than the delay processing time, it is judged that the key is expired, and the key value is the plant station name.
[0026] Through the Redis database key value expiration callback mechanism and the third timing program, the delayed synchronization of the configuration data of the delayed plant station can be realized.
[0027] The application discloses a configuration data automatic synchronization system, comprising a processor, wherein the processor comprises a configuration data automatic synchronization method.
[0028] The application has the advantages that the application has the ability of active detection and dynamic perception of configuration data changes, supports automatic synchronization of station configuration data, and the automatic synchronization function can effectively reduce the number of manual interventions of operation and maintenance personnel and can reduce the phenomenon that the data of a cache module is inconsistent with the data of a configuration library due to negligence as much as possible. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 The application discloses a configuration data automatic synchronization system, comprising a processor, wherein the processor comprises a configuration data automatic synchronization method. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical scheme and advantages of the application more clear, the application is further described in detail below with reference to the drawings and examples.
[0031] TERMS EXPLANATION:
[0032] A relay protection fault information master station (referred to as a master station) is used for collecting and processing various power secondary device information, analyzing and processing primary equipment faults by using the information, providing protection device state maintenance decisions, serving relay protection operation and management, and being a monitoring and decision-making system serving relay protection operation and management;
[0033] All stations: all sub-stations that have been accessed in the master station;
[0034] XXL-JOB is a lightweight distributed task scheduling platform, which has rich task management functions and high performance, high availability and the like. The platform mainly comprises two parts, namely, a scheduling module (a scheduling center) and an execution module (an executor), wherein the scheduling module is responsible for managing scheduling information, issuing scheduling requests according to scheduling configurations, and does not undertake business codes itself; the execution module is responsible for receiving scheduling requests and executing task logic, receiving execution requests, termination requests and log requests of the scheduling center and the like.
[0035] SOE (Sequence Of Event) is an event sequence record.
[0036] A method embodiment for realizing configuration data automatic synchronization is provided.
[0037] A method for realizing configuration data automatic synchronization is provided. Figure 1As shown, the embodiment is a configuration data automatic synchronization method based on XXL-JOB distributed task scheduling and Redis delay task implementation. When the configuration data of the master station end plant station changes, the application actively detects the changed configuration data and actively pushes a message to the modeling tool, and pops up "found that the configuration of a certain plant station has changed, whether to automatically synchronize immediately". If the operation and maintenance personnel select "immediate automatic synchronization", the program will call the micro service through Zeroc ICE in a synchronous manner, automatically synchronize the latest configuration data to the model service and Redis cache database respectively, and the micro service end will also write the status of the synchronization process of the related plant station into Redis. If "delayed automatic synchronization" is selected, there are options such as "after 15 minutes", "after 30 minutes", "after 60 minutes", etc. The program will automatically synchronize at the selected time.
[0038] In this embodiment, the Dm database trigger feature is used to monitor and record the configuration table changes related to the plant station in real time. The instructions for all insert, update and delete operations of the plant station configuration table are recorded in the update record table of the plant station configuration data in the Dm database.
[0039] The detailed steps of the configuration data automatic synchronization method based on XXL-JOB distributed task scheduling and Redis delay task implementation are as follows:
[0040] A timing program is configured through XXL-JOB to periodically (default 5 minutes, dynamically configurable) count the synchronization records of the configuration data of each plant station with the model service and Redis cache database. The record fields mainly include plant station name, configuration data change time, model service synchronization state, Redis database synchronization state, automatic synchronization state bit [not started / completed], model service synchronization start time, model service synchronization end time, Redis database synchronization start time, Redis database synchronization end time, delay processing time (unit: minutes), and the configuration data change time can be obtained from the update record table of the plant station configuration data in the Dm database. At the same time, the latest record of each plant station is written into the Redis database, and the Redis key format is sync_${plant station name}, the value value records the plant station name, the configuration data change time, and the automatic synchronization state bit value is "not started".
[0041] Another timing program is configured through XXL-JOB to periodically (default 10 minutes, dynamically configurable) scan the plant stations with changed configuration data in the Redis database, and then process the data of each plant station.
[0042] When a plant station with changed configuration data is scanned, the application actively pushes a message to the modeling tool, and a pop-up message appears: "Changes in the configuration of a certain plant station have been found. Do you want to automatically synchronize immediately?" If the operation and maintenance personnel choose "automatically synchronize immediately", the model service data synchronization and Redis cache database are processed respectively, and the model service synchronization start time and Redis cache database synchronization start time are modified at the same time. After synchronization is completed, the model service synchronization end time and Redis cache database synchronization end time are modified again. Only when the model service synchronization and Redis cache database synchronization are successful, the automatic synchronization state is modified to "completed", and the model service synchronization state and the Redis cache database synchronization state are modified at the same time. If the model service synchronization or the Redis cache database synchronization fails due to network jitter or micro-service connection exception, etc., a synchronization exception log needs to be sent to the modeling tool interface end.
[0043] If the operation and maintenance personnel choose "delayed automatic synchronization", the minute difference between the current system time and the configuration data change time is calculated, denoted as ${disCurConfigChangeMin}. Then the delayed processing minute value is calculated, denoted as ${delayProcessMin}. The expiration time of the delayed automatic synchronization of the related plant station is obtained by subtracting ${delayProcessMin} from ${disCurConfigChangeMin}.
[0044] In addition, a timing program is also needed to listen to the expired key value in real time. The key is the plant station name. Once the key expires, the model service data synchronization and Redis cache database synchronization are immediately executed by using the callback mechanism after the Redis database (version 2.8 or later) key value expires. The model service synchronization start time and Redis cache database synchronization start time are modified at the same time. After synchronization is completed, the model service synchronization end time and Redis cache database synchronization end time are modified again. Only when the model service synchronization and Redis cache database synchronization are successful, the automatic synchronization state is modified to "completed", and the model service synchronization state and the Redis cache database synchronization state are modified at the same time. Similarly, if the model service synchronization or the Redis database synchronization fails due to network jitter or micro-service connection exception, etc., a synchronization exception log needs to be sent to the modeling tool interface end.
[0045] After synchronization is completed by either of the synchronization modes, the modeling tool end sends a model service update completion message to the kafka, and the communication platform decides when to reestablish the link with the substation.
[0046] A configuration data automatic synchronization system embodiment 2
[0047] A configuration data automatic synchronization system comprises a processor configured to process the configuration data automatic synchronization method described above, which has been described in detail in the configuration data automatic synchronization method embodiments, and will not be repeated here.
Claims
1. A method for implementing automatic synchronization of configuration data, characterized in that, The method comprises the following steps: 1) starting a first timing program through XXL-JOB to periodically scan the power stations whose configuration data in the Redis database has changed and is not completely synchronized; 2) synchronizing the model service data and the Redis cache database of the scanned power stations and modifying the corresponding fields in the synchronization record table, wherein the model service is a service provided by the master station for the communication platform; The scanned power stations also actively push a message to the modeling tool, prompting whether to immediately automatically synchronize: If the feedback is "immediately automatically synchronize", the model service data and the Redis cache database are immediately synchronized, and the corresponding fields in the synchronization record table are modified, wherein the model service is a service provided by the master station for the communication platform; If the feedback is "delayed automatic synchronization", the model service data and the Redis cache database are synchronized by using the Redis database key value expiration callback mechanism; In the Redis database key value expiration callback mechanism, the expired key values are listened to in real time through a third timing program, wherein the expired key values are compared with the delay processing time according to the change time difference formed by the current system time and the configuration data change time, and if the change time difference is greater than the delay processing time, it is judged that the key value is expired, and the key value is the power station name.
2. The method for implementing automatic synchronization of configuration data according to claim 1, characterized in that, The modeling tool comprises a configuration update and data synchronization menu.
3. The method for implementing automatic synchronization of configuration data according to claim 1, characterized in that, In step 1), the configuration data in the Redis database is obtained by the following steps: periodically counting the synchronization records of the configuration data of each power station with the model service and the Redis cache database through the second timing program configured by XXL-JOB; and the Redis database writes the latest records in units of power stations.
4. The method for implementing automatic synchronization of configuration data according to claim 3, characterized in that, The key in the Redis database is the power station name, and the value records the power station name, the configuration data change time, and the automatic synchronization state bit value.
5. The method for implementing automatic synchronization of configuration data according to claim 3, characterized in that, The fields recorded in the synchronization record include the power station name, the configuration data change time, the model service synchronization state, the Redis database synchronization state, the automatic synchronization state bit, the model service synchronization start time, the model service synchronization end time, the Redis database synchronization start time, the Redis database synchronization end time, and the delay processing time.
6. The method for implementing automatic synchronization of configuration data according to claim 5, characterized in that, The configuration data change time field in the synchronization record is obtained through the configuration update record table of the Dream database, which records and updates all operation instructions in the power station configuration table in real time.
7. The method for implementing automatic synchronization of configuration data according to claim 1, wherein, In step 2), the modification of the corresponding fields in the synchronization record table includes the modification of the model service synchronization start time and the Redis cache database synchronization start time; after synchronization is completed, the model service synchronization end time and the Redis cache database synchronization end time are modified again; only when the model service synchronization and the Redis cache database synchronization are both successful, the automatic synchronization state is modified, and the model service synchronization state and the Redis cache database synchronization state are also modified.
8. A system for automatic synchronization of configuration data, characterized in that comprising a processor for executing a method of enabling automatic synchronization of configuration data as claimed in any of claims 1-7.
Citation Information
Patent Citations
Distributed data service processing method, system and device and storage medium
CN110633320A
Dynamic linkage method for plant-station-end panoramic data and monitoring system application
CN114827539A