Data synchronization method and apparatus, storage medium, and computer device
By obtaining business transaction logs in a distributed system and executing reconciliation and repair tasks based on the results, the data inconsistency problem is solved, data synchronization efficiency and consistency are improved, and storage space reads and computations are reduced.
Patent Information
- Application Number
- CN202210787678.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-04
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-07-04
AI Technical Summary
In distributed systems, data inconsistency can occur between different nodes due to network latency and network call failures, which existing technologies struggle to resolve efficiently.
By obtaining business transaction logs, the execution results of business requests are determined. Reconciliation tasks are only executed when the execution result is unsuccessful to obtain the reconciliation results. If the reconciliation result is incorrect, a reconciliation repair task is executed to ensure data consistency among different business parties.
This reduces the amount of business data read and comparison calculations, improves the efficiency of data synchronization, ensures data consistency, and reduces intrusion into the business's storage space.
Smart Images

Figure CN117390112B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technology, and more specifically, to a data synchronization method, apparatus, storage medium, and computer equipment. Background Technology
[0002] A distributed system is a software system composed of multiple geographically distributed computers connected by a network. A distributed system can provide services by forming a distributed cluster of computers. The more computers there are, the more storage resources are available, and the greater the concurrent access that can be handled. This results in a more powerful system with excellent scalability.
[0003] However, to improve processing power, distributed systems inevitably use replication mechanisms, which leads to data consistency issues. For example, if a piece of data exists on multiple different nodes in a distributed system, and this data changes on one node, inconsistencies may occur on other nodes due to network latency and network call failures. Summary of the Invention
[0004] This application provides a data synchronization method, apparatus, storage medium, and computer device. These improvements can enhance the efficiency of data synchronization.
[0005] On one hand, this application provides a data synchronization method, which includes: obtaining a business transaction log, which is generated by a first business party based on a business request; determining the execution result of the business request based on the business transaction log; when the execution result is unsuccessful, executing a reconciliation task corresponding to the business transaction log to obtain a reconciliation result; when the reconciliation result is an error, executing a reconciliation repair task, which is used to maintain the consistency of business data between the first business party and at least one second business party.
[0006] On the other hand, embodiments of this application also provide a data synchronization device, which includes: an acquisition module for acquiring business transaction logs, wherein the business transaction logs are generated by a first business party based on a business request; a determination module for determining the execution result of a business request based on the business transaction logs; a reconciliation module for executing a reconciliation task corresponding to the business transaction logs to obtain a reconciliation result when the execution result is unsuccessful; and a repair module for executing a reconciliation repair task when the reconciliation result is a reconciliation error, wherein the reconciliation repair task is used to maintain the consistency of business data between the first business party and at least one second business party.
[0007] On the other hand, embodiments of this application also provide a computer device, which includes a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are invoked by the processor, the above-described data synchronization method is executed.
[0008] On the other hand, embodiments of this application also provide a computer-readable storage medium storing program code, wherein the above-described data synchronization method is executed when the program code is run by a processor.
[0009] On the other hand, embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a storage medium. A processor of a computer device reads the computer instructions from the storage medium and executes the computer instructions, causing the computer to perform the steps in the aforementioned data synchronization method.
[0010] This application provides a data synchronization method that can acquire business transaction logs, generated by a first business party based on business requests. Based on these logs, the execution result of the business requests is determined. When the execution result is unsuccessful, a reconciliation task corresponding to the business transaction log is executed to obtain the reconciliation result. Furthermore, when the reconciliation result is incorrect, a reconciliation repair task is executed to maintain the consistency of business data between the first business party and at least one second business party. Thus, when the first business party's business request fails to execute, the reconciliation task determines whether there is a consistency problem between the first business party and at least one second business party. When a consistency problem occurs, i.e., the reconciliation result is incorrect, the reconciliation repair task is executed to repair the data between the first business party and at least one second business party, thereby ensuring data consistency and avoiding the need to read business data every time a data consistency check is performed. This significantly reduces the amount of data read from the business party's storage space and the computational workload of comparing business data, thereby improving the efficiency of data synchronization. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A schematic diagram of a data synchronization system architecture provided in an embodiment of this application is shown.
[0013] Figure 2A flowchart illustrating a data synchronization method provided in an embodiment of this application is shown.
[0014] Figure 3 A flowchart illustrating another data synchronization method provided in an embodiment of this application is shown.
[0015] Figure 4 A system architecture diagram of a data synchronization system provided in an embodiment of this application is shown.
[0016] Figure 5 This illustration shows an application scenario diagram for determining a target device according to an embodiment of this application.
[0017] Figure 6 A schematic diagram of the interface of the consistency status report provided in an embodiment of this application is shown.
[0018] Figure 7 A block diagram of a data synchronization device provided in an embodiment of this application is shown.
[0019] Figure 8 This is a block diagram of a computer device provided in an embodiment of this application.
[0020] Figure 9 This is a block diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation
[0021] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0022] In some processes described in the specification, claims, and the foregoing drawings, multiple steps are included in a specific order. However, it should be clearly understood that these steps may be performed in any order or in parallel. The step numbers are merely used to distinguish different steps and do not represent any execution order. Furthermore, descriptions such as "first" and "second" in this document are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0023] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0024] The CAP theorem is a established principle regarding distributed data systems, encompassing three elements: Consistency, Availability, and Partition Tolerance. The Consistency element of the CAP theorem states that accessing all nodes should yield the same data. It's important to note that this consistency refers to strong consistency, meaning that after data updates, users see completely consistent data across any node. However, as long as network calls exist, there is always the possibility of call failure, inevitably leading to inconsistencies between system nodes.
[0025] For example, personalized recommendation systems are long-chain systems, often involving multiple storage spaces—meaning a single set of data might reside in the storage spaces of multiple subsystems. For instance, web browsing product A and client-side product B might use the same account information, which involves the logic of synchronizing data between different systems. When account information is modified on one side, the other side also needs to update its account information synchronously. However, due to complex network environments or programming errors, data inconsistencies often occur where one side fails to synchronize its account information.
[0026] To address the aforementioned problems, the inventors, through research, proposed the data synchronization method provided in the embodiments of this application. This method can acquire business transaction logs and determine the execution result of business requests based on the business transaction logs. When the execution result is unsuccessful, the reconciliation task corresponding to the business transaction log is executed to obtain the reconciliation result. Furthermore, when the reconciliation result is an error, a reconciliation repair task is executed. Consequently, when a data inconsistency problem occurs between the first business party and at least one second business party, the reconciliation repair task is executed, thereby resolving the data inconsistency problem between the first business party and at least one second business party.
[0027] The system architecture of the image generation method involved in this application will be introduced below.
[0028] like Figure 1As shown in the embodiments of this application, the data synchronization method can be applied to a consistency system 400. The consistency system 400 can access the business system 300 via a general protocol, thereby providing data consistency services for the business system 300 and other linked business systems. The general protocol specifies the rules for the business system 300 to access the consistency system 400, enabling business parties from different businesses to use the consistency system 400. For example, the general protocol can specify the format (field content and field size, etc.) for the business system 300 to report business transaction logs.
[0029] Optionally, the business system 300 may include a business request processing flow 310 and a business error handling flow 320. In the business request processing flow 310, when the business system 300 receives a business request for data change, it can generate a business log and send it to the consistency system 400. Then, it executes the business logic corresponding to the business request, determines whether the execution was successful, and sends the execution result to the consistency system 400. In the business error handling flow 320, the business system 300 can generate a callback request based on the error notification sent by the consistency system 400, execute repair logic based on the callback request, determine whether the execution was successful, and send the execution result to the consistency system 400.
[0030] Optionally, the consistency system 400 may include an access layer 410, a logic layer 420, and a storage layer 430. The access layer 410 can be used to receive business transaction logs and data change statuses sent by the business system 300, and can also be used to generate error notifications. The logic layer 420 can be used to perform reconciliation tasks, comparing the same reconciliation data in different storage locations to identify inconsistent data and perform error correction. The storage layer 430 can be used to store business transaction logs that require reconciliation tasks and business transaction logs for re-performing reconciliation tasks during error correction.
[0031] It is worth noting that, Figure 1 This is merely a schematic diagram of a system architecture provided in this application embodiment. The system architecture and application scenarios described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided in this application embodiment. For example, Figure 1 The business system 300 in this application only represents the business party that actively makes data changes. In addition, it also includes one or more other business parties that passively synchronize data with the business system 300. As those skilled in the art will recognize, with the evolution of system architecture and the emergence of new application scenarios, the technical solutions provided in this application are also applicable to similar technical problems.
[0032] Please see Figure 2 , Figure 2A schematic flowchart of an image generation method according to an embodiment of this application is shown. In a specific embodiment, the image generation method is applied to, for example... Figure 7 The data synchronization device 600 and the computer equipment 700 equipped with the data synchronization device 600 are shown. Figure 8 ).
[0033] The following will use a computer device as an example to illustrate the specific process of this embodiment. It is understood that the computer device used in this embodiment can be a server or a terminal, etc. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, blockchain, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The image generation method specifically includes the following steps:
[0034] Step S110: Obtain business transaction records.
[0035] As in the example above, when one business unit (web browsing product A and client product B) makes a data change, the other unit also needs to make a synchronized data change. However, the data synchronization process across multiple systems may fail at any step. Therefore, this application requires the business unit to report a data change log (i.e., a business log) before writing business data. By comparing the business log with the same data stored by different business units, inconsistencies are identified and corrected.
[0036] The service transaction log is generated by the first service provider based on a service request. The first service provider is the one that actively makes data changes. A service request refers to a request instruction generated by a service provider based on user or its own application needs. For example, a service request could be a request from a shopping platform to create a new product order, or a request from a user on a social networking site to change their account information; there are no specific limitations here.
[0037] As one implementation method, when a data change log reported by a business party is received, this data change log can be used as a business log. For example, when a blog platform (the business party) needs to modify a user's level, the blog platform first generates a modification request, then generates a level change log based on the modification request, and then obtains the level change log when the blog platform reports this level change log.
[0038] Step S120: Determine the execution result of the business request based on the business flow.
[0039] Typically, during multi-system data synchronization, data consistency can be determined by directly comparing the changed data in each system. However, comparing the changed data every time it changes to determine if the business data is synchronized puts a huge load on the system storage. Moreover, in real-world applications, most data synchronization is normal, and inconsistencies are rare. Comparing data between systems every time would waste a significant amount of computing resources.
[0040] The execution result refers to the outcome of the business logic executed by the business party according to the business request, such as the success status of data change. In this embodiment, the need for a consistency check on data synchronization can be determined based on the execution result of the business request. If the execution result of the business request is successful, a consistency check is not required; only if the execution result of the business request is unsuccessful will a consistency check be performed.
[0041] In some embodiments, the step of determining the execution result of a business request based on the business flow may include:
[0042] (1) Send a confirmation request to the first business party.
[0043] (2) If the execution result returned by the first business party is a success status, the reconciliation task corresponding to the business transaction will not be executed.
[0044] (3) If no execution result is received from the first business party, the execution result of the business request is determined to be unsuccessful.
[0045] The "Confirm Request" is used to instruct the first business party to confirm and return the execution result of the business request. The "Reconciliation Task" refers to the task of determining data consistency with the business party. It should be noted that after executing the business logic, the first business party can only confirm success, not failure; therefore, the execution result only includes a success status and a failure status.
[0046] As one implementation method, after obtaining the business transaction record sent by the first business party, a confirmation request can be sent to the first business party. Upon receiving the confirmation request, the first business party will determine whether the execution result of the business request was successful. If the first business party determines that the execution result is successful, then upon receiving the successful execution result sent by the first business party, the reconciliation task corresponding to the business transaction record will not be executed. If no execution result is received from the first business party within a preset time range, then the execution result of the business request is determined to be unsuccessful.
[0047] The data synchronization method provided in this application adopts the above-mentioned scheme of first determining the execution result of the business request, and then determining whether to execute the reconciliation task based on the execution result. In the case of a low probability of data synchronization inconsistency, the data comparison operation is greatly reduced, thereby reducing the amount of reading from the business's storage space and the amount of calculation for comparing business data, improving the efficiency of data synchronization, reducing the intrusion into the business's storage, and ensuring the data security of the business.
[0048] Step S130: When the execution result is unsuccessful, execute the reconciliation task corresponding to the business transaction to obtain the reconciliation result.
[0049] In this embodiment of the application, the reconciliation result is the result of judging the consistency of the business data when performing the reconciliation task. The reconciliation result includes reconciliation correct and reconciliation incorrect.
[0050] Considering that in practical application scenarios, it is necessary to simultaneously determine the data consistency of multiple different business parties, in order to facilitate the acquisition of business transaction records for reconciliation tasks and improve the efficiency of data consistency determination, the business transaction records for which reconciliation tasks need to be performed can be stored in the reconciliation event pool.
[0051] In some embodiments, the step of obtaining the reconciliation result for the reconciliation task corresponding to the execution of the business transaction may include:
[0052] (1) Store the business transaction records as reconciliation events in the reconciliation event pool.
[0053] (2) Obtain reconciliation events from the reconciliation event pool and generate reconciliation tasks corresponding to the reconciliation events.
[0054] As one implementation method, when the execution result is unsuccessful, the business transaction records can be stored as reconciliation events in the reconciliation event pool. Optionally, all reconciliation events can be partitioned into data tables according to different business types, and the data tables can be partitioned according to a natural day. Furthermore, reconciliation events in the reconciliation event pool can be used to generate corresponding reconciliation tasks.
[0055] (3) Perform the reconciliation task according to the reconciliation judgment rules and obtain the reconciliation results.
[0056] In this context, a reconciliation event refers to a business transaction that requires data consistency verification. Reconciliation verification rules are used to determine whether a reconciliation task has encountered an error. These rules can be generated based on the business needs of a first business party and at least one second business party, where the second business party is the one passively initiating data changes.
[0057] For example, a music playback platform has web, mobile, and PC versions. When a user adds a new song to their music collection on the mobile version, the user needs to add the same new song to their corresponding music collections on the web and PC versions. In this case, the mobile version is the first business party, and the web and PC versions are the second business parties. The reconciliation rule can be that the song ID of the new song exists in the song list corresponding to each second business party.
[0058] As one implementation method, the step of performing the reconciliation task according to the reconciliation judgment rules and obtaining the reconciliation result may include:
[0059] (3.1) Obtain the baseline data corresponding to the reconciliation event from the first business party.
[0060] (3.2) Obtain reconciliation data corresponding to the reconciliation event from at least one second business party.
[0061] (3.3) According to the reconciliation judgment rules, the baseline data and the reconciliation data are compared to obtain the comparison results.
[0062] (3.4) Use the comparison results as the reconciliation results obtained from performing the reconciliation task.
[0063] When determining whether multiple sets of data are consistent, a correct set of data needs to be designated as the baseline, i.e., the base data. Correspondingly, the remaining data are the reconciliation data. In this way, when errors are found in the reconciliation data, the errors can be corrected based on the base data.
[0064] Optionally, the business entity storing the baseline data can be designated as the baseline party, and the business entity storing the reconciliation data can be designated as the party being inspected. The reconciliation judgment rules can include a first judgment rule and a second judgment rule. The first judgment rule can be a logical expression for simple data comparison, including logical expressions containing OR, AND, and NOT operators, such as the transfer amount (Money). - Equal to the amount received (Money) + Logical expression for Money - ∧Money + =1. The second judgment rule can be for data calculations involving complex data comparisons, such as taking square roots and calculating logarithms.
[0065] For example, a first judgment rule and a second judgment rule can be determined based on the business needs of the first business party and at least one second business party. Then, according to the first and second judgment rules, it is determined whether the baseline data and the reconciliation data are aligned. Specifically, data alignment is determined by comparing the reconciliation data with the baseline data using logical expressions and data calculations. If the reconciliation data is not aligned with the baseline data, the comparison result is a reconciliation error, meaning the reconciliation data is incorrect. If the baseline data and the reconciliation data are aligned, the comparison result is a correct reconciliation. Further, the comparison result is used as the reconciliation result obtained from performing the reconciliation task.
[0066] Step S140: When the reconciliation result is an error, execute the reconciliation repair task.
[0067] When data is synchronized between different systems, inconsistencies are inevitable due to complex network environments or programming errors. In this embodiment of the application, after performing a reconciliation task, inconsistencies in data synchronization can be corrected through reconciliation.
[0068] The reconciliation repair task is used to maintain the consistency of business data between the first business party and at least one second business party. The reconciliation repair task may include directly synchronizing the reconciliation data of the inspected party based on the benchmark data of the benchmark party. If a reconciliation error is found after this synchronization, the reconciliation repair task can be repeated. For reconciliation data that cannot be repaired, a warning can be issued and the reason for the error can be displayed.
[0069] It should be noted that, due to the differences in the business processes handled by different business parties in actual application scenarios, the reconciliation and repair tasks need to be set up for different business parties. Specifically, the content of the reconciliation and repair tasks needs to be jointly specified by the first business party and at least one second business party.
[0070] In some embodiments, the step of performing the reconciliation and repair task may include:
[0071] (1) Store the reconciliation event as an error event in the error event record pool.
[0072] The error event record pool stores reconciliation events that resulted in errors, as well as those eligible for reconciliation repair. Optionally, the error event record pool can manage the stored reconciliation events by table partitioning and partitioning, using the same methods as the reconciliation event pool in the above embodiments, which will not be described here. The error event record pool can also set a lifecycle for the stored reconciliation events to promptly remove those that do not require reconciliation repair.
[0073] For example, when the reconciliation result is a reconciliation error, the reconciliation data with the reconciliation error is identified, and the reconciliation event corresponding to the reconciliation data is identified. Furthermore, the reconciliation event is stored as an error event in the error event record pool.
[0074] (2) Obtain error events from the error event record pool, and perform callback repair on the error events to obtain the repair results.
[0075] Callback repair refers to fixing the data that was erroneous in the error event. Since there may be data that cannot be repaired successfully, callback repair can be delayed, that is, the waiting time for re-repair is gradually extended when the repair fails. Alternatively, when the number of re-repairs reaches the preset number of executions, the discard logic is executed, that is, no more repairs are performed. In this way, callback repair ensures that the reconciliation repair task has optimal availability.
[0076] As one implementation method, the step of retrieving reconciliation events from the error event record pool, performing callback repairs on the error events, and obtaining the repair results may include:
[0077] (2.1) Perform data synchronization processing on the reconciliation data corresponding to the error event.
[0078] (2.2) If the data synchronization process fails, the data synchronization process will be repeated based on the preset number of executions.
[0079] (2.3) If the data synchronization process fails to execute repeatedly, the failure to repair will be taken as the repair result.
[0080] For example, error events can be retrieved from the error event log pool according to event type, and data synchronization processing can be performed on the reconciliation data corresponding to the error event. Specifically, data synchronization can be targeted based on the error type. If the data synchronization processing is successful, the successful repair is taken as the repair result. For example, if the song ID of a new song added from the mobile app is added to the song list on both the web and PC versions of a music playback platform, then the song ID of the new song will be synchronized on the web, mobile, and PC versions of the music playback platform.
[0081] Optionally, if the data synchronization process fails, it is repeated based on a preset number of executions. If the repeated execution of the data synchronization process fails, for example, when the number of attempts to repair reaches the preset number, no further repair is performed, and the repair failure is directly taken as the repair result.
[0082] (3) Send the repair results to the callback party so that the callback party can display the consistency status of business data between the first business party and at least one second business party.
[0083] In this context, the callback party refers to the business party that needs to obtain the repair results. In practical application scenarios, the callback party is the party that is concerned about the data synchronization status. For example, any business party that connects to the consistency system 400 based on the callback protocol can become a callback party.
[0084] As one implementation method, the repair results can be sent to the callback party. Specifically, the repair results may also include statistics on the reconciliation events that resulted in errors, such as the total number of reconciliation tasks executed, the total number of reconciliation repair tasks executed, the distribution of reasons for reconciliation failures, and the length of time that the error events occurred due to data inconsistency. These can be set according to the business needs of the callback party. This allows the callback party to understand the consistency status of business data between the first business party and at least one second business party through visualization based on the repair results.
[0085] In this embodiment, a business transaction log can be obtained. This transaction log is generated by the first business party based on a business request. The execution result of the business request is determined based on the transaction log. This scheme, which determines whether to execute a reconciliation task based on the execution result, reduces intrusion into the business party's storage while ensuring the business party's data security. It avoids reading business data every time data consistency is checked, thus significantly reducing the amount of data read from the business party's storage space and the comparison calculations of business data, thereby improving data synchronization efficiency. Furthermore, when the execution result is unsuccessful, the reconciliation task corresponding to the business transaction log is executed to obtain the reconciliation result. Further, when the reconciliation result is an error, a reconciliation repair task is executed to repair the data between the first business party and at least one second business party, thereby ensuring data consistency.
[0086] Based on the methods described in the above embodiments, the following examples will provide further detailed explanations.
[0087] The following explanation will take the integration of a data synchronization device into a computer device as an example, and will address... Figure 3 The process shown combines Figure 4 The system architecture diagram for the specific application scenario shown is illustrated in detail. This computer device can be a server or a terminal device, etc. Please refer to [link / reference]. Figure 3 , Figure 3 This application illustrates another data synchronization method provided by an embodiment of the present application. In a specific embodiment, this data synchronization method can be applied to, for example... Figure 4 The data synchronization system 500 shown can be deployed in computer equipment.
[0088] After registering an account on the content creation and operation platform, users can publish articles. The platform stores the same article published by a user on different sub-platforms focusing on different business areas to help the user gain more exposure and attention. For example, the content creation and operation platform may include a social media sub-platform, a news sub-platform, and a browser sub-platform. A user's same article will be published on these three platforms. When a user edits an article, the article published on the news sub-platform may be updated synchronously, while the articles published on the social media and browser sub-platforms may not, resulting in data inconsistencies across the sub-platforms.
[0089] Therefore, the content creation and operation platform, as a business entity, can utilize a common protocol to access the data synchronization system 500. This allows the data synchronization system 500 to maintain data consistency across the three sub-platforms of the content creation and operation platform. The data synchronization system 500 primarily includes a reconciliation event management module 510, a configuration management module 520, a reconciliation engine module 530, and an error event management module 540. The data synchronization system 500 also includes a reconciliation repair module.
[0090] The reconciliation event management module 510 provides multiple data access methods and performs data adaptation, including data push and data retrieval. Data push can be done online via RPC, HTTP, or MQ, allowing online business units to push reconciliation data using API calls. Offline push is also possible, allowing offline business units to push reconciliation data via file upload. Data retrieval requires business units to provide a database (DB) or log file conforming to the Data Synchronization System 500 standard; the Data Synchronization System 500 actively retrieves the reconciliation data. A rate limiter is used to rate-limit the writing of reconciliation events into the reconciliation event pool. The storage manager can manage the reconciliation event pool through table partitioning (by different event sources), partition management, and lifecycle management based on the synchronization configuration unit.
[0091] The configuration management module 520 provides CRUD logic for scenario configuration and event pool configuration for business flows, and offers a visual management interface for users of the data synchronization system 500. The parameter validation unit can obtain configuration parameters, which include at least the reconciliation event pool number, first business party interface information, at least one second business party interface, reconciliation event delay consumption time, reconciliation data acquisition interface information (including interface information for the baseline party and the party being monitored), error handling information (retry strategy and callback notification information, etc.), and callback repair information. The rule registration unit can obtain reconciliation judgment rule information, which includes at least the first judgment rule and the second judgment rule. Finally, the configuration parameters and reconciliation judgment rule information are written into the reconciliation scenario configuration library.
[0092] The reconciliation engine module 530 may include an event acquirer, which retrieves reconciliation events requiring reconciliation tasks and error events requiring re-execution of reconciliation tasks from the reconciliation event pool. The data retrieval unit can retrieve baseline data from the baseline party via the baseline party interface and reconciliation data from the inspected party via the inspected party interface. The logic executor executes the reconciliation logic in the reconciliation task according to a first judgment rule and a second judgment rule. The result processor pushes the reconciliation results retrieved from the logic executor to the error event management module 540. The operation of the data retrieval unit, logic executor, and result processor requires configuration parameters parsed from the synchronization configuration unit by the configuration parser.
[0093] The error event management module 540 is used to acquire error events and write them to the error event record pool. The storage manager provides management functions such as table partitioning (based on different reconciliation scenarios), partition management, and lifecycle management for the error event pool. The error event management module 540 can scan the error event record pool periodically to obtain the data consistency status and feed back this consistency status to the users of the data synchronization system 500 via message push. Message push methods include using a message push system, monitor alerts, email push, and page display. Error event callback notifications can be sent to the callback party via RPC, HTTP, or MQ.
[0094] It should be noted that, Figure 4 This is merely a system architecture diagram of a data synchronization system provided in this application embodiment. The system architecture and application scenarios described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided in this application embodiment. For example, Figure 4The data synchronization system 500 also includes an account reconciliation and repair module. As those skilled in the art will recognize, with the evolution of system architecture and the emergence of new application scenarios, the technical solutions provided in this application are also applicable to similar technical problems. The data synchronization method may specifically include the following steps:
[0095] Step S210: The computer equipment obtains the business transaction record.
[0096] As one implementation method, after the computer device establishes a data interface connection with the device that has deployed a content creation and operation platform based on a common protocol, it can obtain business transaction data from the content creation and operation platform through the data interface during the process of maintaining data consistency on the content creation and operation platform.
[0097] For example, when a user modifies an article on the content creation and operation platform, the platform generates a modification request (business request) and generates an article modification log based on this request. The reconciliation event management module 510 of the data synchronization system 500 obtains the article modification log from the content creation and operation platform.
[0098] Step S220: The computer equipment determines the execution result of the business request based on the business flow.
[0099] Computer devices can determine whether or not to perform a consistency check on data synchronization based on the execution result of a business request. If the execution result of the business request is successful, the computer device may not perform a consistency check. Only if the execution result of the business request is unsuccessful will the computer device perform a consistency check.
[0100] In some embodiments, the step of the computer device determining the execution result of a business request based on a business flow may include:
[0101] (1) The computer device sends a confirmation request to the first business party.
[0102] (2) If the computer device receives a successful execution result from the first business party, the reconciliation task corresponding to the business transaction will not be executed.
[0103] (3) If the computer device does not receive the execution result returned by the first business party, the execution result of the business request is determined to be unsuccessful.
[0104] In one implementation, after obtaining the business transaction record sent by the first business party, the computer device can send a confirmation request to the first business party. Upon receiving the confirmation request, the first business party will determine whether the execution result of the business request was successful. If the first business party determines the execution result is successful, the computer device will not execute the reconciliation task corresponding to the business transaction record upon receiving the successful execution result from the first business party. If the computer device does not receive the execution result returned by the first business party within a preset time range, it will determine the execution result of the business request as unsuccessful.
[0105] For example, the data synchronization system 500 can send confirmation requests to the social media sub-platform, the news sub-platform, and the browser sub-platform respectively. If the data synchronization system 500 does not receive an execution result from the news sub-platform within a preset time range, it determines that the execution result of the modification request from the news sub-platform is unsuccessful. If the data synchronization system 500 receives successful execution results from the social media sub-platform and the browser sub-platform, it does not execute the reconciliation task corresponding to the article modification log.
[0106] Step S230: When the execution result is unsuccessful, the computer device stores the business transaction record as a reconciliation event in the reconciliation event pool.
[0107] For example, when the execution result of the modification request of the news sub-platform is unsuccessful, the data synchronization system 500 can store the article modification log as a reconciliation event in the reconciliation event pool through the reconciliation event management module 510. The reconciliation event management module 510 can write the reconciliation event into the corresponding data table in the reconciliation event pool based on the synchronization configuration unit, and manage the life cycle of the reconciliation event.
[0108] Step S240: The computer device retrieves reconciliation events from the reconciliation event pool and generates reconciliation tasks corresponding to the reconciliation events.
[0109] In one implementation, the computer device can retrieve reconciliation events from a data table storing reconciliation data in the reconciliation event pool. For example, the data synchronization system 500 uses an event acquirer to retrieve a reconciliation event (article modification log) from the reconciliation event pool, and then generates a reconciliation task corresponding to the reconciliation event. At this time, the reconciliation task determines whether the news sub-platform has modified the article edited by the user.
[0110] Step S250: The computer equipment executes the reconciliation task according to the reconciliation judgment rules and obtains the reconciliation results.
[0111] Computer devices can perform reconciliation tasks to determine whether data consistency issues have occurred during reconciliation events. In practical applications, multiple computer devices will execute multiple reconciliation tasks in parallel. As the number of reconciliation tasks increases, in order to improve the efficiency of executing reconciliation tasks, it is necessary to balance the load on each computer device. Therefore, each reconciliation task can be preferentially run on the computing device with the fewest tasks.
[0112] In some embodiments, the computer device performs a reconciliation task according to reconciliation judgment rules, and the step of obtaining the reconciliation result may include:
[0113] (1) The computer device obtains the number of tasks executed on each preset device.
[0114] (2) The computer equipment determines the target equipment according to the number of tasks and the task weight rules.
[0115] The task weighting rule refers to the probability calculation rule for obtaining and executing a task. Each reconciliation task has a task lock, and only the target device with the highest probability of obtaining and executing the task can unlock and execute it. The probability calculation formula for obtaining a task can be expressed as follows:
[0116]
[0117] in, For the preset device i, obtain the probability of executing task j. Let t be the number of tasks running on device i at time t.
[0118] In one implementation, the computer device obtains the number of tasks executed on each preset device, and then calculates the probability of each preset device obtaining the task execution based on the number of tasks executed on each preset device and the task weight rules. The computer device sorts all the probabilities of obtaining the task execution and selects the preset device with the highest probability of obtaining the task execution as the target device.
[0119] For example, Figure 5 A schematic diagram of an application scenario for determining a target device is shown. Table 1 shows the status of the device performing tasks at different times. Figure 5 In this process, device 1 (E1) and device 2 (E2) acquire the probability of executing reconciliation task 1 (Task1), reconciliation task 2 (Task2), and reconciliation task 3 (Task3). Reconciliation task 1 has task lock 1, reconciliation task 2 has task lock 2, and reconciliation task 3 has task lock 3. Only the target device with the maximum probability of acquiring the task can unlock and execute the reconciliation task.
[0120] Table 1
[0121] <![CDATA[t1]]> run Not running run Not running run Not running <![CDATA[t2]]> Not running run Not running run Not running run <![CDATA[t3]]> run Not running run Not running run Not running
[0122] (3) The computer equipment performs the reconciliation task based on the target equipment.
[0123] As one implementation, the steps of the computer device performing a reconciliation task based on the target device may include:
[0124] (3.1) The computer equipment obtains the baseline data corresponding to the reconciliation event from the first business party.
[0125] (3.2) The computer equipment obtains the reconciliation data corresponding to the reconciliation event from at least one second business party.
[0126] (3.3) The computer equipment compares the baseline data and the reconciliation data according to the reconciliation judgment rules and obtains the comparison results.
[0127] (3.4) The computer equipment uses the comparison result as the reconciliation result obtained from performing the reconciliation task.
[0128] For example, the reconciliation engine module 530 of the data synchronization system 500 can use a data puller to pull benchmark data from the benchmark party through the benchmark party interface, and pull reconciliation data from the inspected party through the inspected party interface. Furthermore, the data synchronization system 500 can use a synchronization configuration unit to obtain a first judgment rule and a second judgment rule from the reconciliation scenario configuration database, and the configuration parser transmits the first judgment rule and the second judgment rule to the logic executor.
[0129] Furthermore, the logic executor determines whether the baseline data and the reconciliation data are aligned according to the first and second judgment rules. If the baseline data and the reconciliation data are not aligned, the comparison result is a reconciliation error. If the baseline data and the reconciliation data are aligned, the comparison result is a reconciliation correct. The result processor then obtains the comparison result as the reconciliation result obtained from executing the reconciliation task.
[0130] Step S260: When the reconciliation result is an error, the computer device performs a reconciliation repair task.
[0131] Computer equipment can perform reconciliation and repair tasks by directly synchronizing the reconciliation data of the inspected party with the benchmark data of the benchmark party. If a reconciliation error is found after the data synchronization, the reconciliation and repair task can be performed again. For reconciliation data that cannot be repaired, a warning can be issued and the reason for the error can be displayed.
[0132] In some embodiments, when the reconciliation result is an error, the step of the computer device performing a reconciliation repair task may include:
[0133] (1) The computer equipment stores the reconciliation event as an error event in the error event record pool.
[0134] For example, the reconciliation engine module 530 of the data synchronization system 500 can use a result processor to store reconciliation events as error events in an error event record pool. Optionally, the result processor can also send the execution result to the error event management module 540, notifying the callback party via a callback.
[0135] Specifically, the reconciliation engine module 530 can use the event acquirer to obtain reconciliation events (article modification logs) from the reconciliation event pool, generate the reconciliation task corresponding to the reconciliation event, determine the articles modified by the user on the news sub-platform through the reconciliation task, and then store the reconciliation event as an error event in the error event record pool.
[0136] (2) The computer equipment retrieves the reconciliation event from the error event record pool and performs callback repair on the error event to obtain the repair result.
[0137] As one implementation method, the computer device can perform data synchronization processing on the reconciliation data corresponding to the error event. If the data synchronization processing is successful, the computer device can send the successful callback repair as the repair result to the callback party.
[0138] Since there is data that cannot be repaired successfully, callback repair can be delayed. That is, when the repair fails, the waiting time for re-repair is gradually extended. Alternatively, when the number of re-repairs reaches the preset number of executions, the discard logic is executed, that is, no more repairs are performed. In this way, callback repair can ensure the highest availability of repair.
[0139] As an alternative implementation, the computer device retrieves error events from an error event log pool and performs callback repair on the error events to obtain the repair result. The steps may include:
[0140] (2.1) The computer equipment performs data synchronization processing on the reconciliation data corresponding to the error event.
[0141] (2.2) If the data synchronization process fails, the computer device will repeat the data synchronization process based on the preset number of executions.
[0142] (2.3) If the data synchronization process fails to execute repeatedly, the computer device will take the failure as the repair result.
[0143] For example, the data synchronization system 500 can obtain error events from the error event record pool, such as the news sub-platform not modifying the article modified by the user, and then perform article synchronization modification on the article that was not modified by the user, and determine whether the article synchronization modification was successful. If the article synchronization modification fails, the data synchronization system 500 can repeat the article synchronization process based on a preset number of executions. Furthermore, if the repeated execution of article synchronization modification still fails, the data synchronization system 500 will take the repair failure as the repair result.
[0144] (3) The computer device sends the repair results to the callback party.
[0145] For example, the data synchronization system 500 can send the repair results to the callback party. Optionally, the data synchronization system 500 can use the error event management module 540 to statistically analyze reconciliation events that have resulted in errors, such as the total number of reconciliation tasks executed, the total number of reconciliation repair tasks executed, the distribution of reasons for reconciliation failures, and the duration of data inconsistency caused by the error events. The repair results can be set according to the business needs of the callback party. This allows the callback party to understand the consistency status of business data between the first business party and at least one second business party through visualization based on the repair results.
[0146] Please see Figure 6 , Figure 6 The interface diagram of the consistency status report is shown. Specifically, the data synchronization system 500 displays a line graph of the total reconciliation amount, a graph of the total consistent reconciliation amount, a graph of the total inconsistent reconciliation amount, a graph of the real-time distribution of error sources, a graph of the distribution of reconciliation results, a graph of the duration of inconsistent status, a graph of the distribution of real-time reconciliation results, and a reconciliation score through this interface. This reconciliation score is used to assess the health of the data consistency of the business party.
[0147] In this embodiment, a business transaction log can be obtained. This transaction log is generated by a first business party based on a business request. The execution result of the business request is determined based on the transaction log. When the execution result is unsuccessful, a reconciliation task corresponding to the business transaction log is executed to obtain a reconciliation result. Furthermore, when the reconciliation result is an error, a reconciliation repair task is executed. This reconciliation repair task is used to maintain the consistency of business data between the first business party and at least one second business party. Thus, when the first business party's business request fails to execute, the execution of the reconciliation task determines whether there is a consistency problem between the data of the first business party and at least one second business party. When a consistency problem occurs, i.e., the reconciliation result is an error, the reconciliation repair task is executed to repair the data between the first business party and at least one second business party, thereby ensuring data consistency.
[0148] Please see Figure 7The diagram illustrates a structural block diagram of a data synchronization device 600 provided in an embodiment of this application. The data synchronization device 600 includes: an acquisition module 610, used to acquire business transaction logs, which are generated by a first business party based on business requests; a determination module 620, used to determine the execution result of a business request based on the business transaction logs; a reconciliation module 630, used to execute a reconciliation task corresponding to the business transaction logs to obtain a reconciliation result when the execution result is unsuccessful; and a repair module 640, used to execute a reconciliation repair task when the reconciliation result is an error, the reconciliation repair task being used to maintain the consistency of business data between the first business party and at least one second business party.
[0149] In some embodiments, the determining module 620 may include: a request sending unit, configured to send a determining request to a first business party, the determining request being used to instruct the first business party to determine and return the execution result of the business request; a reconciliation non-execution unit, configured to not execute the reconciliation task corresponding to the business transaction if the execution result returned by the first business party is a success status; and a reconciliation execution unit, configured to determine that the execution result of the business request is an unsuccessful status if the execution result returned by the first business party is not received.
[0150] In some embodiments, the reconciliation module 630 may include: a reconciliation storage unit for storing business transactions as reconciliation events in a reconciliation event pool; a task generation unit for retrieving reconciliation events from the reconciliation event pool and generating reconciliation tasks corresponding to the reconciliation events; and a task execution unit for executing the reconciliation tasks according to reconciliation judgment rules to obtain reconciliation results. The reconciliation judgment rules are used to determine whether a reconciliation error has occurred in the reconciliation task. The reconciliation judgment rules are generated based on the business needs of a first business party and at least one second business party.
[0151] In some embodiments, the task execution unit may include: a first acquisition subunit, configured to acquire baseline data corresponding to the reconciliation event from a first business party; a second acquisition subunit, configured to acquire reconciliation data corresponding to the reconciliation event from at least one second business party; a data comparison subunit, configured to compare the baseline data and the reconciliation data according to the reconciliation judgment rules to obtain a comparison result; and a result acquisition subunit, configured to use the comparison result as the reconciliation result obtained by executing the reconciliation task.
[0152] In some embodiments, the data comparison subunit may be specifically used to: obtain a first judgment rule and a second judgment rule; determine whether the benchmark data and the reconciliation data are aligned according to the first judgment rule and the second judgment rule; if the benchmark data and the reconciliation data are not aligned, the comparison result is a reconciliation error; if the benchmark data and the reconciliation data are aligned, the comparison result is a reconciliation correct.
[0153] In some embodiments, the repair module 640 may include: an error storage unit for storing reconciliation events as error events in an error event record pool; an error repair unit for retrieving reconciliation events from the error event record pool and performing callback repair on the error events to obtain a repair result; and a result sending unit for sending the repair result to the callback party so that the callback party can display the consistency status of business data between the first business party and at least one second business party.
[0154] In some embodiments, the error repair unit may be specifically used to: perform data synchronization processing on the reconciliation data corresponding to the error event; if the data synchronization processing fails, repeat the data synchronization processing based on a preset number of executions; if the data synchronization processing fails repeatedly, take the repair failure as the repair result.
[0155] In some implementations, the data synchronization device 600 may further include: a parameter acquisition module for acquiring configuration parameters, the configuration parameters including at least a reconciliation event pool number, first business interface information, at least one second business interface information, and callback repair information; a rule acquisition module for acquiring reconciliation judgment rule information, the reconciliation judgment rule information including at least a first judgment rule and a second judgment rule; and a storage module for storing the configuration parameters and reconciliation judgment rule information in a reconciliation scenario configuration library, the reconciliation scenario configuration library being used to configure reconciliation tasks and reconciliation repair tasks.
[0156] In some implementations, the reconciliation module 630 may include: a task quantity acquisition unit for acquiring the number of tasks executed on each preset device; a target device determination unit for determining the target device based on the number of tasks and task weight rules; and a reconciliation task execution unit for executing reconciliation tasks based on the target device.
[0157] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0158] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0159] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0160] The solution provided in this application can obtain business transaction logs, which are generated by a first business party based on business requests. Based on these logs, the execution result of the business requests is determined. When the execution result is unsuccessful, a reconciliation task corresponding to the business transaction log is executed to obtain the reconciliation result. Furthermore, when the reconciliation result is incorrect, a reconciliation repair task is executed to maintain the consistency of business data between the first business party and at least one second business party. Thus, when the first business party's business request fails to execute, the reconciliation task determines whether there is a consistency problem between the data of the first business party and at least one second business party. When a consistency problem occurs, i.e., the reconciliation result is incorrect, the reconciliation repair task is executed to repair the data between the first business party and at least one second business party, thereby ensuring data consistency.
[0161] like Figure 8 As shown in the figure, this application embodiment also provides a computer device 700, which includes a processor 710, a memory 720, a power supply 730, and an input unit 740. The memory 720 stores computer program instructions. When the computer program instructions are called by the processor 710, they can execute various method steps provided in the above embodiments. Those skilled in the art will understand that the structure of the computer device shown in the figures does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0162] The processor 710 may include one or more processing cores. The processor 710 connects to various parts of the entire battery management system using various interfaces and lines. It executes instructions, programs, code sets, or instruction sets stored in the memory 720, calls data stored in the memory 720, performs various functions and processes data within the battery management system, and performs various functions and processes data within the computer device, thereby providing overall control of the computer device. Optionally, the processor 710 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 710 may integrate one or more of the following: a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and a modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 710 and may be implemented separately using a communication chip.
[0163] The memory 720 may include random access memory (RAM) or read-only memory (ROM). The memory 720 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 720 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), instructions for implementing the various method embodiments described below, etc. The data storage area may also store data created during the use of the computer device (such as phonebook and audio / video data). Accordingly, the memory 720 may also include a memory controller to provide the processor 710 with access to the memory 720.
[0164] The power supply 730 can be logically connected to the processor 710 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 730 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0165] The input unit 740 can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0166] Although not shown, the computer device 700 may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 710 in the computer device loads the executable files corresponding to the processes of one or more applications into the memory 720 according to the following instructions, and the processor 710 runs the applications stored in the memory 720, thereby implementing the various method steps provided in the foregoing embodiments.
[0167] like Figure 9 As shown, this application embodiment also provides a computer-readable storage medium 800, which stores computer program instructions 810, which can be called by a processor to execute the methods described in the above embodiments.
[0168] Computer-readable storage media can be electronic storage devices such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, computer-readable storage media include non-volatile computer-readable storage medium. Computer-readable storage medium 800 has storage space for program code that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code can be compressed, for example, in a suitable form.
[0169] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations of the above embodiments.
[0170] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Although this application has disclosed preferred embodiments as above, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.
Claims
1. A data synchronization method, characterized in that, The method is applied to a data synchronization system that connects to multiple different content creation and operation platforms. User-published content is published to these platforms, and when content is modified on one platform, the modifications are required to be synchronized to the other platforms. Obtain the business transaction data reported by the first business party, which is generated by the first business party based on a business request; the business request is a request to modify the published content on the content creation and operation platform; the first business party refers to the content creation and operation platform that actively makes data changes. Based on the business flow, determine the execution result of the business request; When the execution result is unsuccessful, the reconciliation task corresponding to the business transaction is executed to obtain the reconciliation result; if the baseline data obtained from the first business party is not aligned with the reconciliation data obtained from the second business party, the reconciliation result is determined to be a reconciliation error; the second business party is a content creation and operation platform that passively changes data. When the reconciliation result is incorrect, a reconciliation repair task is executed, which is used to synchronize the baseline data to the second business party.
2. The method according to claim 1, characterized in that, Determining the execution result of the business request based on the business flow includes: Send a confirmation request to the first business party, the confirmation request being used to instruct the first business party to confirm and return the execution result of the business request; If the execution result returned by the first business party is a success status, then the reconciliation task corresponding to the business transaction will not be executed; If no execution result is received from the first service provider, the execution result of the service request is determined to be unsuccessful.
3. The method according to claim 1, characterized in that, The execution of the reconciliation task corresponding to the business transaction to obtain the reconciliation results includes: The business transaction records are stored as reconciliation events in the reconciliation event pool; Retrieve reconciliation events from the reconciliation event pool and generate reconciliation tasks corresponding to the reconciliation events; The reconciliation task is executed according to the reconciliation judgment rule to obtain the reconciliation result. The reconciliation judgment rule is used to determine whether the reconciliation task has an error. The reconciliation judgment rule is generated based on the business needs of the first business party and at least one second business party.
4. The method according to claim 3, characterized in that, The step of executing the reconciliation task according to the reconciliation judgment rules to obtain the reconciliation result includes: Obtain the baseline data corresponding to the reconciliation event from the first business party; Obtain reconciliation data corresponding to the reconciliation event from at least one of the second business parties; According to the reconciliation judgment rules, the baseline data and the reconciliation data are compared to obtain the comparison results; The comparison result is taken as the reconciliation result obtained by performing the reconciliation task.
5. The method according to claim 4, characterized in that, The step of comparing the baseline data and the reconciliation data according to the reconciliation judgment rules to obtain the comparison result includes: Obtain the first and second judgment rules; Based on the first judgment rule and the second judgment rule, determine whether the benchmark data and the reconciliation data are aligned; If the baseline data and the reconciliation data are not aligned, the reconciliation result is a reconciliation error; If the baseline data and the reconciliation data are aligned, the reconciliation result is considered correct.
6. The method according to any one of claims 3 to 5, characterized in that, The execution of the reconciliation and repair task includes: The reconciliation event is stored as an error event in the error event record pool; Error events are retrieved from the error event record pool, and callbacks are performed on the error events to repair them, thereby obtaining the repair results; The repair result is sent to the callback party so that the callback party can display the consistency status of business data between the first business party and at least one second business party.
7. The method according to claim 6, characterized in that, The callback repair of the error event to obtain the repair result includes: Perform data synchronization processing on the reconciliation data corresponding to the aforementioned error events; If the data synchronization process fails, the data synchronization process will be repeated based on a preset number of executions. If the data synchronization process fails to execute repeatedly, the failure to fix it will be considered the fix result.
8. The method according to claim 1, characterized in that, The method further includes: Obtain configuration parameters, which include at least the reconciliation event pool number, the first business party interface information, at least one second business party interface information, and callback repair information; Obtain reconciliation judgment rule information, wherein the reconciliation judgment rule information includes at least a first judgment rule and a second judgment rule; The configuration parameters and reconciliation judgment rules are stored in the reconciliation scenario configuration library, which is used to configure reconciliation tasks and reconciliation repair tasks.
9. The method according to any one of claims 1 or 3-4, characterized in that, The execution of the reconciliation task corresponding to the business transaction includes: Get the number of tasks executed on each preset device; The target device is determined based on the number of tasks and the task weighting rules. The reconciliation task is performed based on the target device.
10. A data synchronization device, characterized in that, An apparatus is used in a data synchronization system that connects to multiple different content creation and operation platforms. User-published content is published to these platforms, and when content is modified on one platform, the modifications are required to be synchronized to the other platforms. The apparatus includes: The acquisition module is used to acquire the business transaction data reported by the first business party, which is generated by the first business party based on a business request; the business request is a request to modify the published content on the content creation and operation platform; the first business party refers to the content creation and operation platform that actively makes data changes. The determination module is used to determine the execution result of the business request based on the business flow. The reconciliation module is used to execute the reconciliation task corresponding to the business transaction when the execution result is unsuccessful, and obtain the reconciliation result; if the baseline data obtained from the first business party is not aligned with the reconciliation data obtained from the second business party, the reconciliation result is determined to be a reconciliation error; the second business party is a content creation and operation platform that passively changes data. The repair module is used to execute a reconciliation repair task when the reconciliation result is an error. The reconciliation repair task is used to synchronize the baseline data to the second business party.
11. The apparatus according to claim 10, characterized in that, The determining module includes: A request sending unit is configured to send a confirmation request to the first service party, wherein the confirmation request is used to instruct the first service party to confirm and return the execution result of the service request; The reconciliation non-execution unit is used to not execute the reconciliation task corresponding to the business transaction if the execution result returned by the first business party is a success status. The reconciliation execution unit is used to determine that the execution result of the business request is unsuccessful if it does not receive the execution result returned by the first business party.
12. The apparatus according to claim 10, characterized in that, The reconciliation module includes: The reconciliation storage unit is used to store the business transaction records as reconciliation events in the reconciliation event pool; The task generation unit is used to obtain reconciliation events from the reconciliation event pool and generate reconciliation tasks corresponding to the reconciliation events. The task execution unit is used to execute the reconciliation task according to the reconciliation judgment rule and obtain the reconciliation result. The reconciliation judgment rule is used to determine whether the reconciliation task has a reconciliation error. The reconciliation judgment rule is generated based on the business needs of the first business party and at least one second business party.
13. The apparatus according to claim 12, characterized in that, The task execution unit includes: The first acquisition subunit is used to acquire the baseline data corresponding to the reconciliation event from the first business party; The second acquisition subunit is used to acquire reconciliation data corresponding to the reconciliation event from at least one of the second business parties; The data comparison subunit is used to compare the benchmark data and the reconciliation data according to the reconciliation judgment rules to obtain the comparison result; The result acquisition subunit is used to take the comparison result as the reconciliation result obtained by performing the reconciliation task.
14. The apparatus according to claim 13, characterized in that, The data comparison subunit is used for: Obtain the first and second judgment rules; Based on the first judgment rule and the second judgment rule, determine whether the benchmark data and the reconciliation data are aligned; If the baseline data and the reconciliation data are not aligned, the reconciliation result is a reconciliation error; If the baseline data and the reconciliation data are aligned, the reconciliation result is considered correct.
15. The apparatus according to any one of claims 12-14, characterized in that, The repair module includes: An error storage unit is used to store the reconciliation event as an error event in an error event record pool; An error repair unit is used to obtain error events from the error event record pool, perform callback repair on the error events, and obtain a repair result. The result sending unit is used to send the repair result to the callback party so that the callback party can display the consistency status of business data between the first business party and at least one second business party.
16. The apparatus according to claim 15, characterized in that, The error repair unit is configured as follows: Perform data synchronization processing on the reconciliation data corresponding to the aforementioned error events; If the data synchronization process fails, the data synchronization process will be repeated based on a preset number of executions. If the data synchronization process fails to execute repeatedly, the failure to fix it will be considered the fix result.
17. The apparatus according to claim 10, characterized in that, The data synchronization device further includes: The parameter acquisition module is used to acquire configuration parameters, which include at least the reconciliation event pool number, the first business party interface information, at least one second business party interface information, and callback repair information. The rule acquisition module is used to acquire reconciliation judgment rule information, which includes at least a first judgment rule and a second judgment rule. The storage module is used to store the configuration parameters and reconciliation judgment rule information into the reconciliation scenario configuration library, which is used to configure reconciliation tasks and reconciliation repair tasks.
18. The apparatus according to claim 10, characterized in that, The reconciliation module includes: The task quantity acquisition unit is used to acquire the number of tasks executed on each preset device; The target device determination unit is used to determine the target device based on the number of tasks and the task weight rules. The reconciliation task execution unit is used to execute the reconciliation task based on the target device.
19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code that can be invoked by a processor to execute the method as described in any one of claims 1 to 9.
20. A computer device, characterized in that, include: Memory; One or more processors are coupled to the memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications being configured to perform the method as described in any one of claims 1 to 9.
21. A computer program product, characterized in that, The computer program product includes computer instructions stored in a storage medium; the processor of the computer device reads the computer instructions from the storage medium and executes the computer instructions, causing the computer device to perform the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Account checking method and device, electronic equipment and computer readable medium
CN113205402A
Medical order processing method, account checking system and computer readable storage medium
CN114445061A