Method, apparatus, electronic device and storage medium for data synchronization

By introducing a caching server and a loop detection mechanism during the data synchronization process, the problems of excessive device pressure and resource consumption were solved, achieving efficient and stable data synchronization and improving the operational stability and data transmission efficiency of the device.

CN119865507BActive Publication Date: 2026-06-12CHINA TELECOM INTELLIGENT NETWORK TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM INTELLIGENT NETWORK TECHNOLOGY CO LTD
Filing Date
2024-12-31
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Traditional data synchronization technologies lead to excessive pressure on equipment and excessive consumption of resources, especially when processing capacity is limited or the network environment is unstable, which affects network stability and equipment lifespan. At the same time, the synchronization efficiency is low in high-concurrency scenarios and cannot meet real-time requirements.

Method used

By introducing a cache server, the target synchronization request is obtained, and when the pressure value of the target device is less than a preset threshold, the data is written to the cache server, avoiding the burden of direct communication between devices. The cache server is used as an intermediate layer to schedule synchronization requests, and the device pressure is monitored in a loop and written to the cache server after recovery, so that data synchronization is performed directly when the device is healthy.

Benefits of technology

It achieves efficient and stable data synchronization, reduces equipment pressure, optimizes resource utilization, improves the efficiency and reliability of data synchronization, and ensures the continuity and integrity of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865507B_ABST
    Figure CN119865507B_ABST
Patent Text Reader

Abstract

The application discloses a data synchronization method and device, electronic equipment and a storage medium. The data synchronization method comprises the following steps: obtaining a target synchronization request from a cache server, wherein the target synchronization request is sent by a synchronization server to the cache server; obtaining a target pressure value of a target device; and in response to the target pressure value being less than a preset threshold, writing target synchronization data into the cache server, wherein the target synchronization data is stored in the target device. The application solves the technical problem of excessive device pressure and excessive resource consumption in the prior art when implementing data synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data synchronization technology, and more specifically, to a data synchronization method, apparatus, electronic device, and storage medium. Background Technology

[0002] In modern communication networks, wavelength division multiplexing (WDM) technology has become a key means to achieve high-capacity data transmission. Especially in optical networks, box-type WDM equipment, as a core component, needs to frequently synchronize data with the network management controller to ensure real-time network monitoring and smooth service operation.

[0003] However, traditional data synchronization technologies primarily employ multi-threaded interaction with devices. This multi-threaded approach leads to frequent data reading and transmission by the device, especially under conditions of limited device processing power or unstable network environments. Devices may malfunction due to excessive stress, resulting in prolonged response times or even disconnections, impacting network stability and device lifespan. Furthermore, an excessive number of synchronization request threads significantly increases system resource consumption for the synchronization service, potentially causing service anomalies such as memory overflows and high CPU usage, affecting the normal operation of the synchronization service and overall system performance. In addition, in high-concurrency scenarios, data synchronization efficiency is severely constrained by thread competition and waiting, increasing synchronization latency and failing to meet the real-time requirements of demanding business applications.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This invention provides a method, apparatus, electronic device, and storage medium for data synchronization, to at least solve the technical problems of excessive equipment pressure and excessive resource consumption caused by the prior art when implementing data synchronization.

[0006] According to one aspect of the present invention, a data synchronization method is provided, comprising: obtaining a target synchronization request from a cache server, the target synchronization request being sent from a synchronization server to the cache server; obtaining a target pressure value of a target device; and writing target synchronization data to the cache server in response to the target pressure value being less than a preset threshold, wherein the target synchronization data is stored in the target device.

[0007] Optionally, obtaining the target synchronization request from the cache server includes: obtaining the result of the synchronization server's judgment on the target health value of the target device; in response to the judgment result indicating that the target health value is less than a preset value, querying whether there is a target synchronization request in the cache server; and in response to the existence of a target synchronization request in the cache server, obtaining the target synchronization request from the cache server.

[0008] Optionally, the data synchronization method further includes: receiving a target synchronization request sent by a synchronization server in response to a judgment result indicating that the target health value is greater than or equal to a preset value.

[0009] Optionally, the data synchronization method further includes: cyclically detecting the target pressure value in response to the target pressure value being greater than a preset threshold; and writing the target synchronization data to the cache server in response to the detection that the target pressure value is less than the preset threshold.

[0010] According to another aspect of the present invention, a data synchronization method is also provided, comprising: obtaining a target health value of a target device; in response to the target health value being less than a preset value, sending a target synchronization request to a cache server; repeatedly querying whether target synchronization data exists in the cache server, wherein the target synchronization data includes a target synchronization flag; and in response to the existence of target synchronization data in the cache server, performing a write operation on the target synchronization data.

[0011] Optionally, the data synchronization method further includes: in response to a target health value being greater than or equal to a preset value, sending a target synchronization request to the target device.

[0012] According to another aspect of the present invention, a data synchronization apparatus is also provided, comprising: a first acquisition module, configured to acquire a target synchronization request from a cache server, the target synchronization request being sent from a synchronization server to the cache server; a second acquisition module, configured to acquire a target pressure value of a target device; and a first writing module, configured to write target synchronization data to the cache server in response to the target pressure value being less than a preset threshold, wherein the target synchronization data is stored in the target device.

[0013] Optionally, the first acquisition module further includes: acquiring the judgment result of the synchronization server on the target health value of the target device; in response to the judgment result indicating that the target health value is less than a preset value, querying whether there is a target synchronization request in the cache server; and in response to the existence of a target synchronization request in the cache server, acquiring the target synchronization request from the cache server.

[0014] Optionally, the first acquisition module further includes: in response to the judgment result indicating that the target health value is greater than or equal to a preset value, receiving a target synchronization request sent by the synchronization server.

[0015] Optionally, the first writing module further includes: cyclically detecting the target pressure value in response to the target pressure value being greater than a preset threshold; and writing the target synchronization data to the cache server in response to the detection that the target pressure value is less than the preset threshold.

[0016] According to another aspect of the present invention, a data synchronization apparatus is also provided, comprising: a third acquisition module for acquiring a target health value of a target device; a first sending module for sending a target synchronization request to a cache server in response to the target health value being less than a preset value; a query module for repeatedly querying whether target synchronization data exists in the cache server, wherein the target synchronization data includes a target synchronization flag; and an execution module for performing a write operation on the target synchronization data in response to the existence of target synchronization data in the cache server.

[0017] Optionally, the first sending module further includes: in response to a target health value being greater than or equal to a preset value, sending a target synchronization request to the target device.

[0018] According to another aspect of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the data synchronization method described in any of the preceding embodiments.

[0019] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to perform the data synchronization method described above when running on a computer or processor.

[0020] In this embodiment of the invention, a target synchronization request is obtained from a cache server, and the target synchronization request is sent from a synchronization server to the cache server; the target pressure value of the target device is obtained; in response to the target pressure value being less than a preset threshold, target synchronization data is written to the cache server, wherein the target synchronization data is stored on the target device. This invention, by utilizing a cache server and determining the target pressure value of the target device, achieves the goal of realizing an efficient, stable, and controllable data synchronization process, thereby significantly improving the efficiency and reliability of data synchronization, reducing device pressure, and optimizing the use of service resources. This solves the technical problems of excessive device pressure and excessive resource consumption caused by existing technologies during data synchronization. Attached Figure Description

[0021] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0022] Figure 1 This is a flowchart of a first data synchronization method according to one embodiment of the present invention;

[0023] Figure 2 This is a flowchart of a second data synchronization method according to one embodiment of the present invention;

[0024] Figure 3 This is a flowchart illustrating a data synchronization method according to one embodiment of the present invention;

[0025] Figure 4 This is a structural block diagram of a first data synchronization device according to one embodiment of the present invention;

[0026] Figure 5 This is a structural block diagram of a second data synchronization device according to one embodiment of the present invention. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] According to an embodiment of the present invention, an embodiment of a data synchronization method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system containing at least one set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0030] This method embodiment can also be performed in an electronic device, similar control device, or electronic device that includes a memory and a processor. Taking an electronic device as an example, the electronic device may include one or more processors and a memory for storing data. Optionally, the aforementioned electronic device may also include a communication device for communication functions and a display device. Those skilled in the art will understand that the above structural description is merely illustrative and does not limit the structure of the aforementioned electronic device. For example, the electronic device may also include more or fewer components than those described above, or have a different configuration than those described above.

[0031] A processor may include one or more processing units. For example, a processor may include a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microcontroller unit (MCU), a field-programmable gate array (FPGA), a neural network processing unit (NPU), a tensor processing unit (TPU), or an artificial intelligence (AI) processor. Different processing units may be independent components or integrated into one or more processors. In some instances, electronic devices may also include one or more processors.

[0032] The memory can be used to store computer programs, such as the computer program corresponding to the data synchronization method in the embodiments of the present invention. The processor implements the above-described data synchronization method by running the computer program stored in the memory. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the electronic device via a grid. Examples of such grids include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0033] Figure 1 This is a flowchart of a first data synchronization method according to one embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0034] Step S101: Obtain the target synchronization request from the cache server. The target synchronization request is sent from the synchronization server to the cache server.

[0035] Specifically, the target device periodically or under the trigger of a specific event retrieves the target synchronization request pre-sent by the synchronization server from the cache server.

[0036] It should be noted that in traditional data synchronization methods, the synchronization server directly sends requests to the device. However, this application stores these requests in a cache server, allowing the device to selectively retrieve the requested information based on its task requirements and workload. In this application, the direct interaction between the synchronization server and the device is replaced by indirect processing through the cache server. This reduces the direct communication burden on the device and avoids excessive consumption of device resources due to frequent synchronization requests. Simultaneously, as an intermediary layer, the cache server can flexibly schedule and store synchronization requests based on the real-time status of the device and the overall system resource situation, making data exchange more efficient and intelligent. With the intervention of the cache server, even if the synchronization server or network fails, the device can still obtain the requested information from the cache server, ensuring the continuity and reliability of the data synchronization process.

[0037] Step S102: Obtain the target pressure value of the target device.

[0038] Specifically, before processing a synchronization request, the target device needs to assess its own status, i.e., obtain the target stress value. This stress value includes, but is not limited to, the device's CPU utilization, memory usage, network bandwidth utilization, and device health status. The purpose of obtaining the target device's target stress value is to ensure that the device will not experience performance degradation or abnormal behavior due to insufficient resources when processing synchronization requests.

[0039] Specifically, the device's built-in monitoring system periodically checks its operational status, including hardware resource usage and software performance, to determine stress levels. The device then feeds back the monitored stress levels to the synchronization server or cache server in real time or periodically, serving as the basis for subsequent data synchronization decisions.

[0040] Step S103: In response to the target pressure value being less than a preset threshold, the target synchronization data is written to the cache server, wherein the target synchronization data is stored in the target device.

[0041] Specifically, when the target device determines that its pressure value is less than a preset threshold, it indicates that the device currently has sufficient resources to handle the data synchronization task. At this time, the device begins to collect target synchronization data and writes it to the cache server, rather than directly transmitting it to the synchronization server.

[0042] Specifically, when resource conditions allow, the device begins to asynchronously collect the information that needs to be synchronized from the data source. This reduces the direct correlation between data collection and transmission, allowing the device to complete data synchronization without affecting the current running tasks.

[0043] Specifically, the target synchronization data is stored in a cache server instead of being directly transmitted to the synchronization server. This reduces the processing pressure on the synchronization server and improves the efficiency of data transmission.

[0044] Specifically, after the device finishes writing the data to the cache server, it sets a completion flag to inform the synchronization server that the data is ready and awaiting further processing by the synchronization service. This mechanism ensures the integrity and reliability of the data, while also avoiding unnecessary operations such as the synchronization server requesting the same data multiple times.

[0045] In this embodiment of the invention, a target synchronization request is obtained from a cache server, and the target synchronization request is sent from a synchronization server to the cache server; the target pressure value of the target device is obtained; in response to the target pressure value being less than a preset threshold, target synchronization data is written to the cache server, wherein the target synchronization data is stored on the target device. This invention, by utilizing a cache server and determining the target pressure value of the target device, achieves the goal of realizing an efficient, stable, and controllable data synchronization process, thereby significantly improving the efficiency and reliability of data synchronization, reducing device pressure, and optimizing the use of service resources. This solves the technical problems of excessive device pressure and excessive resource consumption caused by existing technologies during data synchronization.

[0046] Optionally, obtaining the target synchronization request from the cache server in step S101 may include the following steps:

[0047] Step S201: Obtain the result of the synchronization server's judgment on the target health value of the target device;

[0048] Specifically, the synchronization server continuously monitors the device status, collecting device performance metrics and health data. Based on the status information reported by the device, operation logs, and historical performance data, the synchronization server comprehensively assesses the health status of the target device and obtains a judgment result on the target health value of the target device.

[0049] Specifically, the target health value is an important indicator for measuring the current operating status of a device, reflecting its processing capacity, network connectivity, and overall health. This assessment can be obtained proactively, such as by the device periodically requesting health status from a synchronization server, or passively, by the synchronization server proactively sending health status information to the device when it detects changes in the device's status.

[0050] Specifically, the synchronization server performs comprehensive analysis on the collected data and calculates the target health value of the device based on a preset algorithm or model. This value can be dynamically adjusted to adapt to different device characteristics and network environments.

[0051] Step S202: In response to the judgment result indicating that the target health value is less than the preset value, query whether there is a target synchronization request in the cache server;

[0052] Specifically, after receiving the health value assessment results, the device will make the next decision based on the results.

[0053] Specifically, if the assessment result indicates that the device's target health value is below a preset threshold, this usually means that the device is currently under high load or in an unstable state. Directly processing synchronization requests may increase the device's burden or even cause it to malfunction. Therefore, the device does not directly respond to synchronization requests but instead redirects to the cache server to check if there are any pending synchronization requests. The cache server acts as a storage and scheduling center for synchronization requests, allowing the device to query and retrieve pending requests, thus avoiding the direct communication burden on the device under high pressure.

[0054] The above operations reduce the direct communication pressure on devices. By using a cache server as an intermediary, devices can flexibly choose whether and when to process synchronization requests based on their own status.

[0055] Step S203: In response to the existence of a target synchronization request in the cache server, obtain the target synchronization request from the cache server.

[0056] Specifically, if there are target synchronization requests in the cache server, the target device will read and retrieve these requests from the cache server and begin the data synchronization process.

[0057] It's important to note that devices intelligently retrieve synchronization requests from the cache server based on their own health status, rather than passively waiting for direct requests from the synchronization server. This makes the data synchronization process more flexible and efficient. Simultaneously, the cache server must ensure data integrity and timely updates so that target devices can obtain accurate and up-to-date data when querying and retrieving synchronization requests.

[0058] In addition, the asynchronous processing mechanism allows the device to proactively process synchronization requests in the cache when the pressure is low, avoiding data processing under high pressure and ensuring the stability and reliability of data synchronization.

[0059] Optionally, the data synchronization method further includes: receiving a target synchronization request sent by a synchronization server in response to a judgment result indicating that the target health value is greater than or equal to a preset value.

[0060] Specifically, if the results of the synchronization server's evaluation indicate that the target device's health value is greater than or equal to the preset value, it means that the device is currently in good condition and can effectively handle synchronization requests.

[0061] Specifically, after confirming its own good condition, the target device will directly receive a synchronization request from the synchronization server and begin the data collection and synchronization process according to the request content. This process includes, but is not limited to, data reading, formatting, data packet construction, and data uploading, ultimately completing the processing of the synchronization request and returning a response to the synchronization server. When the device is in good health, this process can be carried out quickly and efficiently, thereby improving the overall speed of data synchronization and system performance.

[0062] Specifically, after processing a synchronization request, the device reports its latest status information to the synchronization server. The synchronization server then updates the target device's health value accordingly, providing the latest data support for subsequent synchronization request decisions. This mechanism ensures real-time updates to the device's health value, providing a more accurate basis for subsequent data synchronization decisions.

[0063] Understandably, once the target device is confirmed to be in a stable and healthy state, the synchronization server will directly send the target synchronization request without going through the cache server. Direct connection and data exchange reduce intermediate steps in data transmission, improve the real-time performance and efficiency of data synchronization, and also reduce the burden on the cache server, optimizing the allocation of system resources.

[0064] It should be noted that the preset values ​​need to take into account the device's processing capacity and the resource requirements of the synchronization requests, so as to ensure that the device can directly receive synchronization requests when the device is stable or resources are sufficient, thereby improving data synchronization efficiency.

[0065] Optionally, the data synchronization method may further include the following steps:

[0066] Step S301: In response to the target pressure value being greater than a preset threshold, the target pressure value is cyclically detected;

[0067] Specifically, when the stress value of the target device (such as CPU utilization, memory usage, network bandwidth usage, etc.) exceeds a preset threshold, it indicates that the device is currently under high load and may not be able to effectively handle additional data synchronization tasks, or even cause device failure. To avoid this situation, this invention employs a cyclic detection mechanism to continuously monitor the device's stress value until it falls back to a safe range.

[0068] Specifically, the target device's built-in monitoring system or external monitoring service continuously monitors the target device's operating status, including the usage of hardware resources and the operation of software, to ensure that changes in the device's stress can be detected in a timely manner.

[0069] Specifically, once the system detects that the device stress value exceeds the preset threshold, it will immediately take measures to stop receiving new synchronization requests to prevent further overload of the device.

[0070] It should be noted that when the device enters a high-pressure state, the system will not immediately stop data synchronization. Instead, it will continuously monitor the pressure changes of the target device through a cyclic detection mechanism until the pressure returns to below the preset threshold.

[0071] In step S302, in response to detecting that the target pressure value is less than a preset threshold, the target synchronization data is written to the cache server.

[0072] Specifically, when the cyclic detection mechanism confirms that the pressure value of the device has dropped to a safe level, that is, less than the preset threshold, the target device begins to process the data synchronization task. However, in order to avoid the target device being subjected to excessive pressure again, the synchronization data is not sent directly to the synchronization server, but is first written to the cache server, which is then uniformly scheduled and managed by the cache server.

[0073] Specifically, the device uses a cache server as a temporary storage location for data, avoiding direct data exchange with the synchronization server under high pressure, thereby achieving reasonable resource allocation and effective pressure relief.

[0074] Specifically, once the data is written to the cache server, the worker thread of the synchronization service is awakened to process the data and finally synchronize it into the database, thereby ensuring the integrity and timeliness of the data.

[0075] Specifically, data written to the cache server can be shared and processed by multiple worker threads, without relying on the direct response of a single synchronization service, thus improving the stability and efficiency of data synchronization.

[0076] By employing a cyclic detection mechanism when the device pressure exceeds a preset threshold, and only writing data to the cache server after the pressure returns to a safe level, the system effectively avoids device failure due to resource overload, while ensuring the continuity and efficiency of data synchronization. This intelligent pressure management and data caching solution provides strong technical support for the stable operation and data synchronization of box-type wavelength division multiplexing (WDM) equipment in large-scale communication networks, and has significant innovative value and application potential.

[0077] Figure 2 This is a flowchart of a second data synchronization method according to one embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:

[0078] Step S401: Obtain the target health value of the target device.

[0079] Specifically, the synchronization server continuously monitors the operating status of the target device, collects real-time performance indicators such as CPU utilization, memory usage, network latency, and anomaly reporting frequency, and calculates the target health value of the target device.

[0080] The target health value is obtained based on the status information and operation logs reported by the device, as well as the comprehensive analysis of the synchronization server. The target health value can accurately reflect the actual operating status and carrying capacity of the device.

[0081] It should be noted that the target health status of the target equipment needs to be monitored and evaluated in real time to ensure that the data synchronization strategy can be flexibly adjusted according to the real-time health status of the equipment, so as to avoid the equipment operating under high pressure and thus reduce the equipment failure rate.

[0082] In step S402, in response to the target health value being less than a preset value, a target synchronization request is sent to the cache server.

[0083] Specifically, when the synchronization server detects that the health value of the target device is lower than a preset threshold, it indicates that the device may be under high pressure and should not be directly received and processed for synchronization requests. To avoid increasing the device's burden, the synchronization server sends the target synchronization request to the cache server instead of sending it directly to the target device.

[0084] By using a caching server as an intermediary, it is possible to effectively avoid devices directly processing synchronization requests under high pressure, reduce the immediate burden on devices, and improve the overall stability and efficiency of the system.

[0085] It should be noted that the preset values ​​are based on an understanding of the normal operating status of the equipment, ensuring that appropriate measures can be taken to protect the stable operation of the equipment when its health is poor.

[0086] Step S403: Loop through the cache server to check if the target synchronization data exists, wherein the target synchronization data includes the target synchronization flag.

[0087] Specifically, after sending the target synchronization request to the cache server, the synchronization server will periodically or continuously query the cache server to see if there is any synchronization data uploaded by the target device.

[0088] Specifically, during the query process, the target synchronization data is marked with a target synchronization flag so that the synchronization server can accurately identify and process it.

[0089] Meanwhile, the loop query mechanism ensures timely data synchronization, avoids data backlog and loss, and also reduces the direct dependence of the synchronization server on the device status, thereby improving the utilization efficiency of system resources.

[0090] Step S404: In response to the existence of target synchronization data in the cache server, a write operation is performed on the target synchronization data.

[0091] Specifically, once the synchronization server detects the synchronization data uploaded by the target device from the cache server, it will immediately perform a write operation on this data and store it in the database of the synchronization service, thus completing the final data synchronization.

[0092] Specifically, write operations need to ensure data integrity and consistency, and also need to process duplicate data to avoid data redundancy in the database.

[0093] Timely data write operations ensure the continuity and efficiency of data synchronization, while a duplicate data processing mechanism guarantees data consistency and reliability.

[0094] The data synchronization method of this invention intelligently schedules data synchronization requests to a cache server when the device's health is poor. Then, it iteratively queries the cache server to check for the existence of synchronization data uploaded by the target device before finally performing a data write operation. This effectively avoids direct data processing under high pressure, reducing the immediate burden on the device, while ensuring the continuity and efficiency of data synchronization. It achieves dynamic matching between device health status and data synchronization strategy, improving the overall stability and efficiency of the system. This data synchronization scheme provides a more intelligent, efficient, and stable data synchronization solution for box-type wavelength division multiplexing (WDM) equipment in large-scale communication networks, possessing significant technical value and application prospects.

[0095] Optionally, the data synchronization method further includes: in response to a target health value being greater than or equal to a preset value, sending a target synchronization request to the target device.

[0096] Specifically, when the health status assessment result of the target device shows that its target health value meets the preset standard, the synchronization service will directly send a data synchronization request to the target device, skipping the intermediate link of the cache server.

[0097] The advantages of this strategy are: direct communication reduces intermediate steps in data transmission, improves the real-time performance and response speed of data synchronization, and ensures that data can be quickly updated to the synchronization service; since the current state of the device is suitable for handling synchronization requests, direct communication avoids the additional scheduling of cache servers and the consumption of data storage resources, thereby improving the efficiency of data synchronization and reducing the waste of system resources; when the device is in good health, direct communication will not put additional pressure on the device, which helps to maintain the stable operation of the device and extend its service life.

[0098] Specifically, after receiving a synchronization request, the target device begins collecting and processing data based on the request content. Once processing is complete, the device directly returns the synchronized data to the synchronization service, eliminating the need for a cache server and further improving data transmission efficiency and real-time performance.

[0099] Figure 3 This is a flowchart illustrating a data synchronization method according to one embodiment of the present invention, such as... Figure 3 As shown, the specific steps to achieve data synchronization include:

[0100] The first step is to calculate the health score of the target equipment, which is used to measure the actual operating condition and load-bearing capacity of the equipment.

[0101] The second step is to compare the calculated health value of the target device with the preset health value. If the health value of the target device is greater than or equal to the preset health value, the target device is determined to be in a healthy state. If the health value of the target device is less than the preset health value, the target device is determined to be in an unhealthy state.

[0102] Third, if the target device is in a healthy state, the synchronization server will directly send the target synchronization request to the target device.

[0103] Fourth, if the target device is in an unhealthy state, the synchronization server adds the target synchronization request to the request queue and sends it to the cache server;

[0104] The fifth step is for the target device to assess its own hardware resource usage and software operation status to determine its target stress value. If the current target stress value is within a safe range, the target device actively obtains a synchronization request from the cache server and performs the synchronization operation.

[0105] The sixth step is to process the data that needs to be synchronized and then return the synchronized data to the cache server.

[0106] Step 7: The synchronization server continuously queries the cache server to see if there is any synchronization data uploaded by the target device. When the synchronization server detects the synchronization data uploaded by the target device in the cache server, it wakes up the worker thread, performs a write operation on the uploaded synchronization data, stores it in the database of the synchronization service, completes the final data synchronization, and the worker thread enters a thread sleep state.

[0107] This invention also provides two data synchronization devices for implementing the above embodiments and preferred embodiments, which will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0108] Figure 4 This is a structural block diagram of a first data synchronization device 500 according to one embodiment of the present invention, as shown below. Figure 4 As shown, the device includes: a first acquisition module 501, used to acquire a target synchronization request from a cache server, the target synchronization request being sent from a synchronization server to a cache server; a second acquisition module 502, used to acquire a target pressure value of a target device; and a first writing module 503, used to write target synchronization data to a cache server in response to the target pressure value being less than a preset threshold, wherein the target synchronization data is stored in the target device.

[0109] Optionally, the first acquisition module 501 is further configured to: acquire the judgment result of the synchronization server on the target health value of the target device; in response to the judgment result indicating that the target health value is less than a preset value, query whether there is a target synchronization request in the cache server; and in response to the existence of a target synchronization request in the cache server, acquire the target synchronization request from the cache server.

[0110] Optionally, the first acquisition module 501 is further configured to: receive a target synchronization request sent by the synchronization server in response to a judgment result indicating that the target health value is greater than or equal to a preset value.

[0111] Optionally, the first writing module 503 is further configured to: perform cyclic detection of the target pressure value in response to the target pressure value being greater than a preset threshold; and write the target synchronization data to the cache server in response to the detection that the target pressure value is less than the preset threshold.

[0112] Figure 5 This is a structural block diagram of a second data synchronization device 600 according to one embodiment of the present invention, as shown below. Figure 5 As shown, the device includes: a third acquisition module 601, used to acquire the target health value of the target device; a first sending module 602, used to send a target synchronization request to the cache server in response to the target health value being less than a preset value; a query module 603, used to cyclically query whether target synchronization data exists in the cache server, wherein the target synchronization data includes a target synchronization flag; and an execution module 604, used to perform a write operation on the target synchronization data in response to the existence of target synchronization data in the cache server.

[0113] Optionally, the first sending module 602 is further configured to: send a target synchronization request to the target device in response to the target health value being greater than or equal to a preset value.

[0114] Embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the data synchronization method described in any of the above embodiments.

[0115] Optionally, in this embodiment, the processor in the above-described electronic device may be configured to run a computer program to perform the following steps:

[0116] Step S101: Obtain the target synchronization request from the cache server. The target synchronization request is sent from the synchronization server to the cache server.

[0117] Step S102: Obtain the target pressure value of the target device;

[0118] Step S103: In response to the target pressure value being less than a preset threshold, the target synchronization data is written to the cache server, wherein the target synchronization data is stored in the target device.

[0119] Optionally, the processor in the aforementioned electronic device may be configured to run a computer program to perform the following steps: obtaining the result of the synchronization server's judgment on the target health value of the target device; in response to the judgment result indicating that the target health value is less than a preset value, querying whether there is a target synchronization request in the cache server; and in response to the existence of a target synchronization request in the cache server, obtaining the target synchronization request from the cache server.

[0120] Optionally, the processor in the aforementioned electronic device may be configured to run a computer program to perform the following steps: in response to a judgment result indicating that the target health value is greater than or equal to a preset value, receiving a target synchronization request sent by a synchronization server.

[0121] Optionally, the processor in the aforementioned electronic device may be configured to run a computer program to perform the following steps: in response to a target pressure value being greater than a preset threshold, cyclically detecting the target pressure value; in response to detecting a target pressure value being less than a preset threshold, writing target synchronization data to a cache server.

[0122] Optionally, in this embodiment, the processor in the above-described electronic device may be configured to run a computer program to perform the following steps:

[0123] Step S401: Obtain the target health value of the target device.

[0124] In step S402, in response to the target health value being less than a preset value, a target synchronization request is sent to the cache server.

[0125] Step S403: Loop through the cache server to check if the target synchronization data exists, wherein the target synchronization data includes the target synchronization flag.

[0126] Step S404: In response to the existence of target synchronization data in the cache server, a write operation is performed on the target synchronization data.

[0127] Optionally, the processor in the aforementioned electronic device may be configured to run a computer program to perform the following steps: in response to a target health value being greater than or equal to a preset value, sending a target synchronization request to the target device.

[0128] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the data synchronization method described in any of the above embodiments when run on a computer or processor.

[0129] Optionally, in this embodiment, the computer program described above may be configured to store a computer program for performing the following steps:

[0130] Step S101: Obtain the target synchronization request from the cache server. The target synchronization request is sent from the synchronization server to the cache server.

[0131] Step S102: Obtain the target pressure value of the target device;

[0132] Step S103: In response to the target pressure value being less than a preset threshold, the target synchronization data is written to the cache server, wherein the target synchronization data is stored in the target device.

[0133] Optionally, the computer program described above may be configured to store a computer program for performing the following steps: obtaining the result of the synchronization server's judgment on the target health value of the target device; in response to the judgment result indicating that the target health value is less than a preset value, querying whether there is a target synchronization request in the cache server; and in response to the existence of a target synchronization request in the cache server, obtaining the target synchronization request from the cache server.

[0134] Optionally, the computer program described above may be configured to store a computer program for performing the following steps: in response to a judgment result indicating that the target health value is greater than or equal to a preset value, receiving a target synchronization request sent by a synchronization server.

[0135] Optionally, the computer program described above can be configured to store a computer program for performing the following steps: cyclically detecting the target pressure value in response to the target pressure value being greater than a preset threshold; and writing target synchronization data to a cache server in response to detecting that the target pressure value is less than a preset threshold.

[0136] Optionally, in this embodiment, the computer program described above may be configured to store a computer program for performing the following steps:

[0137] Step S401: Obtain the target health value of the target device.

[0138] In step S402, in response to the target health value being less than a preset value, a target synchronization request is sent to the cache server.

[0139] Step S403: Loop through the cache server to check if the target synchronization data exists, wherein the target synchronization data includes the target synchronization flag.

[0140] Step S404: In response to the existence of target synchronization data in the cache server, a write operation is performed on the target synchronization data.

[0141] Optionally, the computer program described above may be configured to store a computer program for performing the following steps: in response to a target health value being greater than or equal to a preset value, sending a target synchronization request to the target device.

[0142] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0143] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0144] In the embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0145] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0146] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0147] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or grid device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0148] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for data synchronization, characterized in that, include: The judgment result of the target health value of the target device is obtained, wherein the target health value is calculated by the synchronization server based on the status information, operation logs and historical performance data reported by the target device according to the preset model; In response to the judgment result indicating that the target health value is less than a preset value, the system queries whether there is a target synchronization request in the cache server, wherein the target synchronization request is sent to the cache server in advance by the synchronization server; In response to the target synchronization request existing in the cache server, the target synchronization request is obtained from the cache server; In response to the judgment result indicating that the target health value is greater than or equal to the preset value, the target synchronization request sent by the synchronization server is received; Obtain the target pressure value of the target device, wherein the target pressure value is determined based on the hardware resource usage and software operation status of the target device; In response to the target pressure value being less than a preset threshold, target synchronization data is written to the cache server, wherein the target synchronization data is stored in the target device.

2. The data synchronization method according to claim 1, characterized in that, The method further includes: In response to the target pressure value being greater than the preset threshold, the target pressure value is cyclically detected; In response to detecting that the target pressure value is less than the preset threshold, the target synchronization data is written to the cache server.

3. A method for data synchronization, characterized in that, include: Obtain the target health value of the target device, wherein the target health value is calculated based on the status information, operation logs and historical performance data reported by the target device according to a preset model; In response to the target health value being less than a preset value, a target synchronization request is sent to the cache server; In response to the target health value being greater than or equal to the preset value, the target synchronization request is sent to the target device; The system iterates through the cache server to check if target synchronization data exists. The target synchronization data includes a target synchronization flag. The target synchronization data is written to the cache server by the target device when the target pressure value of the target device is less than a preset threshold. The target pressure value is determined based on the hardware resource usage and software operation status of the target device. In response to the presence of the target synchronization data in the cache server, a write operation is performed on the target synchronization data.

4. A data synchronization device, characterized in that, include: The first acquisition module is used to acquire the judgment result of the target health value of the target device, wherein the target health value is calculated by the synchronization server based on the status information, operation logs and historical performance data reported by the target device according to a preset model; in response to the judgment result indicating that the target health value is less than a preset value, the module queries the cache server to see if there is a target synchronization request, wherein the target synchronization request is sent to the cache server in advance by the synchronization server; in response to the presence of the target synchronization request in the cache server, the module retrieves the target synchronization request from the cache server. The device is further configured to receive the target synchronization request sent by the synchronization server in response to the judgment result indicating that the target health value is greater than or equal to the preset value; The second acquisition module is used to acquire the target pressure value of the target device, wherein the target pressure value is determined based on the hardware resource usage and software operation status of the target device; The first writing module is used to write target synchronization data to the cache server in response to the target pressure value being less than a preset threshold, wherein the target synchronization data is stored in the target device.

5. A data synchronization device, characterized in that, include: The third acquisition module is used to acquire the target health value of the target device, wherein the target health value is calculated based on the status information, operation logs and historical performance data reported by the target device according to a preset model; The first sending module is used to send a target synchronization request to the cache server in response to the target health value being less than a preset value; The device is further configured to send the target synchronization request to the target device in response to the target health value being greater than or equal to the preset value; The query module is used to repeatedly query whether target synchronization data exists in the cache server. The target synchronization data includes a target synchronization flag. The target synchronization data is written to the cache server by the target device when the target pressure value of the target device is less than a preset threshold. The target pressure value is determined based on the hardware resource usage and software operation status of the target device. The execution module is used to perform a write operation on the target synchronized data in response to the target synchronized data existing in the cache server.

6. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the data synchronization method as described in any one of claims 1 to 3.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to perform the data synchronization method as described in any one of claims 1 to 3 when executed on a computer or processor.