Primary and standby dispatching real-time data verification method, device, equipment and medium
By obtaining real-time data of the main and backup system, using timestamps and data identifiers to verify consistency and synchronize data, the problem of data out of synchronization in power system emergencies is solved, and the reliability and stability of the system is improved.
Patent Information
- Application Number
- CN202411663165.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2044-11-20
AI Technical Summary
In the power system emergency, due to frequent rapid data changes, the main and backup system is prone to data out of synchronization, which affects the rapid response capability of the backup dispatch center, and thus affects the safety and reliability of the entire power system.
By obtaining real-time data of the main and backup system, verifying the consistency of the data based on the timestamp and data identifier, recording the differential data, and triggering data synchronization operations to ensure that the real-time data of the main and backup system are consistent.
It effectively solves the problem of data from the main and backup system in emergency events in power system, improves the reliability and stability of the system, ensures that the data remains consistent in a high dynamic environment, and improves the safety and operation and maintenance efficiency of the power system.
Smart Images

Figure CN119519875B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power systems, and more specifically, it relates to a method, device, equipment and medium for real-time data verification between the primary and standby dispatch centers. Background Art
[0002] The method for real-time data verification between the primary and standby dispatch centers refers to ensuring data consistency between the primary dispatch center and the standby dispatch center of the power system through regular or real-time data comparison, so as to ensure that the standby dispatch center can quickly take over the work of the primary dispatch center in case of emergencies and maintain the stable operation of the system.
[0003] However, there are some problems in the actual application of this method. Especially in the case of power system emergencies, due to the frequent rapid change of data, it may lead to data out-of-sync between the primary and standby dispatch centers. This out-of-sync problem will seriously affect the rapid response ability of the standby dispatch center in case of emergencies, and further affect the safety and reliability of the entire power system. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, device, equipment and medium for real-time data verification between the primary and standby dispatch centers, so as to solve the problem of out-of-sync real-time data that occurs in the data synchronization process of the primary and standby dispatch systems in the prior art.
[0005] In the first aspect of the present invention, a method for real-time data verification between the primary and standby dispatch centers is provided. The method includes:
[0006] Obtain the real-time data of the primary dispatch system and the standby dispatch system;
[0007] Verify the consistency of the real-time data of the primary dispatch system and the standby dispatch system based on the time stamp and data identifier. If they are inconsistent, record the differential data; where the consistency includes time consistency and data consistency;
[0008] According to the differential data, trigger the data synchronization operation between the primary dispatch system and the standby dispatch system to make the real-time data of the primary dispatch system and the standby dispatch system consistent.
[0009] In one implementation, verifying the consistency of the real-time data of the primary dispatch system and the standby dispatch system based on the time stamp and data identifier includes:
[0010] Verify the time consistency based on the comparison of the time stamps of the primary dispatch system and the standby dispatch system;
[0011] Compare the real-time data corresponding to the same data identifier in the primary dispatch system and the standby dispatch system. When the real-time data of the primary dispatch system and the standby dispatch system corresponding to the data identifier are inconsistent, record the specific inconsistent differential data;
[0012] Verify the consistency of real-time data using a consistency detection algorithm.
[0013] In one implementation, verify the time consistency based on the comparison of timestamps between the calling system and the standby system, including:
[0014] Calibrate the system time of the calling system and the standby system to ensure the time synchronization of the calling system;
[0015] Use the NTP protocol for time synchronization;
[0016] Calculate the time difference ΔT between the calling system and the standby system, where ΔT = T1 - T2, T1 represents the time of the calling system, and T2 represents the time of the standby system;
[0017] When the time difference exceeds the set tolerance threshold, adjust the time of the standby system to be consistent with the calling system.
[0018] In one implementation, verify the consistency of real-time data between the calling system and the standby system based on timestamps and data identifiers, and also include:
[0019] Verify the consistency of real-time data jointly based on the timestamps and data identifiers of the calling system and the standby system;
[0020] When the data identifiers and timestamps are inconsistent at the same time, record the real-time data with inconsistent timestamps;
[0021] Use the sliding window detection algorithm to check the real-time data within the adjacent time period of the timestamp. When the consistency of the real-time data within the sliding window is lower than the preset threshold, increase the data acquisition frequency and re-compare the consistency of the real-time data between the calling system and the standby system.
[0022] In one implementation, verify the consistency of real-time data jointly based on the timestamps and data identifiers of the calling system and the standby system, including:
[0023] Compare the real-time data based on the hash values of the data identifiers, and perform a one-by-one comparison of the specific content after comparing the hash values to ensure the consistency of the data;
[0024] Use the dynamic data change detection algorithm to track the change trend of real-time data. When the data change trend is abnormal, perform a risk assessment through the formula R = (Nc / Nd) * 100%, where R represents the risk level, Nc represents the number of abnormal data points, and Nd represents the total number of data points.
[0025] In one implementation, compare the real-time data based on the hash values of the data identifiers, including:
[0026] Calculate the hash values of the data identifiers of the calling system and the standby system based on the SHA256 hash algorithm;
[0027] Compare whether the hash values of the primary control system and the standby control system are the same, and record the data identifiers with different hash values and the specific content of the corresponding real-time data;
[0028] Use the formula C = 1 - (Hd / Hn) to evaluate the matching degree of the hash value of the data identifier, where C represents the matching degree, Hd represents the number of different hash values, and Hn represents the number of hash values.
[0029] In one implementation, the method further includes:
[0030] Obtain the real-time data of the primary control system and the real-time data of the standby control system based on a preset time interval;
[0031] When it is detected that an emergency occurs, reduce the preset time interval to increase the acquisition frequency of real-time data;
[0032] Calculate the stability of the example data through the data change rate. When the data change rate exceeds the preset threshold, immediately trigger the data comparison and synchronization process; where the data change rate is calculated by the formula Δ = |A(t + 1) - A(t)| / A(t), Δ represents the data change rate, A(t + 1) represents the data value at the current moment, and A(t) represents the data value at the previous moment.
[0033] In a second aspect of the present invention, there is provided a primary and standby control real-time data verification device, the device including:
[0034] A data acquisition module for acquiring the real-time data of the primary control system and the standby control system;
[0035] A consistency verification module for verifying the consistency of the real-time data of the primary control system and the standby control system based on the time stamp and the data identifier. If they are inconsistent, record the differential data; where the consistency includes time consistency and data consistency;
[0036] A data synchronization module for triggering the data synchronization operation of the primary control system and the standby control system according to the differential data, so that the real-time data of the primary control system and the standby control system are consistent.
[0037] In a third aspect of the present invention, there is provided an electronic device, the electronic device including a processor, a memory, and a computer program stored on the memory and executable by the processor, where when the computer program is executed by the processor, the steps of a primary and standby control real-time data verification method provided in the first aspect of the present invention are implemented.
[0038] In a fourth aspect of the present invention, there is provided a computer-readable storage medium, which includes a computer program that, when executed by one or more processors, implements a primary and standby dispatching real-time data verification method provided in the first aspect of the present invention.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] An embodiment of the present invention provides a primary and standby dispatching real-time data verification method. The method obtains real-time data of a primary dispatching system and a standby dispatching system; verifies the consistency of the real-time data of the primary dispatching system and the standby dispatching system based on a timestamp and a data identifier. If they are inconsistent, the differential data is recorded. Among them, the consistency includes time consistency and data consistency; according to the differential data, a data synchronization operation between the primary dispatching system and the standby dispatching system is triggered to make the real-time data of the primary dispatching system and the standby dispatching system consistent. Through the technical solution of the embodiment of the present invention, it is possible to solve the problem that the data of the primary and standby dispatching systems is out of sync due to frequent rapid data changes in the event of an emergency in the power system. Description of the Drawings
[0041] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, form a part of this application, and do not limit the embodiments of the present invention. In the drawings:
[0042] Figure 1 is a flowchart of a primary and standby dispatching real-time data verification method provided by an embodiment of the present invention;
[0043] Figure 2 is a flowchart of a process for triggering data comparison and synchronization provided by an embodiment of the present invention;
[0044] Figure 3 is a flowchart of verifying the consistency of real-time data of a primary dispatching system and a standby dispatching system based on a timestamp and a data identifier provided by an embodiment of the present invention;
[0045] Figure 4 is a flowchart of verifying time consistency based on timestamp comparison between a primary dispatching system and a standby dispatching system provided by an embodiment of the present invention;
[0046] Figure 5 is a flowchart of verifying the consistency of real-time data of a primary dispatching system and a standby dispatching system based on a timestamp and a data identifier provided by an embodiment of the present invention;
[0047] Figure 6 is a flowchart of jointly verifying the consistency of real-time data based on a timestamp and a data identifier of a primary dispatching system and a standby dispatching system provided by an embodiment of the present invention;
[0048] Figure 7It is a flowchart of real-time data based on data identifiers and hash value comparison provided by an embodiment of the present invention. Detailed implementation manners
[0049] To make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below with reference to embodiments and drawings. The illustrative embodiments of the present invention and their descriptions are only used to explain the present invention and are not intended to limit the present invention.
[0050] It should be noted that the term "including" or "may include" that can be used in various embodiments of the present application indicates the presence of the claimed functions, operations or elements, and does not limit the addition of one or more functions, operations or elements. In addition, as used in various embodiments of the present application, the terms "including", "having" and their cognates are only intended to represent specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be construed as first excluding the existence or addition of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0051] In various embodiments of the present application, the expression "or" or "at least one of B or / and C" includes any combination or all combinations of the listed words. For example, the expression "B or C" or "at least one of B or / and C" may include B, may include C, or may include both B and C.
[0052] In the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.
[0053] Next, refer to Figure 1 to describe each step of the master-slave adjustment real-time data verification method of the present invention and how to solve the problem of out-of-sync master-slave adjustment data caused by frequent rapid data changes in the event of a power system emergency. The method includes:
[0054] S101, obtain the real-time data of the master control system and the standby control system.
[0055] In this embodiment, obtaining the real-time data of the master control system means obtaining the data records at the current time point from the master dispatching system. These data may include important parameters such as grid load, generator output, and breaker status. The data is regularly uploaded to the master control system through pre-set data collection points to ensure the accuracy and timeliness of the data. For example, in the power system, the whole network load and generation output data are collected every 5 minutes and uploaded to the master control system. This step ensures the data benchmark in the subsequent comparison process.
[0056] Obtaining the real-time data of the backup dispatching system means retrieving the corresponding data records from the backup dispatching system. As a backup solution, the data of the backup dispatching system needs to be synchronized with the main dispatching system to ensure seamless switching in case of a failure in the main dispatching system. Similarly, data is also uploaded to the backup dispatching system from various monitoring points and devices at predetermined time intervals. In one embodiment, the backup dispatching system synchronizes the main operating parameters of the power grid every 10 seconds to ensure timely access to the latest data even under unstable network conditions.
[0057] S102. Verify the consistency of the real-time data between the main dispatching system and the backup dispatching system based on timestamps and data identifiers. If they are inconsistent, record the differential data; wherein, the consistency includes time consistency and data consistency.
[0058] In this embodiment, comparing the real-time data of the main dispatching system and the backup dispatching system based on timestamps and data identifiers is to verify the data consistency by comparing their timestamps and specific data identifiers after obtaining the data of the two systems. Timestamps ensure the freshness of the data, and data identifiers are used to identify the specific data type and source. Specifically, by comparing the grid load data with the same timestamp in the main dispatching system and the backup dispatching system, it can be found whether there are numerical differences. If the load data at a certain time point is 10000 MW in the main dispatching system and 10010 MW in the backup dispatching system, it is considered that these two pieces of data are inconsistent.
[0059] When data inconsistency is found, record the differences and generate an alarm message. Once data inconsistency is detected, the system will immediately record the content of the inconsistent data and generate an alarm message to notify relevant personnel. This helps to promptly discover potential problems and take measures. For example, in a certain power dispatching center, if the main dispatching system shows that the status of a certain line is closed while the backup dispatching system shows it is open, the system will generate an alarm and send it to the on-duty personnel for timely inspection and handling.
[0060] S103. Trigger the data synchronization operation between the main dispatching system and the backup dispatching system according to the differential data to make the real-time data of the main dispatching system and the backup dispatching system consistent.
[0061] In this embodiment, automatically synchronizing the data of the main dispatching system and the backup dispatching system to a consistent state means that when data inconsistency is detected, the system will automatically start the synchronization mechanism to push the correct data in the main dispatching system to the backup dispatching system, or update the data in the main dispatching system from the backup dispatching system. Through this mechanism, it is ensured that the data of the two systems can be kept consistent at any time point. Specifically, when data inconsistency is detected at a certain time point, the system will push the latest and most accurate data in the main dispatching system to the backup dispatching system to ensure the consistency of the two sets of data. At the same time, it will also check whether certain data in the main dispatching system needs to be updated to maintain comprehensive data accuracy.
[0062] Throughout the process, the timestamp and data identifier are key elements that ensure the accuracy of comparison and synchronization. This method not only maintains data synchronization between the primary and backup dispatching systems during daily operations but also enables quick problem detection and resolution in the event of emergencies, such as sudden short circuits or natural disasters that cause significant data changes, thereby enhancing the reliability and stability of the system. For example, during a severe storm, the data at multiple power grid monitoring points changed frequently. Through real-time data verification, inconsistencies in several data points were promptly detected, and data synchronization was completed within minutes, avoiding dispatching errors caused by data inconsistencies and ensuring the safe and stable operation of the power system.
[0063] Next, please refer to Figure 2 , in one embodiment, the method provided by the embodiments of the present invention further includes:
[0064] S201, Obtain the real-time data of the primary dispatching system and the real-time data of the backup dispatching system based on a preset time interval.
[0065] In this embodiment, a fixed time interval (such as every minute or every second) is set, and real-time data is synchronously collected from the primary dispatching system and the backup dispatching system within this interval. For example, in a power dispatching center, the primary dispatching system is responsible for data processing during normal operation, while the backup dispatching system serves as a redundant backup. Every 60 seconds, these two systems synchronize their internal power parameter data to ensure data consistency and accuracy.
[0066] S202, When it is detected that an emergency has occurred, reduce the preset time interval to increase the acquisition frequency of real-time data.
[0067] In this embodiment, when an emergency occurs, increasing the data acquisition frequency to adapt to rapid data changes is intended to address data fluctuations in emergency situations. In the event of emergencies such as power grid failures or extreme weather, data may change rapidly, so it is necessary to shorten the data collection time interval to capture these changes. For example, when it is detected that the power grid has a momentary power outage, the system increases the data acquisition frequency to once every 5 seconds to more quickly grasp and respond to changes in the system state.
[0068] S203, Calculate the stability of the data in the embodiment through the data change rate. When the data change rate exceeds a preset threshold, immediately trigger the data comparison and synchronization process; wherein, the data change rate is calculated by the formula Δ = |A(t + 1) - A(t)| / A(t), where Δ represents the data change rate, A(t + 1) represents the data value at the current moment, and A(t) represents the data value at the previous moment.
[0069] In this embodiment, in this formula, Δ is used to measure the difference between two consecutive data points, that is, the change ratio of the current data point relative to the previous data point. The range of the parameter is usually from 0 to 1 (or expressed as 0% to 100% in percentage), and the optimal value varies depending on the specific application scenario. However, generally, a value less than 0.05 or 5% is considered normal fluctuation. The purpose of the formula design is to quantify the degree of data change and determine whether a significant change has occurred. In power grid monitoring, by calculating the power load change rate per minute, it is possible to evaluate whether the power grid is operating stably. When the data change rate exceeds the preset threshold, the data comparison and synchronization process is immediately triggered. This step aims to take immediate measures when anomalies are detected. Once the monitored data change rate exceeds the pre-set safety threshold, it indicates that the system may have problems or face risks, and it is necessary to promptly perform data comparison and synchronization to ensure data consistency between the primary and backup systems. For example, when the power grid load suddenly surges and the change rate exceeds the preset 0.07 (or 7%), the system will automatically trigger a series of safety check procedures, including verifying whether the data of the primary and backup systems is consistent, and performing synchronous updates when they are inconsistent to ensure the reliable operation of the entire power system.
[0070] In some embodiments, please refer to Figure 3 , which describes the verification of the consistency of real-time data between the calling system and the standby system provided by the present invention based on timestamps and data identifiers, including:
[0071] S301, Based on the comparison of timestamps of the calling system and the standby system, verify the consistency of time.
[0072] In this embodiment, based on the comparison of timestamps of the calling system and the standby system, ensure the consistency of time. This process involves comparing the timestamp of the calling system with the timestamp of the standby system to ensure that the clocks of the two systems are synchronized. If they are inconsistent, clock calibration is required to ensure that subsequent data comparisons can be performed under the same time reference. For example, in one embodiment, the timestamp of the calling system is 2024-11-05 10:00:00, while the timestamp of the standby system is 2024-11-05 10:00:01, with a difference of 1 second. In this case, the clock of the standby system needs to be adjusted forward by 1 second.
[0073] S302, Compare the real-time data corresponding to the same data identifier in the calling system and the standby system. When the real-time data of the calling system and the standby system corresponding to the data identifier is inconsistent, record the specific inconsistent difference data.
[0074] In this embodiment, the data corresponding to the same data identifier in two systems is compared. The data identifier is an identifier used to uniquely identify a piece of data. By comparing the data with the same identifier, the differences in data between different systems can be discovered. Specifically, assume that the record with the data identifier 1001 has a value of 500 in the calling system and a value of 502 in the standby system. Then, it is considered that there is an inconsistency in this data between the two systems. During this process, all records with the same data identifier need to be traversed, and the inconsistent content needs to be recorded.
[0075] When the data in the two systems corresponding to the data identifier is inconsistent, record the specific inconsistent content. This step is to ensure that in subsequent processing, it can be traced which specific data is inconsistent. Specifically, the recorded content includes information such as the data identifier, the value in the calling system, the value in the standby system, and the timestamp when the data is located. For example, if the value of the data identifier 1001 in the calling system is 500, while the value in the standby system is 502, and the occurrence timestamp is 2024-11-05 10:01:00, then these information need to be recorded in detail.
[0076] S303, Use a consistency detection algorithm to verify the consistency of real-time data.
[0077] In this embodiment, a consistency detection algorithm is used to further verify the data consistency. This algorithm calculates the data consistency percentage through the formula S=(M / N)*100%, where S represents the data consistency percentage, M represents the number of consistent data, and N represents the total data volume. The parameters M and N are both positive integers, and the value range of M is from 0 to N, and the optimal value is N, that is, all data is consistent. The meaning of the formula is to calculate the proportion of consistent records among all data records. Through this proportion, the data consistency degree between the two systems can be intuitively evaluated. The reason for setting this formula is that the consistency level of the data can be clearly shown in the form of a percentage, which is convenient for subsequent data management and decision-making. For example, assume that the total data volume N is 1000 records, and the number of consistent data records M is 950. Then the data consistency percentage S is 95%. Such a result can reflect that the data consistency between the calling system and the standby system is relatively high, but there are still a small number of inconsistent data that need to be further processed.
[0078] In some embodiments, please refer to Figure 4 , which describes the comparison of timestamps based on the calling system and the standby system provided by the present invention to verify the time consistency, including:
[0079] S401, Based on the system time calibration of the calling system and the standby system, ensure the time synchronization of the calling system.
[0080] In this embodiment, the system time of the main control system and the standby control system is calibrated to ensure the time synchronization of the two systems. The main purpose of this step is to avoid deviations in subsequent timestamp comparisons by ensuring that the time bases of the two systems are consistent. The specific operation can be achieved through an external high-precision time source or a dedicated device for time calibration.
[0081] S402, perform time synchronization using the NTP protocol.
[0082] In this embodiment, the NTP (Network Time Protocol) is used for time synchronization. NTP is a widely used protocol for synchronizing the time of computer systems in a network. NTP ensures that the time differences between various systems are within an acceptable range by periodically exchanging time information with time servers. For example, in one embodiment, the main control system and the standby control system perform time synchronization via NTP every 5 minutes to ensure that the time difference is less than 1 second.
[0083] S403, calculate the time difference ΔT between the main control system and the standby control system, where ΔT = T1 - T2, T1 represents the time of the main control system, and T2 represents the time of the standby control system.
[0084] In this embodiment, calculate the time difference ΔT between the two systems, where ΔT = T1 - T2, T1 represents the time of the main control system, and T2 represents the time of the standby control system. In this formula, the values of T1 and T2 generally fall within the time range allowed by the system, such as the time interval from the Unix epoch time to several decades in the future. Ideally, the optimal value is that ΔT is close to 0, indicating that the times of the two systems are completely synchronized. Specifically, when the calculated ΔT is not 0, it can be determined that there is a time difference between the two systems.
[0085] S404, when the time difference exceeds the set tolerance threshold, adjust the time of the standby control system to be consistent with the main control system.
[0086] In this embodiment, when the time difference ΔT exceeds the set tolerance threshold, the time of the standby control system is automatically adjusted to be consistent with the main control system. The tolerance threshold is a parameter set according to the specific application scenario and is used to define the maximum acceptable time difference between the two systems. For example, the tolerance threshold can be set to 100 milliseconds. When ΔT exceeds 100 milliseconds, the standby control system will automatically adjust its time to reduce the time difference with the main control system to an acceptable range. In a specific instance, if at a certain moment the time of the main control system is 10:00:00.000 and the time of the standby control system is 10:00:00.150, at this time ΔT is 150 milliseconds, exceeding the set tolerance threshold of 100 milliseconds. Therefore, the standby control system will automatically adjust its time to 10:00:00.000 to ensure consistency with the main control system.
[0087] Through this embodiment, the consistency of time between the calling system and the standby system can be effectively ensured, thereby improving the reliability and accuracy of the real-time data verification method for the primary and standby systems.
[0088] In some embodiments, please refer to Figure 5 , which describes verifying the consistency of real-time data between the calling system and the standby system based on timestamps and data identifiers provided by the present invention, and further includes:
[0089] S501, jointly verify the consistency of real-time data based on the timestamps and data identifiers of the calling system and the standby system.
[0090] In this embodiment, the consistency of data is jointly verified based on the timestamps and data identifiers of the calling system and the standby system. This step means that when comparing the real-time data of the two systems, not only the content of the data itself is compared, but also the consistency of the data is confirmed by checking the timestamps and data identifiers of each data item. The timestamp is used to determine the generation time of the data, and the data identifier is used to uniquely identify each piece of data. For example, in one embodiment, if the data sent by the calling system contains a record with an identifier of 123456 and a timestamp of 2024-11-05T12:00:00Z, then the corresponding data in the standby system should also have the same identifier and timestamp to be considered consistent.
[0091] S502, when both the data identifier and the timestamp are inconsistent, record the real-time data with inconsistent timestamps.
[0092] In this embodiment, when both the data identifier and the timestamp are inconsistent, the information with inconsistent timestamps is preferentially recorded. This is because the timestamp can more intuitively reflect the time difference of data generation, making it easier to locate the root cause of the problem. For example, if the data identifier 123456 and the timestamp 2024-11-05T12:00:00Z in the calling system are inconsistent with the data identifier 123456 and the timestamp 2024-11-05T12:01:00Z in the standby system, the system will preferentially record the difference in timestamps.
[0093] S503, use a sliding window detection algorithm to check the real-time data within the adjacent time period of the timestamp. When the consistency of the real-time data within the sliding window is lower than a preset threshold, increase the data acquisition frequency and re-compare the consistency of the real-time data between the calling system and the standby system.
[0094] In this embodiment, a sliding window mechanism is used to check the data within a recent period of time to ensure the continuity and integrity of the data. The sliding window is a dynamically adjusted time period for continuously monitoring the consistency and continuity of the data. For example, the length of the sliding window can be set to 5 minutes, which means the system will check the consistency of all data within the past 5 minutes. If a large amount of data inconsistency is found during this period, further measures will be taken. When the consistency of the data within the sliding window is lower than the preset threshold, the data acquisition frequency will be increased and the data will be compared again. The preset threshold is a key parameter indicating the level of data consistency within the sliding window that is considered acceptable. For example, if the preset threshold is 95%, it means that at least 95% of the data within the past 5 minutes should be consistent. If the proportion of inconsistent data exceeds 5%, the system will increase the data acquisition frequency from once every 10 seconds to once every 5 seconds and re-compare the data to ensure that data inconsistencies are discovered and resolved as early as possible.
[0095] Throughout the process, the key parameters include the length of the sliding window (such as 5 minutes) and the preset threshold (such as 95%), and these parameters need to be optimized according to specific business requirements. In the formula, the optimal value of the length T of the sliding window is usually determined by the data update frequency, and the preset threshold is based on the business's tolerance for data consistency. Specifically, if the business has a high requirement for data consistency, the preset threshold can be appropriately reduced to ensure data quality.
[0096] In some embodiments, please refer to Figure 6 , which describes the verification of the consistency of real-time data based on the timestamps and data identifiers of the main call system and the backup call system provided by the present invention, including:
[0097] S601, comparing the real-time data based on the hash value of the data identifier, and after comparing the hash values, comparing each piece of specific content one by one to ensure the consistency of the data.
[0098] In this embodiment, comparing based on the hash value of the data identifier improves the efficiency of data comparison; after comparing the hash values, comparing each piece of specific content one by one to ensure the consistency of the data; using a dynamic data change detection algorithm to track the change trend of the data; when the data change trend shows an anomaly, a risk assessment is performed through the formula R = (Nc / Nd)*100%, where R represents the risk level, Nc represents the number of abnormal data points, and Nd represents the total number of data points.
[0099] For example, if the master control system has a piece of data with an identifier of 12345, the generated hash value may be abc123. Similarly, the hash value of the same data entry in the standby control system also needs to be calculated. Hash values have high dispersion and uniqueness. Therefore, by comparing the hash values, it is possible to quickly determine whether most of the data is consistent without the need for a detailed content comparison. After comparing the hash values, a one-by-one comparison of the specific content is carried out to ensure data consistency. If it is found in the first step that the hash values of some data entries are inconsistent, these data entries will be marked as potential difference items. For example, in the above example, if the hash value of 12345 is abc123 in the master control system and xyz789 in the standby control system, this data entry will be further inspected. The system will extract the specific content of these two data entries for one-by-one comparison to check whether the content of each field is exactly the same, thus ensuring data consistency.
[0100] S602, use a dynamic data change detection algorithm to track the change trend of real-time data. When the data change trend shows an anomaly, perform a risk assessment through the formula R = (Nc / Nd) * 100%, where R represents the risk level, Nc represents the number of abnormal data points, and Nd represents the total number of data points.
[0101] In this embodiment, a dynamic data change detection algorithm is used to track the change trend of data. The dynamic data change detection algorithm can monitor the data update situation in the master control system and the standby control system in real time. Specifically, this algorithm will regularly collect and analyze the changes in data to form a change trend graph. In one embodiment, it is assumed that the data changes are detected every five minutes. If the update frequency of a specific field suddenly increases within a certain period of time, the system will automatically mark these changes for further analysis.
[0102] When the data change trend shows an anomaly, perform a risk assessment through the formula R = (Nc / Nd) * 100%, where R represents the risk level, Nc represents the number of abnormal data points, and Nd represents the total number of data points. If the change trend graph shows that there are many data points with abnormal changes within a certain period of time, the formula will be used to calculate the risk level. Nc is the number of abnormal data points during this period, and Nd is the total number of data points during this period. The value range of R is from 0% to 100%. The higher the value, the greater the risk. For example, assume that there are 10 abnormal data points within one hour, and the total number of updated data points is 100, then R = (10 / 100) * 100% = 10%, indicating a low risk. If the values of Nc and Nd are both positive integers, in the optimal case, Nc should be as small as possible to reduce the risk level. The setting of this formula is designed to quantify the proportion of abnormal data, helping the administrator quickly understand the health status of the system, so as to take necessary measures for repair or optimization.
[0103] In some embodiments, please refer to Figure 7 for a description of the real-time data for comparing hash values based on data identifiers provided by the present invention, including:
[0104] S701, calculating the hash values of the data identifiers of the calling system and the standby system based on the SHA256 hash algorithm.
[0105] In this embodiment, the SHA256 hash algorithm is used to calculate the hash values of the data identifiers of the calling system and the standby system. This step is to convert complex identifiers into unique identifiers of a fixed length for subsequent quick comparison. The hash algorithm can convert inputs of any size into outputs of a fixed length, and different inputs generally generate different outputs.
[0106] S702, comparing whether the hash values of the calling system and the standby system are the same, and recording the data identifiers with different hash values and the specific content of the corresponding real-time data.
[0107] In this embodiment, it is compared whether the hash values of the two systems are the same. This step determines the consistency of the data of the two systems by comparing one by one the hash values generated by the same data identifiers in the calling system and the standby system. If all the hash values are the same, it means that the data of the two systems are consistent; otherwise, there are differences and further analysis is required. After finding mismatched hash values, record the data identifiers with different hash values and the specific content of the corresponding data. This process not only marks the inconsistent places but also details the specific data for subsequent correction and analysis work.
[0108] S703, using the formula C = 1 - (Hd / Hn) to evaluate the matching degree of the hash values of the data identifiers, where C represents the matching degree, Hd represents the number of different hash values, and Hn represents the number of hash values.
[0109] In this embodiment, the formula C = 1 - (Hd / Hn) is used to evaluate the matching degree of the hash values of the data identifiers. In this formula, C represents the matching degree, ranging from 0 to 1, and the optimal value is 1, indicating a perfect match. Hd represents the number of different hash values, while Hn represents the total number of hash values. The design of this formula is to quantify the degree of data consistency, where Hd / Hn reflects the proportion of different hash values, and taking 1 minus this proportion is the degree of matching.
[0110] In one embodiment, it is assumed that both the primary dispatching system and the backup dispatching system have 1,000 data identifiers. The hash value of each identifier is calculated through the SHA256 algorithm, and the hash values of the two systems are compared one by one. The result shows that 10 hash values are different, and the remaining 990 hash values are the same. These different hash values and their corresponding original data are recorded for subsequent investigation. The matching degree is calculated according to the above formula: C = 1 - 10 / 1000 = 0.99. This means that the matching degree of the hash values of the data identifiers is 99%, which is a very high matching degree, but the inconsistent parts still need to be checked to ensure data integrity.
[0111] Based on the verification method described in the above embodiments, it can be seen that the present invention effectively solves the problem of out-of-sync data between the primary and backup dispatching systems in the event of an emergency in the power system through real-time data collection, accurate comparison, and automatic data synchronization, improving the reliability and stability of the system. Even in a highly dynamic environment, it can ensure that the data of the primary and backup dispatching systems remain highly consistent, thus enhancing the overall system security and operation and maintenance efficiency.
[0112] The embodiment of the present invention also provides a device for real-time verification of primary and backup dispatching data, which includes:
[0113] A data acquisition module for acquiring the real-time data of the primary dispatching system and the backup dispatching system;
[0114] A consistency verification module for verifying the consistency of the real-time data of the primary dispatching system and the backup dispatching system based on timestamps and data identifiers. If they are inconsistent, the differential data is recorded; where the consistency includes time consistency and data consistency;
[0115] A data synchronization module for triggering data synchronization operations between the primary dispatching system and the backup dispatching system according to the differential data to make the real-time data of the primary dispatching system and the backup dispatching system consistent.
[0116] A device for real-time verification of primary and backup dispatching data in the embodiment of the present application, and the Figure 1 shown method for real-time verification of primary and backup dispatching data are inventions based on the same concept. Through the detailed description of the method for real-time verification of primary and backup dispatching data provided in the above embodiments, those skilled in the art can clearly understand the implementation process of the device for real-time verification of primary and backup dispatching data in this embodiment. Therefore, for the sake of simplicity of the specification, it will not be elaborated here.
[0117] Accordingly, a main and standby dispatching real-time data verification device provided in this embodiment obtains real-time data of the main dispatching system and the standby dispatching system; verifies the consistency of the real-time data of the main dispatching system and the standby dispatching system based on timestamps and data identifiers, and if they are inconsistent, records the differential data; wherein, the consistency includes time consistency and data consistency; according to the differential data, triggers a data synchronization operation between the main dispatching system and the standby dispatching system to make the real-time data of the main dispatching system and the standby dispatching system consistent. Through the technical solution of the embodiment of the present invention, it is possible to solve the problem of out-of-sync data between the main and standby dispatching systems caused by frequent rapid data changes in the event of an emergency in the power system.
[0118] An electronic device is also provided in an embodiment of the present invention. Among them, the electronic device includes a processor, a memory, a communication interface, and at least one communication bus for connecting the processor, the memory, and the communication interface. The memory includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (PROM), or a portable read-only memory (CD-ROM), and this memory is used for relevant instructions and data.
[0119] The communication interface is used to receive and send data. The processor can be one or more CPUs. In the case where the processor is a single CPU, the CPU can be a single-core CPU or a multi-core CPU. The processor in the electronic device is used to read one or more programs stored in the memory and perform the following operations: obtain real-time data of the main dispatching system and the standby dispatching system; verify the consistency of the real-time data of the main dispatching system and the standby dispatching system based on timestamps and data identifiers, and if they are inconsistent, record the differential data; wherein, the consistency includes time consistency and data consistency; according to the differential data, trigger a data synchronization operation between the main dispatching system and the standby dispatching system to make the real-time data of the main dispatching system and the standby dispatching system consistent.
[0120] It should be noted that the specific implementation of each operation can be the corresponding description in the method embodiment shown above. Figure 1 The host computer can be used to execute a main and standby dispatching real-time data verification method in the method embodiment of the present application, which will not be specifically elaborated here.
[0121] In an embodiment of the present disclosure, a computer-readable storage medium is further provided. The computer-readable storage medium is a memory device in a computer device and is used to store programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and, of course, the extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, and the operating system of the terminal is stored in this storage space. Moreover, one or more instructions suitable for being loaded and executed by a processor are stored in this storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. One or more instructions stored in the computer-readable storage medium can be loaded and executed by the processor to implement the corresponding steps of the method for real-time data verification between the primary and standby regulators in the above embodiments. Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0122] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above description is only the specific embodiments of the present invention and is not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for real-time data verification of primary and standby dispatching, characterized in that the method Including: Obtain the real-time data of the primary dispatching system and the standby dispatching system; Verify the consistency of the real-time data of the primary dispatching system and the standby dispatching system based on timestamps and data identifiers. If they are inconsistent, record the differential data. Among them, the consistency includes time consistency and data consistency. Among them, verifying the consistency of the real-time data of the primary dispatching system and the standby dispatching system based on timestamps and data identifiers also includes: jointly verifying the consistency of the real-time data based on the timestamps and data identifiers of the primary dispatching system and the standby dispatching system; when both the data identifier and the timestamp are inconsistent, record the real-time data with inconsistent timestamps; use a sliding window detection algorithm to check the real-time data within the adjacent time period of the timestamp. When the consistency of the real-time data within the sliding window is lower than the preset threshold, increase the data acquisition frequency and re-compare the consistency of the real-time data of the primary dispatching system and the standby dispatching system; According to the differential data, trigger the data synchronization operation between the primary dispatching system and the standby dispatching system to make the real-time data of the primary dispatching system and the standby dispatching system consistent.
2. The method according to claim 1, characterized in that, Verifying the consistency of the real-time data of the primary dispatching system and the standby dispatching system based on timestamps and data identifiers includes: Verify the time consistency based on the comparison of the timestamps of the primary dispatching system and the standby dispatching system; Compare the real-time data corresponding to the same data identifier in the primary dispatching system and the standby dispatching system. When the real-time data of the primary dispatching system and the standby dispatching system corresponding to the data identifier is inconsistent, record the specific inconsistent differential data; Use a consistency detection algorithm to verify the consistency of the real-time data.
3. The method according to claim 2, wherein Verifying the time consistency based on the comparison of the timestamps of the primary dispatching system and the standby dispatching system includes: Based on the system time calibration of the primary dispatching system and the standby dispatching system, ensure the time synchronization of the primary dispatching system; Use the NTP protocol for time synchronization; Calculate the time difference ΔT between the primary dispatching system and the standby dispatching system, where ΔT = T1 - T2, T1 represents the time of the primary dispatching system, and T2 represents the time of the standby dispatching system; When the time difference exceeds the set tolerance threshold, adjust the time of the standby dispatching system to be consistent with the primary dispatching system.
4. The method according to claim 1, characterized in that, Jointly verifying the consistency of the real-time data based on the timestamps and data identifiers of the primary dispatching system and the standby dispatching system includes: Compare the real-time data based on the hash values of the data identifiers, and after comparing the hash values, conduct a one-by-one comparison of the specific content to ensure the data consistency; Use a dynamic data change detection algorithm to track the change trend of the real-time data. When the data change trend shows an anomaly, conduct a risk assessment through the formula R = (Nc / Nd) * 100%, where R represents the risk level, Nc represents the number of abnormal data points, and Nd represents the total number of data points.
5. The method according to claim 4, wherein Comparing the real-time data based on the hash values of the data identifiers includes: Calculate the hash values of the data identifiers of the primary dispatching system and the standby dispatching system based on the SHA256 hash algorithm; Compare whether the hash values of the primary dispatching system and the standby dispatching system are the same, and record the data identifiers with different hash values and the specific content of the corresponding real-time data; Use the formula C = 1 -(Hd / Hn) to evaluate the matching degree of the hash values of data identifiers, where C represents the matching degree, Hd represents the number of different hash values, and Hn represents the number of hash values.
6. The method according to claim 1, wherein The method further includes: Obtaining the real-time data of the calling system and the standby system based on a preset time interval; When detecting the occurrence of an emergency, reducing the preset time interval to increase the acquisition frequency of real-time data; Calculating the stability of the example data through the data change rate, and immediately triggering the data comparison and synchronization process when the data change rate exceeds a preset threshold; wherein, the data change rate is calculated by the formula Δ = |A(t+1)- A(t)| / A(t), where Δ represents the data change rate, A(t+1) represents the data value at the current moment, and A(t) represents the data value at the previous moment.
7. A main and standby dispatching real-time data verification device, characterized in that, The device includes: A data acquisition module for acquiring the real-time data of the calling system and the standby system; A consistency verification module for verifying the consistency of the real-time data of the calling system and the standby system based on timestamps and data identifiers. If they are inconsistent, the differential data is recorded; wherein, the consistency includes time consistency and data consistency; wherein, verifying the consistency of the real-time data of the calling system and the standby system based on timestamps and data identifiers further includes: jointly verifying the consistency of the real-time data based on the timestamps and data identifiers of the calling system and the standby system; when both the data identifier and the timestamp are inconsistent, recording the real-time data with inconsistent timestamps; using a sliding window detection algorithm to check the real-time data within the adjacent time period of the timestamp. When the consistency of the real-time data within the sliding window is lower than the preset threshold, increasing the data acquisition frequency and re-comparing the consistency of the real-time data of the calling system and the standby system; A data synchronization module for triggering the data synchronization operation between the calling system and the standby system according to the differential data to make the real-time data of the calling system and the standby system consistent.
8. An electronic device, characterized in that, The electronic device includes a processor, a memory, and a computer program stored on the memory and executable by the processor. When the computer program is executed by the processor, the steps of a primary and standby real-time data verification method as described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program, and when the computer program is executed by one or more processors, a primary and standby real-time data verification method as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Timestamp-based data synchronization method and device, and computer equipment
CN111245548A