A method for updating service data, a related device and a storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-03-03
- Publication Date
- 2026-07-10
AI Technical Summary
因此,在创建快照的过程中,若已完成扫描的部分数据发生变更,则无法获取到变更后的数据,导致数据入库的准确性和完整性较低
[0065] This application provides a method for updating business data. A target node can obtain snapshot data from a first time point to a second time point corresponding to first business data in the business node, and obtain operation logs from the first time point to a third time point, where the third time point is a time point following the second time point. The target node can then generate log data based on the operation logs, and update the second business data (which is the business data from the first to the third time points) based on the log data and the snapshot data. Through this method, during the snapshot creation process of the business node, when some scanned data changes, the operation logs accurately record the real-time changes in the data. Therefore, the target node can use the operation logs to update the received snapshot data, thereby improving the accuracy and completeness of data synchronization.
Smart Images

Figure CN115033578B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud database technology, and in particular to a method, related apparatus and storage medium for updating business data. Background Technology
[0002] With the rapid development of the internet, data volume is enormous and updates frequently. Business databases with limited performance (such as MySQL) may not be able to handle complex and computationally intensive tasks effectively. Generally, data can be imported into a more stable data warehouse with larger storage capacity and stronger computing power.
[0003] In the existing data ingestion process, snapshots can be used to scan the business database for the data that needs to be copied, and then the scanned data can be copied to the data warehouse.
[0004] Because data snapshots require a certain amount of time, while business data is constantly changing, if some scanned data changes during the snapshot creation process, the changed data cannot be obtained, resulting in lower accuracy and completeness of the data being imported into the database. Summary of the Invention
[0005] This application provides a method, related apparatus, and storage medium for updating business data, which improves the accuracy and integrity of data during the process of synchronizing business data from business nodes to target nodes.
[0006] In view of this, this application provides a method for updating business data, including:
[0007] Obtain snapshot data from the business node, wherein the snapshot data is generated by the business node based on the first business data, and the first business data is the business data from the first time to the second time.
[0008] Obtain the target operation log from the business node. The target operation log includes the operation log recorded by the business node from the first moment to the third moment, where the third moment is the moment that occurs after the second moment.
[0009] Obtain log data based on the target operation log;
[0010] Based on the snapshot data and log data, the second business data is updated and obtained, which is the business data from the first time to the third time.
[0011] This application also provides a method for updating business data, including:
[0012] Obtain the first business data corresponding to the period from the first moment to the second moment;
[0013] Generate snapshot data based on the first business data;
[0014] Retrieve the target operation log from the first moment to the third moment, where the third moment is the moment that occurs after the second moment.
[0015] Snapshot data and target operation logs are sent to the target node so that the target node can obtain log data based on the target operation logs. Based on the snapshot data and log data, the second business data is updated and obtained. The second business data is the business data from the first time to the third time.
[0016] Another aspect of this application provides a business data updating apparatus, comprising:
[0017] The acquisition unit is used to acquire snapshot data from the business node, wherein the snapshot data is generated by the business node based on the first business data, and the first business data is the business data from the first time to the second time.
[0018] The acquisition unit is also used to acquire target operation logs from business nodes, wherein the target operation logs are the operation logs recorded by the business nodes from the first moment to the third moment, and the third moment is a moment that occurs after the second moment;
[0019] The acquisition unit is also used to acquire log data based on the target operation log;
[0020] The update unit is used to update the second business data based on the snapshot data and log data, wherein the second business data is the business data from the first time to the third time.
[0021] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0022] The update unit is specifically used to retrieve data from the log data from the first moment to the second moment to obtain the first updated data;
[0023] The second updated data is obtained by retrieving data from the log data from the second time point to the third time point.
[0024] The snapshot data is updated using the first and second update data to obtain the second business data.
[0025] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0026] The update unit is specifically used to retrieve data from the log data from the second time point to the third time point to obtain the second updated data;
[0027] The snapshot data is updated using the second updated data to obtain the second business data.
[0028] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0029] The acquisition unit is also used to acquire the record logs corresponding to the business node from the second time to the third time if the first business data changes between the second time and the third time.
[0030] The acquisition unit is also used to acquire the third updated data of the first business data between the second and third time points based on the recorded logs;
[0031] The update module is also used to update snapshot data using third-party update data.
[0032] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0033] The acquisition unit is specifically used to receive snapshot data sent by the service node if the service node detects a change in the first service data.
[0034] In one possible design, in another implementation of another aspect of the embodiments of this application, the service update device further includes a receiving unit, a comparison unit, and a sending unit.
[0035] The receiving unit is used to receive the third service data sent by the service node, wherein the third service data is the service data that has not changed after the third time point;
[0036] The comparison unit is used to compare the second business data and the third business data to obtain the data comparison results;
[0037] The sending unit is used to send the data comparison results to the service nodes so that the service nodes can adjust the first time and the second time according to the data comparison results.
[0038] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0039] The update unit is also used to update the second business data using the third business data if the data comparison result indicates that the second business data and the third business data are inconsistent.
[0040] Another aspect of this application provides a business data updating apparatus, comprising:
[0041] The acquisition unit is used to acquire the first business data corresponding to the period from the first time to the second time.
[0042] A generation unit is used to generate snapshot data based on the first business data;
[0043] The acquisition unit is also used to acquire the target operation log from the first moment to the third moment, where the third moment is a moment that occurs after the second moment;
[0044] The sending unit is used to send snapshot data and target operation log to the target node, so that the target node can obtain log data according to the target operation log, and update the second service data according to the snapshot data and log data. The second service data is the service data from the first time to the third time.
[0045] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0046] The generation unit is specifically used to generate snapshot data based on the first business data if a change is detected in the first business data.
[0047] In one possible design, in another implementation of another aspect of the embodiments of this application, the business data update device further includes a receiving unit and an adjustment unit;
[0048] The sending unit is specifically used to send third service data to the target node. The third service data is data that has not changed after the third time point.
[0049] The receiving unit is used to receive the data comparison result sent by the target node, wherein the data comparison result is obtained by the target node after comparing the second service data and the third service data;
[0050] The adjustment unit is used to adjust the first and second time points based on the data comparison results.
[0051] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0052] The adjustment unit is specifically used to determine the difference between the third business data and the second business data based on the data comparison results.
[0053] If the difference value is greater than or equal to the difference threshold, then the interval between the first and second time points is shortened.
[0054] This application also provides a computer device, specifically a target node, which includes: a memory, a transceiver, a processor, and a bus system;
[0055] The memory is used to store programs;
[0056] The processor is used to execute programs in memory, and the processor is used to execute the methods mentioned above according to the instructions in the program code;
[0057] Bus systems are used to connect memory and processor to enable communication between them.
[0058] This application also provides a computer device, specifically a service node, which includes: a memory, a transceiver, a processor, and a bus system;
[0059] The memory is used to store programs;
[0060] The processor is used to execute programs in memory, and the processor is used to execute the methods mentioned above according to the instructions in the program code;
[0061] Bus systems are used to connect memory and processor to enable communication between them.
[0062] Another aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described above.
[0063] Another aspect of this application provides a computer program product or computer program including 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 above aspects.
[0064] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0065] This application provides a method for updating business data. A target node can obtain snapshot data from a first time point to a second time point corresponding to first business data in the business node, and obtain operation logs from the first time point to a third time point, where the third time point is a time point following the second time point. The target node can then generate log data based on the operation logs, and update the second business data (which is the business data from the first to the third time points) based on the log data and the snapshot data. Through this method, during the snapshot creation process of the business node, when some scanned data changes, the operation logs accurately record the real-time changes in the data. Therefore, the target node can use the operation logs to update the received snapshot data, thereby improving the accuracy and completeness of data synchronization. Attached Figure Description
[0066] Figure 1 This is a schematic diagram illustrating a scenario in which business data in a business node is synchronized to a data warehouse in an embodiment of this application.
[0067] Figure 2 This is a schematic diagram illustrating the application scenario of the business data update method in the embodiments of this application;
[0068] Figure 3 This is a schematic diagram of one embodiment of the business data updating method in this application;
[0069] Figure 4 This is a schematic diagram illustrating how the second business data is updated based on snapshot data and log data in an embodiment of this application.
[0070] Figure 5 This is another schematic diagram illustrating how the second business data is updated based on snapshot data and log data in this embodiment of the application.
[0071] Figure 6 This is a schematic diagram of a scenario in this embodiment where the second business data and the third business data are compared;
[0072] Figure 7 This is a schematic diagram of another embodiment of the business data updating method in this application;
[0073] Figure 8 This is a schematic diagram of a data sharing system based on blockchain technology in an embodiment of this application;
[0074] Figure 9 This is a schematic diagram of a blockchain based on a data sharing system in an embodiment of this application;
[0075] Figure 10 This is a schematic diagram illustrating an embodiment of generating a block in this application.
[0076] Figure 11 This is a schematic diagram of the structure of a business data update device provided in an embodiment of this application;
[0077] Figure 12 This is a schematic diagram of another embodiment of the business data update device in this application;
[0078] Figure 13 This is a schematic diagram of the structure of a node device in an embodiment of this application. Detailed Implementation
[0079] This application provides a method, related apparatus, and storage medium for updating business data, which improves the accuracy and integrity of data during the process of synchronizing business data from business nodes to target nodes.
[0080] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding to,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0081] The Storage Networking Industry Association (SNIA) defines a snapshot as: a fully usable copy of a specified set of data, which includes an image of the data at a specific point in time (the point at which the copy began). A snapshot can be a copy of the data it represents, or a replica of the data.
[0082] The primary function of snapshots is to enable online data backup and recovery. When storage devices experience application failures or file corruption, they allow for rapid data recovery, restoring data to a usable point in time. Another function of snapshots is to provide storage users with an alternative data access channel. While the original data is being processed online, users can access the snapshot data and utilize snapshots for testing and other tasks. Therefore, snapshots are an indispensable feature for storage systems and are frequently used in the following business scenarios:
[0083] A: Daily backups of databases, system disks, or data disks can utilize snapshots to periodically back up important business data, thus mitigating the risk of data loss due to accidental operations, attacks, or viruses.
[0084] B: Before major operations such as changing the operating system, upgrading application software, or migrating business data, one or more data snapshots can be created. If any problems occur during the upgrade or migration process, the system data can be restored to a normal state in a timely manner through the data snapshots.
[0085] C: The application of multiple copies of business data can provide near real-time real business data for applications such as data mining, report querying, or development testing by creating snapshots of business data.
[0086] Please see Figure 1As shown, in a scenario where snapshots are used to synchronize business data from business nodes to a data warehouse, taking the synchronization of all data from business nodes from 0:00 to 24:00 each day to the data warehouse as an example, neither data older than 24:00 nor data before 24:00 should be missed. Snapshot technology requires a traversal scan of the data to be backed up; the larger the amount of data to be backed up, the longer the traversal scan time. To ensure that the synchronized data does not exceed 24:00, a snapshot can be taken at 23:00, capturing data from 0:00 onwards in the business nodes. Assuming the snapshot creation process takes 30 minutes, the snapshot data obtained at this time will be data from 0:00 to 23:30. On the one hand, data from 23:30 to 24:00 is missing; on the other hand, for business nodes carrying business data, the frequency of changes to the stored business data is often quite frequent. Therefore, if changes occur to some data that has already been scanned during the snapshot creation process (e.g., additions, modifications, or deletions), the snapshot will not be aware of these changes. Therefore, changes to the data that has already been scanned between 11 PM and 11:30 PM are missed. At this time, the snapshot cannot obtain the changed data, resulting in low accuracy and completeness of the data entering the database.
[0087] Please see Figure 2 , Figure 2 This application describes an application scenario for the business data update method provided in this embodiment. To address the aforementioned issues, this application can send snapshot data from a business node between a first and second moment (e.g., 0:00 to 23:30) to a target node (e.g., a data warehouse), and also send operation logs from the business node between a first and third moment (e.g., 0:00 to 24:00) to the target node. Since the operation logs accurately record real-time data changes (including 0:00 to 24:00), the target node can use the operation logs as a basis to overwrite the snapshot data with the recorded data changes, thereby improving the accuracy and completeness of the data synchronization process.
[0088] Based on the above introduction, the method for updating business data in this application based on the target node is described below. Please refer to [link / reference]. Figure 3 , Figure 3 This is a schematic diagram of an embodiment of the method for updating business data in this application. As shown in the figure, an embodiment of the method for updating business data in this application includes:
[0089] 101. Obtain snapshot data from the business node, wherein the snapshot data is generated by the business node based on the first business data, and the first business data is the business data from the first moment to the second moment;
[0090] This application provides a method for synchronizing business data from a business node to a target node. The business node can be a database (such as MySQL or Oracle) used to store business data. With the rapid development of the internet, business data from sectors such as internet value-added services, online games, finance, or e-commerce are often massive in volume and frequently updated. To better store and analyze business data, a data warehouse with higher storage capacity, stronger computing power, and greater stability is generally chosen as the target node, and the business data from the business node is synchronized to the target node.
[0091] In short, a "database" can be viewed as an electronic filing cabinet—a place to store electronic files, where users can add, query, update, and delete data. A "database" is a collection of data stored together in a certain way, shared by multiple users, with minimal redundancy, and independent of application programs.
[0092] A Database Management System (DBMS) is a computer software system designed to manage databases, generally possessing basic functions such as storage, retrieval, security, and backup. DBMSs can be classified according to the database model they support, such as relational or XML (Extensible Markup Language); or according to the type of computer they support, such as server clusters or mobile devices; or according to the query language used, such as SQL (Structured Query Language) or XQuery; or according to performance priorities, such as maximum scale or maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, simultaneously supporting multiple query languages.
[0093] For ease of understanding, this embodiment takes synchronizing all business data from 0:00 to 24:00 every day in the business node to the data warehouse as an example. It is required that the business data synchronized to the data warehouse cannot contain data beyond 24:00, nor can it omit any data before 24:00.
[0094] Specifically, the time point corresponding to the first business data for which a snapshot needs to be created (i.e., the first and second moments in this application) is first selected. Then, the business data in the business node is traversed and scanned according to the selected first and second moments. Since the traversal scan takes time, a snapshot needs to be created in advance. It should be noted that in this embodiment, the second moment refers to the moment the snapshot is created, while the time consumed during the snapshot creation process is not within the range of the second moment.
[0095] Taking 0:00 as the first time point and 23:00 as the second time point as the second, a snapshot of the business data from 0:00 to 23:00 is created, resulting in a snapshot data set. Since the snapshot scan is comprehensive, no data will be missed. This snapshot data can then be sent to the data warehouse.
[0096] However, this snapshot data is incomplete. Assuming snapshot creation takes half an hour, any changes to the already scanned business data within that half hour will not be detected again. Therefore, this snapshot data does not fully capture the data changes of the first business data between 11:00 PM and 11:30 PM. Furthermore, since no snapshot scan was performed between 11:30 PM and midnight, this snapshot data also lacks the data changes from 11:30 PM to midnight. Therefore, it is necessary to supplement the snapshot data with the data changes from 11:00 PM to midnight from the business data.
[0097] Specifically, the "business node" and "target node" in this application can be composed of servers. These servers can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers 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, and big data and artificial intelligence platforms. The terminal can connect directly or indirectly to the server via wired or wireless communication to read and write data stored on the server. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these.
[0098] In practical applications, if the computing power of a business node or target node is relatively limited, computing devices can be configured for it. For example, these computing devices can be configured on a cloud server, which will then perform the logical processing and computation.
[0099] 102. Obtain the target operation log from the business node. The target operation log is the operation log recorded by the business node from the first moment to the third moment. The third moment is the moment that appears after the second moment.
[0100] Database operation logs record real-time data changes. Therefore, operation logs provide a clear picture of all data changes, whether updates, insertions, or deletions. However, operation log transmission has a certain probability of loss, especially for MySQL databases, where log transmission is more unstable, leading to data inaccuracies.
[0101] In this embodiment, the business node can send the operation logs from the first moment to the third moment to the data warehouse. Taking the third moment as 24:00 as an example, the target operation logs are the operation logs from 0:00 to 24:00.
[0102] It should be noted that business nodes can send the updated operation logs to the data warehouse in real time between the first and third time points; alternatively, they can package the operation logs from the first to the third time point together and send them to the data warehouse after the third time point is reached.
[0103] 103. Obtain log data based on the target operation log;
[0104] After receiving the target operation log from the business node, the data warehouse can parse the target operation log and generate log data. This log data accurately reflects the data changes of the business node at each time point from the first time to the third time (0:00 to 24:00).
[0105] 104. Based on the snapshot data and log data, update the second business data, which is the business data from the first time to the third time.
[0106] Since the log data includes data changes at various points in time from the first to the third time (0:00 to 24:00), it naturally also includes data changes from the second to the third time (23:00 to 24:00). As mentioned in step 101, the snapshot data received by the data warehouse is incomplete and inaccurate. Therefore, the data warehouse can update the second business data based on the snapshot data and the log data.
[0107] Taking an e-commerce application scenario as an example, in a business node, there is an order data entry whose order status is updated to "Pending Shipment" at 8 PM. At this time, the business node starts creating a snapshot from 11 PM until 11:30 PM. Assume that during the snapshot creation process, the order data is scanned at 11:10 PM, and the "Pending Shipment" status updated at 8 PM has already been recorded. When the order data is updated to "Shipped" at 11:20 PM, this "Shipped" status will not be scanned by the snapshot. In the snapshot data received by the data warehouse, the order will still be in the "Pending Shipment" status. However, the operation log can record the event that the order status was updated to "Shipped" at 11:20 PM. After receiving this operation log, the data warehouse can parse and generate corresponding log data. The log data records that the order status was updated to "Shipped" at 11:20 PM. The latest update time recorded in the snapshot data for this order is 8 PM, indicating that the update time for the order status "shipped" in the operation log is later than the update time for the order status "pending shipment" in the snapshot data. In this case, the "shipped" order status in the operation log should be taken as the standard, and the "pending shipment" order status in the snapshot data should be overwritten.
[0108] This application provides a method for updating business data. A target node can obtain snapshot data from a first time point to a second time point corresponding to first business data in the business node, and obtain operation logs from the first time point to a third time point, where the third time point is a time point following the second time point. The target node can then generate log data based on the operation logs, and update the second business data (which is the business data from the first to the third time points) based on the log data and the snapshot data. Through this method, during the snapshot creation process of the business node, when some scanned data changes, the operation logs accurately record the real-time changes in the data. Therefore, the target node can use the operation logs to update the received snapshot data, thereby improving the accuracy and completeness of data synchronization.
[0109] Optionally, in the above Figure 3 Based on the corresponding embodiments, in another optional embodiment of the business data update method provided in this application, the second business data is updated according to snapshot data and log data, specifically including:
[0110] Retrieve data from the first moment to the second moment from the log data to obtain the first updated data;
[0111] The second updated data is obtained by retrieving data from the log data from the second time point to the third time point.
[0112] The snapshot data is updated using the first update data to obtain the third update data;
[0113] The second updated data is used to update the third updated data to obtain the second business data.
[0114] In this embodiment, snapshots cannot reflect the data update status across different time periods; they only provide the real-time state of the data at a specific moment. Therefore, to make the snapshot data more complete, data from the first moment to the second moment can be retrieved from the log data to obtain the first updated data. This first updated data records the changes the business data underwent from the first moment to the second moment. Updating the snapshot data using the first updated data completes the data update process and improves the integrity of the snapshot data.
[0115] On the other hand, since snapshots are created starting at the second time point, and the snapshot traversal scan takes time, any changes to already scanned business data during the traversal scan (i.e., after the second time point) will not be scanned again. Therefore, data from the second to the third time point can be obtained from the log data to obtain the second updated data. This second updated data records the changes the business data underwent from the second to the third time point. Updating the snapshot data with this second updated data supplements the changes the business data underwent after the second time point, improving the completeness of the snapshot data.
[0116] For easier understanding, please refer to Figure 4 , Figure 4 This is a schematic diagram illustrating a scenario in this application where second business data is updated based on snapshot data and log data. For example... Figure 4As shown, the order status was updated to "Pending Payment" at 10:00, "Paid" at 18:00, and "Shipped" at 23:20. At this time, the business node created a snapshot at 23:00 and scanned the order status at 23:10, showing "Paid" at 18:00. However, the order status updated to "Shipped" at 23:20 could not be scanned again by the snapshot, making the snapshot data inaccurate. Furthermore, the data warehouse operations could not know that the order status had previously been updated to "Pending Payment" at 10:00; therefore, the completeness of this snapshot data is low. By using the operation logs from 00:00 to 24:00, the data warehouse can obtain the changes in the order status at different points in time and update the snapshot data. On one hand, it supplements the data changes before the snapshot update time (18:00), such as adding: "Order status updated to 'Pending Payment' at 10:00." On the other hand, it uses data changes after the snapshot update time (18:00) to overwrite the snapshot data, i.e., updating it to: "Order status updated to 'Shipped' at 23:20." Ultimately, the updated second business data is as follows: the order status was updated to "Pending Payment" at 10:00, the order status was updated to "Paid" at 18:00, and the order status was updated to "Shipped" at 23:20.
[0117] In this embodiment, the data from the first moment to the second moment in the log data is used to supplement the data changes before the snapshot data update time. The data from the second moment to the third moment in the log data is used to overwrite the snapshot data. The resulting second business data includes the data changes of the business data at each time point from the first moment to the third moment, thereby improving the completeness and accuracy of the snapshot data.
[0118] Optionally, in the above Figure 3 Based on the corresponding embodiments, in another optional embodiment of the business data update method provided in this application, the second business data is updated according to snapshot data and log data, specifically including:
[0119] Retrieve data from the first moment to the second moment from the log data to obtain the first updated data;
[0120] The second updated data is obtained by retrieving data from the log data from the second time point to the third time point.
[0121] The snapshot data is updated using the first update data and the second update data to obtain the second business data.
[0122] In this embodiment, during the snapshot scanning process, since the snapshot is created starting at the second time point, and the snapshot traversal scan takes a certain amount of time, any changes to the already scanned business data during the traversal scan (i.e., after the second time point) will not be scanned again. Therefore, data from the second time point to the third time point can be obtained from the log data to obtain the second updated data. This second updated data records the changes that the business data has undergone from the second time point to the third time point. Updating the snapshot data with the second updated data supplements the changes that the business data has undergone after the second time point, thus improving the completeness of the snapshot data.
[0123] For easier understanding, please refer to Figure 5 , Figure 5 This is a schematic diagram illustrating another scenario in this application's embodiments where second business data is updated based on snapshot data and log data. For example... Figure 5 As shown, the order status was updated to "Pending Payment" at 10:00, "Paid" at 18:00, and "Shipped" at 23:20. At this time, the business node created a snapshot at 23:00 and scanned the order status at 23:10, showing "Paid" at 18:00. However, the order status updated to "Shipped" at 23:20 could not be scanned again by the snapshot, so the snapshot data was inaccurate. By obtaining data from the second to third time points (i.e., 23:00 to 24:00) in the log data, the second updated data (i.e., the order status updated to "Shipped" at 23:20) was obtained. Since the update time of the second updated data (23:20) was after the update time of the snapshot data (18:00), the snapshot data was overwritten with the second updated data to obtain the second business data (i.e., the order status updated to "Shipped" at 23:20).
[0124] In this embodiment, the snapshot data is overwritten using the data from the second to the third time in the log data, thereby obtaining the second business data, which includes the latest state of the business data up to the third time, thus improving the accuracy of the snapshot data. Furthermore, this embodiment only updates and overwrites the latest state of the business data, without processing data changes that occurred before the snapshot data update time, thus saving storage space on the target node.
[0125] Optionally, in the above Figure 3 Based on the corresponding embodiments, in another optional embodiment of the business data update method provided in this application, the business data update method may further include the following steps:
[0126] If the first business data changes between the second and third time points, then the log records corresponding to the business nodes between the second and third time points are retrieved.
[0127] Based on the recorded logs, obtain the third updated data of the first business data between the second and third time points;
[0128] The snapshot data is updated using the third update data.
[0129] Because the transmission of operation logs has a certain probability of loss, especially for MySQL databases where the transmission of operation logs is more unstable and prone to loss, this embodiment aims to better complete the snapshot data. In this embodiment, when the first business data in the business node changes between the second and third time points, the user can actively record the corresponding changes, forming a log which is then sent to the target node. The target node parses the third update data from the log and updates the snapshot data accordingly.
[0130] In this embodiment, the user actively records changes in the data and sends them to the target node to update the snapshot data, thereby further improving the accuracy and completeness of the data.
[0131] Optionally, in the above Figure 3 Based on the corresponding embodiments, in another optional embodiment of the business data update method provided in this application, obtaining snapshot data from the business node specifically includes:
[0132] If a service node detects a change in the first service data, it receives the snapshot data sent by the service node.
[0133] In this embodiment, only the first business data that has been updated between the first and second time points of the business node can be scanned, while the business data that has not changed between the first and second time points can be ignored and the corresponding snapshot data is not obtained.
[0134] It should be noted that the embodiments of this application do not limit the number of times snapshots are created. In practical applications, the business data update method provided in the embodiments of this application can be repeatedly executed for the data that needs to be synchronized at preset time intervals. For example, as described above, for the business data that needs to be synchronized, a snapshot data is first obtained through a snapshot, and then updated in combination with the operation log. In addition, the time interval for executing snapshots can be preset, and a snapshot scan is automatically executed whenever the time point for executing a snapshot (the second moment) is reached. Then, the second data is updated based on the operation log and snapshot data from the first moment to the third moment. However, when the snapshot scanning interval is short, due to the large amount of data, it is difficult to scan all the data within a time period (from the first moment to the second moment), and frequent scanning and sending of some business data with low update frequency will result in the target node receiving a lot of redundant business data, causing resource waste. Therefore, in this embodiment, only the business data that has changed between the first moment and the second moment can be scanned, while those data that have not changed can be ignored.
[0135] For example, when synchronizing business data that has changed between 0:00 and 24:00, a snapshot can be taken every hour starting at 1:00, and the snapshot data can be sent to the target node. Then, each snapshot data is updated according to the operation log. In this way, the target node can obtain a snapshot data every hour, improving the real-time performance of the data on the target node.
[0136] In this embodiment, the service node can scan only the first service data that has been updated between the first time and the second time, thereby reducing the amount of data scanned in the snapshot, shortening the scanning time, and reducing the consumption of computing resources.
[0137] Optionally, in the above Figure 3 Based on the corresponding embodiments, in another optional embodiment of the business data update method provided in this application, after updating the second business data according to snapshot data and log data, the method may further include the following steps:
[0138] Receive third service data sent by the service node, wherein the third service data is service data that has not changed after the third time point;
[0139] The second and third business data are compared to obtain the data comparison results;
[0140] Send the data comparison results to the business nodes so that the business nodes can adjust the first and second time points based on the data comparison results.
[0141] For easier understanding, please refer to Figure 6 , Figure 6This is a schematic diagram illustrating a scenario in this embodiment where the second and third service data are compared. Figure 6 As shown in this embodiment, after updating the second business data based on the snapshot data and log data, the second business data can be compared with the data in the business node to verify the data synchronization result.
[0142] However, generally speaking, business data within a business node changes frequently. Since the second business data represents the data state from the first to the third time point (0:00 to 24:00), any changes to the business data within the business node after the third time point (24:00) are meaningless. Therefore, when data comparison is needed, the business data that has not changed after the third time point (24:00), i.e., the third business data, can be sent to the target node. The target node can then compare the second and third business data to obtain the comparison result. This comparison result can be sent to the business node, allowing it to determine the accuracy of the data update. Furthermore, the difference between the second and third business data reflects the frequency of business data updates within the business node.
[0143] It should be understood that in step 101, the longer the time period (from the first moment to the second moment) during which the business node creates the snapshot, the longer the traversal scan will take, and the more times the business data will change during this period, thus directly affecting the accuracy of the snapshot data. Therefore, the business node can adjust the time period from the first moment to the second moment based on the data comparison results. That is, on the one hand, the time point for the scheduled snapshot creation (the second moment) can be adjusted, for example, moving the snapshot creation time from 11 PM to 10 PM; on the other hand, the time interval between each snapshot creation can be adjusted, for example, changing from creating a snapshot every hour to creating a snapshot every half hour.
[0144] In this embodiment, after updating the second business data based on snapshot data and log data, the second business data is compared with the data in the business node that has not changed after the third time point, and the first and second time points are adjusted according to the data comparison results, thereby optimizing the accuracy and completeness of subsequent business data updates.
[0145] Optionally, in the above Figure 3 Based on the corresponding embodiments, in another optional embodiment of the business data update method provided in this application, after comparing the second business data and the third business data to obtain the data comparison result, the method may further include the following steps:
[0146] If the data comparison results indicate that the second business data and the third business data are inconsistent, the second business data will be updated using the third business data.
[0147] In this embodiment, the second business data and the third business data are compared. After obtaining the data comparison results, if it is found that there is still data in the second business data that is inconsistent with the third business data, the target node can update the second business data based on the third business data, thereby further improving the accuracy and completeness of the business data update.
[0148] The following describes the method for updating business data in this application based on business nodes. Please refer to [link / reference]. Figure 7 , Figure 7 This is a schematic diagram of another embodiment of the business data update method in this application, as shown below. Figure 7 As shown, one embodiment of the business data update method in this application includes:
[0149] 201. Obtain the first business data corresponding to the period from the first moment to the second moment;
[0150] 202. Generate snapshot data based on the first business data;
[0151] 203. Obtain the target operation log from the first moment to the third moment, where the third moment is the moment that occurs after the second moment;
[0152] 204. Send snapshot data and target operation log to the target node so that the target node can obtain log data based on the target operation log and update the second business data based on the snapshot data and log data. The second business data is the business data from the first time to the third time.
[0153] This embodiment provides a method for updating business data. A target node can obtain snapshot data from a first time point to a second time point corresponding to the first business data in the business node, and obtain the operation log of the business node from the first time point to a third time point, where the third time point is a time point occurring after the second time point. Then, the target node can generate log data based on the operation log, and update the second business data based on this log data and the snapshot data, where the second business data is the business data from the first time point to the third time point. Through this method, during the snapshot creation process of the business node, when some scanned data changes, the operation log accurately records the real-time changes in the data. Therefore, the target node can use the operation log to update the received snapshot data, thereby improving the accuracy and completeness of data synchronization. The specific method flow and related beneficial effects are similar to the methods described in the previous embodiments and will not be repeated here.
[0154] Optionally, in the above Figure 7 Based on the corresponding embodiments, in another optional embodiment of the business data update method provided in this application, generating snapshot data based on the first business data may include the following steps:
[0155] If a change is detected in the first business data, snapshot data is generated based on the first business data.
[0156] In this embodiment, the service node can scan only the first service data that has been updated between the first and second time points, thereby reducing the amount of data scanned in the snapshot, shortening the scanning time, and reducing the consumption of computing resources. The specific method flow is similar to that described in the previous embodiment and will not be repeated here.
[0157] Optionally, in the above Figure 7 Based on the corresponding embodiments, in another optional embodiment of the business data update method provided in this application, snapshot data and target operation logs are sent to the target node so that the target node obtains log data according to the target operation logs. After updating the second business data according to the snapshot data and log data, the method may further include the following steps:
[0158] Send the third service data to the target node. The third service data is the data that has not changed after the third time point.
[0159] Receive the data comparison result sent by the target node, wherein the data comparison result is obtained by the target node after comparing the second service data and the third service data;
[0160] Adjustments were made to the first and second time points based on the data comparison results.
[0161] In this embodiment, after updating the second business data based on snapshot data and log data, the second business data is compared with the data in the business node that has not changed after the third time point. The first and second time points are then adjusted based on the data comparison results, thereby optimizing the accuracy and completeness of subsequent business data updates. The specific method flow is similar to that described in the previous embodiments and will not be repeated here.
[0162] Optionally, in the above Figure 7 Based on the corresponding embodiments, updating the data snapshot period according to the data comparison results may include the following steps:
[0163] Based on the data comparison results, determine the difference between the third business data and the second business data;
[0164] If the difference value is greater than or equal to the difference threshold, then the interval between the first and second time points is shortened.
[0165] In this embodiment, a threshold value for the difference between the third business data and the second business data can be configured first, i.e., a difference threshold. This difference threshold is used to determine whether the data comparison result meets the requirements.
[0166] Specifically, by comparing the data results, the difference between the third and second business data can be determined. Further, this difference is compared to a preset difference threshold. If the difference is less than the threshold, the accuracy and completeness of the snapshot data are considered to meet the requirements, and no adjustment to the first and second snapshots is needed. If the difference is greater than the threshold, the accuracy and completeness of the snapshot data are considered insufficient, and this can be improved by adjusting the snapshot scan time. In this case, the time interval between snapshot execution (i.e., the interval between the first and second snapshots) can be shortened, thereby reducing the time consumed by the snapshot traversal scan and minimizing changes in business data during the traversal scan process.
[0167] In this embodiment, the difference between the third business data and the second business data is used to determine whether the snapshot scan time needs to be adjusted, thereby improving the accuracy of the snapshot data.
[0168] This application provides a method for updating business data. A target node can obtain snapshot data from a first time point to a second time point corresponding to the first business data in the business node, and obtain operation logs from the first time point to a third time point, where the third time point is a time point following the second time point. The target node can then generate log data based on the operation logs, and update the second business data based on this log data and the snapshot data, where the second business data is the business data from the first time point to the third time point. Through this method, during the snapshot creation process of the business node, when some scanned data changes, the operation logs accurately record the real-time changes in the data. Therefore, the target node can use the operation logs to update the received snapshot data, thereby improving the accuracy and completeness of data synchronization. Furthermore, in this embodiment, either the business node or the target node can be a blockchain node device, thereby saving and synchronizing business data to the blockchain node in the form of blockchain information. Because blockchain technology has strong confidentiality and tamper-proof properties, it can often synchronize highly important business data (such as financial information, identity information, or internal enterprise information) to blockchain node devices, thereby improving data security.
[0169] Specifically, for ease of understanding, please refer to Figure 8 , Figure 8This is a schematic diagram of a data sharing system based on blockchain technology in an embodiment of this application. As shown in the figure, the data sharing system 300 refers to a system for data sharing between nodes. This data sharing system may include multiple nodes 301, which can refer to various clients within the data sharing system. Each node 301, during normal operation, can receive input information and maintain shared data within the data sharing system based on the received input information. To ensure information interoperability within the data sharing system, information connections can exist between each node, allowing information transmission between nodes. For example, when any node in the data sharing system receives input information, other nodes in the system obtain this input information according to a consensus algorithm and store it as data in the shared data, ensuring consistency of data stored on all nodes in the data sharing system.
[0170] Each node in the data sharing system has a corresponding node identifier, and each node can also store the node identifiers of other nodes in the data sharing system. This allows for the subsequent broadcasting of generated blocks to other nodes in the data sharing system based on their node identifiers. Each node can maintain a node identifier list as shown in the table below, storing the node name and node identifier in this list. The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node. Table 1 only uses IP addresses as an example.
[0171] Node Name Node identifier Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258
[0172] Each node in the data-sharing system stores the same blockchain. A blockchain consists of multiple blocks; see [link to blockchain documentation]. Figure 9 A blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block takes the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values of the current block, the block header feature values of the parent block, version number, timestamp, and difficulty value, and so on. This ensures that the block data stored in each block is related to the block data stored in the parent block, guaranteeing the security of the input information in the blocks.
[0173] When generating the individual blocks in the blockchain, see Figure 10When a node in the blockchain receives input information, it verifies the input information. After verification, it stores the input information in a memory pool and updates its hash tree used to record the input information. Then, it updates the timestamp to the time the input information was received and tries different random numbers multiple times to calculate the feature value, ensuring that the calculated feature value satisfies the following formula:
[0174] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
[0175] Wherein, SHA256 is the feature value algorithm used to calculate the feature value; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header feature value of the parent block of the current block; merkle_root is the feature value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value for a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the feature value threshold, which can be determined based on nbits.
[0176] Thus, when a random number satisfying the above formula is calculated, the information can be stored accordingly, generating a block header and a block body to obtain the current block. Subsequently, the node where the blockchain resides sends the newly generated block to other nodes in its data sharing system based on the node identifiers of other nodes in the data sharing system. The other nodes then verify the newly generated block and add it to their stored blockchain after verification.
[0177] In this embodiment of the application, a method for storing business data on a blockchain node device is provided. In this way, since the block contains information to verify the validity of the next block, the possibility of business data being maliciously stolen can be effectively reduced. In addition, once a new block is added to the blockchain, it will not be removed, thereby reducing the possibility of business data loss.
[0178] To better implement the above-described solutions of the embodiments of this application, related apparatus for implementing the above solutions is also provided below. Please refer to... Figure 11 , Figure 11 This is a schematic diagram of a business data update device provided in an embodiment of this application. The business data update device 300 includes:
[0179] The acquisition unit 301 is used to acquire snapshot data from the business node, wherein the snapshot data is generated by the business node based on the first business data, and the first business data is the business data from the first time to the second time.
[0180] The acquisition unit 301 is also used to acquire the target operation log from the business node, wherein the target operation log is the operation log recorded by the business node from the first moment to the third moment, and the third moment is a moment that occurs after the second moment;
[0181] The acquisition unit 301 is also used to acquire log data based on the target operation log;
[0182] The update unit 302 is used to update the second business data based on the snapshot data and log data, wherein the second business data is the business data from the first time to the third time.
[0183] Optionally, in the above Figure 11 Based on the corresponding embodiments, in one embodiment of the business data update device 300 provided in this application,
[0184] Update unit 302 is specifically used to obtain data from the log data from the first moment to the second moment to obtain the first updated data;
[0185] The second updated data is obtained by retrieving data from the log data from the second time point to the third time point.
[0186] The snapshot data is updated using the first and second update data to obtain the second business data.
[0187] Optionally, in the above Figure 11 Based on the corresponding embodiments, in one embodiment of the business data update device 300 provided in this application,
[0188] Update unit 302 is specifically used to obtain data from the log data from the second time point to the third time point to obtain the second updated data;
[0189] The snapshot data is updated using the second updated data to obtain the second business data.
[0190] Optionally, in the above Figure 11 Based on the corresponding embodiments, in one embodiment of the business data update device 300 provided in this application,
[0191] The acquisition unit 301 is also used to acquire the record log corresponding to the service node from the second time to the third time if the first service data changes between the second time and the third time.
[0192] The acquisition unit 301 is also used to acquire the third updated data of the first business data between the second and third time points based on the record log;
[0193] The update module 302 is also used to update the snapshot data using the third update data.
[0194] Optionally, in the above Figure 11 Based on the corresponding embodiments, in one embodiment of the business data update device 300 provided in this application,
[0195] The acquisition unit is specifically used to receive snapshot data sent by the service node if the service node detects a change in the first service data.
[0196] Optionally, in the above Figure 11 Based on the corresponding embodiments, in one embodiment of the service data update device 300 provided in this application, the service update device 300 further includes a receiving unit, a comparison unit, and a sending unit;
[0197] The receiving unit 303 is used to receive the third service data sent by the service node, wherein the third service data is the service data that has not changed after the third time point;
[0198] The comparison unit 304 is used to compare the second business data and the third business data to obtain the data comparison result;
[0199] The sending unit 305 is used to send the data comparison results to the service nodes so that the service nodes can adjust the first time and the second time according to the data comparison results.
[0200] Optionally, in the above Figure 11 Based on the corresponding embodiments, in one embodiment of the business data update device 300 provided in this application,
[0201] The updating unit 302 is also used to update the second business data using the third business data if the data comparison result indicates that the second business data and the third business data are inconsistent.
[0202] In this embodiment, the business data update device 300 can perform the aforementioned... Figure 3 or Figure 7 The specific operations performed by the target node in any of the embodiments shown are not detailed here.
[0203] Please see Figure 12 , Figure 12 This is a schematic diagram of another embodiment of the business data update device in this application, as shown below. Figure 12 As shown, the business data update device 400 includes:
[0204] The acquisition unit 401 is used to acquire the first service data corresponding to the period from the first time to the second time.
[0205] Generation unit 402 is used to generate snapshot data based on the first business data;
[0206] The acquisition unit 401 is also used to acquire the target operation log from the first time to the third time, where the third time is a time that occurs after the second time.
[0207] The sending unit 403 is used to send snapshot data and target operation log to the target node, so that the target node can obtain log data according to the target operation log, and update the second service data according to the snapshot data and log data. The second service data is the service data from the first time to the third time.
[0208] Optionally, in the above Figure 12 Based on the corresponding embodiments, in one embodiment of the business data update device 400 provided in this application,
[0209] The generation unit 402 is specifically used to generate snapshot data based on the first business data if a change is detected in the first business data.
[0210] Optionally, in the above Figure 12 Based on the corresponding embodiments, in one embodiment of the service data update device 400 provided in this application, the service data update device further includes a receiving unit and an adjustment unit;
[0211] The sending unit 403 is specifically used to send third service data to the target node. The third service data is data that has not changed after the third time.
[0212] The receiving unit 404 is used to receive the data comparison result sent by the target node, wherein the data comparison result is obtained by the target node after comparing the second service data and the third service data;
[0213] The adjustment unit 405 is used to adjust the first time and the second time based on the data comparison results.
[0214] In one possible design, in another implementation of another aspect of the embodiments of this application,
[0215] The adjustment unit 405 is specifically used to determine the difference value between the third business data and the second business data based on the data comparison results; if the difference value is greater than or equal to the difference threshold, the interval between the first time and the second time is shortened.
[0216] In this embodiment, the business data update device 400 can perform the aforementioned... Figure 3 or Figure 7 The specific operations performed by the business nodes in any of the embodiments shown are not detailed here.
[0217] This application also provides a node device for performing... Figure 3 or Figure 7 In the corresponding embodiment, the steps executed by the target node, or, used to execute Figure 3 or Figure 7 The steps executed by the service node in the corresponding embodiment. Please refer to [link / reference]. Figure 13 , Figure 13 This is a schematic diagram of a node device in an embodiment of this application. It should be understood that the node device mentioned can be the target node or the service node in the above embodiments. As shown in the figure, the node device 500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 522 (e.g., one or more processors) and memory 532, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 542 or data 544. The memory 532 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the node device. Furthermore, the CPU 522 may be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the node device 500.
[0218] Node device 500 may also include one or more power supplies 526, one or more wired or wireless network interfaces 550, one or more input / output interfaces 558, and / or one or more operating systems 541, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0219] The steps performed by the target node, or by the service node, in the above embodiments can be based on this... Figure 13 The structure of the node device is shown.
[0220] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the foregoing embodiments.
[0221] This application also provides a computer program product including a program, which, when run on a computer, causes the computer to perform the methods described in the foregoing embodiments.
[0222] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0223] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0224] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0225] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0226] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, an interactive video management device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0227] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for updating business data, characterized in that, include: Obtain snapshot data from a business node, wherein the snapshot data is generated by the business node based on first business data, the first business data being the business data from a first moment to a second moment, and the second moment being the moment the snapshot is created; Obtain the target operation log from the business node, wherein the target operation log includes the operation log recorded by the business node from the first time to the third time, and the third time is a time that occurs after the second time; Obtain log data based on the target operation log; Based on the snapshot data and the log data, the second business data is updated and obtained, wherein the second business data is the business data from the first time moment to the third time moment; If the first business data changes between the second time and the third time, then the record log corresponding to the business node between the second time and the third time is obtained; According to the recorded log, obtain the third update data of the first business data within the second time period to the third time period; The snapshot data is updated using the third update data.
2. The method according to claim 1, characterized in that, The step of updating the second business data based on the snapshot data and the log data includes: Data from the first time point to the second time point is obtained from the log data to obtain the first updated data; The data from the second time point to the third time point is obtained from the log data to obtain the second updated data; The snapshot data is updated using the first update data and the second update data to obtain the second business data.
3. The method according to claim 1, characterized in that, The step of updating the second business data based on the snapshot data and the log data includes: The data from the second time point to the third time point is obtained from the log data to obtain the second updated data; The snapshot data is updated using the second updated data to obtain the second business data.
4. The method according to any one of claims 1 to 3, characterized in that, The acquisition of snapshot data from business nodes includes: If the service node detects a change in the first service data, it receives the snapshot data sent by the service node.
5. The method according to claim 4, characterized in that, After updating the second business data based on the snapshot data and the log data, the method further includes: Receive third service data sent by the service node, wherein the third service data is service data that has not changed after the third time point; The second business data and the third business data are compared to obtain the data comparison results; The data comparison result is sent to the service node so that the service node can adjust the first time and the second time according to the data comparison result.
6. The method according to claim 5, characterized in that, After comparing the second business data and the third business data to obtain the data comparison result, the method further includes: If the data comparison result indicates that the second service data is inconsistent with the third service data, then the second service data is updated using the third service data.
7. A method for updating business data, characterized in that, include: Obtain the first business data corresponding to the period from the first moment to the second moment; The second moment is the moment when the snapshot is created; Generate snapshot data based on the first business data; Obtain the target operation log from the first time point to the third time point, where the third time point is a time point that occurs after the second time point; The snapshot data and the target operation log are sent to the target node so that the target node can obtain log data based on the target operation log, and update the second service data based on the snapshot data and the log data; and if the first service data changes between the second time and the third time, the corresponding record log between the second time and the third time is obtained; the third update data of the first service data between the second time and the third time is obtained based on the record log; and the snapshot data is updated using the third update data, wherein the second service data is the service data between the first time and the third time.
8. The method according to claim 7, characterized in that, The step of generating snapshot data based on the first business data includes: If a change is detected in the first service data, snapshot data is generated based on the first service data.
9. The method according to claim 7 or 8, characterized in that, After sending the snapshot data and the target operation log to the target node so that the target node can obtain log data based on the target operation log, and updating the second service data based on the snapshot data and the log data, the method further includes: Send third service data to the target node, wherein the third service data is data that has not changed after the third time point; The system receives a data comparison result sent by the target node, wherein the data comparison result is obtained by the target node after comparing the second service data and the third service data; The first and second time points are adjusted based on the data comparison results.
10. The method according to claim 9, characterized in that, The step of updating the data snapshot period based on the data comparison results includes: Based on the data comparison results, the difference between the third business data and the second business data is determined; If the difference value is greater than or equal to the difference threshold, then the interval between the first time point and the second time point is shortened.
11. A business data update device, characterized in that, include: The acquisition unit is used to acquire snapshot data from a business node, wherein the snapshot data is generated by the business node based on first business data, the first business data being business data from a first time point to a second time point; and the second time point being the time when the snapshot was created. The acquisition unit is further configured to acquire target operation logs from the business node, wherein the target operation logs are operation logs recorded by the business node from the first time to the third time, and the third time is a time that occurs after the second time; The acquisition unit is further configured to acquire log data based on the target operation log; An update unit is used to update the second service data based on the snapshot data and the log data, wherein the second service data is the service data from the first time point to the third time point; The acquisition unit is further configured to acquire the record log corresponding to the business node from the second time to the third time if the first business data changes between the second time and the third time. The acquisition unit is further configured to acquire the third update data of the first business data between the second and third time points based on the record log; The update unit is also used to update the snapshot data using the third update data.
12. The apparatus according to claim 11, characterized in that, The update unit is specifically used to obtain data from the log data from the first time point to the second time point to obtain the first update data; The data from the second time point to the third time point is obtained from the log data to obtain the second updated data; The snapshot data is updated using the first update data and the second update data to obtain the second business data.
13. The apparatus according to claim 11, characterized in that, The update unit is specifically used to obtain data from the log data from the second time point to the third time point to obtain the second update data; The snapshot data is updated using the second updated data to obtain the second business data.
14. The apparatus according to any one of claims 11-13, characterized in that, The acquisition unit is specifically used to receive the snapshot data sent by the service node if the service node detects that the first service data has changed.
15. The apparatus according to claim 14, characterized in that, The device further includes a receiving unit, a comparison unit, and a sending unit; The receiving unit is configured to receive third service data sent by the service node, wherein the third service data is service data that has not changed after the third time point; The comparison unit is used to compare the second business data and the third business data to obtain a data comparison result; The sending unit is used to send the data comparison result to the service node so that the service node can adjust the first time and the second time according to the data comparison result.
16. The apparatus according to claim 15, characterized in that, The updating unit is further configured to update the second service data using the third service data if the data comparison result indicates that the second service data and the third service data are inconsistent.
17. A business data update device, characterized in that, include: The acquisition unit is used to acquire the first business data corresponding to the period from the first time to the second time. The second moment is the moment when the snapshot is created; The generation unit is used to generate snapshot data based on the first business data; The acquisition unit is further configured to acquire the target operation log from the first time to the third time, wherein the third time is a time that occurs after the second time. The sending unit is configured to send the snapshot data and the target operation log to the target node, so that the target node obtains log data according to the target operation log, updates the second service data according to the snapshot data and the log data, and if the first service data changes between the second time and the third time, obtains the record log corresponding to the second time to the third time; obtains the third update data of the first service data between the second time and the third time according to the record log; and updates the snapshot data using the third update data; wherein the second service data is the service data between the first time and the third time.
18. The apparatus according to claim 17, characterized in that, The generation unit is specifically used to generate snapshot data based on the first service data if a change is detected in the first service data.
19. The apparatus according to claim 17 or 18, characterized in that, The device further includes a receiving unit and an adjustment unit; The sending unit is specifically used to send third service data to the target node, wherein the third service data is data that has not changed after the third time. The receiving unit is configured to receive the data comparison result sent by the target node, wherein the data comparison result is obtained by the target node after comparing the second service data and the third service data; The adjustment unit is used to adjust the first time point and the second time point according to the data comparison results.
20. The apparatus according to claim 19, characterized in that, The adjustment unit is specifically used to determine the difference value between the third business data and the second business data based on the data comparison result; if the difference value is greater than or equal to the difference threshold, the interval between the first time and the second time is shortened.
21. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store program code; The processor is configured to execute the method as described in any one of claims 1 to 6, or to execute the method as described in any one of claims 7 to 10, according to instructions in the program code.
22. A computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 6, or to perform the method as described in any one of claims 7 to 10.
23. A computer program product, characterized in that, The computer program product includes instructions that, when executed on a computer device, cause the computer to perform the method as described in any one of claims 1 to 6, or to perform the method as described in any one of claims 7 to 10.