A method, device, server and medium for synchronizing multi-application data on the cloud
By calculating the data summary value through the hash algorithm, the data consistency between the data synchronization initiator and the receiver is determined, which solves the consistency problem in the data synchronization of multiple applications on the cloud and realizes the strict consistency and security of the data table in the multi-application architecture on the cloud.
Patent Information
- Application Number
- CN202211345921.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-10-31
AI Technical Summary
In the existing technology, the synchronization of multi-application data on the cloud has the problem of poor data consistency, which affects the subsequent related business.
The summary value of the data table is calculated through a hash algorithm to determine the data consistency between the data synchronization initiator and the receiver. When the data is consistent, data is imported. This supports data synchronization that depends on business scenarios and ensures the integrity and consistency of the data table.
It achieves strict consistency in data table synchronization, ensures the consistency and security of data in multi-application architecture on the cloud, and supports data synchronization in dependent business scenarios.
Smart Images

Figure CN115643271B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data transmission technology, and in particular to a method, device, server and medium for synchronizing multi-application data on the cloud. Background Art
[0002] The cloud-native technology architecture solves the problem that traditional application data synchronization requires specialized research and development to achieve tight application coupling, elastic scaling, and observability. However, cloud application data synchronization has higher requirements for consistency and security due to the difficulty in troubleshooting caused by software platform hosting.
[0003] Existing data synchronization technologies primarily include tightly coupled application data synchronization, scheduled data synchronization, message middleware-based asynchronous data synchronization, and real-time database data synchronization. Tightly coupled application data synchronization integrates data synchronization logic within business logic. Scheduled data synchronization uses a timer outside of application business functions to synchronize data. Message middleware-based asynchronous data synchronization uses asynchronous processing to synchronize data. Real-time database data synchronization utilizes rolling transaction logs to synchronize field data.
[0004] The above four types of data synchronization methods are applicable to different types of business systems, but they have varying degrees of deficiencies in data consistency. They may all cause inconsistent synchronized data, thus affecting the subsequent related business operations. Summary of the Invention
[0005] The embodiments of the present application provide a method, device, server and medium for synchronizing multi-application data on the cloud, which are used to solve the problem of poor data consistency in data synchronization in the prior art.
[0006] This application provides a method for synchronizing multi-application data on the cloud, the method comprising:
[0007] The data synchronization initiator obtains the data table to be synchronized, determines the first data summary value of the data table by using a hash algorithm, stores the first data summary value and the data table in a data synchronization request message, and sends the data synchronization request message to the data synchronization receiver;
[0008] The data synchronization receiver receives the data synchronization request information, obtains the first data summary value and data table carried therein, determines the second data summary value of the received data table through a hash algorithm, and determines whether the first data summary value and the second data summary value are consistent. If so, imports the data table.
[0009] Furthermore, the data synchronization initiator determines a data table to be synchronized, determines a first data digest value of the data table by using a hash algorithm, and stores the first data digest value and the data table in the data synchronization request information, including:
[0010] Determine whether the current data synchronization business scenario is a dependent business scenario. If so, obtain the dependent data table corresponding to the data table to be synchronized, determine the first data summary value of the data table and the third data summary value of the dependent data table through a hash algorithm, and store the first data summary value, the third data summary value and the data table in the data synchronization request information.
[0011] Furthermore, the data synchronization receiver receives the synchronization request information, obtains the first data summary value and the data table carried therein, determines the second data summary value of the received data table by using a hash algorithm, and determines whether the first data summary value and the second data summary value are consistent. If so, importing the data table includes:
[0012] The data synchronization receiver receives the synchronization request information and obtains the first data summary value, the third data summary value and the data table carried therein;
[0013] Determining an imported dependent data table corresponding to the data table according to pre-configured import conditions;
[0014] Determine a second data digest value of the received data table and a fourth data digest value of the imported dependent data table by a hash algorithm;
[0015] It is determined whether the first data summary value is consistent with the second data summary value, and whether the third data summary value is consistent with the fourth data summary value. If they are consistent, an import operation is performed on the data table.
[0016] Furthermore, before importing the data table, the method further includes:
[0017] Determine whether there is overwritten data corresponding to the data table in the imported data. If so, back up the overwritten data and save it to a specified address. Delete the overwritten data in the imported data and import the data table.
[0018] Furthermore, the method further comprises:
[0019] After the data table is imported, a prompt message indicating that the data has been synchronized is fed back to the data synchronization initiator.
[0020] Furthermore, the method further comprises:
[0021] If it is determined that the first data summary value and the second data summary value are inconsistent, the data table is rolled back to the data synchronization initiator, and a prompt message indicating that the synchronization data is abnormal is sent to the administrator of the data synchronization initiator.
[0022] Furthermore, the method further comprises:
[0023] If it is determined that the third data summary value and the fourth data summary value are inconsistent, the data table is rolled back to the data synchronization initiator, and a prompt message indicating that the dependent synchronization task is abnormal is sent to the administrator of the data synchronization initiator.
[0024] On the other hand, the present application provides a multi-application data synchronization device on the cloud, the device comprising:
[0025] a sending module, configured to obtain a data table to be synchronized, determine a first data summary value of the data table by using a hash algorithm, store the first data summary value and the data table in a data synchronization request message, and send the data synchronization request message to a data synchronization recipient;
[0026] A receiving module is used to receive the data synchronization request information, obtain the first data summary value and data table carried therein, determine the second data summary value of the received data table through a hash algorithm, and judge whether the first data summary value and the second data summary value are consistent. If so, import the data table.
[0027] Furthermore, the sending module is specifically used to determine whether the business scenario of the current data synchronization is a dependent business scenario. If so, obtain the dependent data table corresponding to the data table to be synchronized, determine the first data summary value of the data table and the third data summary value of the dependent data table through a hash algorithm, and store the first data summary value, the third data summary value and the data table in the data synchronization request information.
[0028] Furthermore, the receiving module is specifically used for the data synchronization receiver to receive the synchronization request information, obtain the first data summary value, the third data summary value and the data table carried therein; determine the imported dependent data table corresponding to the data table according to the pre-configured import conditions; determine the second data summary value of the received data table and the fourth data summary value of the imported dependent data table through a hash algorithm; judge whether the first data summary value and the second data summary value are consistent, and whether the third data summary value and the fourth data summary value are consistent, and if they are consistent, perform an import operation on the data table.
[0029] Furthermore, the receiving module is also used to determine whether there is overwritten data corresponding to the data table in the imported data. If so, the overwritten data is backed up and saved to a specified address, the overwritten data in the imported data is deleted, and the data table is imported.
[0030] Furthermore, the device further comprises:
[0031] The first feedback module is configured to feed back a prompt message indicating that the data has been synchronized to the data synchronization initiator after the data table is imported.
[0032] Furthermore, the device further comprises:
[0033] The second feedback module is used to return the data table to the data synchronization initiator if it is determined that the first data summary value and the second data summary value are inconsistent, and send a prompt message of synchronization data abnormality to the administrator of the data synchronization initiator.
[0034] Furthermore, the device further comprises:
[0035] The third feedback module is used to roll back the data table to the data synchronization initiator if it is determined that the third data summary value and the fourth data summary value are inconsistent, and send a prompt message of the dependent synchronization task abnormality to the administrator of the data synchronization initiator.
[0036] In another aspect, the present application provides a server, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0037] Memory for storing computer programs;
[0038] The processor is configured to implement any of the above method steps when executing a program stored in the memory.
[0039] On the other hand, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of the above are implemented.
[0040] The present application provides a method, device, server and medium for synchronizing multi-application data on the cloud, the method comprising: a data synchronization initiator determines a data table to be synchronized, determines a first data summary value of the data table by using a hash algorithm, stores the first data summary value and the data table in a data synchronization request message, and sends the data synchronization request message to a data synchronization receiver; the data synchronization receiver receives the synchronization request message, obtains the first data summary value and data table carried therein, determines a second data summary value of the received data table by using a hash algorithm, determines whether the first data summary value and the second data summary value are consistent, and if so, performs an import operation on the data table.
[0041] The above technical solution has the following advantages or beneficial effects:
[0042] In this application, when the data synchronization initiator initiates a data synchronization request message, it first obtains the data table to be synchronized, then calculates the first data summary value of the data table, and carries the first data summary value and the data table in the data synchronization request message and sends it to the data synchronization receiver. The data synchronization receiver receives the data synchronization request message, obtains the first data summary value and the data table carried therein, and first calculates the second data summary value of the received data table. When it is determined that the first data summary value and the second data summary value are consistent, it means that the data table sent by the data synchronization initiator is completely consistent with the data table received by the data synchronization receiver, and then imports the data table, thereby strictly ensuring the consistency of data table synchronization. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0044] Figure 1 Schematic diagram of the multi-application data synchronization process on the cloud provided by this application;
[0045] Figure 2 The multi-application data synchronization architecture diagram on the cloud provided for this application;
[0046] Figure 3 A schematic diagram of the structure of the synchronization device provided in this application;
[0047] Figure 4 A two-dimensional schematic diagram of the infrastructure architecture provided for this application;
[0048] Figure 5 The data synchronization principle architecture diagram provided for this application;
[0049] Figure 6 Data synchronization flow chart provided for this application;
[0050] Figure 7 A schematic diagram of the structure of the multi-application data synchronization device on the cloud provided by this application;
[0051] Figure 8 Schematic diagram of the server structure provided for this application. DETAILED DESCRIPTION
[0052] In order to make the purpose and implementation of this application clearer, the exemplary implementation of this application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of this application. Obviously, the described exemplary embodiments are only part of the embodiments of this application, not all of the embodiments.
[0053] It should be noted that the brief descriptions of terms in this application are only for the purpose of facilitating the understanding of the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their ordinary and usual meanings.
[0054] In the specification and claims of this application and the accompanying drawings, the terms "first," "second," "third," etc. are used to distinguish similar or similar objects or entities, and are not necessarily intended to limit a particular order or sequence, unless otherwise noted. It should be understood that the terms used in this manner are interchangeable under appropriate circumstances.
[0055] The terms "comprise," "include," and "have," and any variations thereof, are intended to cover but not exclude inclusion; for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0056] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functionality associated with that element.
[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
[0058] For ease of explanation, the above description has been made with reference to specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations are possible. The above embodiments are selected and described to better explain the principles and practical applications, so that those skilled in the art can better utilize the embodiments and various different variations of the embodiments suitable for specific use considerations.
[0059] Figure 1 This is a diagram of the multi-application data synchronization process on the cloud provided by this application. The process includes the following steps:
[0060] S101: A data synchronization initiator obtains a data table to be synchronized, determines a first data summary value of the data table through a hash algorithm, stores the first data summary value and the data table in a data synchronization request message, and sends the data synchronization request message to a data synchronization receiver.
[0061] S102: The data synchronization receiver receives the data synchronization request information, obtains the first data summary value and data table carried therein, determines the second data summary value of the received data table through a hash algorithm, and determines whether the first data summary value and the second data summary value are consistent. If so, imports the data table.
[0062] The multi-application data synchronization method provided in this application is applied to servers in a multi-application architecture on the cloud. The multi-application architecture on the cloud includes multiple servers, and data synchronization is required between the servers. The server that initiates data synchronization is referred to as the data synchronization initiator, and the destination server is referred to as the data synchronization receiver.
[0063] After obtaining the data table to be synchronized, the data synchronization initiator performs a hash calculation on the data table to obtain a first data digest value. It then carries the first data digest value and the data table to be synchronized in a data synchronization request message and sends the data synchronization request message to the data synchronization receiver. After receiving the data synchronization request message, the data synchronization receiver parses the data synchronization request message, obtains the first data digest value and data table carried therein, then performs a hash calculation on the received data table to obtain a second data digest value. It then determines whether the first data digest value and the second data digest value are consistent. If so, it imports the data table to complete data synchronization. Otherwise, it does not import the data.
[0064] In this application, in order to ensure the security of data synchronization, the data synchronization initiator carries the first data summary value and the data table to be synchronized in the data synchronization request information, and then adds a digital signature to the data synchronization request information through a digital signature algorithm. After the data synchronization receiver receives the data synchronization request information, it first verifies the signature of the data synchronization request information. If the signature verification is successful, the data synchronization request information is parsed to obtain the first data summary value and data table carried therein, and then a hash calculation is performed on the received data table to obtain the second data summary value, and it is determined whether the first data summary value and the second data summary value are consistent. If so, the data table is imported to complete the data synchronization, otherwise the data import is not performed. If the signature verification fails, the subsequent parsing process of the data synchronization request information is not performed.
[0065] In this application, when the data synchronization initiator initiates a data synchronization request message, it first obtains the data table to be synchronized, then calculates the first data summary value of the data table, and carries the first data summary value and the data table in the data synchronization request message and sends it to the data synchronization receiver. The data synchronization receiver receives the data synchronization request message, obtains the first data summary value and the data table carried therein, and first calculates the second data summary value of the received data table. When it is determined that the first data summary value and the second data summary value are consistent, it means that the data table sent by the data synchronization initiator is completely consistent with the data table received by the data synchronization receiver, and then imports the data table, thereby strictly ensuring the consistency of data table synchronization.
[0066] To further ensure the consistency of data synchronization, in this application, the data synchronization initiator determines the data table to be synchronized, determines the first data summary value of the data table through a hash algorithm, and stores the first data summary value and the data table in the data synchronization request information, including:
[0067] Determine whether the current data synchronization business scenario is a dependent business scenario. If so, obtain the dependent data table corresponding to the data table to be synchronized, determine the first data summary value of the data table and the third data summary value of the dependent data table through a hash algorithm, and store the first data summary value, the third data summary value and the data table in the data synchronization request information.
[0068] Before sending a data synchronization request to a data synchronization recipient, the data synchronization initiator first determines whether the current data synchronization business scenario is a dependent business scenario. If not, data synchronization is performed according to the above scheme. If it is a dependent business scenario, the dependent data table corresponding to the data table to be synchronized is obtained based on the predetermined dependency relationship between the data tables. A hash calculation is performed on the data table to be synchronized to obtain a first data digest value, and a hash calculation is performed on the dependent data table to obtain a third data digest value. The first data digest value, the third data digest value, and the data table are stored in the data synchronization request.
[0069] For a dependent business scenario, the data synchronization receiver receives the synchronization request information, obtains the first data summary value and data table carried therein, determines the second data summary value of the received data table through a hash algorithm, and determines whether the first data summary value and the second data summary value are consistent. If so, importing the data table includes:
[0070] The data synchronization receiver receives the synchronization request information and obtains the first data summary value, the third data summary value and the data table carried therein;
[0071] Determining an imported dependent data table corresponding to the data table according to pre-configured import conditions;
[0072] Determine a second data digest value of the received data table and a fourth data digest value of the imported dependent data table by a hash algorithm;
[0073] It is determined whether the first data summary value is consistent with the second data summary value, and whether the third data summary value is consistent with the fourth data summary value. If they are consistent, an import operation is performed on the data table.
[0074] In this application, for dependent business scenarios, the data synchronization recipient receives the data synchronization request information, and after obtaining the first data summary value, the third data summary value and the data table carried therein through parsing, determines the imported dependent data table corresponding to the data table according to the pre-configured import conditions; then performs a hash calculation on the imported dependent data table to obtain the fourth data summary value, and performs a hash calculation on the data table to obtain the second data summary value.
[0075] If the first and second data summary values match, the currently synchronized data tables are consistent. If the third and fourth data summary values match, the dependent data tables corresponding to the currently synchronized data tables are consistent. If the currently synchronized data tables are consistent and the dependent data tables corresponding to the currently synchronized data tables are consistent, the data table is imported to complete data synchronization. Otherwise, the data table is not imported.
[0076] In order to further ensure the consistency of data synchronization, before the data table is imported, the method further includes:
[0077] Determine whether there is overwritten data corresponding to the data table in the imported data. If so, back up the overwritten data and save it to a specified address. Delete the overwritten data in the imported data and import the data table.
[0078] In one scenario, if the data synchronization recipient verifies the data table successfully, but a network failure or import anomaly occurs during the data table import process, the locally imported data will be incomplete. When the data table needs to be re-imported, the data synchronization recipient's database will contain overwritten data. In this case, the overwritten data needs to be backed up and saved to a designated address. When business needs require a request for overwritten data, the overwritten data can be directly obtained from the designated address and the corresponding business can be carried out. After backing up the overwritten data and saving it to the designated address, the data synchronization recipient deletes the overwritten data from the database and then imports the data table again. This ensures the consistency of data synchronization.
[0079] The method further comprises:
[0080] After the data table is imported, a prompt message indicating that the data has been synchronized is fed back to the data synchronization initiator.
[0081] After the data synchronization receiver imports the data table, it can send a message to the data synchronization initiator to inform the initiator of the data synchronization status.
[0082] The method further comprises:
[0083] If it is determined that the first data summary value and the second data summary value are inconsistent, the data table is rolled back to the data synchronization initiator, and a prompt message indicating that the synchronization data is abnormal is sent to the administrator of the data synchronization initiator.
[0084] If the first data digest value and the second data digest value are inconsistent, data synchronization will not proceed, meaning the data table will not be imported. This inconsistency indicates a synchronization data anomaly. The data table will be rolled back to the data synchronization initiator, and a message alerting the anomaly will be sent to the administrator of the data synchronization initiator. This alerts the data synchronization initiator to the anomaly status and the cause of the anomaly.
[0085] The method further comprises:
[0086] If it is determined that the third data summary value and the fourth data summary value are inconsistent, the data table is rolled back to the data synchronization initiator, and a prompt message indicating that the dependent synchronization task is abnormal is sent to the administrator of the data synchronization initiator.
[0087] If the third and fourth data digest values are inconsistent, data synchronization will not proceed, meaning the data table will not be imported. This inconsistency indicates a dependent data synchronization anomaly. In this case, the data table is rolled back to the data synchronization initiator, and a message is sent to the administrator of the data synchronization initiator, indicating an anomaly in the dependent synchronization task. This allows the data synchronization initiator to identify the anomaly and identify the cause of the anomaly.
[0088] The following is a detailed description of the multi-application data synchronization process on the cloud provided by this application.
[0089] 1. The data synchronization of multiple applications on the cloud is implemented based on the API interface. Each processing link of the data synchronization of this application is processed in a purely asynchronous manner, and the response time of the API interface is in milliseconds.
[0090] 2. This application can realize the multi-threaded concurrent sending of data synchronization request information by the data synchronization initiator to multiple data synchronization receivers, with high CPU utilization. The data synchronization processing links are all processed in parallel using multi-threaded processing based on database tables, with high business processing concurrency, which can fully utilize CPU computing resources.
[0091] 3. To control overall processing time, this application limits the amount of data synchronized at a single time to a certain threshold, for example, within 100MB. Anything exceeding 100MB is sent in multiple requests. A "number limit" is configured for the number of records in a single table, which are sent in separate messages. This ensures that the application occupies limited memory during runtime. Data transmission is streamed, ensuring a memory-constrained process.
[0092] 4. When transmitting data synchronization request information, a digital signature algorithm is used to improve data transmission security, and the transmission is transmitted over the HTTPS network to further improve data transmission security. The overall data summary check ensures the consistency of data synchronization.
[0093] This application uses cloud-native technology to design multi-center application data synchronization, adopts a two-dimensional plane microservice architecture, and embeds irreversible secure data verification technology with a data signature algorithm as the core in the management plane. It supports a two-layer verification factor calculation method on the data plane to achieve the high consistency and data security requirements of data synchronization for batch processing systems under a multi-center hot standby architecture. At the same time, it has decoupling from the application system, elastic scaling capabilities, and wide applicability. The identification of highly discrete transaction elements in financial transaction data and the irreversible secure data summary and verification technology for these transaction elements ensure the high consistency and data security of multi-center data synchronization.
[0094] Figure 2 This application provides a diagram of the cloud multi-application data synchronization architecture, including data synchronization session scheduling, data synchronization session services, and various business systems. Each business system includes a database and a synchronization device configured independently of the database.
[0095] Figure 3 This is a structural diagram of the synchronization device provided in this application. The synchronization device is mainly divided into four working modules, namely configuration management module, multi-center management module, data synchronization module, and task monitoring module.
[0096] The synchronization device proposed in this application uses the HTTP universal API communication protocol and leverages data security verification technology to achieve low-coupling data synchronization for cloud applications. Specific features include two-dimensional flat center management and data synchronization with dynamic scaling. The detailed working principles are detailed below.
[0097] Figure 4 A two-dimensional schematic diagram of the infrastructure architecture provided for this application is shown in the figure below. Figure 4 As shown, it includes a mesh console and various business systems. Each business system includes a synchronization device. Figure 4 The dashed line in the figure represents the management plane, and the solid line represents the data plane. The management plane incorporates irreversible secure data verification technology centered around a data signature algorithm, while the data plane supports two-layer verification factor calculation.
[0098] The multi-center management module is configured as follows:
[0099] (1) Central registration table and central status table.
[0100] The center registry provides configuration for the following information: center ID, machine ID, IP, and port. A center status table, MACHINE_ST, is added to support active detection of center line status. The center status table can record the connection status between centers.
[0101] (2) Central link establishment and link selection.
[0102] Communication with other centers uses short HTTP links. When sending synchronization messages to each center, a load balancing strategy such as polling or specifying a machine is used to send a data synchronization request to a machine in the center.
[0103] (3) Unified data synchronization API.
[0104] a. Status detection interface:
[0105] GET, parameter is empty, normal return message body {code: "0000", msg: ""}, abnormal fill in the specific error code and reason.
[0106] b. Center identification query interface:
[0107] GET, parameter is empty, normal return message body {code: "0000", msg: "", centerIn: "master"}, exception is the same as above.
[0108] c. Data synchronization receiving interface:
[0109] POST, the request message includes {eventid: xxx, dataTaskId: xxx, params: LISTMAP}, the data file is sent in multimedia attachment format, the response is the same as a, a normal response only indicates that it has been received.
[0110] d. Remote center response interface:
[0111] POST, the request message body includes {code: "0000", msg: "", eventid: xxx, dataTaskId: xxx}, the response is the same as a.
[0112] The data synchronization schedule is as follows:
[0113] Sessions are scheduled using the job scheduling system. Specific session execution conditions must be handled in accordance with the following requirements:
[0114] a. The dependent business session has been successfully executed.
[0115] b. The corresponding business data has been executed.
[0116] c. All data synchronization tasks corresponding to the current transfer date have been successful (used to limit abnormal scenarios such as redoing and avoid conflicts in the synchronization of similar data).
[0117] The function of each session is essentially a call to a data task.
[0118] a. Define the data synchronization content through data synchronization task configuration.
[0119] b. Fill in the parameters required for the corresponding task.
[0120] c. Call the device described in this proposal to initiate data synchronization.
[0121] The data synchronization module is configured as follows:
[0122] Figure 5 This is the data synchronization principle architecture diagram provided for this application.
[0123] (1) The task is defined as follows:
[0124] a. Task ID: Development assigned, for display only.
[0125] b. Task description: Development definition, for demonstration only.
[0126] c. Task type: data transfer, file transfer.
[0127] d. Data configuration: [{database, entity name, table name, condition: {[{field, type, operator, value}...], SQL_WHERE}},......] Description: Supports variable placeholders, fill in the actual value when initiating, and the device uniformly assembles the conditions into fill-in parameters according to the configured primary key.
[0128] e. Financial field column configuration: For the target table to be exported, according to the conditions configured in item d, the financial field columns are specifically exported based on the number of data entries within the set threshold range. The threshold range can be set to 5,000 to 6,000 or 5,000 to 7,000, for example. After aggregation, the data digest value is calculated using the SHA256 hash algorithm. This data digest value and the corresponding data table are hash-mapped and stored in the data synchronization request message, which is sent to the backup center. Financial field columns are mandatory. For synchronization of non-financial data, you can specify frequently changing fields such as time information and status information to achieve the same effect.
[0129] (2) Data export and synchronization initiation are as follows:
[0130] a. Generate files when exporting data.
[0131] d. There are two ways to export data: configure conditional fields or conditional SQL.
[0132] c. Generate a secure data digest. For data synchronization tasks with dependencies, wait for the dependent tasks to complete. Before starting this data synchronization, first export the financial field columns according to the number of data items within the set threshold range. After aggregation, use the SHA256 hash algorithm to calculate the data digest value as digest factor A. Then calculate the data digest of the newly added data as digest factor B. The two calculated digest values are placed as a digest pair in the data synchronization request message. For data synchronization tasks with no dependencies, export the financial field columns according to the number of data items within the set threshold range. After aggregation, use the SHA256 hash algorithm to calculate the data digest value. Pair this digest value B with the empty digest factor A_EMPTY. Store it in the data synchronization request message through a hash map with the corresponding data file and send it to the backup center.
[0133] (3) Data import is as follows:
[0134] After receiving the import file, implement it first. For data synchronization tasks with dependent tasks, calculate the existing data summary according to the import conditions before importing. If the data is empty, set the summary factor A_EMPTY to avoid repeated calculation. If data exists, calculate the summary value A'.
[0135] b. The backup center's tolerance for data synchronization: Configurable dependency conditions allow data to be overwritten when the conditions are met.
[0136] c. Back up the overwritten data before importing. After the backup is complete, delete it first and then insert the synchronized data.
[0137] d. Import and Data Summary Factor Calculation: To avoid the risk of synchronizing excessive amounts of data, we do not use the batch-submitted "large transaction" method to import data. Instead, each imported data entry is automatically submitted to the database. If an exception occurs during the backup import process, the backup data is used to roll back the current import operation to achieve data consistency at the application level. After the import is complete, the data summary factor B' for the imported incremental data is calculated using the same method.
[0138] e. Security Verification: Compare the digest factors A' and B' calculated on the receiving side with A and B in the message. Data is considered consistent only when both are equal. If A and A' are consistent but B is not equal to B', there is a problem with the synchronized data. All currently imported data will be rolled back, and the error message will be reported to the operations and maintenance personnel. If A and A' are inconsistent but B is equal to B', data synchronization is consistent but a dependent synchronization task has a fault. All currently imported data will be rolled back, and the error message will be reported to the operations and maintenance personnel.
[0139] Figure 6 The data synchronization flow chart provided for this application is as follows: Figure 6As shown in the figure, a data synchronization process consists of five specific steps. From the beginning to the end, the technical parameters of both sides of the data synchronization are loaded. The data synchronization initiator (the primary center) waits for the business operation to complete the database operation. Upon completion, the data synchronization device generates a data file for the incremental data of the current operation, along with a data security verification summary. The data file is then sent to the data synchronization receiver (the backup center) via HTTP. Upon receiving the request, the data synchronization receiver first stores the data file. After completing the data security verification, the specific import operation begins, and the processing results are finally fed back to the data synchronization initiator.
[0140] Figure 7 This is a schematic diagram of the structure of the multi-application data synchronization device on the cloud provided by this application, which includes:
[0141] A sending module 71 is configured to obtain a data table to be synchronized, determine a first data summary value of the data table by using a hash algorithm, store the first data summary value and the data table in a data synchronization request message, and send the data synchronization request message to a data synchronization recipient;
[0142] The receiving module 72 is used to receive the data synchronization request information, obtain the first data summary value and data table carried therein, determine the second data summary value of the received data table through a hash algorithm, and judge whether the first data summary value and the second data summary value are consistent. If so, import the data table.
[0143] The sending module 71 is specifically used to determine whether the business scenario of the current data synchronization is a dependent business scenario. If so, obtain the dependent data table corresponding to the data table to be synchronized, determine the first data summary value of the data table and the third data summary value of the dependent data table through a hash algorithm, and store the first data summary value, the third data summary value and the data table in the data synchronization request information.
[0144] The receiving module 72 is specifically used for the data synchronization receiver to receive the synchronization request information, obtain the first data summary value, the third data summary value and the data table carried therein; determine the imported dependent data table corresponding to the data table according to the pre-configured import conditions; determine the second data summary value of the received data table and the fourth data summary value of the imported dependent data table through a hash algorithm; judge whether the first data summary value and the second data summary value are consistent, and whether the third data summary value and the fourth data summary value are consistent, and if they are consistent, perform an import operation on the data table.
[0145] The receiving module 72 is further configured to determine whether there is overwritten data corresponding to the data table in the imported data. If so, the overwritten data is backed up and saved to a specified address, the overwritten data in the imported data is deleted, and the data table is imported.
[0146] The device further comprises:
[0147] The first feedback module 73 is configured to feed back a prompt message indicating that the data has been synchronized to the data synchronization initiator after the data table is imported.
[0148] The device further comprises:
[0149] The second feedback module 74 is configured to return the data table to the data synchronization initiator if it is determined that the first data summary value and the second data summary value are inconsistent, and send a prompt message of synchronization data abnormality to the administrator of the data synchronization initiator.
[0150] The device further comprises:
[0151] The third feedback module 75 is used to return the data table to the data synchronization initiator if it is determined that the third data summary value and the fourth data summary value are inconsistent, and send a prompt message of the dependent synchronization task abnormality to the administrator of the data synchronization initiator.
[0152] This application also provides a server, such as Figure 8 As shown, it includes: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304;
[0153] The memory 303 stores a computer program, and when the program is executed by the processor 301 , the processor 301 performs any of the above method steps.
[0154] The communication bus mentioned in the server above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into address buses, data buses, control buses, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0155] The communication interface 302 is used for communication between the server and other devices.
[0156] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk memory. Alternatively, the memory may be at least one storage device located away from the processor.
[0157] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0158] The present application also provides a computer-readable storage medium, which stores a computer program that can be executed by a server. When the program runs on the server, the server implements any of the above method steps when executing.
[0159] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0160] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A method for synchronizing multi-application data on the cloud, characterized in that: The method comprises: The data synchronization initiator obtains the data table to be synchronized, determines whether the business scenario of the current data synchronization is a dependent business scenario, and if so, obtains the dependent data table corresponding to the data table to be synchronized, determines the first data summary value of the data table and the third data summary value of the dependent data table through a hash algorithm, stores the first data summary value, the third data summary value and the data table in a data synchronization request message, and sends the data synchronization request message to the data synchronization receiver; The data synchronization receiver receives the data synchronization request information and obtains the first data summary value, the third data summary value and the data table carried therein; Determining an imported dependent data table corresponding to the data table according to pre-configured import conditions; Determine a second data digest value of the received data table and a fourth data digest value of the imported dependent data table by a hash algorithm; It is determined whether the first data summary value is consistent with the second data summary value, and whether the third data summary value is consistent with the fourth data summary value. If they are consistent, an import operation is performed on the data table.
2. The method according to claim 1, wherein Before the data table is imported, the method further includes: Determine whether there is overwritten data corresponding to the data table in the imported data. If so, back up the overwritten data and save it to a specified address. Delete the overwritten data in the imported data and import the data table.
3. The method according to claim 1, wherein The method further comprises: After the data table is imported, a prompt message indicating that the data has been synchronized is fed back to the data synchronization initiator.
4. The method according to claim 1, wherein The method further comprises: If it is determined that the first data summary value and the second data summary value are inconsistent, the data table is rolled back to the data synchronization initiator, and a prompt message indicating that the synchronization data is abnormal is sent to the administrator of the data synchronization initiator.
5. The method according to claim 1, wherein The method further comprises: If it is determined that the third data summary value and the fourth data summary value are inconsistent, the data table is rolled back to the data synchronization initiator, and a prompt message indicating that the dependent synchronization task is abnormal is sent to the administrator of the data synchronization initiator.
6. A multi-application data synchronization device on the cloud, characterized in that: The device comprises: A sending module is used for the data synchronization initiator to obtain the data table to be synchronized, determine whether the business scenario of the current data synchronization is a dependent business scenario, and if so, obtain the dependent data table corresponding to the data table to be synchronized, determine the first data summary value of the data table and the third data summary value of the dependent data table through a hash algorithm, store the first data summary value, the third data summary value and the data table in data synchronization request information, and send the data synchronization request information to the data synchronization receiver; A receiving module is used for the data synchronization receiver to receive the synchronization request information, obtain the first data summary value, third data summary value and data table carried therein; determine the imported dependent data table corresponding to the data table according to pre-configured import conditions; determine the second data summary value of the received data table and the fourth data summary value of the imported dependent data table through a hash algorithm; judge whether the first data summary value and the second data summary value are consistent, and whether the third data summary value and the fourth data summary value are consistent, and if they are consistent, perform an import operation on the data table.
7. The device according to claim 6, characterized in that The receiving module is further configured to determine whether there is overwritten data corresponding to the data table in the imported data; if so, back up the overwritten data and save it to a specified address, delete the overwritten data in the imported data, and perform an import operation on the data table.
8. The device according to claim 6, wherein The device further comprises: The first feedback module is configured to feed back a prompt message indicating that the data has been synchronized to the data synchronization initiator after the data table is imported.
9. The device according to claim 6, wherein The device further comprises: The second feedback module is used to return the data table to the data synchronization initiator if it is determined that the first data summary value and the second data summary value are inconsistent, and send a prompt message of synchronization data abnormality to the administrator of the data synchronization initiator.
10. The device according to claim 6, wherein The device further comprises: The third feedback module is used to roll back the data table to the data synchronization initiator if it is determined that the third data summary value and the fourth data summary value are inconsistent, and send a prompt message of the dependent synchronization task abnormality to the administrator of the data synchronization initiator.
11. A server, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Service processing method and device based on artificial intelligence and electronic equipment
CN112231367A