Intelligent online or offline data synchronization method and system for power equipment test control terminal
By realizing event subscription and differentiated algorithm synchronization between the two parties on the power equipment test control terminal, and combining the index backoff algorithm for network reconnection, the problems of large resource consumption and poor real-time performance in the existing technology are solved, and the system performance and real-time performance of data synchronization are improved.
Patent Information
- Application Number
- CN202411616067.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-07
AI Technical Summary
The existing intelligent data synchronization methods of power equipment test control terminals have problems such as high resource consumption, poor real-time performance and affecting the performance of use.
Through data synchronization, both parties subscribe to each other for data update events, establish an event subscription relationship, monitor changes in data sources, and use event-driven release of data change events during changes to realize differentiated algorithms and incremental synchronization, and combine exponential backoff algorithms to reconnect networks to ensure real-time and efficiency of data synchronization.
It effectively reduces resource consumption, improves the real-timeness of data synchronization, improves system performance, and solves the problems of large resource consumption, poor real-timeness and affects usage performance.
Smart Images

Figure CN119577027A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of power equipment data management, and specifically to a method and system for intelligent online or offline data synchronization of a power equipment test control terminal. Background Art
[0002] In the field of power facility operation, maintenance and repair management, the traditional operation process relies heavily on manual data transcription and report preparation, which is not only time-consuming and labor-intensive, but also prone to errors, greatly limiting the improvement of overall work efficiency and accuracy. This situation highlights the urgent need for the transformation of field operations to digitalization and automation.
[0003] In the prior art, there are three methods for intelligent online or offline data synchronization of power equipment test control terminals:
[0004] Basic synchronization strategy: When online, directly synchronize online data to local data storage. When offline, wait until the online state is restored before synchronizing local data to online data storage.
[0005] Periodic polling: Periodically poll the online data storage and download data, or check the online status when the application starts and decide whether to synchronize.
[0006] The synchronization priority is fixed: when online, online data is synchronized first; when offline, local data is updated first, and then online data is synchronized after the online state is restored.
[0007] The basic synchronization strategy and synchronization priority will synchronize data regardless of whether there is data update, which consumes too much resources. Although periodic polling can synchronize data only when polling finds data update, or synchronize data only after checking for data update when the application starts, it can reduce resource consumption to a certain extent, but polling and checking will still consume network bandwidth and system resources, and data update cannot be discovered in time, and the real-time performance is poor. In addition, no matter which synchronization method is used, thread synchronization is adopted, which will affect the performance of the application to a certain extent. If the application frequently switches threads and makes network requests, it will lead to slow response and even application freeze.
[0008] Currently, no effective solution has been proposed to address the problems of resource consumption, poor real-time performance, and performance degradation in related technologies. Summary of the invention
[0009] The main purpose of this application is to provide an online or offline data intelligent synchronization method and system for an electric power equipment test control terminal to solve the problems of resource consumption, poor real-time performance, and impact on performance.
[0010] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for intelligent online or offline data synchronization of an electric power equipment test control terminal is provided.
[0011] According to the present application, the online or offline intelligent data synchronization method of the power equipment test control terminal includes: the two parties of data synchronization subscribe to each other's data update events to establish an event subscription relationship; monitor whether any data source of the two parties of data synchronization changes; when any data source of the two parties of data synchronization changes, the party with the data source change uses event-driven publishing of data change events; the party with no data source change receives the published data change events; and synchronizes the data sources of the two parties of data synchronization according to the data change event and the preset event subscription relationship.
[0012] Furthermore, when any data source of the two parties of data synchronization changes, the party where the data source changes uses event-driven publishing of data change events and also includes: monitoring the network connection status between the two parties of data synchronization; when it is monitored that the network connection between the two parties of data synchronization is successful, the party where the data source has not changed receives the published data change event.
[0013] Furthermore, after monitoring the network connection status between the two parties of data synchronization, the method further includes: when a network connection failure is detected, using an exponential backoff algorithm to reconnect the network.
[0014] Furthermore, the exponential backoff algorithm includes: calculating the time interval for the next connection attempt according to a preset backoff strategy, and delaying the retry of the connection, increasing the retry interval at an exponential level for each failure, stopping the retry after reaching the maximum retry limit, and sending a failure notification.
[0015] Furthermore, after monitoring the network connection status between the two parties of data synchronization, it also includes: when a network connection failure is detected and it is determined that either party of the data synchronization is offline, the party where the data source changes records the data change as an event log and saves it, and when the party where the data source has not changed comes online, data synchronization is performed based on the event log.
[0016] Furthermore, synchronizing the data sources of both parties of data synchronization according to the data change event and the preset event subscription relationship includes: executing a differentiation algorithm on the data sources of both parties of data synchronization according to the data change event and the event subscription relationship to obtain updated data; and executing an incremental synchronization operation based on the updated data to complete data synchronization.
[0017] Furthermore, the party where the data source changes occurs uses event-driven publishing of data change events in a message queue in chronological order; the party where the data source does not change receives the published data change events according to the message queue.
[0018] Furthermore, the differentiation algorithm includes: comparing the contents in the data sources of both parties of data synchronization, and finding the changed parts of the contents as the updated data.
[0019] Furthermore, an incremental synchronization operation is performed based on the updated data. When data synchronization is completed, a pessimistic lock mechanism is used to lock the data change event to prevent other events from accessing it until the current event completes the operation.
[0020] Furthermore, when any data source of either party to the data synchronization changes, the party where the data source changes first uses domestic encryption algorithms and authentication technology to encrypt the corresponding data source, and then uses event-driven publishing of data change events; based on data change events and event subscription relationships, a differentiation algorithm is executed on the data sources of both parties to the data synchronization, and after obtaining the updated data, it also includes: using a domestic encryption algorithm to decrypt the updated data and performing a hash check. If the check is successful, an incremental synchronization operation is performed based on the updated data to complete data synchronization.
[0021] Furthermore, the updated data is decrypted using a domestic encryption algorithm, and after hash verification, it also includes: if the verification fails, whether there is an abnormality in the data synchronization process is monitored, and if there is an abnormality, the abnormality repair program is called according to the abnormality type to repair the abnormality.
[0022] Furthermore, before the two data synchronization parties mutually subscribe to data update events to establish an event subscription relationship, the process also includes: comparing version numbers of the data sources of the two data synchronization parties; if the comparison is inconsistent, the two data synchronization parties mutually subscribe to data update events to establish an event subscription relationship.
[0023] Furthermore, after comparing the version numbers of the data sources of both parties of data synchronization, it also includes: if the comparison is consistent, a new inspection task is added to the local devices of both parties of data synchronization, and the relevant data of the new inspection task is intelligently cached; after the local device and the test instrument establish a communication connection, the local device sends policies and configuration parameters according to the detected user's sending and configuration operations; the test instrument completes the new inspection task according to the sent policies and configured parameters, and returns the task data; generates a corresponding test report according to the task data, and saves the test report as a data source to the local database according to the user's save and submit operation.
[0024] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an online or offline data intelligent synchronization system for a power equipment test control terminal is provided.
[0025] The online or offline intelligent data synchronization system of the power equipment test control terminal according to the present application includes: a relationship establishment module, which is used for the two parties of data synchronization to subscribe to data update events to establish an event subscription relationship; a change monitoring module, which is used to monitor whether any data source of the two parties of data synchronization has changed; an event publishing module, which is used when any data source of the two parties of data synchronization changes, the party with the data source change adopts event-driven publishing of data change events; an event receiving module, which is used for the party with no data source change to receive the published data change events; a data synchronization module, which is used to synchronize the data sources of the two parties of data synchronization according to the data change event and the preset event subscription relationship.
[0026] In an embodiment of the present application, an event-driven architecture is adopted to monitor whether any data source of the two parties of data synchronization has changed; when any data source of the two parties of data synchronization has changed, the party with the data source change adopts event-driven publishing of data change events; the party with no data source change receives the published data change events; data sources of the two parties of data synchronization are synchronized according to the data change event and the preset event subscription relationship; data synchronization is performed in real time only when an update event occurs, and since most events occur at different time points, most events are processed asynchronously, thereby achieving the technical effect of reducing resource consumption, effectively improving real-time performance, and improving usage performance, thereby solving the technical problems of resource consumption, poor real-time performance, and affecting usage performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings constituting a part of this application are used to provide a further understanding of this application, so that other features, purposes and advantages of this application become more obvious. The schematic embodiment drawings and their descriptions of this application are used to explain this application and do not constitute an improper limitation on this application. In the drawings:
[0028] Figure 1 It is a flow chart of an online or offline data intelligent synchronization method of an electric power equipment test control terminal according to an embodiment of the present application;
[0029] Figure 2 is a schematic diagram of device data synchronization according to a preferred embodiment of the present application;
[0030] Figure 3 is a flow chart of an event-driven architecture according to a preferred embodiment of the present application;
[0031] Figure 4 is a flowchart of an incremental synchronization and differentiation algorithm according to a preferred embodiment of the present application;
[0032] Figure 5 Flow chart of the online or offline data intelligent synchronization method of the power equipment test control terminal according to the preferred embodiment of the present application;
[0033] Figure 6 Cloud encryption and decryption flow chart according to the preferred embodiment of this application;
[0034] Figure 7 Block diagram of an online or offline data intelligent synchronization device for an electric power equipment test control terminal according to an embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] In the present application, the terms "upper", "lower", "left", "right", "front", "back", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings. These terms are mainly used to better describe the present invention and its embodiments, and are not used to limit the indicated devices, elements or components to have a specific orientation, or to be constructed and operated in a specific orientation.
[0038] In addition, some of the above terms may be used to express other meanings in addition to indicating orientation or positional relationship. For example, the term "on" may also be used to express a certain dependency or connection relationship in some cases. For those skilled in the art, the specific meanings of these terms in the present invention can be understood according to specific circumstances.
[0039] In addition, the terms "installed", "set", "provided with", "connected", "connected", and "socketed" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral structure; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be an internal connection between two devices, elements, or components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0040] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0041] According to an embodiment of the present invention, a method for intelligent online or offline data synchronization of a power equipment test control terminal is provided. Figure 1 As shown, the method includes the following steps S101 to S105:
[0042] Step S101: Both parties of data synchronization subscribe to each other's data update events to establish an event subscription relationship;
[0043] Step S102: monitor whether any data source of both parties of data synchronization has changed;
[0044] Step S103: When any data source of the two data synchronization parties changes, the party where the data source changes uses event-driven publishing of data change events;
[0045] Step S104: The party where no data source change occurs receives the published data change event;
[0046] Step S105: synchronize the data sources of both data synchronization parties according to the data change event and the preset event subscription relationship.
[0047] The two parties for data synchronization are local devices and the cloud; local devices can be smart tablets carried by multiple on-site staff, and multiple smart devices correspond to one cloud.
[0048] Initially, the data on the local device subscribes to data update events with the corresponding data in the cloud to establish an event subscription relationship; this ensures that in subsequent data synchronization, the data source to be synchronized and the target synchronization data source can be accurately identified based on this relationship.
[0049] The cloud or local devices are used to monitor in real time whether one or more of the multiple data sources stored in the system have changed.
[0050] What needs to be understood is that it is only necessary to monitor whether there is a user update request on the device or the cloud. If so, it is determined that the data source corresponding to the request content has changed locally or in the cloud; the local or cloud where the change occurs calls the event-driven module, which publishes the corresponding data change event, which carries the data itself; the other party where no data change has occurred will receive the data change event, and extract the changed data source A from the data change event, and then refer to the event subscription relationship to search for the data source B corresponding to the data source A from the other party where no data change has occurred, and finally synchronize the data source A to the location where the data source B is stored to achieve data synchronization.
[0051] In this way, data synchronization is performed in real time only when an update event occurs, which effectively overcomes the defect that data updates cannot be discovered in real time during periodic polling and synchronization when the application is started, and the real-time performance is effectively improved; and the form of real-time monitoring does not need to consume too much network bandwidth and system resources, so there is no need to introduce additional fields or tags for data identification processing, which reduces resource consumption for large-scale data sets or frequently updated data; in addition, since most events occur at different time points, most events can be processed asynchronously, which can improve performance. It solves the technical problems of resource consumption, poor real-time performance, and poor performance.
[0052] In this embodiment, preferably, the local device publishes a data change event, and the cloud receives and receives data synchronized from the local device based on the event.
[0053] Reference Figure 3 According to an embodiment of the present invention, preferably, when any data source of both parties of data synchronization changes, the party where the data source changes uses event-driven publishing of data change events further includes:
[0054] Monitor the network connection status between the two parties of data synchronization;
[0055] When the network connection between the two parties of data synchronization is detected to be successful, the party with no data source change receives the published data change event.
[0056] After a local device (one or more) or cloud device with data changes publishes a data change event, it is necessary to first determine whether the network connection is successful or failed. Only when the network connection is successful will the other party be triggered to receive the event. While ensuring the stability and reliability of the connection, event-driven methods can also be used to avoid the process of attempting data synchronization when the network connection fails, thereby saving system resources.
[0057] The existing scheme does not have a corresponding reconnection mechanism, which may cause great pressure on local devices or the cloud. Therefore, after monitoring the network connection status between the two parties of data synchronization, it also includes: when the network connection failure is detected, an exponential backoff algorithm is used to reconnect the network. Preferably, the exponential backoff algorithm includes: calculating the time interval for the next connection attempt according to a preset backoff strategy, and delaying the retry of the connection, and the retry interval of each failure increases at an exponential level. After reaching the maximum retry limit, the retry stops and a failure notification is sent. Setting up a corresponding reconnection mechanism can effectively reduce the computing pressure locally or in the cloud.
[0058] Reference Figure 3 According to an embodiment of the present invention, preferably, after monitoring the network connection status between the two parties of data synchronization, the method further includes:
[0059] When a network connection failure is detected and it is determined that either party of the data synchronization is offline, the party where the data source changes will record the data change as an event log and save it. When the party where the data source does not change comes online, data synchronization will be performed based on the event log.
[0060] It provides a method to record and save all data changes generated as event logs when the local device or cloud is offline. All events are stored and managed in chronological order, so that data recovery and synchronization can be performed based on event tracing to ensure data integrity and traceability.
[0061] It is important to understand that only after the network reconnection fails will it be determined that the local device or cloud is offline, ensuring the rationality of the driver architecture.
[0062] Reference Figure 4 According to an embodiment of the present invention, preferably, synchronizing data sources of both parties of data synchronization according to the data change event and the preset event subscription relationship includes:
[0063] According to the data change events and event subscription relationships, the differentiation algorithm is executed on the data sources of both parties of data synchronization to obtain updated data;
[0064] Perform incremental synchronization operations based on updated data to complete data synchronization.
[0065] Furthermore, the differentiation algorithm includes: comparing the contents in the data sources of both parties of data synchronization, and finding the changed parts of the contents as the updated data.
[0066] During the data synchronization process, the data sources to be synchronized on the device or cloud are often replaced with the target data source on the other side to complete the update. Obviously, this operation will take up a lot of system resources. For this reason, a differentiation algorithm is used to find out the different parts between the data sources, and then incremental synchronization is used to synchronize the different data parts to the cloud or local device. This effectively reduces the amount of synchronized data and greatly reduces the occupation of system resources.
[0067] Reference Figure 3 According to an embodiment of the present invention, preferably, the party where the data source changes adopts event-driven publishing data change events in the message queue according to the time sequence; the party where the data source does not change receives the published data change events according to the message queue. Although the asynchronous processing of most data can be realized by using only the event architecture, it cannot completely prevent the occurrence of thread synchronization. Therefore, when event-driven and receiving events, data change events are also published to the message queue according to the event sequence. Once a new event arrives, the system will obtain the event from the message queue and execute the corresponding business logic and data processing operations according to the type and content of the event, so as to synchronize data one by one through the message queue in the time sequence.
[0068] It can further ensure asynchronous processing of events, reduce performance loss, and improve maintainability; and it can ensure data consistency under multi-user operations.
[0069] Preferably, incremental synchronization operations are performed based on updated data. When data synchronization is completed, a pessimistic lock mechanism is used to lock the data change event, preventing other events from accessing it until the current event completes the operation. The pessimistic lock mechanism is used to lock resources before accessing them, preventing other events from accessing them until the current event completes the operation; this can further ensure asynchronous processing of events.
[0070] Reference Figure 5 , according to an embodiment of the present invention, preferably, when any data source of the two parties of data synchronization changes, the party where the data source changes first uses a domestic encryption algorithm and authentication technology to encrypt the corresponding data source, and then uses event-driven publishing of data change events;
[0071] According to the data change events and event subscription relationships, a differentiation algorithm is executed on the data sources of both parties of data synchronization. After obtaining the updated data, it also includes: using a domestic encryption algorithm to decrypt the updated data and perform a hash check. If the check is successful, an incremental synchronization operation is performed based on the updated data to complete data synchronization.
[0072] Domestic encryption algorithms and authentication technologies are used to encrypt and decrypt data to protect data security and confidentiality and prevent data leakage and illegal access. The specific encryption and decryption process can be referred to Figure 6 The specific content is: the data is calculated using a domestic hash algorithm to update the hash value of the data, and the data is encrypted using a domestic ECB mode group symmetric encryption algorithm based on the initialization key Local Key. The timestamp, 16-byte data hash value and data ciphertext are concatenated and passed to the message queue to publish the data update event. After the cloud receives the data, it uses the Online key to decrypt the data, and then performs a hash check on the data integrity to ensure data security and integrity.
[0073] Reference Figure 5 According to an embodiment of the present invention, preferably, the update data is decrypted using a domestic encryption algorithm, and after the hash check is performed, the following steps are further included:
[0074] If the verification fails, monitor whether there are any abnormalities in the data synchronization process. If there are any abnormalities, call the abnormality repair program to repair the abnormality according to the abnormality type.
[0075] Exceptions include device exceptions, data errors, etc. Specifically, most errors are classified and an automatic repair mechanism is used. For example, for data errors, an attempt can be made to automatically repair the erroneous data and resubmit it to reduce manual intervention.
[0076] Reference Figure 5 According to an embodiment of the present invention, preferably, before the data synchronization parties mutually subscribe to data update events to establish an event subscription relationship, the following steps are further included:
[0077] Compare the version numbers of the data sources of both parties of data synchronization;
[0078] If the comparison is inconsistent, the two data synchronization parties subscribe to each other's data update events to establish an event subscription relationship.
[0079] Before establishing the event subscription relationship, a version comparison process is set up. First, the data version comparison is used. Then, the version numbers of each data source on the device and the cloud are compared. If the version numbers are inconsistent, it means there is no update. If the version numbers are inconsistent, it means there is an update. Then, the event subscription relationship establishment process is entered. Further improving the event architecture can effectively reduce the frequent updates of large-scale data.
[0080] Reference Figure 2 and Figure 6 According to an embodiment of the present invention, preferably, after comparing the version numbers of the data sources of both parties of data synchronization, the following is further included:
[0081] If the comparison is consistent, a new inspection task will be added to the local devices of both parties of data synchronization, and the relevant data of the new inspection task will be intelligently cached;
[0082] After the local device and the tester establish a communication connection, the local device issues policies and configuration parameters according to the detected user's issuance and configuration operations;
[0083] The tester completes the newly added inspection task according to the issued strategy and configured parameters, and returns the task data;
[0084] Generate a corresponding test report based on the task data, and save the test report as a data source to the local database according to the user's save and submit operation.
[0085] Through one-click operation on the local device, all tasks such as test strategy issuance, test parameter setting, test report generation, intelligent analysis of test results, and test report archiving can be achieved. This enables the generation of data sources on the local device, that is, when data changes occur on the local device, the change is detected by itself and then enters the data encryption process.
[0086] Parameter setting can pre-set all test parameters, and no separate operation is required during the test. Equipment parameters such as main transformer voltage level, winding type, rated capacity, etc. can be automatically matched according to the test object.
[0087] One-key test can automatically complete all test items according to the selected test items, including: insulation resistance test, dielectric winding test, DC resistance test, carrier waveform test, voltage ratio measurement test, short-circuit impedance test, and custom retest.
[0088] The test report can be automatically generated after the test is completed, and the report format is matched with the PMS ledger. The report content includes:
[0089] (1) Data entry: Test data is automatically entered into the corresponding report items.
[0090] (2) Data conversion: The test data is automatically converted into data under standard temperature and humidity according to the current temperature and humidity.
[0091] (3) Data judgment: The converted data can be compared with the standard value with one click, and those that do not meet the standards will be marked.
[0092] (4) Intelligent analysis: Compare current test data with historical test data, analyze deviations, and mark data with obvious deterioration in operating trends.
[0093] (5) Test conclusion: Based on data judgment and intelligent analysis, the current operating status and operating trend of the test object are judged and concluded to provide data support for equipment status evaluation.
[0094] The intelligent cache and pre-fetch module can pre-cache and pre-fetch the data that may be needed according to the user's maintenance tasks or needs, thereby improving the data access speed and user experience.
[0095] In this embodiment, if Figure 6 As shown, a preferred method for intelligent online or offline data synchronization of a power equipment test control terminal is provided, comprising the following steps:
[0096] Step 1: Before using the smart tablet to start working, you need to ensure that the cloud and local network are online and connected to initialize data synchronization. By comparing the data version number, determine the latest data source and the data source to be updated.
[0097] Step 2: The data source to be updated reads data update events from the message queue in chronological order, uses a differentiation algorithm to obtain the data to be updated, and then uses the corresponding key to decrypt and perform a hash check. If the data check passes, incremental synchronization can be performed to update the data source. If the check fails, the automatic exception handling module is entered for corresponding exception handling.
[0098] Step 3: After data synchronization is completed, users can create corresponding work tasks through the smart tablet. The smart cache module will automatically cache the corresponding data to the local cache according to the work content, ensuring offline availability and a faster user experience.
[0099] Step 4: The inspection personnel arrive at the site and use the power equipment test control terminal to establish a communication connection with the "six-in-one" test instrument offline at the site. Through the one-key maintenance module, they issue the experimental strategy, set the experimental parameters, complete the relevant tasks, generate local experimental reports and conclusions, save and submit relevant data. At this time, the task status is "unfinished".
[0100] Step 5. After the inspection personnel save and submit the corresponding data, the encryption module will be called. The hash algorithm will be used to calculate the 16-byte hash value, and then the local Local Key will be used to encrypt the data in groups. The timestamp, ciphertext, 16-byte hash value and other information will be pieced together into complete data. At this time, the task is "submitted".
[0101] Step 6: If the device is online at this time, the data update event is directly published in the message queue. If the device is offline, the corresponding event is saved locally in the form of a log until the network status becomes online and the data update event is resent.
[0102] In step 7, the cloud receives the corresponding data in the message queue. As in step 2, it uses a differential algorithm to obtain the data to be updated, and then uses the cloud's Online Key to decrypt and perform a hash check. If the data check passes, incremental synchronization can be performed to update the cloud data. If the check fails, the automatic exception handling module is entered to perform the corresponding exception handling, automatically repair the data, or retransmit the data.
[0103] Step 8: When processing data update events, events are obtained from the message queue in sequence according to the event time. When synchronizing incremental data, a pessimistic locking mechanism is used to lock the corresponding data resources in advance to ensure that no data conflicts occur.
[0104] Step 9: After the data synchronization update is completed, the work task status changes to "Completed", the work is completed and returns to the initial state, and the next task can be carried out.
[0105] In some embodiments, intelligent alarms are also set during data synchronization. Intelligent alarms include real-time alarms, alarm processing, and historical recall. Real-time alarms will promptly obtain signals from the monitoring system of the centralized control station regarding equipment anomalies, environmental anomalies, monitoring equipment disconnection, and displacement of important auxiliary equipment, and push alarms in real time. Alarm processing can filter interference alarm events through alarm confirmation, object selection, and other methods. Global alarm information can be searched according to filtering conditions such as time, site, equipment, and alarm type. Historical recall provides historical curve queries and historical event queries such as anomalies, disconnections, displacements, and operations, and conducts event tracing and analysis and comparison.
[0106] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0107] According to an embodiment of the present invention, a system for implementing the above-mentioned method for intelligent online or offline data synchronization of a power equipment test control terminal is also provided. Figure 7 As shown, the system includes:
[0108] Relationship establishment module 10, used for data synchronization parties to subscribe to data update events to establish event subscription relationship;
[0109] A change monitoring module 20 is used to monitor whether any data source of the data synchronization parties has changed;
[0110] An event publishing module 30 is used to publish a data change event by using event-driven when any data source of the two parties of data synchronization changes;
[0111] An event receiving module 40 is used for receiving published data change events by a party where no data source change has occurred;
[0112] The data synchronization module 50 is used to synchronize the data sources of both parties of the data synchronization according to the data change event and the preset event subscription relationship.
[0113] The two parties for data synchronization are local devices and the cloud; local devices can be smart tablets carried by multiple on-site staff, and multiple smart devices correspond to one cloud.
[0114] Initially, the data on the local device subscribes to data update events with the corresponding data in the cloud to establish an event subscription relationship; this ensures that in subsequent data synchronization, the data source to be synchronized and the target synchronization data source can be accurately identified based on this relationship.
[0115] The cloud or local devices are used to monitor in real time whether one or more of the multiple data sources stored in the system have changed.
[0116] What needs to be understood is that it is only necessary to monitor whether there is a user update request on the device or the cloud. If so, it is determined that the data source corresponding to the request content has changed locally or in the cloud; the local or cloud where the change occurs calls the event-driven module, which publishes the corresponding data change event, which carries the data itself; the other party where no data change has occurred will receive the data change event, and extract the changed data source A from the data change event, and then refer to the event subscription relationship to search for the data source B corresponding to the data source A from the other party where no data change has occurred, and finally synchronize the data source A to the location where the data source B is stored to achieve data synchronization.
[0117] In this way, data synchronization is performed in real time only when an update event occurs, which effectively overcomes the defect that data updates cannot be discovered in real time during periodic polling and synchronization when the application is started, and the real-time performance is effectively improved; and the form of real-time monitoring does not need to consume too much network bandwidth and system resources, so there is no need to introduce additional fields or tags for data identification processing, which reduces resource consumption for large-scale data sets or frequently updated data; in addition, since most events occur at different time points, most events can be processed asynchronously, which can improve performance. It solves the technical problems of resource consumption, poor real-time performance, and poor performance.
[0118] In this embodiment, preferably, the local device publishes a data change event, and the cloud receives and receives data synchronized from the local device based on the event.
[0119] Reference Figure 3 According to an embodiment of the present invention, preferably, when any data source of both parties of data synchronization changes, the party where the data source changes uses event-driven publishing of data change events further includes:
[0120] Monitor the network connection status between the two parties of data synchronization;
[0121] When the network connection between the two parties of data synchronization is detected to be successful, the party with no data source change receives the published data change event.
[0122] After a local device (one or more) or cloud device with data changes publishes a data change event, it is necessary to first determine whether the network connection is successful or failed. Only when the network connection is successful will the other party be triggered to receive the event. While ensuring the stability and reliability of the connection, event-driven methods can also be used to avoid the process of attempting data synchronization when the network connection fails, thereby saving system resources.
[0123] The existing scheme does not have a corresponding reconnection mechanism, which may cause great pressure on local devices or the cloud. Therefore, after monitoring the network connection status between the two parties of data synchronization, it also includes: when the network connection failure is detected, an exponential backoff algorithm is used to reconnect the network. Preferably, the exponential backoff algorithm includes: calculating the time interval for the next connection attempt according to a preset backoff strategy, and delaying the retry of the connection, and the retry interval of each failure increases at an exponential level. After reaching the maximum retry limit, the retry stops and a failure notification is sent. Setting up a corresponding reconnection mechanism can effectively reduce the computing pressure locally or in the cloud.
[0124] Reference Figure 3 According to an embodiment of the present invention, preferably, after monitoring the network connection status between the two parties of data synchronization, the method further includes:
[0125] When a network connection failure is detected and it is determined that either party of the data synchronization is offline, the party where the data source changes will record the data change as an event log and save it. When the party where the data source does not change comes online, data synchronization will be performed based on the event log.
[0126] It provides a method to record and save all data changes generated as event logs when the local device or cloud is offline. All events are stored and managed in chronological order, so that data recovery and synchronization can be performed based on event tracing to ensure data integrity and traceability.
[0127] It is important to understand that only after the network reconnection fails will it be determined that the local device or cloud is offline, ensuring the rationality of the driver architecture.
[0128] Reference Figure 4 According to an embodiment of the present invention, preferably, synchronizing data sources of both parties of data synchronization according to the data change event and the preset event subscription relationship includes:
[0129] According to the data change events and event subscription relationships, the differentiation algorithm is executed on the data sources of both parties of data synchronization to obtain updated data;
[0130] Perform incremental synchronization operations based on updated data to complete data synchronization.
[0131] Furthermore, the differentiation algorithm includes: comparing the contents in the data sources of both parties of data synchronization, and finding the changed parts of the contents as the updated data.
[0132] During the data synchronization process, the data sources to be synchronized on the device or cloud are often replaced with the target data source on the other side to complete the update. Obviously, this operation will take up a lot of system resources. For this reason, a differentiation algorithm is used to find out the different parts between the data sources, and then incremental synchronization is used to synchronize the different data parts to the cloud or local device. This effectively reduces the amount of synchronized data and greatly reduces the occupation of system resources.
[0133] Reference Figure 3 According to an embodiment of the present invention, preferably, the party where the data source changes adopts event-driven publishing data change events in the message queue according to the time sequence; the party where the data source does not change receives the published data change events according to the message queue. Although the asynchronous processing of most data can be realized by using only the event architecture, it cannot completely prevent the occurrence of thread synchronization. Therefore, when event-driven and receiving events, data change events are also published to the message queue according to the event sequence. Once a new event arrives, the system will obtain the event from the message queue and execute the corresponding business logic and data processing operations according to the type and content of the event, so as to synchronize data one by one through the message queue in the time sequence.
[0134] It can further ensure asynchronous processing of events, reduce performance loss, and improve maintainability; and it can ensure data consistency under multi-user operations.
[0135] Preferably, incremental synchronization operations are performed based on updated data. When data synchronization is completed, a pessimistic lock mechanism is used to lock the data change event, preventing other events from accessing it until the current event completes the operation. The pessimistic lock mechanism is used to lock resources before accessing them, preventing other events from accessing them until the current event completes the operation; this can further ensure asynchronous processing of events.
[0136] Reference Figure 5 , according to an embodiment of the present invention, preferably, when any data source of the two parties of data synchronization changes, the party where the data source changes first uses a domestic encryption algorithm and authentication technology to encrypt the corresponding data source, and then uses event-driven publishing of data change events;
[0137] According to the data change events and event subscription relationships, a differentiation algorithm is executed on the data sources of both parties of data synchronization. After obtaining the updated data, it also includes: using a domestic encryption algorithm to decrypt the updated data and perform a hash check. If the check is successful, an incremental synchronization operation is performed based on the updated data to complete data synchronization.
[0138] Domestic encryption algorithms and authentication technologies are used to encrypt and decrypt data to protect data security and confidentiality and prevent data leakage and illegal access. The specific encryption and decryption process can be referred to Figure 6 The specific content is: the data is calculated using a domestic hash algorithm to update the hash value of the data, and the data is encrypted using a domestic ECB mode group symmetric encryption algorithm based on the initialization key Local Key. The timestamp, 16-byte data hash value and data ciphertext are concatenated and passed to the message queue to publish the data update event. After the cloud receives the data, it uses the Online key to decrypt the data, and then performs a hash check on the data integrity to ensure data security and integrity.
[0139] Reference Figure 5 According to an embodiment of the present invention, preferably, the update data is decrypted using a domestic encryption algorithm, and after the hash check is performed, the following steps are further included:
[0140] If the verification fails, monitor whether there are any abnormalities in the data synchronization process. If there are any abnormalities, call the abnormality repair program to repair the abnormality according to the abnormality type.
[0141] Exceptions include device exceptions, data errors, etc. Specifically, most errors are classified and an automatic repair mechanism is used. For example, for data errors, an attempt can be made to automatically repair the erroneous data and resubmit it to reduce manual intervention.
[0142] Reference Figure 5 According to an embodiment of the present invention, preferably, before the data synchronization parties mutually subscribe to data update events to establish an event subscription relationship, the following steps are further included:
[0143] Compare the version numbers of the data sources of both parties of data synchronization;
[0144] If the comparison is inconsistent, the two data synchronization parties subscribe to each other's data update events to establish an event subscription relationship.
[0145] Before establishing the event subscription relationship, a version comparison process is set up. First, the data version comparison is used. Then, the version numbers of each data source on the device and the cloud are compared. If the version numbers are inconsistent, it means there is no update. If the version numbers are inconsistent, it means there is an update. Then, the event subscription relationship establishment process is entered. Further improving the event architecture can effectively reduce the frequent updates of large-scale data.
[0146] Reference Figure 2 and Figure 6 According to an embodiment of the present invention, preferably, after comparing the version numbers of the data sources of both parties of data synchronization, the following is further included:
[0147] If the comparison is consistent, a new inspection task will be added to the local devices of both parties of data synchronization, and the relevant data of the new inspection task will be intelligently cached;
[0148] After the local device and the tester establish a communication connection, the local device issues policies and configuration parameters according to the detected user's issuance and configuration operations;
[0149] The tester completes the newly added inspection task according to the issued strategy and configured parameters, and returns the task data;
[0150] Generate a corresponding test report based on the task data, and save the test report as a data source to the local database according to the user's save and submit operation.
[0151] Through one-click operation on the local device, all tasks such as test strategy issuance, test parameter setting, test report generation, intelligent analysis of test results, and test report archiving can be achieved. This enables the generation of data sources on the local device, that is, when data changes occur on the local device, the change is detected by itself and then enters the data encryption process.
[0152] Parameter setting can pre-set all test parameters, and no separate operation is required during the test. Equipment parameters such as main transformer voltage level, winding type, rated capacity, etc. can be automatically matched according to the test object.
[0153] One-key test can automatically complete all test items according to the selected test items, including: insulation resistance test, dielectric winding test, DC resistance test, carrier waveform test, voltage ratio measurement test, short-circuit impedance test, and custom retest.
[0154] The test report can be automatically generated after the test is completed, and the report format is matched with the PMS ledger. The report content includes:
[0155] (1) Data entry: Test data is automatically entered into the corresponding report items.
[0156] (2) Data conversion: The test data is automatically converted into data under standard temperature and humidity according to the current temperature and humidity.
[0157] (3) Data judgment: The converted data can be compared with the standard value with one click, and those that do not meet the standards will be marked.
[0158] (4) Intelligent analysis: Compare current test data with historical test data, analyze deviations, and mark data with obvious deterioration in operating trends.
[0159] (5) Test conclusion: Based on data judgment and intelligent analysis, the current operating status and operating trend of the test object are judged and concluded to provide data support for equipment status evaluation.
[0160] The intelligent cache and pre-fetch module can pre-cache and pre-fetch the data that may be needed according to the user's maintenance tasks or needs, thereby improving the data access speed and user experience.
[0161] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0162] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for intelligent online or offline data synchronization of a power equipment test control terminal, characterized in that: include: The two parties of data synchronization subscribe to each other's data update events to establish an event subscription relationship; Monitor whether any data source of both parties of data synchronization has changed; When any data source of the two parties of data synchronization changes, the party where the data source changes uses event-driven publishing of data change events; The party where no data source change occurs receives the published data change event; Data synchronization is performed on the data sources of both parties of data synchronization according to the data change event and the preset event subscription relationship.
2. The method according to claim 1, characterized in that When any data source of the two parties of data synchronization changes, the party where the data source changes uses event-driven publishing of data change events, which also includes: Monitor the network connection status between the two parties of data synchronization; When the network connection between the two parties of data synchronization is detected to be successful, the party with no data source change receives the published data change event.
3. The method according to claim 2, characterized in that After monitoring the network connection status between the two parties of data synchronization, it also includes: When a network connection failure is detected, an exponential backoff algorithm is used to reconnect to the network.
4. The method according to claim 3, characterized in that The exponential backoff algorithm includes: The time interval for the next connection attempt is calculated based on the preset backoff strategy, and the connection is retried with a delay. The retry interval for each failure increases exponentially. When the maximum retry limit is reached, the retry stops and a failure notification is sent.
5. The method according to claim 2, characterized in that: After monitoring the network connection status between the two parties of data synchronization, it also includes: When a network connection failure is detected and it is determined that either party of the data synchronization is offline, the party where the data source changes will record the data change as an event log and save it. When the party where the data source does not change comes online, data synchronization will be performed based on the event log.
6. The method according to claim 1, characterized in that Synchronizing the data sources of both parties of data synchronization according to the data change event and the preset event subscription relationship includes: According to the data change events and event subscription relationships, the differentiation algorithm is executed on the data sources of both parties of data synchronization to obtain updated data; Perform incremental synchronization operations based on updated data to complete data synchronization.
7. The method according to claim 1, characterized in that The party where the data source changes occurs uses event-driven publishing of data change events in the message queue in chronological order; the party where the data source does not change receives the published data change events according to the message queue.
8. The method according to claim 6, characterized in that Differentiation algorithms include: Compare the contents of the data sources of both parties for data synchronization and find the changed parts as updated data.
9. The method according to claim 6, characterized in that Perform incremental synchronization based on updated data. When data synchronization is completed, A pessimistic lock mechanism is used to lock the data change event, preventing other events from accessing it until the current event completes the operation.
10. The method according to claim 6, characterized in that When any data source of the data synchronization party changes, The party where the data source changes first uses domestic encryption algorithms and authentication technologies to encrypt the corresponding data source, and then uses event-driven publishing of data change events; According to the data change events and event subscription relationships, the differentiation algorithm is executed on the data sources of both parties of data synchronization. After obtaining the updated data, the following is also included: A domestic encryption algorithm is used to decrypt the updated data and perform a hash check. If the check is successful, an incremental synchronization operation is performed based on the updated data to complete data synchronization.
11. The method according to claim 10, characterized in that The updated data is decrypted using a domestic encryption algorithm, and after hash verification, it also includes: If the verification fails, monitor whether there are any abnormalities in the data synchronization process. If there are any abnormalities, call the abnormality repair program to repair the abnormality according to the abnormality type.
12. The method according to claim 1, characterized in that Before the two parties in data synchronization subscribe to each other's data update events to establish an event subscription relationship, the following also need to be included: Compare the version numbers of the data sources of both parties of data synchronization; If the comparison is inconsistent, the two data synchronization parties subscribe to each other's data update events to establish an event subscription relationship.
13. The method according to claim 12, characterized in that After comparing the version numbers of the data sources of both parties, the following is also included: If the comparison is consistent, a new inspection task will be added to the local devices of both parties of data synchronization, and the relevant data of the new inspection task will be intelligently cached; After the local device and the tester establish a communication connection, the local device issues policies and configuration parameters according to the detected user's issuance and configuration operations; The tester completes the newly added inspection task according to the issued strategy and configured parameters, and returns the task data; Generate a corresponding test report based on the task data, and save the test report as a data source to the local database according to the user's save and submit operation.
14. An online or offline data intelligent synchronization system for a power equipment test control terminal, characterized in that: include: Relationship establishment module, used for data synchronization parties to subscribe to each other's data update events to establish event subscription relationships; The change monitoring module is used to monitor whether any data source of the data synchronization parties has changed; The event publishing module is used to publish data change events in an event-driven manner when any data source of the two parties of data synchronization changes; An event receiving module is used for receiving published data change events by a party where no data source change has occurred; The data synchronization module is used to synchronize the data sources of both parties of the data synchronization according to the data change event and the preset event subscription relationship.
Citation Information
Cited By
Data synchronization method and device
CN121350147A