Data synchronization method and device, equipment and medium
By defining field association conditions and operation order during data synchronization, the problem of frequent failures in complex data synchronization tasks is solved, achieving efficient and reliable data synchronization and optimized user experience.
Patent Information
- Application Number
- CN202511117172.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies frequently fail in complex data synchronization tasks and cannot properly handle synchronization failures, leading to wasted system resources and worsening of problems.
By acquiring the data to be synchronized, determining whether the fields meet the preset association conditions, synchronizing the data according to the operation sequence, and introducing a time period and reminder mechanism in case of failure, the order and reliability of data synchronization are ensured.
A fault-tolerant mechanism was built, which reduced the operational burden of data synchronization, optimized the user experience, ensured the system operated efficiently after failure, and reduced manual intervention.
Smart Images

Figure CN120980093A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data processing, and in particular, to a data synchronization method, device, equipment and medium. BACKGROUND
[0002] In the actual operation of data synchronization, data synchronization often faces many challenges. On the one hand, when the synchronization task involves multiple fields or complex logic, the traditional method is difficult to handle complex synchronization tasks due to the lack of field and complex logic decomposition, and synchronization failure occurs frequently. On the other hand, the traditional data synchronization method also has obvious shortcomings when synchronization fails. Once the synchronization fails, the system can only perform simple repeated attempts, and such blind retries not only consume a lot of system resources, but also may cause the problem to worsen. SUMMARY
[0003] In view of the above problems, the present application embodiment is proposed in order to provide a data synchronization method, device, equipment and medium which overcomes the above problems of frequent failure of complex data synchronization tasks and cannot properly handle synchronization failure or at least partially solves the above problems of frequent failure of complex data synchronization tasks and cannot properly handle synchronization failure.
[0004] In order to solve the above problems, the present application embodiment discloses a data synchronization method, which comprises:
[0005] Obtaining to-be-synchronized data; the to-be-synchronized data comprises at least one field;
[0006] Determining whether the at least one field meets a preset association condition;
[0007] In the case that the at least one field meets the preset association condition, determining an operation order of an operation required for the to-be-synchronized data to perform data synchronization;
[0008] According to the operation order, performing data synchronization on the to-be-synchronized data;
[0009] In the case that the to-be-synchronized data fails to synchronize, determining a first time period corresponding to the to-be-synchronized data, and according to the first time period and the operation order, re-performing data synchronization on the to-be-synchronized data;
[0010] After re-performing data synchronization, if the to-be-synchronized data fails to synchronize within a preset time window, outputting a prompt information to a user, the prompt information being used to remind the user to perform manual data synchronization on the to-be-synchronized data.
[0011] Optionally, the determining whether the at least one field meets the preset association condition comprises:
[0012] determine whether the at least one field has a storage dependency and / or an update constraint relationship;
[0013] in a case where the at least one field has a field storage dependency and / or a field update constraint relationship, determine that the at least one field meets a preset association condition.
[0014] Optionally, the determining whether the at least one field meets the preset association condition comprises:
[0015] determine whether the to-be-synchronized data has an operation sequence requirement and / or a version tracking requirement;
[0016] in a case where the to-be-synchronized data has a specific sequence requirement and / or a version tracking requirement, determine that the at least one field meets the preset association condition.
[0017] Optionally, the determining whether the at least one field meets the preset association condition comprises:
[0018] obtain historical synchronization data corresponding to the at least one field;
[0019] determine whether the historical synchronization data corresponding to the respective fields has field correlation;
[0020] in a case where the historical synchronization data corresponding to the at least one field has field correlation, determine that the at least one field meets the preset association condition.
[0021] Optionally, the determining whether the at least one field meets the preset association condition comprises:
[0022] obtain historical synchronization data corresponding to the at least one field;
[0023] determine an update change rule of the historical synchronization data corresponding to the respective fields;
[0024] determine, according to the update change rule of the historical synchronization data, whether updates of the historical synchronization data corresponding to the respective fields have a causal relationship;
[0025] in a case where the updates of the historical synchronization data corresponding to the respective fields have a causal relationship, determine that the at least one field meets the preset association condition.
[0026] Optionally, the determining, in a case where the to-be-synchronized data fails to be synchronized, a first time period corresponding to the to-be-synchronized data comprises:
[0027] obtain a basic time interval and an exponentially increasing sequence corresponding to the to-be-synchronized data;
[0028] The base time interval is sequentially multiplied by each element of the exponentially increasing sequence to determine a retry time sequence;
[0029] The retry time sequence is determined as a first time period corresponding to the to-be-synchronized data.
[0030] Optionally, the method further comprises:
[0031] The number of times of re-performing the data synchronization and the execution time are recorded;
[0032] In a case where the number of times of the data synchronization is equal to a preset number threshold or the execution time exceeds a preset time threshold, a second time period corresponding to the to-be-synchronized data is determined, and the to-be-synchronized data is subjected to timed data synchronization according to the second time period and the operation sequence.
[0033] In another aspect, the present application further provides a data synchronization device, which comprises:
[0034] A data acquisition module is configured to acquire to-be-synchronized data; the to-be-synchronized data comprises at least one field;
[0035] An association condition determination module is configured to determine whether the at least one field satisfies a preset association condition;
[0036] An operation sequence determination module is configured to determine an operation sequence of operations required for the to-be-synchronized data to perform data synchronization in a case where the at least one field satisfies the preset association condition;
[0037] A data synchronization module is configured to perform data synchronization on the to-be-synchronized data according to the operation sequence;
[0038] A retry synchronization module is configured to determine a first time period corresponding to the to-be-synchronized data in a case where the to-be-synchronized data fails to be synchronized, and re-perform data synchronization on the to-be-synchronized data according to the first time period and the operation sequence;
[0039] A reminding output module is configured to output reminding information to a user in a case where the to-be-synchronized data fails to be synchronized within a preset time window after re-performing the data synchronization, the reminding information being used to remind the user to perform manual data synchronization on the to-be-synchronized data;
[0040] Optionally, the association condition determination module comprises:
[0041] A first relationship determination submodule is configured to determine whether the at least one field has a storage dependency relationship and / or an update constraint relationship;
[0042] The first association condition determining submodule is configured to determine that the at least one field satisfies a preset association condition when the at least one field has a field storage dependency relationship and / or a field update constraint relationship.
[0043] Optionally, the association condition determining module comprises:
[0044] The second relationship determining submodule is configured to determine whether the to-be-synchronized data has an operation sequence requirement and / or a version tracking requirement.
[0045] The second association condition determining submodule is configured to determine that the at least one field satisfies a preset association condition when the to-be-synchronized data has a specific sequence requirement and / or a version tracking requirement.
[0046] Optionally, the association condition determining module comprises:
[0047] The first historical data obtaining submodule is configured to obtain historical synchronization data corresponding to the at least one field.
[0048] The third relationship determining submodule is configured to determine whether the historical synchronization data corresponding to the respective fields has a field correlation.
[0049] The third association condition determining submodule is configured to determine that the at least one field satisfies a preset association condition when the historical synchronization data corresponding to the at least one field has a field correlation.
[0050] Optionally, the association condition determining module comprises:
[0051] The second historical data obtaining submodule is configured to obtain historical synchronization data corresponding to the at least one field.
[0052] The change rule determining submodule is configured to determine an update change rule of the historical synchronization data corresponding to the respective fields.
[0053] The fourth relationship determining submodule is configured to determine, according to the update change rule of the historical synchronization data, whether the update of the historical synchronization data corresponding to the respective fields has a causal relationship.
[0054] The fourth association condition determining submodule is configured to determine that the at least one field satisfies a preset association condition when the update of the historical synchronization data corresponding to the respective fields has a causal relationship.
[0055] Optionally, the retry synchronization module comprises:
[0056] The interval determining submodule is configured to obtain a basic time interval and an exponentially increasing sequence corresponding to the to-be-synchronized data.
[0057] The time sequence determining submodule is configured to multiply the base time interval sequentially with each element of the exponential increasing sequence to determine a retry time sequence;
[0058] The time period determining submodule is configured to take the retry time sequence as a first time period corresponding to the to-be-synchronized data.
[0059] Optionally, the apparatus further comprises:
[0060] The retry parameter determining submodule is configured to record the number of times of re-performing the data synchronization and the execution time;
[0061] The timing synchronization submodule is configured to determine a second time period corresponding to the to-be-synchronized data when the number of times of the data synchronization is equal to a preset number threshold or the execution time exceeds a preset time threshold, and perform timing data synchronization on the to-be-synchronized data according to the second time period and the operation sequence.
[0062] Correspondingly, an electronic device is disclosed, which comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and the computer program implements each step of the above-mentioned data synchronization method embodiment when executed by the processor.
[0063] Correspondingly, a computer readable storage medium is disclosed, which stores a computer program, and each step of the above-mentioned data synchronization method embodiment is implemented when the computer program is executed by a processor.
[0064] The embodiment of the present application comprises the following advantages: by acquiring the to-be-synchronized data; the to-be-synchronized data comprises at least one field; determining whether the at least one field satisfies a preset association condition, in the case that the at least one field satisfies the preset association condition, determining the operation order of the operation required by the to-be-synchronized data for data synchronization, ensuring that the field structure and complex logic can be correctly processed, and the complex data synchronization problem can be correctly handled, by determining a first time period corresponding to the to-be-synchronized data in the case that the to-be-synchronized data fails to be synchronized, and re-performing data synchronization on the to-be-synchronized data according to the first time period and the operation order; after re-performing data synchronization, if the to-be-synchronized data fails to be synchronized within a preset time window, outputting a prompt information to a user, the prompt information is used to remind the user of a manual data synchronization manner of the to-be-synchronized data, after synchronization fails, the first time period and the operation order are introduced to re-perform synchronization, and the user is only reminded to manually handle when necessary, thereby greatly reducing the operation burden of data synchronization, optimizing the user experience, and constructing a complete fault-tolerant mechanism through operation order arrangement and time period design. This mechanism enables the system to still operate efficiently after data retry synchronization fails, thereby properly handling the data synchronization failure problem. BRIEF DESCRIPTION OF DRAWINGS
[0065] Figure 1 is a step flow chart of an embodiment of a data synchronization method of the present application;
[0066] Figure 2 is an execution flow schematic diagram of an embodiment of a data synchronization method of the present application
[0067] Figure 3 is a structure block diagram of an embodiment of a data synchronization device of the present application. DETAILED DESCRIPTION
[0068] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0069] One of the core ideas of the embodiment of the present application is that a complete fault-tolerant mechanism is constructed through operation order arrangement and time period design, so that the system can still operate efficiently after data retry synchronization fails.
[0070] REFERENCE Figure 1 , a step flow chart of an embodiment of a data synchronization method of the present application is shown, which can specifically comprise the following steps:
[0071] Step 101, acquiring to-be-synchronized data; the to-be-synchronized data comprises at least one field;
[0072] Data synchronization refers to copying or updating data from one system, device or storage location to another to ensure that the data on both sides is consistent. It often occurs in the following scenarios:
[0073] User multi-device, or multi-user multi-device scenarios: In the modern technological environment, a user often has multiple smart devices, such as smartphones, tablets and laptops, and multiple users also have multiple devices associated with each other. For example, when a user adds a new contact on a mobile phone, the system will synchronize the change information through data synchronization such as cloud services to update the contact list on other associated devices such as tablets and computers. In this way, the user can access complete contact information on any device.
[0074] Server and client scenarios: such as web browser and user data synchronization on the server, ensuring that users see the same information when logging in on different devices. This scenario is common in modern web applications. For example, an online document editing platform application, users can access the online document editing platform application through smart mobile devices such as mobile phones, computers and other devices. At this time, these mobile devices are equivalent to a client device, when the user edits the document on the client, the changes made will be continuously synchronized to the server of the online document editing platform application. In this way, even in the scenario where the user's client is damaged or cannot be used, the user's edited document data will not be lost, and the user can continue to edit the previously edited document by logging in to the account using other devices.
[0075] Database scenarios: Enterprise data storage or data interaction cannot be separated from data interaction between different databases; generally, different departments use different database systems. For example, the sales department and the finance department. When the sales department enters a new order data, in order for the finance department to account in time, the order related data needs to be synchronized to the database used by the finance department. The data synchronization method in this application can be applied on the server, or on the software synchronization service or software synchronization tool;
[0076] Because of the different application scenarios, there are many ways of data synchronization, such as unidirectional synchronization and bidirectional synchronization divided by the direction of data synchronization. Unidirectional synchronization refers to data flowing from one source to one destination. For example, the main database in an enterprise synchronizes data to the backup database. After the data in the main database is updated, the updates will flow to the backup database, but if the backup database finds data changes, it will not feedback to the main database. This method is suitable for data backup scenarios and ensures that there is a usable copy when the source data is problematic; bidirectional synchronization refers to data flowing between two or more storage locations. For example, when a folder on one computer is modified, the modification will be synchronized to the other computer; conversely, the modification on the other computer will be synchronized back to the first computer. This synchronization method is commonly used in collaborative work environments, allowing multiple users to operate on the same set of data and maintaining data consistency.
[0077] If divided by the synchronization time, it can be divided into real-time synchronization and timing synchronization. Real-time synchronization refers to data being synchronized immediately after it changes. For example, in a stock trading system, when the stock price changes, this information needs to be synchronized in real time to all relevant trading platforms and display terminals so that investors can make timely decisions. This synchronization method requires the system to have high response speed and reliability. Timing synchronization refers to synchronization at a pre-set time interval. For example, some enterprise log data synchronization will synchronize the log data of each day from various business servers to the central log server for analysis and storage at a fixed time each day. This method can reduce resource consumption when the system synchronizes at a high frequency and is suitable for scenarios where real-time data requirements are not high.
[0078] If divided by the synchronization granularity, the data synchronization method can be divided into full synchronization and incremental synchronization. Full synchronization refers to transmitting all data each time. For example, in some small data backup scenarios, each backup operation will completely copy the entire data set to the backup storage device. This method is simple and direct, but when the data volume is large, it will consume a lot of storage space and transmission bandwidth. Incremental synchronization refers to synchronizing only the data that has changed since the last synchronization. For example, if there are 100 files in a folder and only one file has been modified since the last synchronization, incremental synchronization will only transmit the modified file, rather than retransmit all files in the entire folder. This method can effectively save transmission resources and improve synchronization efficiency.
[0079] Generally, before data synchronization, the data to be synchronized is first obtained. Depending on the incremental synchronization or full synchronization mentioned above, all data or data changed since the last synchronization can be selected as the data to be synchronized. How to select the data to be synchronized can be changed at will according to business requirements. The field can be understood as a specific attribute or component of the data. For example, a customer record in a database can include multiple fields such as "customer number", "name", "phone number", etc. Even simple data has the most basic fields. For example, a simple numerical data, its value itself can be regarded as a field. Therefore, when obtaining the data to be synchronized, the field content contained in the data should be determined, so that the synchronization process can complete and accurately process all related information of the data.
[0080] In step 102, it is determined whether the at least one field satisfies a preset association condition.
[0081] In the embodiment of the present application, the preset association condition includes business association data requirements and the association relationship between fields. The business association data requirements refer to rules set from specific business requirements. For example, for customer data, the "region" field may require to belong to certain specific cities, and the "consumption level" field requires to reach a certain level to perform synchronization operation. The association relationship between fields refers to the logical relationship between fields. For example, the "order amount" field is associated with the "product quantity" and "product unit price" fields, and the relationship of order amount = product quantity * product unit price should be met under normal circumstances.
[0082] By checking whether the field satisfies the preset association condition, it can be ensured that the data is accurate at the business level and the logical level. If only the business association data requirements are considered, the internal logic error of the data can be ignored; if only the association relationship between fields is considered, it can not meet the business requirements. The combination of the two can comprehensively screen the data.
[0083] For example, in an inventory management system, the inventory data to be synchronized has fields such as "product number", "inventory quantity", "purchase price", etc. The "product number" needs to meet the coding rules of the company (business requirements), and at the same time, the "inventory quantity" should match the previous inventory record, purchase record and sales record, and the "purchase price" should also be kept within a reasonable range according to the supplier contract and historical purchase data and be logically consistent with other related fields. Only the data that meets these comprehensive conditions is accurate and reliable.
[0084] And, when there is a correlation between fields, data synchronization is sensitive to order. For example, there is a correlation between the "inventory quantity" field and the "sales volume" field, and the "inventory quantity" is synchronized first and then the "sales volume" is synchronized, because the sales volume depends on the change of the inventory quantity. If not in order, it may lead to unreasonable situations such as the sales volume being greater than the inventory quantity. For the case of multiple field correlations, such as the "task start time", "task end time", "task progress", "task resource allocation" fields of a project management system, they should be synchronized in a reasonable order, such as synchronizing the "task start time" first, then the "task resource allocation", then the "task progress", and finally the "task end time", to ensure that each field is based on the data of the previously synchronized fields, and to ensure accuracy.
[0085] Generally, only data that meets the preset correlation conditions is valid data, and such data can be normally used after being synchronized to the target system. Otherwise, incorrect or abnormal data may cause the functions of the target system to be disordered or cause decision-making errors. For example, in the scenario of synchronizing financial data, the reimbursement data to be synchronized includes the "reimbursement person", "reimbursement amount", "reimbursement item" and other fields. The "reimbursement person" needs to be a personnel in the company employee list based on business requirements, the "reimbursement amount" needs to be consistent with the attached invoice amount and not exceed the company's prescribed reimbursement limit, and the "reimbursement item" needs to match the company's reimbursement policy. In addition, the "reimbursement amount" may also have a correlation with the budget allocation of the "reimbursement item". Only the reimbursement data that meets all these preset correlation conditions is valid and can be used for subsequent synchronization operations and financial accounting purposes.
[0086] Moreover, due to the correlation between fields during synchronization, more stringent integrity checks are required. For example, when synchronizing customer order data, the "order number" and "product information" fields have been synchronized, and the correlation with the "product information" needs to be checked before and after synchronizing the "payment amount" to ensure the integrity of the order data. In addition, there should be a perfect rollback mechanism. If it is found that a field does not meet the preset correlation conditions and affects the synchronization of other related fields, it needs to be rolled back to the previous state. For example, when synchronizing the "income", "expense" and "profit" fields of financial data, if the "profit" field does not match the previous two, a rollback operation is required to prevent the generation of incorrect records.
[0087] The following four exemplary embodiments are proposed. In the first exemplary embodiment, step 102 can include the following content:
[0088] determining whether the at least one field has a storage dependency relationship and / or an update constraint relationship;
[0089] In the case where the at least one field has a field storage dependency relationship and / or a field update constraint relationship, it is determined that the at least one field meets the preset correlation conditions.
[0090] Field storage dependency refers to the data storage of one field depending on the existence or state of another field. For example, in a database, the "employee salary level" field can depend on the storage of the "employee seniority" field. Only when the "employee seniority" field has been correctly stored, can the "employee salary level" field be reasonably stored. In the data synchronization scenario, if the "employee seniority" field in the source data has not been synchronized to the target system and correctly stored first, the synchronization of the "employee salary level" field will be problematic, as it lacks the necessary underlying data for correct calculation or assignment. As mentioned above, the association between fields affects the order sensitivity of data synchronization. One specific manifestation is the field storage dependency. When determining whether a field meets the preset association condition, it is first necessary to determine whether such a storage dependency exists. If it does, synchronization operations need to be performed in a certain order to ensure that the dependent field is processed first.
[0091] Field update constraint refers to the update of one field needing to follow the constraint rules related to another field. For example, the update of the "inventory remaining quantity" field is constrained by the "sold quantity" field. In each update of the "inventory remaining quantity", the current "sold quantity" must be considered, and the situation of inventory remaining quantity being less than zero, i.e., exceeding the sold quantity, must not occur. When performing data synchronization, if the "sold quantity" field in the source data has changed, the synchronization of the "inventory remaining quantity" field must comply with this constraint relationship, otherwise it will lead to inaccurate inventory data. This constraint is related to the data integrity check mentioned earlier. In the synchronization process, in order to ensure the validity and consistency of the data, the update constraint relationship between fields needs to be checked. If it is found that the update of a field violates the constraint relationship with other fields, measures need to be taken, such as rollback operation or recalculation of the value of the field, to ensure that the entire data set meets the preset association condition.
[0092] If it is determined that a field has one or both of these two relationships, it can be determined that the field meets the preset association condition, which reflects the internal relationship between fields. In the actual data synchronization process, this embodiment helps to more accurately handle the relationship between fields. For example, in the scenario of synchronizing customer data in an enterprise customer relationship management system, there can be a storage dependency between the "customer credit limit" field and the "customer historical transaction amount" field, i.e., the credit limit depends on the historical transaction amount to set; the update constraint relationship can be that the update of the credit limit cannot violate the rules based on the historical transaction amount. According to this exemplary embodiment, the relationship between the two fields can be first determined, and then the synchronization order, integrity check, and rollback mechanism can be reasonably arranged according to the relationship, so as to ensure the accuracy and effectiveness of data synchronization.
[0093] In the second exemplary embodiment, step 102 can include the following contents:
[0094] determining whether there are operation sequence requirements and / or version tracking requirements for the to-be-synchronized data;
[0095] In the case where there are specific sequence requirements and / or version tracking requirements for the to-be-synchronized data, determining whether the at least one field meets the preset correlation condition.
[0096] The operation sequence requirement refers to the requirement that the processing of the to-be-synchronized data must follow a specific sequence. For example, in project management data, the operation of the “task creation” field should be prior to the operation of the “task assignment” field, and the operation of the “task assignment” field should be prior to the operation of the “task completion” field. In the data synchronization scenario, if the fields in the source data are not synchronized in the correct order, it will cause the data logic in the target system to be chaotic. For example, the task assignment information is synchronized in the case where the task is not created, which is not reasonable in the business logic. This is closely related to the sequence sensitivity of data synchronization mentioned above. The operation sequence requirement is from the perspective of the entire to-be-synchronized data, further emphasizing the importance of the sequence in the data synchronization process. It is an important factor for judging whether the field meets the preset correlation condition, because only the field data that meets the operation sequence requirement can guarantee the logical correctness after data synchronization.
[0097] The version tracking requirement refers to the requirement for recording and managing different versions of the to-be-synchronized data. For example, in a document collaborative editing system, each modification of a document will generate a new version. In data synchronization, it is necessary to be able to track the modification content, modification time, and modifier of each version and other information. When synchronizing such data with version tracking requirements, if the information of different versions cannot be accurately identified and synchronized, it may cause data loss or confusion. For example, when synchronizing code files in a software code library, if the version information is not correctly handled, important code modifications may be overwritten or incorrect code versions may be introduced. This is related to the data integrity check and rollback mechanism mentioned above. Version tracking can be regarded as a more fine-grained data integrity guarantee means. Through version tracking, when data synchronization problems occur, the data of a specific version can be rolled back or re-synchronized according to the version information, so as to ensure that the data finally synchronized to the target system is complete and correct.
[0098] If the requirements are found in the data to be synchronized, it can be determined that at least one field satisfies the preset association condition, because these requirements reflect the inherent logic of the data in the operation process and version management, and are important embodiment of the association between fields and data validity guarantee. In the actual data synchronization process, the exemplary embodiment helps to better handle complex data. For example, when synchronizing the product development data of an enterprise, for product design document data, there may be strict operation sequence requirements such as conceptual design-preliminary design-detailed design and version tracking requirements to record the details of each design modification. According to this embodiment, it can be determined whether these requirements exist, and then the synchronization process is reasonably arranged according to the determination result. If there is an operation sequence requirement, the related field data is synchronized in sequence according to the sequence; if there is a version tracking requirement, the data information of different versions is accurately recorded and managed in the synchronization process, thereby ensuring the accuracy and traceability of the product design data synchronization.
[0099] In a third exemplary embodiment, step 102 can include the following content:
[0100] Obtaining historical synchronization data corresponding to the at least one field;
[0101] Determining whether the historical synchronization data corresponding to the respective fields exist field correlation;
[0102] In the case where the historical synchronization data corresponding to the at least one field exist field correlation, determining that the at least one field satisfies the preset association condition.
[0103] Obtaining historical synchronization data corresponding to at least one field means that the data records related to the current field to be synchronized that have been synchronized before are to be collected. For example, in a customer relationship management system, for the "customer purchase preference" field, its historical synchronization data may include information such as the customer's purchase category and purchase frequency at different time points in the past. These historical synchronization data provide an important reference basis for determining whether the field of the current data to be synchronized satisfies the preset association condition. By analyzing the historical data, potential rules and relationships between fields can be found. This is an extension of the association between fields mentioned above. The above mainly discusses the association from the field itself of the current data to be synchronized or from the design logic level, while the exemplary embodiment introduces historical synchronization data to further explore the implicit association between fields from the time dimension. It helps to more comprehensively understand the mutual influence between fields, so as to more accurately determine whether the preset association condition is satisfied.
[0104] Determine whether the historical synchronization data corresponding to each field has field correlation, where the correlation mainly refers to an implicit association. Taking the data of patients in a hospital as an example, for the fields of “patient age” and “disease type”, through clustering analysis or correlation analysis of the historical synchronization data or other data mining methods, it can be found that patients of certain age groups are more likely to suffer from specific types of diseases. This relationship cannot be directly derived from medical common sense, but is an implicit association obtained through data mining. In the data synchronization scenario, the discovery of such implicit relationships can help optimize the synchronization strategy. For example, when synchronizing the diagnosis and treatment data of patients, if the implicit association between age and disease type is known in advance, more accurate judgment can be made on the rationality and completeness of the data.
[0105] If it is found that the historical synchronization data corresponding to at least one field has field correlation, it can be determined that these fields meet the preset association condition, because such correlation reflects the long-term existence and certain stability of the relationship between fields, and is an important form of the association between fields. In the actual data synchronization process, this embodiment helps to discover the hidden value in the data. For example, when synchronizing the user behavior data of a social media platform, for the fields of “user attention topic” and “user participation activity”, through obtaining the historical synchronization data and using the preset data mining algorithm, the implicit association between the two fields can be mined, such as users who pay attention to certain specific topics are more likely to participate in a certain type of online activity. According to this embodiment, when synchronizing the current user behavior data, the implicit relationship mined can be used to optimize the data synchronization process, such as prioritizing the synchronization of key field data related to the implicit relationship, or classifying and synchronizing the data according to the implicit relationship, thereby improving the efficiency and accuracy of data synchronization.
[0106] In a fourth exemplary embodiment, step 102 can include the following content:
[0107] Obtain the historical synchronization data corresponding to the at least one field;
[0108] Determine the update change rule of the historical synchronization data corresponding to each field;
[0109] According to the update change rule of the historical synchronization data, determine whether the update of the historical synchronization data corresponding to each field has a causal relationship;
[0110] In the case where the update of the historical synchronization data corresponding to each field has a causal relationship, determine that the at least one field meets the preset association condition.
[0111] Obtaining the historical synchronization data corresponding to at least one field means collecting the data records related to the current field to be synchronized that have been synchronized before. For example, in a customer relationship management system, for the "customer purchase preference" field, its historical synchronization data can include the customer's purchase category, purchase frequency, and other information at different time points in the past. These historical synchronization data provide an important reference basis for determining whether the current field to be synchronized data meets the preset association condition. By analyzing the historical data, potential rules and relationships between fields can be found. This is an extension of the association relationship between fields mentioned above. The above mainly discusses the association relationship from the field of the current data to be synchronized itself or from the design logic level, while the exemplary embodiment introduces historical synchronization data to further explore the implicit association between fields from the time dimension. It helps to more comprehensively understand the mutual influence between fields, so as to more accurately determine whether the preset association condition is met.
[0112] Determining the update change rule of the historical synchronization data corresponding to each field is to find the trend or pattern of the field data change over time or other factors. Taking the "product price" and "product sales" fields in the sales data as an example, by analyzing their historical synchronization data, it can be found that there is a certain regularity between the periodic fluctuations of "product price" such as seasonal promotion discount and the growth of "product sales". In the data synchronization scenario, understanding this update change rule helps to predict the reasonableness of the current data to be synchronized. If the current "product sales" field data does not match the expected result according to the historical update change rule, there may be data anomalies. The update change rule can be an important reference for checking data integrity. If the current data violates the known update change rule, such as the case where the sales and price rules do not match, it is necessary to re-examine the data source or check whether there is a problem in the data synchronization process, so as to ensure the accuracy of the data after synchronization.
[0113] According to the update change rule of the historical synchronization data, it is determined whether the update of the historical synchronization data corresponding to each field has a cause-and-effect relationship. For example, in enterprise production data, the "raw material supply amount" field and the "product output" field are analyzed to find that when the raw material supply amount increases, the product output also increases after a certain time interval, and this relationship has stability and repeatability. Therefore, it is determined that there is a cause-and-effect relationship between the two. In the data synchronization process, the determination of the cause-and-effect relationship is crucial for understanding the logical structure and mutual influence of the data. It can help better arrange the synchronization order and avoid unreasonable data caused by incorrect synchronization order. Order sensitivity is mainly based on the determination of the synchronization order between fields, and the cause-and-effect relationship here further refines the basis for order arrangement from the perspective of historical data update. If it is determined that the field update has a cause-and-effect relationship, the data synchronization can be performed according to the cause-and-effect order, that is, the data of the field as the cause is synchronized first, and then the data of the field as the result is synchronized, thereby improving the logicality and effectiveness of data synchronization.
[0114] For the content mentioned in the above four exemplary embodiments, a field correlation analysis model can be constructed in sequence as a basis. Using this model, the above-mentioned methods can be used to distinguish the data types of the data to be synchronized. For example, the data can be divided into ordinary data and data synchronization operation order sensitive data. A global transaction identifier GTID (Global Transaction Identifier) can be generated for each piece of data synchronization operation order sensitive data to ensure the uniqueness and traceability of the data in the distributed system. GTID can be used as an identifier for data transmission and abnormal recovery process, facilitating traceability, idempotency control, and compensation logic execution. At the same time, the GTID and the version snapshot information before and after the corresponding operation are stored in the distributed database as the basis for subsequent synchronization and version rollback.
[0115] Step 103, determining the operation order of the operation required for the data synchronization of the to-be-synchronized data when the at least one field meets the preset correlation condition;
[0116] Only when the at least one field meets the preset correlation condition, the step of determining the operation order is entered.
[0117] For example, in a customer relationship management system, if the "customer credit level" field and the "customer consumption record" field do not meet the preset correlation conditions such as business rules and logical relationships between fields, direct data synchronization may damage the integrity and consistency of the data in the target system.
[0118] The storage dependency and update constraint relationship between fields directly affect the operation sequence. When the to-be-synchronized data itself has an associated condition, it can be considered that there is an operation sequence requirement in the data synchronization process of the to-be-synchronized data. A reasonable operation sequence can ensure that the data is transmitted and updated according to the correct logic in the synchronization process. For example, in financial data synchronization, for the "income", "expense", and "profit" fields, synchronization in a reasonable order can avoid the situation of incorrect profit calculation and ensure that the synchronized financial data accurately reflects the business status of the enterprise. When the data is synchronized to the target system according to the correct operation sequence, the relationship between each field can be consistent, thereby ensuring the data consistency of the entire system.
[0119] In step 104, the data synchronization is performed on the to-be-synchronized data according to the operation sequence.
[0120] The operation sequence is determined based on various bases such as field dependency relationship, operation sequence requirement, historical data rule, etc. that meet the preset associated condition. Not following this sequence may damage the integrity and consistency of the data. For example, in an inventory management system, if the "inventory quantity" field is synchronized first and then the "purchase quantity" field, but the update of the "inventory quantity" depends on the "purchase quantity", then it may lead to inventory data errors, such as negative inventory or sudden abnormal increase of inventory, etc.
[0121] According to the operation sequence, the to-be-synchronized data is synchronized field by field or data block by data block. Taking customer data in a customer relationship management system as an example, if the operation sequence is to synchronize "customer basic information" first, then "customer consumption record", and finally "customer credit rating". Then in the synchronization process, the data related to "customer basic information" will be transmitted from the source system to the target system and the update operation will be completed, and then the synchronization of "customer consumption record" and "customer credit rating" will be processed. In the process of data synchronization according to the operation sequence, data verification needs to be continuously performed. To ensure that each field or data block after synchronization meets the expectation and is consistent with the data that has been synchronized before. If a problem is found in the verification process, it may need to be adjusted according to the preset rules. For example, when synchronizing enterprise financial data, after synchronizing the "income" field in sequence, it is found that the sum of the "expense" field and the "profit" field does not meet the expected logical relationship of the already synchronized "profit" field. At this time, it may be necessary to recheck the data source of the "expense" field or adjust the synchronization method to ensure the accuracy of the data.
[0122] When the synchronization of all the data to be synchronized is completed according to the operation sequence, the data in the target system is logically consistent with the data in the source system. The relationship between the fields meets the preset association condition, whether it is the dependency relationship between the fields, the association requirement on the business or the rule revealed by the historical data, etc. The accurate data synchronization enables the target system to normally and stably play its function.
[0123] Step 105, in the case that the synchronization of the data to be synchronized fails, determining a first time period corresponding to the data to be synchronized, and re-performing data synchronization on the data to be synchronized according to the first time period and the operation sequence;
[0124] In the data synchronization process, the to-be-synchronized data may fail to be synchronized due to various reasons. For example, network interruption may cause incomplete data transmission, and source data or target data system failure may cause data to be unable to be correctly written. Once the synchronization failure is detected, the process flow of retrying synchronization needs to be started. For example, in the synchronization of enterprise financial data, if part of the data fails to be successfully transmitted to the target system due to network fluctuations during the synchronization of the "income" field data, this is considered as a synchronization failure. The first time period corresponding to the to-be-synchronized data is determined in order to clarify the time range of re-synchronizing the data. This time period may be set based on business requirements, data update frequency, or system recovery capability, etc. For example, for stock trading data with high real-time requirements, the first time period may be relatively short, such as a few minutes; and for some log data, the first time period may be relatively long, such as several hours. Taking an inventory management system as an example, if the inventory data fails to be synchronized, the first time period may be set to 10 minutes. This means that the to-be-synchronized inventory data needs to be re-synchronized within this 10-minute time range. Different data characteristics will affect the determination of the first time period. For frequently changing data with high real-time requirements, such as player state data in online games, the first time period will be relatively short, because long-time data asynchronization may seriously affect the game experience. For relatively stable data, such as enterprise fixed asset data, the first time period can be relatively long. According to the operation sequence determined before, the to-be-synchronized data is re-synchronized. This is because after the initial synchronization failure, the logical relationship between the data may have been destroyed, and re-synchronization according to the original operation sequence can maximize the consistency and integrity of the data. For example, in the data synchronization of a project management system, if the initial synchronization of the "task creation", "task allocation", "task completion" field data fails, the re-synchronization still needs to be performed in this order. The "task creation" field data is synchronized first to ensure that the basic information of the task is correct, and then the "task allocation" and "task completion" field data are synchronized in turn. The re-synchronization operation must be completed within the first time period. If the re-synchronization cannot be successfully completed within the specified time period, other emergency measures may need to be taken, such as suspending related business operations, notifying technical personnel to check the system, etc.
[0125] In an embodiment, step 105 can include the following sub-steps:
[0126] Sub-step S11, obtaining a basic time interval and an exponentially increasing sequence corresponding to the to-be-synchronized data;
[0127] The basic time interval is an initial time unit, which is the basis for constructing the retry time sequence. This time interval can be determined according to business requirements, system performance, and other factors of data synchronization. For example, in an enterprise internal data synchronization scenario, if the real-time requirement of data synchronization is not very high, the basic time interval can be set to 5 seconds; while for real-time financial transaction data synchronization, the basic time interval can be only 1 second. The exponential increasing sequence is a sequence of values that increases exponentially. A common form is a sequence that starts from 0 power and increases the power by a fixed base (such as 2), such as 2 0 , 2 1 , 2 2 , 2 3 ……, which is a sequence of 1, 2, 4, 8……. The introduction of the exponential increasing sequence in the retry mechanism after data synchronization failure is to avoid frequent invalid retry operations. If each retry is performed at a fixed time interval, it may attempt to synchronize multiple times in a short period of time, wasting system resources and possibly increasing the system load. Using an exponential increasing sequence can gradually increase the retry time interval, giving the system more time to recover or solve the problem that caused the synchronization failure.
[0128] Sub-step S12, multiplying the basic time interval by each element of the exponential increasing sequence in order to determine the retry time sequence;
[0129] Multiplying the basic time interval by each element of the exponential increasing sequence in order to determine the retry time sequence;
[0130] Sub-step S13, taking the retry time sequence as the first time period corresponding to the data to be synchronized.
[0131] If the retry time sequence is 5 seconds, 10 seconds, 20 seconds, 40 seconds, …, then in the case of data synchronization failure, the operation of re-synchronization will be attempted at these time points until success or reaching certain limiting conditions such as total number of retries or total time limit. This conversion makes the previously calculated retry time sequence directly become the basis for the time of the re-synchronization operation after data synchronization failure, providing clear time planning for the error handling link in the entire data synchronization process. The first time period determined in this way is of great significance to the re-synchronization of the data to be synchronized. It can not only ensure that the retry is performed as soon as possible after data synchronization failure, but also avoid excessive frequent retries causing excessive pressure on the system.
[0132] Step 106, after re-synchronizing the data, if the data to be synchronized is not synchronized successfully within the preset time window, output a reminder information to the user, the reminder information is used to remind the user to manually synchronize the data to be synchronized.
[0133] The preset time window is a predetermined time range, which sets a deadline for the re-synchronization operation. The length of this time window is set according to business needs, data importance and urgency, etc. Within the preset time window, the system will continue to monitor whether the re-synchronization operation is successful. If it is successful within this time range, no further action is needed; if it is not successful, the operation of outputting a reminder information to the user is triggered.
[0134] The reminder information should contain enough information for the user to understand the problem and take appropriate action. It usually includes a brief description of the data to be synchronized, such as data type, involved fields, etc., an explanation of the synchronization failure, such as the number of retries attempted, possible reasons, etc., and guidance on how to manually synchronize the data, such as providing an operation entry or step-by-step instructions for manual synchronization. For example, for the case of synchronization failure of customer contact information in an enterprise customer relationship management system, the reminder information may be similar to: "Your customer contact information (including name, phone, email, etc. Fields) has not been successfully synchronized after multiple automatic synchronization attempts. Possible reasons are unstable network connection or target system temporarily unavailable. You can enter the manual synchronization interface by clicking the following link and follow the prompts to complete the data synchronization." The main purpose is to let the user know that there is a problem with data synchronization, and to guide the user to manually synchronize the data. Because at this step, the automatic synchronization mechanism has failed to solve the problem within the preset time, and the user's intervention is needed to ensure that the data can be finally synchronized to the target system. This helps to avoid serious impact on business due to long-term data synchronization.
[0135] In an embodiment, the method can further include:
[0136] record the number of times of re-performing data synchronization and the execution time;
[0137] In the case where the number of times of data synchronization is equal to a preset number threshold or the execution time exceeds a preset time threshold, a second time period corresponding to the to-be-synchronized data is determined, and the to-be-synchronized data is subjected to timed data synchronization according to the second time period and the operation sequence.
[0138] The number of times of re-performing data synchronization is recorded to track the effort of the automatic synchronization mechanism in attempting to fix the synchronization failure problem. Each time of re-synchronization represents that the system is attempting to overcome the factors that caused the synchronization failure before, such as network fluctuations, insufficient system resources, and the like. The execution time is recorded to master the length of time consumed by the entire re-synchronization process. This is very important for evaluating the synchronization efficiency and judging whether further measures such as switching to manual synchronization or timed synchronization need to be taken. For example, in an enterprise inventory management system, when inventory data synchronization fails and starts to re-synchronize, the system records the operation of each re-synchronization and the time elapsed since the first re-synchronization. If re-synchronization is performed 3 times and 10 minutes have elapsed, this information will be accurately recorded.
[0139] When the number of times of re-performing data synchronization is equal to a preset number threshold, it means that the system has attempted a sufficient number of times according to the predetermined retry mechanism, but still fails to synchronize data. At this time, it may no longer be effective to continue according to the original retry logic, and a strategy needs to be switched to adopt a timed data synchronization manner. If the execution time of re-performing data synchronization exceeds a preset time threshold, it also indicates that the current automatic re-synchronization mechanism has a problem. Even if the number of times of re-synchronization has not reached the number threshold, the time is too long and may affect the business, so the timed data synchronization strategy needs to be started.
[0140] The second time period is a new time range set for timed data synchronization. Unlike the first time period, it is determined based on the number of times of re-synchronization or the execution time reaching the threshold, and is used to plan the time interval of timed synchronization operation. For example, for customer feedback data synchronization in a customer relationship management system, if the number of times of re-synchronization or the execution time reaches the threshold, the determined second time period may be to perform timed synchronization every 2 hours. After the second time period is determined, the to-be-synchronized data is still subjected to timed data synchronization according to the operation sequence determined before. This is because in any synchronization scenario, the operation sequence is the key to ensuring data consistency and integrity. By recording the number of times of re-performing data synchronization and adopting the timed synchronization strategy when the preset number threshold is reached, the system can better cope with the situation of multiple automatic synchronization failures. This avoids the waste of system resources and potential risk of system collapse that may be caused by infinite invalid retries.
[0141] By acquiring the to-be-synchronized data; the to-be-synchronized data includes at least one field; determining whether the at least one field meets a preset association condition, in the case that the at least one field meets the preset association condition, determining the operation order of the operation required for the to-be-synchronized data to synchronize data, ensuring that the field structure and complex logic can be correctly processed, and complex data synchronization problems can be correctly handled, by determining a first time period corresponding to the to-be-synchronized data in the case that the to-be-synchronized data fails to synchronize, and re-synchronizing the to-be-synchronized data according to the first time period and the operation order; after re-synchronizing the data, if the to-be-synchronized data is not synchronized successfully within a preset time window, outputting a prompt information to the user, the prompt information is used to remind the user of the manual data synchronization manner of the to-be-synchronized data, after synchronization fails, the first time period and the operation order are introduced to re-synchronize, and only when necessary, the user is prompted to handle manually, greatly reducing the operation burden of data synchronization, optimizing the user experience, and through the operation order arrangement and the time period design, a complete fault-tolerant mechanism is constructed. This mechanism enables the system to remain efficient after data retry synchronization fails, thereby properly handling data synchronization failure problems.
[0142] Referring to Figure 2 , an execution flow diagram of an embodiment of a data synchronization method of the application is shown:
[0143] The flow covers the whole process from receiving data for synchronization to processing various possible synchronization situations until the final completion of data processing and output, aiming to ensure accurate and complete synchronization of data between different systems or storage locations.
[0144] The process of accepting data and synchronization is the starting action of the whole data synchronization process, similar to the process of starting to acquire to-be-synchronized data and trying to synchronize in various data synchronization scenarios mentioned above. The execution subject can be a data synchronization software, an application program itself function, etc. with data synchronization capability.
[0145] After data synchronization, it is judged whether the data synchronization is successful. If the synchronization is successful, it means that the data is successfully completed in the current synchronization operation, and subsequent operations such as data display and use for other business processes can be performed. When the synchronization fails, a complex processing branch for the synchronization failure condition is entered, which corresponds to various conditions that may occur during the data synchronization process that cause the synchronization to fail, which need to be further analyzed and processed. In some data synchronization scenarios, such as situations involving transaction processing and other strict requirements for data order, if the synchronization fails and the data order is sensitive, the current operation chain needs to be rolled back and the synchronization needs to be retried to ensure data consistency and accuracy, which reflects the fine processing of specific data synchronization requirements. For data order insensitive conditions such as some log data, the data is stored in an exception pool for subsequent centralized processing;
[0146] In the exception pool, the data needs to be further judged for the type of data exception. For some common exceptions that are easy to find and repair through manual review, such as data format errors, direct retry synchronization is performed to solve the synchronization failure problem caused by temporary network fluctuations and other reasons through synchronization again. For non-ordinary exceptions such as complex situations that may involve system underlying errors, manual review and repair are performed and then combined for output, which utilizes the judgment ability of humans to handle some situations that software may not be able to handle automatically, and reflects the role of human-machine collaboration in the data synchronization process.
[0147] After trying to retry synchronization, if the synchronization is successful within a certain time range or within a certain number of retries, the synchronization is ended, and if it is still unsuccessful, the data to be synchronized is further placed in a timing task pool for timing retry, and if the timing retry is still unsuccessful, manual review is entered at this time, and the operation and maintenance personnel manually synchronize the data.
[0148] It should be noted that for the method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present application are not limited to the order of the actions described, because according to the embodiments of the present application, certain steps can be performed in other order or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0149] Referring to Figure 3 , a structural block diagram of an embodiment of a data synchronization device of the present application is shown, which can specifically include the following modules:
[0150] The data acquisition module 201 is configured to acquire data to be synchronized; the data to be synchronized includes at least one field;
[0151] The association condition determining module 202 is configured to determine whether the at least one field satisfies a preset association condition.
[0152] The operation sequence determining module 203 is configured to determine an operation sequence of operations required for the data synchronization of the to-be-synchronized data, in a case where the at least one field satisfies the preset association condition.
[0153] The data synchronization module 204 is configured to perform the data synchronization on the to-be-synchronized data according to the operation sequence.
[0154] The retry synchronization module 205 is configured to determine a first time period corresponding to the to-be-synchronized data, in a case where the data synchronization of the to-be-synchronized data fails, and perform the data synchronization on the to-be-synchronized data again according to the first time period and the operation sequence.
[0155] The reminding output module 206 is configured to output reminding information to a user, in a case where the data synchronization is performed again and the to-be-synchronized data is not successfully synchronized within a preset time window, the reminding information being used to remind the user to perform manual data synchronization on the to-be-synchronized data.
[0156] In an embodiment, the association condition determining module comprises:
[0157] The first relationship determining submodule is configured to determine whether the at least one field has a storage dependency relationship and / or an update constraint relationship.
[0158] The first association condition determining submodule is configured to determine that the at least one field satisfies the preset association condition, in a case where the at least one field has a field storage dependency relationship and / or a field update constraint relationship.
[0159] In an embodiment, the association condition determining module comprises:
[0160] The second relationship determining submodule is configured to determine whether the to-be-synchronized data has an operation sequence requirement and / or a version tracking requirement.
[0161] The second association condition determining submodule is configured to determine that the at least one field satisfies the preset association condition, in a case where the to-be-synchronized data has a specific sequence requirement and / or a version tracking requirement.
[0162] In an embodiment, the association condition determining module comprises:
[0163] The first historical data obtaining submodule is configured to obtain historical synchronization data corresponding to the at least one field.
[0164] The third relationship determining submodule is configured to determine whether the historical synchronization data corresponding to the respective fields has field correlation.
[0165] The third correlation condition determining sub-module is configured to determine that the at least one field satisfies a preset correlation condition in a case where the historical synchronization data corresponding to the at least one field has a field correlation.
[0166] In an embodiment, the correlation condition determining module comprises:
[0167] The second historical data obtaining sub-module is configured to obtain historical synchronization data corresponding to the at least one field.
[0168] The change rule determining sub-module is configured to determine an update change rule of the historical synchronization data corresponding to the respective fields.
[0169] The fourth relationship determining sub-module is configured to determine whether the updates of the historical synchronization data corresponding to the respective fields have a causal relationship according to the update change rule of the historical synchronization data.
[0170] The fourth correlation condition determining sub-module is configured to determine that the at least one field satisfies a preset correlation condition in a case where the updates of the historical synchronization data corresponding to the respective fields have a causal relationship.
[0171] In an embodiment, the retry synchronization module comprises:
[0172] The interval determining sub-module is configured to obtain a basic time interval and an exponentially increasing sequence corresponding to the to-be-synchronized data.
[0173] The time sequence determining sub-module is configured to multiply the basic time interval and each element of the exponentially increasing sequence in sequence to determine a retry time sequence.
[0174] The time period determining sub-module is configured to take the retry time sequence as a first time period corresponding to the to-be-synchronized data.
[0175] In an embodiment, the apparatus further comprises:
[0176] The retry parameter determining sub-module is configured to record the number of times of re-performing data synchronization and the execution time.
[0177] The timing synchronization sub-module is configured to determine a second time period corresponding to the to-be-synchronized data in a case where the number of times of data synchronization is equal to a preset number threshold or the execution time exceeds a preset time threshold, and perform timing data synchronization on the to-be-synchronized data according to the second time period and the operation sequence.
[0178] By acquiring to-be-synchronized data, determining whether at least one field of the to-be-synchronized data satisfies a preset association condition, determining a manner of an operation sequence of an operation required by the to-be-synchronized data for data synchronization in a case where the at least one field satisfies the preset association condition, ensuring that a field structure and complex logic can be correctly processed, and a complex data synchronization problem can be correctly handled, determining a first time period corresponding to the to-be-synchronized data in a case where the to-be-synchronized data fails in synchronization, and re-performing data synchronization on the to-be-synchronized data according to the first time period and the operation sequence, and outputting a prompt information to a user in a case where the to-be-synchronized data fails in synchronization within a preset time window, the prompt information being used to prompt a manual data synchronization manner of the to-be-synchronized data performed by the user, re-performing synchronization by introducing the first time period and the operation sequence after synchronization fails, and reminding the user to manually handle only when necessary, thereby greatly reducing an operation burden of data synchronization, optimizing user experience, and constructing a complete fault-tolerant mechanism through operation sequence arrangement and time period design. The mechanism enables the system to maintain high efficiency after data retry synchronization fails, thereby properly handling a data synchronization failure problem.
[0179] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts are described in the part of the method embodiment.
[0180] The embodiment of the application further provides an electronic device, including a processor, a memory and a computer program stored in the memory and capable of running on the processor, when the computer program is executed by the processor, each process of the above-mentioned data synchronization method embodiment is realized, and the same technical effect can be achieved, to avoid repetition, which will not be repeated here.
[0181] The embodiment of the application further provides a computer readable storage medium, a computer program is stored in the computer readable storage medium, when the computer program is executed by the processor, each process of the above-mentioned data synchronization method embodiment is realized, and the same technical effect can be achieved, to avoid repetition, which will not be repeated here.
[0182] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.
[0183] Those skilled in the art will appreciate that embodiments of the present application can be readily used as a method, apparatus, or computer program product. Accordingly, embodiments of the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, and the like) embodying computer program instructions.
[0184] Embodiments of the present application are described herein with reference to the Figure 1 one or more functions specified in a flow or multiple flows and / or blocks. Figure 1 means for performing the function specified by the block or blocks.
[0185] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing Figure 1 one or more functions specified in a flow or multiple flows and / or blocks. Figure 1 means for performing the function specified by the block or blocks.
[0186] These computer program instructions can also be loaded onto a computer or other programmable data processing devices to cause a series of operational steps to be performed on the computer or other programmable devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable devices provide steps for implementing the functions specified in the flow or multiple flows and / or blocks. Figure 1 one or more functions specified in a flow or multiple flows and / or blocks. Figure 1 means for performing the function specified by the block or blocks.
[0187] Although preferred embodiments of the present application have been described, those skilled in the art will recognize that additional modifications and changes can be made thereto without departing from the scope of the present application. Accordingly, the appended claims are intended to cover all such modifications and changes as fall within the scope of the present application.
[0188] Finally, it is to be understood that the phraseology or terminology such as "first" and "second" etc. used herein is merely intended to differentiate one entity or operation from another entity or operation, without necessarily requiring or implying any actual such relationship or order between such entities or operations. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0189] The above describes in detail the data synchronization method, device, equipment and medium provided by the present application. The principles and implementation manners of the present application are described by using specific examples. The above description of the embodiments is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, the specific implementation manners and application ranges can be changed according to the idea of the present application. In summary, the content of the specification should not be understood as a limitation of the present application.
Claims
1. A data synchronization method, characterized in that, The method includes: Obtain the data to be synchronized; the data to be synchronized includes at least one field; Determine whether the at least one field satisfies the preset association conditions; If at least one field satisfies a preset association condition, determine the order of operations required for data synchronization of the data to be synchronized. The data to be synchronized is synchronized according to the described operation sequence; If the synchronization of the data to be synchronized fails, a first time period corresponding to the data to be synchronized is determined, and the data to be synchronized is resynchronized according to the first time period and the operation sequence. If the data to be synchronized fails to synchronize within a preset time window after resynchronization, a reminder message will be output to the user to remind the user to manually synchronize the data to be synchronized.
2. The data synchronization method according to claim 1, characterized in that, Determining whether the at least one field satisfies the preset association condition includes: Determine whether the at least one field has storage dependencies and / or update constraints; If at least one field has a field storage dependency relationship and / or a field update constraint relationship, then the at least one field is determined to satisfy a preset association condition.
3. The data synchronization method according to claim 1, characterized in that, Determining whether the at least one field satisfies the preset association condition includes: Determine whether the data to be synchronized has operation sequence requirements and / or version tracking requirements; If the data to be synchronized has specific order requirements and / or version tracking requirements, determine that at least one field satisfies a preset association condition.
4. The data synchronization method according to claim 1, characterized in that, Determining whether the at least one field satisfies the preset association condition includes: Obtain the historical synchronization data corresponding to at least one of the fields; Determine whether there is any field correlation in the historical synchronized data corresponding to each of the aforementioned fields; If there is field correlation in the historical synchronized data corresponding to at least one field, it is determined that the at least one field satisfies the preset association condition.
5. The data synchronization method according to claim 1, characterized in that, Determining whether the at least one field satisfies the preset association condition includes: Obtain the historical synchronization data corresponding to at least one of the fields; Determine the update and change patterns of the historical synchronized data corresponding to each of the aforementioned fields; Based on the update and change patterns of the historical synchronization data, determine whether there is a causal relationship between the updates of the historical synchronization data corresponding to each field; If there is a causal relationship between the updates of the historical synchronized data corresponding to each field, it is determined that at least one field satisfies a preset association condition.
6. The data synchronization method according to claim 1, characterized in that, In the event that the synchronization of the data to be synchronized fails, determining the first time period corresponding to the data to be synchronized includes: Obtain the basic time interval and exponentially increasing sequence corresponding to the data to be synchronized; The base time interval is multiplied sequentially by each element of the exponentially increasing sequence to determine the retry time series; The retry time series is used as the first time period corresponding to the data to be synchronized.
7. The data synchronization method according to claim 1, characterized in that, The method further includes: Record the number of times the data synchronization was re-synchronized and the execution time; If the number of data synchronizations equals a preset threshold or the execution time exceeds a preset time threshold, a second time period corresponding to the data to be synchronized is determined, and the data to be synchronized is synchronized at regular intervals according to the second time period and the operation sequence.
8. A data synchronization device, characterized in that, The device includes: The data acquisition module is used to acquire data to be synchronized; the data to be synchronized includes at least one field. The association condition determination module is used to determine whether the at least one field satisfies a preset association condition; The operation sequence determination module is used to determine the operation sequence of the operations required for data synchronization of the data to be synchronized, provided that at least one field satisfies a preset association condition. The data synchronization module is used to synchronize the data to be synchronized according to the operation sequence. The retry synchronization module is used to determine a first time period corresponding to the data to be synchronized when the synchronization of the data to be synchronized fails, and to re-synchronize the data to be synchronized according to the first time period and the operation sequence. The reminder output module is used to output a reminder message to the user if the data to be synchronized fails to synchronize within a preset time window after resynchronization. The reminder message is used to remind the user to manually synchronize the data to be synchronized.
9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of a data synchronization method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of a data synchronization method as described in any one of claims 1-7.