An adaptive data synchronization method, device and storage medium

By using an adaptive data synchronization method that combines device status and machine learning to optimize retry strategies, the problem of not considering device status in existing technologies is solved, achieving more efficient and intelligent data synchronization.

CN122120282AActive Publication Date: 2026-05-29WINCOR NIXDORF RETAIL & BANKING SYST (SHANGHAI) LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WINCOR NIXDORF RETAIL & BANKING SYST (SHANGHAI) LTD
Filing Date
2026-04-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing data synchronization technologies do not fully consider the real-time status of the devices themselves, lack differentiated backoff parameter configurations, and cannot optimize retry strategies based on historical data, resulting in resource waste and increased system burden.

Method used

An adaptive data synchronization method is adopted. By determining the error type, adjustment parameters are obtained. Combined with the current status of the device, a status adjustment factor is calculated to dynamically adjust the retry waiting time. The weight coefficient is optimized through machine learning to predict the synchronization success rate and adjust the strategy accordingly.

Benefits of technology

It effectively reduces invalid retries, balances synchronization speed and equipment stability, improves system fault tolerance and intelligence, and adapts to various fault scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120282A_ABST
    Figure CN122120282A_ABST
Patent Text Reader

Abstract

The application discloses an adaptive data synchronization method for synchronizing data from a first device to a second device, and the method comprises the following steps: if the data synchronization fails, determining an error type corresponding to the synchronization failure, obtaining a preset adjustment parameter based on the error type, obtaining a current state of the first device, and calculating a state adjustment factor according to the current state, calculating a waiting time for a next synchronization attempt according to the adjustment parameter and the state adjustment factor, and executing a next data synchronization after the waiting time, and performing a new execution strategy according to a synchronization result, such as continuing to attempt synchronization or ending the process. The application can balance the synchronization as soon as possible and guarantee stable operation of the device.
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 specifically to an adaptive data synchronization method, apparatus, and storage medium. Background Technology

[0002] With the popularization of distributed system architecture and the rapid development of IoT technology, data synchronization between devices has become a fundamental function of various applications. From data interaction between mobile terminals and cloud servers to information sharing between edge nodes and state synchronization of server clusters, the reliability and efficiency of data synchronization directly affect the performance and user experience of the entire system. During data synchronization, factors such as network fluctuations, service overload, and device resource constraints can all lead to synchronization failures. Retry mechanisms are a common means of improving system fault tolerance to address these transient failures. Existing technologies typically employ retry methods such as fixed-interval retries, exponential backoff retries, and error type-based handling. Among these, error type-based retries allow developers to configure retry strategies based on the type of exception. For example, transient errors such as network timeouts and service overloads are suitable for retries, while business logic errors such as authentication failures and insufficient permissions should not be retried. However, most existing retry mechanisms only consider the network and server perspectives, failing to use the device's real-time state as a basis for dynamically adjusting retry strategies. For example, when a device's battery is about to run out, frequent retries will accelerate battery consumption; when the CPU load is too high, synchronization operations may further exacerbate system busyness, thus reducing the success rate.

[0003] Existing technologies have the following shortcomings in retry mechanisms for data synchronization: 1. They do not fully consider the impact of the real-time status of the device initiating the synchronization; 2. They lack differentiated backoff parameter configurations for different error types; 3. They cannot continuously optimize the weights of various status indicators based on historical synchronization data; 4. They lack a mechanism to predict the synchronization success rate using real-time status and dynamically adjust the retry backoff strategy. Summary of the Invention

[0004] To overcome at least one of the aforementioned shortcomings of the prior art, the present invention proposes an adaptive data synchronization method for synchronizing data from a first device to a second device, wherein if data synchronization fails, the following adaptive adjustment steps are performed:

[0005] S1: Determine the error type corresponding to the synchronization failure, and obtain the preset adjustment parameters based on the error type;

[0006] S2: Obtain the current state of the first device and calculate the state adjustment factor based on the current state;

[0007] S3: Calculate the waiting time for the next synchronization attempt based on the adjustment parameters and the state adjustment factor;

[0008] S4: After the waiting time, perform the next data synchronization;

[0009] S5: Determine whether the next data synchronization is successful. If successful, the process ends; if it fails, record the number of synchronization failures and determine whether the preset maximum number of retries has been reached.

[0010] If the maximum number of retries has not been reached, return to S1;

[0011] If the maximum number of retries has been reached, the process will end or a preset exception handling will be executed.

[0012] The preset adjustment parameters include the base waiting time and the exponential backoff factor. The formula for calculating the waiting time T_wait is:

[0013]

[0014] In the formula, Based on waiting time, As an indexed retreat factor, For state adjustment factor, This is a random jitter value. Indicates proceeding to the first The first synchronization attempt;

[0015] The formula for calculating the state adjustment factor is:

[0016]

[0017] In the formula, The weighting coefficients for each state index representing the current state of the first device, This is the penalty function for each state indicator.

[0018] Furthermore, the error types include network errors between the first and second devices, internal anomalies of the second device, and local I / O errors of the first device. The base latency and exponential backoff factor corresponding to network errors between the first and second devices are smaller than the base latency and exponential backoff factor corresponding to internal anomalies of the second device and local I / O errors of the first device, respectively.

[0019] Furthermore, the status indicators of the first device include battery level, CPU load rate, memory utilization rate, storage I / O latency, and network signal strength. For battery level and network signal strength, the penalty function is negatively correlated with the value of the status indicator, while for CPU load rate, memory utilization rate, and storage I / O latency, the penalty function is positively correlated with the value of the status indicator.

[0020] Furthermore, it also includes AI-enhanced dynamic weight update steps:

[0021] Collect historical synchronization records, which include a state index vector X and the corresponding synchronization result Y at each synchronization attempt;

[0022] The historical synchronization records are input into a machine learning model for training to calculate the importance of each state indicator on the synchronization success rate.

[0023] Based on the dynamic weight coefficients obtained after normalization of the influence importance. To replace the original weighting coefficients .

[0024] Furthermore, it also includes AI-enhanced synchronization success rate prediction and strategy adaptation steps:

[0025] Obtain the current status information of the first device and input it into the machine learning model;

[0026] The machine learning model is used to predict the success probability of the next synchronization. ;

[0027] Based on the success probability The waiting time is dynamically adjusted based on the threshold range in which it falls. .

[0028] Furthermore, if <First predetermined value, extend the waiting time ;

[0029] like >Second predetermined value, shorten the waiting time ;

[0030] If the first predetermined value ≤ ≤Second predetermined value, without changing the waiting time .

[0031] Furthermore, the machine learning model employs a gradient boosting tree model.

[0032] In another aspect, the present invention also proposes an adaptive data synchronization device, disposed in a first device, for synchronizing data with a second device, the device comprising:

[0033] The error type determination module is used to determine the error type corresponding to the data synchronization failure when the data synchronization fails.

[0034] The parameter acquisition module is used to acquire preset adjustment parameters based on the error type;

[0035] The status monitoring module is used to obtain the current status of the first device;

[0036] A state adjustment factor calculation module is used to calculate a state adjustment factor based on the current state.

[0037] The waiting time calculation module is used to calculate the waiting time for the next synchronization attempt based on the adjustment parameters and the state adjustment factor.

[0038] The synchronization execution module is used to perform the next data synchronization after the waiting time.

[0039] The failure handling module is used to determine whether the next data synchronization will be successful. If successful, the process ends; if it fails, the number of synchronization failures is recorded, and it is determined whether the preset maximum number of retries has been reached.

[0040] If the maximum number of retries is not reached, the error type determination module is triggered to re-execute;

[0041] If the maximum number of retries has been reached, the process will end or a preset exception handling will be executed. The preset adjustment parameters include the base waiting time and the exponential backoff factor. The formula for calculating the waiting time T_wait is:

[0042]

[0043] In the formula, Based on waiting time, As an indexed retreat factor, For state adjustment factor, This is a random jitter value. Indicates proceeding to the first The first synchronization attempt;

[0044] The formula for calculating the state adjustment factor is:

[0045]

[0046] In the formula, The weighting coefficients for each state index representing the current state of the first device, This is the penalty function for each state indicator.

[0047] Furthermore, the device also includes an AI enhancement module for performing dynamic updates of weight coefficients and predicting and adaptively adjusting the synchronization success rate through machine learning.

[0048] The present invention also includes a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the aforementioned adaptive data synchronization method.

[0049] Compared with the prior art, the method of the present invention has at least the following beneficial effects: 1. The error types corresponding to synchronization failures include network errors, server-side internal exceptions, and local I / O errors. For errors that are easier to recover from, a shorter base wait time and an exponential backoff factor are given, while for errors that are harder to recover from, a longer base wait time and an exponential backoff factor are given. This avoids wasting resources on unrecoverable errors and allows for a quick response to recoverable errors, thereby reducing invalid retries. 2. The state adjustment factor calculated from the current state of the equipment is incorporated into the calculation of the retry interval time to balance the two objectives of "completing synchronization as soon as possible" and "ensuring stable operation of the equipment", so as to avoid further deterioration of the system due to retry when the equipment is in poor condition; 3. An adaptive retry interval calculation formula is constructed based on the error cause of synchronization failure and the status indicators of the current device status. It can simultaneously cope with multiple fault scenarios such as network fluctuations, server overload, local IO bottlenecks, insufficient power, and weak signal, and automatically optimize the retry strategy. 4. By learning the importance of each status indicator to the success rate from historical synchronization records through machine learning, the weight coefficients are dynamically updated, the probability of successful synchronization is predicted based on the real-time status of the equipment, and the backoff strategy is dynamically adjusted according to the probability threshold, thereby realizing the leap from passive reaction to active prediction and improving the level of intelligence of control. Attached Figure Description

[0050] Figure 1 This is a general flowchart of the method in this invention;

[0051] Figure 2 This is a flowchart of the AI-enhanced synchronization method used in this invention. Detailed Implementation

[0052] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention. It should be noted that the selection of the first device and the second device in the present invention covers a variety of application scenarios, including but not limited to various combinations such as peer-to-peer synchronization between terminal devices and servers, between IoT devices and edge gateways, between wearable devices and mobile phones, between vehicle-mounted devices and cloud platforms, and between edge nodes.

[0053] Example 1

[0054] This embodiment uses the synchronization of business data between a smart terminal device (first device) and a cloud server (second device) as a typical scenario. The smart terminal can be a smartphone, tablet, POS machine, self-service terminal, or other mobile or fixed terminal device. When synchronization of transaction data to the server fails, the retry strategy is no longer a fixed or simple exponential backoff, but rather a dynamic decision made by a set of intelligent algorithms. (See [link to relevant documentation]). Figure 1 .

[0055] S1: Determine the error type corresponding to the data synchronization failure, and obtain preset adjustment parameters based on the error type.

[0056] First, determine the error type corresponding to this synchronization failure. The error types should include at least the following three categories:

[0057] A. Network errors, such as network timeout, connection refused, authentication failure;

[0058] B. Internal server anomalies, such as server overload or internal processing errors;

[0059] C. Local I / O errors in smart terminals, such as insufficient storage space, database lock waits, file read / write failures, etc.

[0060] The following definitions are made for various types of errors:

[0061] Based on the identified error type, the corresponding adjustment parameters are retrieved from the preset configuration table. These adjustment parameters include the base wait time. and exponential retreat factor Among these, network errors have a shorter base wait time, while internal server anomalies and local I / O errors have a longer base wait time. (Exponential backsliding factor) The value can be adjusted based on the error type. For example, it can be 2 for network error-related (100X) errors, and 3 for server error-related (11XX) or local I / O error-related (15XX) errors. This is because network errors are usually transient and can be recovered quickly, while the recovery from server internal anomalies and local I / O errors takes longer.

[0062] S2: Obtain the current state of the smart terminal device and calculate the state adjustment factor based on the current state.

[0063] Obtain the real-time status of the smart terminal, including battery level, CPU load rate, memory usage, storage I / O latency, network signal strength, etc.

[0064] Equipment status adjustment factor Detailed calculation method:

[0065] First, monitor the equipment status indicators. To comprehensively assess the equipment status, the system needs to monitor the following key indicators in real time:

[0066] 1. Battery level, range: 0% ~ 100%, low battery threshold: for example, set to 20%;

[0067] 2. CPU load rate, range: 0% ~ 100%, high load threshold: for example, set to 80%;

[0068] 3. Memory usage rate, range: 0% ~ 100%, high memory usage threshold: for example, set to 85%;

[0069] 4. Storage I / O latency, unit: milliseconds (ms), high latency threshold: for example, set to 100ms;

[0070] 5. Network signal strength: For mobile devices (such as Android), refer to RSSI or signal level (such as 0 ~ 4). Weak signal threshold: for example, a signal strength of 2 bars.

[0071] After obtaining the equipment status indicators, the equipment status adjustment factor... Based on the weighted calculation of the above indicators, the formula is as follows:

[0072]

[0073] in:

[0074] These are the weighting coefficients for each indicator. .

[0075] The weight allocation design is as follows:

[0076] If a battery is present, the weight is: battery weight: 0.4; CPU weight: 0.2; memory weight: 0.1; storage weight: 0.1; network weight: 0.2. If no battery is present, the battery weight should be evenly distributed among the other indicators, totaling 1.

[0077] These are the normalized values ​​for each state index. This is the penalty function for each metric, reflecting the amplified effect of that metric on the retry interval.

[0078] The penalty functions for each state indicator are designed as follows:

[0079] The basic principle is that the lower the battery level, the greater the penalty; the higher the CPU load, the greater the penalty; the higher the memory usage, the greater the penalty; the higher the local I / O latency, the greater the penalty; and the weaker the signal, the greater the penalty.

[0080] Calculation Example: Assume a POS machine with the following parameters: battery level B = 15%; CPU load C = 70%; memory usage M = 80%; storage latency S = 50ms, i.e., 50ms / 100ms = 50%; network signal strength N = level 1, i.e., level 1 / 4 = 25%.

[0081] Then the device: ,

[0082] That is, the retry interval should be extended by 76%. =1.76.

[0083] Introducing equipment condition adjustment factor When the terminal device is in a poor state, such as low battery, high CPU load, memory shortage, high I / O latency, or weak network signal, the retry interval is significantly increased to reduce energy consumption and prevent device overheating or lag. Device state adjustment factor. Taking into account the real-time status of the terminal equipment, the interval of synchronization retry is dynamically adjusted to balance the two goals of "completing synchronization as soon as possible" and "ensuring stable operation of the equipment".

[0084] S3: Calculate the waiting time for the next synchronization attempt based on the adjustment parameters obtained in step S1 and the state adjustment factor obtained in step S2.

[0085] The waiting time is calculated using a modified exponential backoff time, the first... Waiting time for retry The calculation is as follows:

[0086]

[0087] In the formula, The value is a random jitter, ranging from ±1 to ±60 seconds.

[0088] The above calculations can be used to determine the time interval until the next data synchronization, i.e., the waiting time. .

[0089] S4: After the waiting time, perform the next data synchronization.

[0090] The terminal device waited for the waiting time calculated in step S3. Then, perform the next data synchronization.

[0091] S5: Result judgment and loop control. Specifically, it determines whether the next data synchronization was successful:

[0092] If successful, the process ends;

[0093] If the synchronization fails, record the number of synchronization failures. and judge Has the preset maximum number of retries N been reached?

[0094] If the maximum number of retries N is not reached, return to step S1 and re-execute adaptive adjustment based on the new failure situation and the latest device status;

[0095] If the maximum number of retries N has been reached, the process will end or the preset exception handling will be executed, such as logging errors, triggering alarms, or switching to offline mode.

[0096] Example 2

[0097] like Figure 2 As shown, to further enhance the system's adaptability and intelligence in complex and ever-changing environments, this embodiment introduces multi-level artificial intelligence technology. Based on AI learning, a closed-loop system of "learning-prediction-decision-optimization" is constructed to achieve the evolution from static rules to dynamic intelligence. Embodiment 2 is a further improvement on Embodiment 1, mainly reflected in the weighting coefficients in Embodiment 1. arrive The update, as well as the AI-enhanced synchronous success rate prediction and strategy adaptation steps.

[0098] Dynamic weighting coefficients The algorithm's goal is to automatically learn the impact of various device status indicators (battery, CPU, memory, storage, network, etc.) on the synchronization success rate based on historical synchronization data, and generate dynamic weighting coefficients. To replace the original weighting coefficients That is, manually preset fixed weights .

[0099] The algorithm flow is as follows:

[0100] 1. Data Collection: Collect historical synchronization records, including recording feature vectors after each synchronization attempt on the terminal device, including a status indicator vector X and the corresponding synchronization result Y:

[0101] X = [B(Battery), C(CPU), M(Memory), S(Storage I / O), N(Network Signal)]

[0102] Y = {0: failure, 1: success}

[0103] 2. Cloud Aggregation and Training: Historical synchronization records are input into a machine learning model for training to calculate the importance of each state indicator on the synchronization success rate. For example, once every night, the feature data of each terminal is encrypted and uploaded to the cloud. The cloud then uses the gradient boosting tree LightGBM to train a classification model on the historical 7-day feature data to calculate and extract feature importance scores.

[0104] 3. Normalize the feature importance to obtain dynamic weight coefficients. And distribute the update to the local terminal. The calculation formula replaces the original weighting coefficients. The new formula is as follows:

[0105]

[0106] 4. Strategy Deployment: Dynamic weight coefficients are deployed daily from the cloud. The terminal uses the dynamically assigned weight coefficients. Achieve adaptive weight evolution.

[0107] The synchronization success rate prediction and strategy adaptation steps are used to predict the success probability of this synchronization based on the current device status, and to dynamically adjust the retry strategy.

[0108] The steps for synchronization success rate prediction and strategy adaptation are as follows:

[0109] 1. Data Modeling:

[0110] Features: Normalized values ​​of 5 status indicators (battery, CPU, memory, storage, network) recorded over 7 days; feature vector X = [B(battery), C(CPU), M(memory), S(storage I / O), N(network signal)]; Label: "Synchronization result" Y for a single record, Y = {0: failure, 1: success}; the model outputs probabilities by fitting the result distribution of a large number of samples.

[0111] Model training: Deploy a lightweight gradient boosting tree model (e.g., LightGBM) locally on the terminal device and fit the relationship between features and synchronization results;

[0112] Probabilistic prediction: Input five status indicators of the current device, and the model outputs a value between 0 and 1, which is the probability of success of this synchronization. ;

[0113] Policy mapping:

[0114] like If the value is less than 0.2, enter "negative mode" and extend the retry interval. For example, in... × 1.2.

[0115] like >0.8, enter "aggressive mode" to shorten the retry interval. For example, in ×0.8.

[0116] If 0.2≤ ≤0.8, maintain the standard backoff strategy, and do not change the waiting time. .

[0117] Example 3

[0118] This embodiment is an adaptive data synchronization device, adapted to the adaptive data synchronization methods of embodiments 1 and 2, and is installed on a first device for synchronizing business data to a second device. The device includes an error type determination module, a parameter acquisition module, a status monitoring module, a status adjustment factor calculation module, a waiting time calculation module, a synchronization execution module, a failure handling module, and an AI enhancement module.

[0119] The error type determination module is used to determine the error type corresponding to the synchronization failure when data synchronization fails. In its implementation, this module is connected to the synchronization interface of the first device. When the synchronization operation throws an exception or returns an error code, the error type determination module captures and parses this information.

[0120] The parameter acquisition module is used to acquire preset adjustment parameters based on the error type. The parameter acquisition module is connected to a storage unit, which contains preset adjustment parameter configuration tables corresponding to different error types.

[0121] The status monitoring module is used to obtain the current status of the first device. The status monitoring module preprocesses the collected raw data, including outlier removal, unit conversion, etc., and outputs the normalized values ​​of each status indicator, with a value range of [0,1].

[0122] The state adjustment factor calculation module is used to calculate the state adjustment factor based on the current state. The formula for calculating the state adjustment factor is as follows:

[0123]

[0124] In the formula, The weighting coefficients for each state indicator representing the current state of a smart device. This is the penalty function for each state indicator.

[0125] The waiting time calculation module is used to calculate the waiting time for the next synchronization attempt based on the adjustment parameters and the state adjustment factor.

[0126] Waiting time The formula for calculation is:

[0127]

[0128] In the formula, The base waiting time comes from the parameter acquisition module. This is the exponential backslip factor, derived from the parameter acquisition module. This is the state adjustment factor, derived from the state adjustment factor calculation module. The value is a random jitter value, generated by a random number generator. In this embodiment, the value ranges from ±1 to ±60 seconds. Indicates proceeding to the first The first synchronization attempt;

[0129] The synchronization execution module is used to perform the next data synchronization after the waiting time.

[0130] The synchronization execution module encapsulates the specific synchronization protocol and data transmission logic, and is responsible for establishing a connection with the server and completing the data synchronization operation. This module includes the following sub-functions:

[0131] Connection management: Establishes connections with the server according to synchronization protocols (such as HTTP, MQTT, CoAP, etc.);

[0132] Data transmission: Encapsulate the data to be synchronized into a protocol format and send it;

[0133] Result reception: Receive synchronization results or error messages returned by the server;

[0134] Timeout control: Set a reasonable synchronization timeout to avoid infinite waiting.

[0135] After the synchronization module finishes execution, it outputs the synchronization result (success / failure) and possible error information to the failure handling module.

[0136] The failure handling module is used to determine whether the next data synchronization performed by the synchronization execution module is successful, and to perform corresponding processing based on the result.

[0137] The failure handling module includes the following logic:

[0138] Successful processing: If synchronization is successful, the entire synchronization process will end and the relevant states will be cleared.

[0139] Failure handling: If synchronization fails, perform the following operations:

[0140] Record the number of synchronization failures and maintain a counter. .

[0141] judge Has the preset maximum number of retries been reached? (For example ):

[0142] like If this happens, the error type determination module will be triggered to re-execute a new round of adaptive adjustments;

[0143] like Reaching the maximum number of retries If the error occurs, the process will end or the preset exception handling will be executed.

[0144] Exception handling: When the maximum number of retries is reached, one or more of the following exception handling methods can be executed:

[0145] Record error logs, including information such as the cause of failure and the final status;

[0146] Trigger an alarm to notify the user or administrator;

[0147] The data is temporarily stored locally and will be manually synchronized later.

[0148] Switch to offline mode to continue collecting data but without attempting to synchronize.

[0149] The AI ​​enhancement module is used to perform dynamic updates of weight coefficients and predict and adaptively adjust the success rate through machine learning.

[0150] Example 4

[0151] Embodiment 4 of the present invention relates to a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method in Embodiment 1 or 2. The computer-readable storage medium can be various forms of storage media, including but not limited to: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid-state drive (SSD), optical disk (CD-ROM, DVD), magneto-optical disk, floppy disk, magnetic tape, etc. The storage medium can be non-transitory or transient, but a non-transitory computer-readable storage medium is preferred.

[0152] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An adaptive data synchronization method for synchronizing data from a first device to a second device, characterized in that, If data synchronization fails, the following adaptive adjustment steps will be executed: S1: Determine the error type corresponding to the synchronization failure, and obtain the preset adjustment parameters based on the error type; S2: Obtain the current state of the first device and calculate the state adjustment factor based on the current state; S3: Calculate the waiting time for the next synchronization attempt based on the adjustment parameters and the state adjustment factor; S4: After the waiting time, perform the next data synchronization; S5: Determine whether the next data synchronization is successful. If successful, the process ends; if it fails, record the number of synchronization failures and determine whether the preset maximum number of retries has been reached. If the maximum number of retries has not been reached, return to S1; If the maximum number of retries has been reached, the process will end or a preset exception handling will be executed. The preset adjustment parameters include the base waiting time and the exponential backsliding factor, with the waiting time... The formula for calculation is: , In the formula, Based on waiting time, As an indexed retreat factor, For state adjustment factor, This is a random jitter value. Indicates proceeding to the first The first synchronization attempt; The formula for calculating the state adjustment factor is: , In the formula, The weighting coefficients for each state index representing the current state of the first device, This is the penalty function for each state indicator.

2. The adaptive data synchronization method as described in claim 1, characterized in that, Error types include network errors between the first and second devices, internal anomalies of the second device, and local I / O errors of the first device. The base latency and exponential backoff factor for network errors between the first and second devices are smaller than those for internal anomalies of the second device and local I / O errors of the first device, respectively.

3. The adaptive data synchronization method as described in claim 2, characterized in that, The status indicators of the first device include battery level, CPU load rate, memory utilization, storage I / O latency, and network signal strength. Among them, for battery level and network signal strength, the penalty function is negatively correlated with the value of the status indicator; for CPU load rate, memory utilization, and storage I / O latency, the penalty function is positively correlated with the value of the status indicator.

4. The adaptive data synchronization method as described in claim 1, characterized in that, It also includes AI-enhanced dynamic weight update steps: Collect historical synchronization records, which include a state index vector X and the corresponding synchronization result Y at each synchronization attempt; The historical synchronization records are input into a machine learning model for training to calculate the importance of each state indicator on the synchronization success rate. Based on the dynamic weight coefficients obtained after normalization of the influence importance. To replace the original weighting coefficients .

5. The adaptive data synchronization method as described in claim 1, characterized in that, It also includes AI-enhanced synchronization success rate prediction and strategy adaptation steps: Obtain the current status information of the first device and input it into the machine learning model; The machine learning model is used to predict the success probability of the next synchronization. ; Based on the success probability The waiting time is dynamically adjusted based on the threshold range in which it falls. .

6. In the adaptive data synchronization method as described in claim 5, dynamically adjusting the waiting time specifically involves: like <First predetermined value, extend the waiting time ; like >Second predetermined value, shorten the waiting time ; If the first predetermined value ≤ ≤Second predetermined value, without changing the waiting time .

7. The adaptive data synchronization method according to any one of claims 4 to 6, characterized in that, The machine learning model uses a gradient boosting tree model.

8. An adaptive data synchronization device, disposed in a first device, for synchronizing data with a second device, characterized in that, The device includes: The error type determination module is used to determine the error type corresponding to the data synchronization failure when the data synchronization fails. The parameter acquisition module is used to acquire preset adjustment parameters based on the error type; The status monitoring module is used to obtain the current status of the first device; A state adjustment factor calculation module is used to calculate a state adjustment factor based on the current state. The waiting time calculation module is used to calculate the waiting time for the next synchronization attempt based on the adjustment parameters and the state adjustment factor. The synchronization execution module is used to perform the next data synchronization after the waiting time. The failure handling module is used to determine whether the next data synchronization will be successful. If successful, the process ends; if it fails, the number of synchronization failures is recorded, and it is determined whether the preset maximum number of retries has been reached. If the maximum number of retries is not reached, the error type determination module is triggered to re-execute; If the maximum number of retries has been reached, the process will end or a preset exception handling will be executed. The preset adjustment parameters include the base waiting time and the exponential backsliding factor, with the waiting time... The formula for calculation is: , In the formula, Based on waiting time, As an indexed retreat factor, For state adjustment factor, This is a random jitter value. Indicates proceeding to the first The first synchronization attempt; The formula for calculating the state adjustment factor is: , In the formula, The weighting coefficients for each state index representing the current state of the first device, This is the penalty function for each state indicator.

9. The adaptive data synchronization device as described in claim 8, characterized in that, The device also includes an AI enhancement module for performing dynamic updates of weight coefficients and predicting and adaptively adjusting the synchronization success rate through machine learning.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.