Data synchronization method, device, equipment, medium and program product

By receiving, decrypting, and constructing offline time-series data and transmitting it to microservices, the problem of unstable data synchronization in remote areas is solved, achieving data consistency and security.

CN120980091APending Publication Date: 2025-11-18CHINA MOBILE (XIONGAN) ICT CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511009865.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In remote construction sites and other areas without network access, existing data synchronization tools suffer from issues such as modification conflicts, leading to unstable data synchronization and an inability to ensure data consistency and security.

Method used

By receiving encrypted time-series data from offline devices, decrypting it to construct offline time-series data, querying interface information and constructing target time-series data, and using a data synchronization engine to transmit it to microservices, data consistency and security are ensured.

Benefits of technology

It improves the security and consistency of data synchronization, prevents data tampering, and achieves data traceability and stable synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120980091A_ABST
    Figure CN120980091A_ABST
Patent Text Reader

Abstract

The invention provides a data synchronization method and device, equipment, a medium and a program product, and the method comprises the steps: in a data synchronization process, receiving encrypted time sequence data sent by offline equipment after a user submits offline operation data through an application program, decrypting the encrypted time sequence data to obtain offline encrypted data, and transmitting the offline encrypted data to a server; analyzing the offline time sequence data to obtain offline operation data of each time point, querying interface information of micro-services corresponding to each offline operation data in the configuration information, and constructing target time sequence data according to the interface information, each offline operation data and the user information, the micro-service interface is called based on the data synchronization engine to transmit the offline operation data and the user information in the target time sequence data to the micro-service, and the safety and the consistency of offline data synchronization are improved by transmitting the offline time sequence data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of communication technology, and in particular to a data synchronization method, apparatus, device, medium, and program product. Background Technology

[0002] With the continuous development of communication technology and the accelerating pace of urbanization, more and more areas are starting construction, and correspondingly, the demand for communication coverage is also increasing. However, there are still construction areas that cannot be covered by communication, such as construction sites in remote areas. As software technology continues to improve, the construction process is gradually being recorded through applications. This has led to the problem that some work areas are without network access and cannot synchronize work records. In existing technologies, data synchronization is usually achieved through file synchronization tools or database synchronization tools. These tools typically store changes when the device is offline using a local caching mechanism and automatically upload or synchronize the data after the network is restored. However, problems such as modification conflicts exist. How to achieve more stable data synchronization has become a key focus for all parties. Summary of the Invention

[0003] The purpose of one embodiment of this application is to provide a data synchronization method, apparatus, device, and program product to solve the problems of insufficient data consistency and data security of devices and servers during data synchronization.

[0004] To solve the above-mentioned technical problems, one embodiment of this application is implemented as follows: In a first aspect, one embodiment of this application provides a data synchronization method applied to a server, the method comprising: Receive encrypted timing data sent by the offline device after the user submits offline operation data through the application, and decrypt the encrypted timing data to obtain offline timing data; Parse the offline time-series data to obtain offline operation data at each time point, and query the interface information of the microservice corresponding to each offline operation data in the configuration information; Target time-series data is constructed based on the interface information, the offline operation data, and the user information. The data synchronization engine calls the microservice interface to transmit the offline operation data and user information from the target time-series data to the microservice.

[0005] The data synchronization method provided in this embodiment receives encrypted time-series data sent by offline devices after submitting offline operation data through an application during the data synchronization process. The encrypted time-series data is decrypted to obtain the offline time-series data. Encrypting the synchronized data improves data synchronization security. The offline time-series data is parsed to obtain offline operation data at each time point. The interface information corresponding to each offline operation data is queried from the configuration information. Target time-series data is constructed based on the interface information, each offline operation data, and user information. By converting synchronized data into time-series data, the user's operation time sequence and order are accurately represented, effectively preventing data tampering and improving data consistency. Finally, the data synchronization engine calls the microservice interface to transmit each offline operation data and user information from the target time-series data to the microservices. This allows each microservice to record user operations sequentially according to execution time and simultaneously stores the target time-series data on the server for archiving, making data synchronization traceable and improving data synchronization security and consistency.

[0006] Secondly, one embodiment of this application provides another data synchronization method applied to an offline device, the method comprising: Obtain offline operation data submitted by the user after performing offline operations within the application, and construct offline time-series data based on the offline operation data; The offline time-series data is submitted to the central offline device, and the encrypted time-series data returned by the central offline device after encrypting the offline time-series data is obtained. After detecting that the offline device is online, the encrypted time-series data is sent to the server; the server parses and decrypts the obtained offline time-series data to obtain offline operation data at each time point, and calls the microservice interface corresponding to each offline operation data to perform offline operation data transmission.

[0007] Another data synchronization method provided in this embodiment obtains offline operation data submitted by the user after performing offline operations in the application during the data synchronization process. Offline time-series data is constructed based on the offline operation data. The offline operation data is converted into offline time-series data according to the time sequence, which facilitates verification and reduces the risk of data tampering, ensuring data consistency and security. The offline time-series data is submitted to the central offline device, and encrypted time-series data is obtained after the central offline device encrypts the offline time-series data and sends it back. The encrypted time-series data is then sent to the server. The encryption of the offline time-series data by the central offline device further enhances data security.

[0008] Thirdly, one embodiment of this application provides a data synchronization device, including: The data decryption module is used to receive encrypted time-series data sent by the offline device after the user submits offline operation data through the application, and decrypt the encrypted time-series data to obtain offline time-series data; The interface information query module is used to parse the offline time series data to obtain offline operation data at each time point, and query the interface information of the microservice corresponding to each offline operation data in the configuration information. The target time series data construction module is used to construct target time series data based on the interface information, the offline operation data, and the user information. The data transmission module is used to transmit the offline operation data and user information in the target time-series data to the microservice by calling the microservice interface based on the data synchronization engine.

[0009] Fourthly, another embodiment of this application provides another data synchronization device, including: The offline time-series data construction module is used to obtain offline operation data submitted by the user after performing offline operations within the application, and to construct offline time-series data based on the offline operation data. The encrypted time-series data acquisition module is used to submit the offline time-series data to the central offline device and acquire the encrypted time-series data returned by the central offline device after encrypting the offline time-series data. After detecting that the offline device is online, the data sending module is run, which is used to send the encrypted time-series data to the server; the server parses and decrypts the obtained offline time-series data to obtain offline operation data at each time point, and calls the microservice interface corresponding to each offline operation data to perform offline operation data transmission.

[0010] Fifthly, another embodiment of this application provides a data synchronization device, including: a memory, a processor, and computer-executable instructions stored in the memory and executable on the processor, wherein the computer-executable instructions, when executed by the processor, implement the steps of the data synchronization method as described in the first aspect above.

[0011] In a sixth aspect, yet another embodiment of this application provides another data synchronization device, comprising: a memory, a processor, and computer-executable instructions stored in the memory and executable on the processor, wherein the computer-executable instructions, when executed by the processor, implement the steps of the data synchronization method as described in the second aspect above.

[0012] In a seventh aspect, another embodiment of this application provides a computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the steps of the data synchronization method described in the first aspect above.

[0013] In an eighth aspect, another embodiment of this application provides another computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the steps of the data synchronization method as described in the second aspect above.

[0014] In a ninth aspect, another embodiment of this application provides a computer program product, the computer program product including a data synchronization program, which, when executed by a processor, implements the steps of the data synchronization method as described in the first aspect above.

[0015] In a tenth aspect, another embodiment of this application provides another computer program product, the computer program product including a data synchronization program, which, when executed by a processor, implements the steps of the data synchronization method as described in the second aspect above. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in one or more embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Figure 1 A flowchart illustrating a data synchronization method provided in one or more embodiments of this application; Figure 2 A schematic diagram illustrating the establishment of a control data channel provided for one or more embodiments of this application; Figure 3 A schematic diagram illustrating the startup of a target subroutine provided for one or more embodiments of this application; Figure 4 A timing diagram illustrating the processing flow of a data synchronization method applied in a base station construction scenario, provided for one or more embodiments of this application; Figure 5 A schematic diagram illustrating the establishment of a program data channel provided for one or more embodiments of this application; Figure 6 A flowchart illustrating another data synchronization method provided in one or more embodiments of this application; Figure 7 A schematic diagram of a data synchronization device provided for one or more embodiments of this application; Figure 8 A schematic diagram of another data synchronization device provided for one or more embodiments of this application; Figure 9A schematic diagram of the structure of a data synchronization device provided in one or more embodiments of this application; Figure 10 This is a schematic diagram of the structure of another data synchronization device provided in one or more embodiments of this application. Detailed Implementation

[0017] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this application, the technical solutions in one or more embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on one or more embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the protection scope of this document.

[0018] This application provides an embodiment of a data synchronization method: Reference Figure 1 It shows a flowchart of a data synchronization method provided in this embodiment, with reference to... Figure 5 The diagram illustrates a timing diagram of a data synchronization method applied to a base station construction scenario, as provided in this embodiment.

[0019] Reference Figure 1 The data synchronization method provided in this embodiment can be applied to a server, specifically an application server, and includes the following steps S102 to S108.

[0020] Step S102: Receive encrypted timing data sent by the offline device after the user submits offline operation data through the application, and decrypt the encrypted timing data to obtain offline timing data.

[0021] In this embodiment, the application is used for work recording. Specifically, it can be an application for processing construction work tasks. Users can perform operations such as attendance check-in, attendance check-out, information reporting, inspection check-in, work image recording and / or work event recording in the application. The application can be used offline, and the data generated offline can be stored in the user's offline device (user terminal). Correspondingly, operations performed by users through offline devices while offline can be called offline operations. Offline operations can generate corresponding offline data, such as offline check-in data, offline check-out data, offline inspection data, and / or offline record data. Optionally, offline operations include offline check-in, offline check-out, offline inspection, and / or offline recording. In addition, the process of users handling tasks in the application can also be called offline operations. Optionally, offline operations include performing offline check-in tasks, performing offline check-out tasks, performing offline inspection tasks, and / or performing offline recording tasks.

[0022] For example, in the scenario of base station construction, users can check in offline in the application to indicate that they have arrived at the base station construction site, and can also conduct offline inspections in the application to indicate that they have collected and recorded images of the inspected locations. They can also check out offline in the application to indicate that they have left the base station construction site. For example, in the scenario of base station construction, users can trigger the check-in interface in the application to perform offline check-in tasks, indicating that they have arrived at the base station construction site. They can also trigger the inspection interface in the application to perform image acquisition and offline inspection tasks, indicating that image acquisition and recording of the inspection location have been carried out. They can also trigger the check-out interface in the application to perform offline check-out tasks, indicating that they have left the base station construction site.

[0023] In real-world scenarios, offline operation data generated by users while offline needs to be synchronized after connecting to the network. This offline operation data can be converted into offline time-series data, which represents the user's offline operations, facilitating data verification via timestamps and improving data security and consistency. Specifically, the offline device acquires the offline operation data submitted by the user after performing offline operations in the application and constructs offline time-series data based on this data. Once the offline device is detected to be online, the offline time-series data is sent to the server. Optionally, the offline operation data includes offline check-in data and / or offline check-out data.

[0024] Offline time-series data is time-series data constructed based on offline operation data and the timestamps corresponding to each offline operation data. It is used to represent offline operations executed by the user in sequence according to time. Specifically, offline time-series data can be a time-series chain, and offline time-series data can contain data blocks corresponding to each offline operation and / or data headers corresponding to user information.

[0025] Furthermore, after constructing offline time-series data, the data can be encrypted by a central offline device to further enhance data security. In practice, the central offline device can form an offline local area network with multiple users' offline devices. After constructing offline time-series data, the offline devices can send it to the central offline device for encryption. Specifically, the offline devices submit their offline time-series data to the central offline device and receive encrypted time-series data from the central offline device. Once the offline device is detected to be online, it sends the encrypted time-series data to the server.

[0026] Specifically, the central offline device can first verify the offline time-series data based on the operation time of each data block in the offline time-series data, and / or verify the offline time-series data based on the execution order of the operation information of each data block in the offline time-series data. After the verification is successful, the offline time-series data is encrypted based on a preset key to obtain encrypted time-series data.

[0027] For example, the server verifies all new nodes (data blocks of offline time-series data) generated during the offline period sequentially. First, it checks if the timestamps of each node conform to the logical order (i.e., timestamps increment). Then, it calculates the hash value of the current node using the hash value of the previous node and compares it with the hash value stored on the chain to ensure data consistency. If verification fails, the node is ignored or marked as invalid. During the initialization of the offline central device, a public key is pre-configured for symmetric encryption of the offline time-series data, while the private key is stored on the server.

[0028] Specifically, in the offline time-series data construction process, the raw time-series data sent by the server can be obtained first. Specifically, when the user is online, they log in to the application through an offline device. Correspondingly, the server responds to the login request by constructing the data header of the raw time-series data based on the user identifier and user permissions, and sends the raw time-series data to the offline device. Optionally, the raw time-series data can be constructed and sent by the server based on the user's user information after receiving the user's login request. The user information includes user identifier information and / or user permission information.

[0029] For example, when a user logs in for the first time and activates the offline data reporting function (logging into the application), the server generates an initial node (header) for the raw time-series data. This initial node contains the user's login information, permission information, and a timestamp. This information is stored in a node, and a hash value is calculated for storage.

[0030] After obtaining the raw time-series data, the offline device can sequentially generate data blocks corresponding to each offline operation, and write the data blocks into the raw time-series data to obtain offline time-series data. In one optional implementation of this embodiment, constructing offline time-series data based on offline operation data includes: Data blocks corresponding to each offline operation are generated based on the offline operation data, and the data blocks are written into the original time-series data in chronological order to obtain offline time-series data; optionally, the offline time-series data includes a first data block corresponding to the check-in operation and / or a second data block corresponding to the check-out operation.

[0031] Specifically, each time a user performs an offline operation, a corresponding data block is generated. After writing the data block into the data block of the previous offline operation in the original time-series data, the data block for each offline operation can be processed according to the data block of any of the above offline operations to construct offline time-series data. Among them, users usually use the application to check in when they start work. For the check-in operation, a first data block can be generated based on the offline check-in data. After writing the first data block into the data header of the original time-series data, subsequent offline operations are written into the first data block in chronological order. After obtaining the offline check-out data, a second data block is generated and written into the original time-series data to obtain the offline time-series data. That is, the offline time-series data is constructed from the user login operation and updated from the user check-in operation until the user check-out operation is completed.

[0032] Furthermore, during the data block generation process, the offline operation data corresponding to the previous offline operation can be written into the data block of the current offline operation to facilitate verification and improve data consistency and security. In an optional implementation method provided in this embodiment, any data block in the data block is generated in the following manner: Query the operation information, operation time, and operation type of the previous offline operation corresponding to any data block; According to a preset strategy, the operation information, operation time, and operation type of the previous offline operation are converted to obtain the hash value of the previous offline operation; This data block is generated based on the hash value and the operation information, operation time, and operation type of the target offline operation.

[0033] The operation information includes: specific parameters of the offline operation, such as: the triggered interface information, the uploaded image information and / or the page information viewed; the operation type includes: the type information of the microservice corresponding to the operation, such as: check-in service type, attendance service type, inspection service type and / or reporting service type.

[0034] For example, such as Figure 2As shown, when a user performs any operation (such as clicking a button, browsing a page, etc.), a new node (data block) is added to the time-series chain (raw time-series data) to record the specific information of the operation. Each new node contains the user's operation information, the specific action and its timestamp, as well as the hash value of the previous node, to ensure data consistency and integrity. Whenever a user performs an operation, the system creates a new node and calculates the hash value of the node's content (including operation information and timestamp). New nodes are linked through the hash value of the previous node to form an immutable chain.

[0035] Furthermore, to improve data consistency, the central offline device and each offline device can be used as consensus nodes. When each offline device is building offline time-series data, the data blocks corresponding to each offline operation are synchronized to the central offline device, so that the central offline device can store offline time-series data at the same time for data consistency verification.

[0036] For example, consensus can be achieved through LPoA (Layer Delegated Proof of Authority). Since offline devices are often mobile phones, to save space, offline devices only need to store data between login and / or check-in operations and check-out operations. When a single offline device creates a new time-series chain node, it will notify all nodes to vote. When the number of votes obtained is greater than half of the total number of nodes, the time-series chain node will be written into all nodes and / or the offline central device.

[0037] After the offline device sends offline timing data and / or encrypted timing data, in specific implementation, the offline timing data and / or encrypted timing data are received; furthermore, the encrypted timing data is decrypted to obtain the offline timing data.

[0038] Step S104: Parse the offline time series data to obtain offline operation data at each time point, and query the interface information of the microservice corresponding to each offline operation data in the configuration information.

[0039] In real-world scenarios, multiple microservice modules can be configured for an application. Configuring microservices enhances the application's scalability and flexibility, while also enabling updates to the application via microservices without downtime, thus improving application stability. Furthermore, during data synchronization, offline user operation data can be sent to each microservice, where it is recorded. This data is also recorded a second time in the application's database and / or transaction logs, enabling traceability of offline data.

[0040] In practice, offline time-series data is parsed according to operation time and / or data record order to obtain offline operation data corresponding to each operation time point. The interface information of the microservice corresponding to each offline operation data is then queried from the preset configuration information. Specifically, based on the operation type contained in the offline operation data, the interface information of the microservice interface (data transmission interface) corresponding to the operation type can be queried from the configuration information.

[0041] In this embodiment, the configuration information refers to information that records the correspondence between operation types and microservice interface information. Specifically, the configuration information can be a mapping table, which may include operation types and / or operation identifiers, communication protocol types, and microservice call information; for example, Figure 3 As shown, the configuration information may include an Operation ID, which uniquely identifies the operation performed by the user; a Protocol Type, which specifies the network protocol used, supporting HTTP, RPC, TCP, etc.; and Endpoint information, which provides specific connection or call parameters based on different protocol types, including the URL address and calling method corresponding to the HTTP Endpoint; the service name and method name corresponding to the RPC Endpoint; and the server IP and service port corresponding to the TCP Endpoint.

[0042] During specific execution, the operation time, operation type, and operation information contained in each data block of the offline time-series data can be read. The microservices corresponding to the operation types and their interface information can be queried from the configuration information. In one optional implementation of this embodiment, parsing the offline time-series data to obtain offline operation data and querying the interface information of the microservices corresponding to the offline operation data includes: Iterate through and read each data block in the offline time-series data to obtain the operation time, operation type and / or operation information corresponding to the offline operation data; Query the microservices corresponding to each operation type in the configuration information, and query the interface information of each microservice in the configuration information.

[0043] Optionally, the traversal start position includes the first data block corresponding to the check-in operation and / or the data header corresponding to the login operation, and the traversal end position includes the second data block corresponding to the check-out operation.

[0044] Specifically, the data blocks in the offline time-series data are traversed and read in chronological order to obtain the operation time, operation type and / or operation information corresponding to each offline operation, and the interface information of the microservice corresponding to the operation type is queried in the mapping table of the configuration file.

[0045] For example, initial node parsing is performed first, starting from the first node of the time-series chain (the data header corresponding to the login operation). User login information (such as user ID, login timestamp, and permission information) is extracted as the starting point of the operation chain. Then, node-by-node parsing and mapping are performed, traversing each subsequent node to extract its operation information and the timestamp of its occurrence. The mapping relationships in the microservice management module are used to convert this operation information into corresponding microservice call interfaces; for example, clicking a button might correspond to a specific API interface.

[0046] Furthermore, since the offline time-series data collected from various offline devices is characterized by large data volume and high concurrency, data parsing can be performed through operation classification and flow control to improve system performance. The purpose of operation classification is to improve the parallelism of the system. When different operations are mapped to different endpoints, they can usually be called in parallel. The purpose of flow control is to calculate the number of calls based on dimensions such as operation type and endpoint, so that resource planning can be done in advance to ensure that there are sufficient computing and storage resources to process these requests. Specifically, in the process of querying the interface information of each microservice, queries can be performed in parallel.

[0047] Step S106: Construct target time-series data based on the interface information, the offline operation data, and the user information.

[0048] In practice, the obtained interface information is constructed into target time-series data containing interface information, offline operation data, and user information based on the timestamp. Specifically, for any offline operation, the interface information, offline operation data, and user data of the offline operation can be combined into a data block, and the data blocks can be arranged in chronological order to obtain the target time-series data.

[0049] For example, based on the extracted operation information and operation time, nodes (databases) are constructed in a new data structure (target time-series data). Each node contains the specific parameters of the microservice call, execution time, and hash value to ensure integrity. All parsed operation information is reorganized into a new data structure—the operation chain—according to operation time. It is ensured that the timestamp of each node is consistent with its timestamp in the offline time-series data, maintaining logical continuity.

[0050] Step S108: Based on the data synchronization engine, call the microservice interface to transmit the offline operation data and user information in the target time series data to the microservice.

[0051] In practice, the target time-series data is used as the input for the data synchronization engine. The data synchronization engine sequentially transmits the offline operation data and user information according to the microservice interfaces corresponding to the interface information, offline operation data and user data call interface information in the data blocks recorded in the target time-series data, until the offline operation data contained in each data block in the target time-series data is transmitted.

[0052] During specific execution, the data synchronization engine can iterate through and call the microservice interface to transmit offline operation data and user information to the microservice, so that the microservice records the user's offline operations in the offline state through the offline device in the database and / or logs according to the operation information, operation time and user information; in one optional implementation of this embodiment, calling the microservice interface to transmit offline operation data to the microservice includes: Read multiple data blocks from the target time-series data and extract the interface information and target operation data of the target microservice contained in each data block; Iterate through the microservice interfaces corresponding to the API call information to transmit the target operation data and user information, and obtain the data synchronization result returned by the target microservice after recording the target operation data.

[0053] Specifically, for any data block, the interface information and target operation data of the target microservice contained in the data block are extracted. The microservice interface corresponding to the interface information is called to transmit the target operation data and user information. The target microservice records the user's operation information at that operation time according to the operation information and operation time in the target operation data and returns the data synchronization result to the engine. After the data transmission in any data block is completed, the data transmission of the next data block is carried out until the data block transmission of the target time-series data is completed.

[0054] For example, first, load the target time-series data from storage, create an execution context, initialize necessary environment variables and states, set basic information such as user permissions and current time, and then call the microservice interface: based on the information in the first node of the operation chain, call the corresponding microservice interface. Parameters passed to the microservice typically include the specific operation type, target object ID, and necessary state information. Record the result and response time of each call, and call the next microservice interface sequentially according to the time order of the nodes in the operation chain. Maintain consistency and logical coherence between operations.

[0055] It should be noted that, after obtaining the interface information, the microservice interface can also be directly called for data transmission. That is, after step S104 is executed, steps S106 to S108 can be omitted, and the step of calling the microservice interface to transmit offline operation data and user information to the microservice can be executed instead. This can be combined with the remaining steps and / or optional implementation methods provided in this embodiment to form a new embodiment. It should also be noted that the step of calling the microservice interface to transmit offline operation data and user information to the microservice can also be executed using the execution method of the above-mentioned data synchronization engine.

[0056] In summary, the data synchronization method provided in this embodiment, during the data synchronization process, receives encrypted time-series data sent by offline devices after submitting offline operation data through an application, decrypts the encrypted time-series data to obtain offline time-series data, and improves the security of data synchronization by encrypting the synchronized data. It then parses the offline time-series data to obtain offline operation data at each time point, queries the interface information corresponding to each offline operation data in the configuration information, and constructs target time-series data based on the interface information, each offline operation data, and user information. By converting synchronized data into time-series data, it accurately represents the user's operation time sequence and operation order, effectively preventing data tampering and improving data consistency. Finally, based on the data synchronization engine, it calls the microservice interface to transmit each offline operation data and user information from the target time-series data to the microservices. This allows each microservice to record the user's operations sequentially according to the execution time and simultaneously stores the target time-series data on the server for archiving, making data synchronization traceable and improving the security and consistency of data synchronization.

[0057] It should be noted that the data synchronization method provided in the above embodiments can be applied to the calling terminal, while the other data synchronization method provided in this embodiment can be applied to the called terminal. The data synchronization method provided in this embodiment that can be applied to the calling terminal and the data synchronization method provided in the following embodiments that can be applied to the called terminal have a cooperative relationship during execution. Therefore, when reading this embodiment, you can refer to the relevant content of the following embodiments, and correspondingly, when reading the following embodiments, you can also refer to the relevant content of this embodiment.

[0058] The following combination Figure 4 Taking the application of the data synchronization method provided in this embodiment in a base station construction scenario as an example, the data synchronization method provided in this embodiment will be further explained. (Refer to...) Figure 4 The data synchronization method applied to base station construction scenarios specifically includes steps S404 to S406 and steps S418 to S424.

[0059] Step S404: In response to the user login request, generate raw time-series data and generate a data header based on user permission information and user identification information.

[0060] Step S406: Write the data header into the raw timing data and send it to the offline device.

[0061] Step S418: Receive encrypted timing data and decrypt the encrypted timing data to obtain offline timing data.

[0062] Step S420: Parse the offline time series data to obtain the offline operation data at each time point, and traverse and read each data block in the offline time series data to obtain the operation time, operation type and operation information corresponding to the offline operation.

[0063] Step S422: Query the microservices corresponding to each query type in the configuration information, and query the interface information of each microservice in the configuration information.

[0064] Step S424: Iterate through the microservice interfaces corresponding to the call interface information to transmit offline operation data and user information, and obtain the data synchronization result returned by the microservice after recording the target operation data.

[0065] Steps S404 to S406 and S418 to S424 provided in this embodiment are executed by the server. It should be noted that the steps S404 to S406 and S418 to S424 executed by the server can cooperate with steps S402 and S408 to S416 executed by the offline device in the following embodiment. Therefore, when reading this embodiment, please refer to the corresponding content of steps S402 and S408 to S416 provided in the following method embodiment, and when reading the following method embodiment, please refer to the corresponding content of steps S404 to S406 and S418 to S424 provided in this embodiment.

[0066] It should be noted that any one or more of steps S404 to S406 and steps S418 to S424 can be combined to form a new implementation method according to the needs of implementation and deployment. Furthermore, any one or more technical features in the technical solution composed of steps S404 to S406 and steps S418 to S424 can also be combined to form a new implementation method according to the actual deployment needs, or the technical features in one or more optional implementations provided by steps S102 to S108 can be combined to form a new implementation method. These will not be elaborated on here.

[0067] It should also be noted that the data synchronization method provided in one or more embodiments of this specification is applicable to... Figure 5 The implementation environment shown is based on... Figure 5 In this implementation environment: After acquiring offline operation data, the offline device constructs offline time-series data through the time-series chain module and sends the offline time-series data to the offline central device. The offline central device verifies the offline time-series data through the time-series chain module, encrypts the offline time-series data through the key module to obtain the encrypted time-series module, and returns it to the offline device. The offline device returns the encrypted time-series module to the application server through the offline data reporting module. The application server decrypts the encrypted time-series data through the key verification module to obtain the offline time-series data, verifies the offline time-series data through the time-series chain module, parses the offline time-series data through the operation chain replay module to obtain the offline operation data, determines the interface information of the microservice corresponding to the offline operation data through the microservice management module, and calls the microservice interface through the operation chain replay module to transmit the offline operation data for data synchronization.

[0068] Another embodiment of the data synchronization method provided in this application: Reference Figure 6 It shows a flowchart of another data synchronization method provided in this embodiment, refer to Figure 4 The diagram illustrates a timing diagram of a data synchronization method applied to a base station construction scenario, as provided in this embodiment.

[0069] Reference Figure 6 The data synchronization method provided in this embodiment can be applied to offline devices, specifically the user's user terminal, and includes the following steps S602 to S606.

[0070] Step S602: Obtain offline operation data submitted by the user after performing offline operations within the application, and construct offline time-series data based on the offline operation data.

[0071] In this embodiment, the application is used for work recording. Specifically, it can be an application for processing construction work tasks. Users can perform operations such as attendance check-in, attendance check-out, information reporting, inspection check-in, work image recording and / or work event recording in the application. The application can be used offline, and the data generated offline can be stored in the user's offline device (user terminal). Correspondingly, operations performed by users through offline devices while offline can be called offline operations. Offline operations can generate corresponding offline data, such as offline check-in data, offline check-out data, offline inspection data, and / or offline record data. Optionally, offline operations include offline check-in, offline check-out, offline inspection, and / or offline recording. In addition, the process of users handling tasks in the application can also be called offline operations. Optionally, offline operations include performing offline check-in tasks, performing offline check-out tasks, performing offline inspection tasks, and / or performing offline recording tasks.

[0072] For example, in the scenario of base station construction, users can check in offline in the application to indicate that they have arrived at the base station construction site, and can also conduct offline inspections in the application to indicate that they have collected and recorded images of the inspected locations. They can also check out offline in the application to indicate that they have left the base station construction site. For example, in the scenario of base station construction, users can trigger the check-in interface in the application to perform offline check-in tasks, indicating that they have arrived at the base station construction site. They can also trigger the inspection interface in the application to perform image acquisition and offline inspection tasks, indicating that image acquisition and recording of the inspection location have been carried out. They can also trigger the check-out interface in the application to perform offline check-out tasks, indicating that they have left the base station construction site.

[0073] In real-world scenarios, offline operation data generated by users while offline needs to be synchronized after connecting to the network. This offline operation data can be converted into offline time-series data, which represents the user's offline operations. This facilitates data verification via timestamps, improving data security and consistency of synchronized data. Specifically, the offline operation data submitted by the user after performing offline operations in the application is obtained, and offline time-series data is constructed based on this data. Optionally, the offline operation data includes offline check-in data and / or offline check-out data.

[0074] Offline time-series data is time-series data constructed based on offline operation data and the timestamps corresponding to each offline operation data. It is used to represent offline operations executed by the user in sequence according to time. Specifically, offline time-series data can be a time-series chain, and offline time-series data can contain data blocks corresponding to each offline operation and / or data headers corresponding to user information.

[0075] Specifically, in the offline time-series data construction process, the raw time-series data sent by the server can be obtained first. Specifically, when the user is online, they log in to the application through an offline device. Correspondingly, the server responds to the login request by constructing the data header of the raw time-series data based on the user identifier and user permissions, and sends the raw time-series data to the offline device. Optionally, the raw time-series data can be constructed and sent by the server based on the user's user information after receiving the user's login request. The user information includes user identifier information and / or user permission information.

[0076] For example, when a user logs in for the first time and activates the offline data reporting function (logging into the application), the server generates an initial node (header) for the raw time-series data. This initial node contains the user's login information, permission information, and a timestamp. This information is stored in a node, and a hash value is calculated for storage.

[0077] After obtaining the raw time-series data, the offline device can sequentially generate data blocks corresponding to each offline operation, and write the data blocks into the raw time-series data to obtain offline time-series data. In one optional implementation of this embodiment, constructing offline time-series data based on offline operation data includes: Data blocks corresponding to each offline operation are generated based on the offline operation data, and the data blocks are written into the original time-series data in chronological order to obtain offline time-series data; optionally, the offline time-series data includes a first data block corresponding to the check-in operation and / or a second data block corresponding to the check-out operation.

[0078] Specifically, each time a user performs an offline operation, a corresponding data block is generated. After writing the data block into the data block of the previous offline operation in the original time-series data, the data block for each offline operation can be processed according to the data block of any of the above offline operations to construct offline time-series data. Among them, users usually use the application to check in when they start work. For the check-in operation, a first data block can be generated based on the offline check-in data. After writing the first data block into the data header of the original time-series data, subsequent offline operations are written into the first data block in chronological order. After obtaining the offline check-out data, a second data block is generated and written into the original time-series data to obtain the offline time-series data. That is, the offline time-series data is constructed from the user login operation and updated from the user check-in operation until the user check-out operation is completed.

[0079] Furthermore, during the data block generation process, the offline operation data corresponding to the previous offline operation can be written into the data block of the current offline operation to facilitate verification and improve data consistency and security. In an optional implementation method provided in this embodiment, any data block in the data block is generated in the following manner: Query the operation information, operation time, and operation type of the previous offline operation corresponding to any data block; According to a preset strategy, the operation information, operation time, and operation type of the previous offline operation are converted to obtain the hash value of the previous offline operation; This data block is generated based on the hash value and the operation information, operation time, and operation type of the target offline operation.

[0080] The operation information includes: specific parameters of the offline operation, such as: the triggered interface information, the uploaded image information and / or the page information viewed; the operation type includes: the type information of the microservice corresponding to the operation, such as: check-in service type, attendance service type, inspection service type and / or reporting service type.

[0081] Furthermore, to improve data consistency, the central offline device and each offline device can be used as consensus nodes. When each offline device is building offline time-series data, the data blocks corresponding to each offline operation are synchronized to the central offline device, so that the central offline device can store offline time-series data at the same time for data consistency verification.

[0082] Step S604: Submit the offline time series data to the central offline device, and obtain the encrypted time series data returned by the central offline device after encrypting the offline time series data.

[0083] In practice, the constructed offline time-series data is submitted to the central offline device, which encrypts the offline time-series data to obtain encrypted time-series data. The encrypted time-series data is then sent back to the offline device, and the corresponding encrypted time-series data sent back by the central offline device is obtained.

[0084] Specifically, the central offline device can form an offline local area network with offline devices of multiple users. After constructing offline time-series data, the offline devices can send it to the central offline device for encryption. In the specific execution process, the central offline device can first verify the offline time-series data according to the operation time of each data block in the offline time-series data, and / or verify the offline time-series data according to the execution order of the operation information of each data block in the offline time-series data. After the verification is successful, the offline time-series data is encrypted based on a preset key to obtain encrypted time-series data.

[0085] Step S606: After detecting that the offline device is online, the encrypted timing data is sent to the server.

[0086] In practice, the network status of offline devices is detected through a communication component. Once an offline device is detected to be connected to the internet, encrypted time-series data is sent to the server via the internet. Correspondingly, the server can synchronize the data after receiving the encrypted time-series data. Optionally, the server parses and decrypts the obtained offline time-series data to obtain offline operation data at each time point, and calls the corresponding microservice interface for each offline operation data to transmit the offline operation data.

[0087] In summary, the data synchronization method provided in this embodiment acquires offline operation data submitted by the user after performing offline operations in the application during the data synchronization process. Offline time-series data is constructed based on the offline operation data, and the offline operation data is converted into offline time-series data according to time sequence. This facilitates verification while reducing the risk of data tampering, ensuring data consistency and security. The offline time-series data is submitted to a central offline device, and encrypted time-series data is obtained and returned by the central offline device after encryption. This encrypted time-series data is then sent to the server. The encryption of the offline time-series data by the central offline device further enhances data security.

[0088] The following combination Figure 4 Taking the application of the data synchronization method provided in this embodiment in a base station construction scenario as an example, the data synchronization method provided in this embodiment will be further explained. (Refer to...) Figure 4 The data synchronization method applied to base station construction scenarios specifically includes steps S402 and steps S408 to S416.

[0089] Step S402: Obtain and send the user login request submitted by the user when performing a login operation in the application.

[0090] Step S408: Receive raw timing data including the data header.

[0091] Step S410: Obtain offline operation data submitted by the user after performing the base station construction task in the application.

[0092] Step S412: Generate data blocks corresponding to each base station construction task based on offline operation data, and write the data blocks into the original time series data in time order to obtain offline time series data.

[0093] Any data block within the data block is generated as follows: query the operation information, operation time, and operation type of the previous offline operation corresponding to any data target offline operation; perform data transformation on the operation information, operation time, and operation type according to a preset strategy to obtain the hash value of the previous offline operation; generate any data block based on the hash value and the operation information, operation time, and operation type of the target offline operation.

[0094] Step S414: Submit the offline time series data to the central offline device and obtain the encrypted time series data returned by the central offline device after encrypting the offline time series data.

[0095] Step S416: After detecting that the offline device is online, the encrypted timing data is sent to the server.

[0096] It should be noted that any one or more of steps S402 and steps S408 to S416 can be combined to form a new implementation method according to the needs of implementation and deployment. Furthermore, any one or more technical features in the technical solution composed of steps S402 and steps S408 to S416 can also be combined to form a new implementation method according to the actual deployment needs, or the technical features in one or more optional implementations provided by steps S602 to S606 can be combined to form a new implementation method. These will not be elaborated on here.

[0097] Figure 7 This is a schematic diagram of a data synchronization device provided in an embodiment of the present invention, as shown below. Figure 7 As shown, the device includes: The data decryption module 702 is used to receive encrypted time-series data sent by the offline device after the user submits offline operation data through the application, and decrypt the encrypted time-series data to obtain offline time-series data; The interface information query module 704 is used to parse the offline time series data to obtain offline operation data at each time point, and query the interface information of the microservice corresponding to each offline operation data in the configuration information. The target time series data construction module 706 is used to construct target time series data based on the interface information, the offline operation data, and the user information. The data transmission module 708 is used to transmit the offline operation data and the user information in the target time-series data to the microservice by calling the microservice interface based on the data synchronization engine.

[0098] The data synchronization device provided in this embodiment, during the data synchronization process, runs a data decryption module 702 to receive encrypted time-series data sent by offline devices after submitting offline operation data through an application, decrypts the encrypted time-series data to obtain offline time-series data, and improves the security of data synchronization by encrypting the synchronized data. An interface information query module 704 parses the offline time-series data to obtain offline operation data at each time point, queries the interface information corresponding to each offline operation data in the configuration information, and runs a target time-series data construction module 706 to construct target time-series data based on the interface information, each offline operation data, and user information. By converting synchronized data into time-series data, the user's operation time sequence and operation order are accurately represented, effectively preventing data tampering and improving data consistency. Finally, a data transmission module 708 calls the microservice interface based on the data synchronization engine to transmit each offline operation data and user information from the target time-series data to the microservices, enabling each microservice to record user operations sequentially according to execution time and simultaneously store the target time-series data on the server for archiving, making data synchronization traceable and improving the security and consistency of data synchronization.

[0099] The data synchronization device provided in one embodiment of this application can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0100] Figure 8 This is a schematic diagram of another data synchronization device provided in an embodiment of the present invention, as shown below. Figure 8 As shown, the device includes: The offline time-series data construction module 802 is used to obtain offline operation data submitted by the user after performing offline operations in the application, and construct offline time-series data based on the offline operation data; The encrypted time series data acquisition module 804 is used to submit the offline time series data to the central offline device and acquire the encrypted time series data returned by the central offline device after encrypting the offline time series data. After detecting that the offline device is online, the data sending module 806 is run. The data sending module 806 is used to send the encrypted time-series data to the server. The server parses and decrypts the obtained offline time-series data to obtain offline operation data at each time point, and calls the microservice interface corresponding to each offline operation data to perform offline operation data transmission.

[0101] Another data synchronization device provided in this embodiment, during the data synchronization process, runs an offline time-series data construction module 802 to obtain offline operation data submitted by the user after performing offline operations in the application, constructs offline time-series data based on the offline operation data, runs an encrypted time-series data acquisition module 804 to convert the offline operation data into offline time-series data according to the time sequence, which facilitates verification and reduces the risk of data tampering, ensuring data consistency and security, submits the offline time-series data to the central offline device, obtains encrypted time-series data returned by the central offline device after encrypting the offline time-series data, and runs a data sending module 806 to send encrypted time-series data to the server after detecting that the offline device is online. The encryption of offline time-series data by the central offline device further improves data security.

[0102] The data synchronization device provided in one embodiment of this application can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0103] Furthermore, one embodiment of this application also provides a data synchronization device. Figure 9 This is a schematic diagram of the structure of a data synchronization device provided in an embodiment of this application, as shown below. Figure 9 As shown, the device includes a memory 901, a processor 902, a bus 903, and a communication interface 904. The memory 901, processor 902, and communication interface 904 communicate via the bus 903. The communication interface 904 may include input / output interfaces, including but not limited to a keyboard, mouse, monitor, microphone, and loudspeaker.

[0104] Figure 9 In the processor 902, the memory 901 stores computer-executable instructions that can run on the processor 902. When the processor 902 executes the computer-executable instructions, the following process is implemented: Receive encrypted timing data sent by the offline device after the user submits offline operation data through the application, and decrypt the encrypted timing data to obtain offline timing data; Parse the offline time-series data to obtain offline operation data at each time point, and query the interface information of the microservice corresponding to each offline operation data in the configuration information; Target time-series data is constructed based on the interface information, the offline operation data, and the user information. The data synchronization engine calls the microservice interface to transmit the offline operation data and user information from the target time-series data to the microservice.

[0105] The data synchronization device provided in this embodiment, through the cooperation of memory 901, processor 902, bus 903 and communication interface 904, receives encrypted time-series data sent by offline devices after submitting offline operation data through the application during the data synchronization process. It decrypts the encrypted time-series data to obtain offline time-series data. By encrypting the synchronized data, the security of data synchronization is improved. The offline time-series data is parsed to obtain offline operation data at each time point. The interface information corresponding to each offline operation data is queried from the configuration information. Based on the interface information, each offline operation data, and user information, target time-series data is constructed. By converting synchronized data into time-series data, the user's operation time sequence and operation order are accurately represented, effectively preventing data tampering and improving data consistency. Finally, based on the data synchronization engine, the microservice interface is called to transmit each offline operation data and user information from the target time-series data to the microservices. This allows each microservice to record user operations sequentially according to execution time and simultaneously store the target time-series data on the server for archiving, making data synchronization traceable and improving the security and consistency of data synchronization.

[0106] The data synchronization device provided in one embodiment of this application can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0107] Furthermore, one embodiment of this application also provides a data synchronization device. Figure 10 This is a schematic diagram of the structure of a data synchronization device provided in an embodiment of this application, as shown below. Figure 10 As shown, the device includes: a memory 1001, a processor 1002, a bus 1003, and a communication interface 1004. The memory 1001, the processor 1002, and the communication interface 1004 communicate via the bus 1003. The communication interface 1004 may include input / output interfaces, including but not limited to a keyboard, mouse, monitor, microphone, and loudspeaker.

[0108] Figure 10 In the memory 1001, computer-executable instructions that can run on the processor 1002 are stored. When the processor 1002 executes the computer-executable instructions, the following process is implemented: Obtain offline operation data submitted by the user after performing offline operations within the application, and construct offline time-series data based on the offline operation data; The offline time-series data is submitted to the central offline device, and the encrypted time-series data returned by the central offline device after encrypting the offline time-series data is obtained. After detecting that the offline device is online, the encrypted time-series data is sent to the server; the server parses and decrypts the obtained offline time-series data to obtain offline operation data at each time point, and calls the microservice interface corresponding to each offline operation data to perform offline operation data transmission.

[0109] The data synchronization device provided in this embodiment, through the cooperation of the memory 1001, processor 1002, bus 1003 and communication interface 1004, acquires offline operation data submitted by the user after performing offline operations in the application during the data synchronization process. It constructs offline time-series data based on the offline operation data, converts the offline operation data into offline time-series data according to the time sequence, which facilitates verification and reduces the risk of data tampering, ensuring data consistency and security. The offline time-series data is submitted to the central offline device, and encrypted time-series data is obtained after the central offline device encrypts the offline time-series data and sends it back. The encrypted time-series data is then sent to the server. The encryption of the offline time-series data by the central offline device further enhances data security.

[0110] The data synchronization device provided in one embodiment of this application can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0111] Furthermore, another embodiment of this application provides a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the following process: Receive encrypted timing data sent by the offline device after the user submits offline operation data through the application, and decrypt the encrypted timing data to obtain offline timing data; Parse the offline time-series data to obtain offline operation data at each time point, and query the interface information of the microservice corresponding to each offline operation data in the configuration information; Target time-series data is constructed based on the interface information, the offline operation data, and the user information. The data synchronization engine calls the microservice interface to transmit the offline operation data and user information from the target time-series data to the microservice.

[0112] The computer-readable storage medium provided in this embodiment receives encrypted time-series data sent by offline devices after submitting offline operation data through an application during data synchronization. It decrypts the encrypted time-series data to obtain offline time-series data. Encrypting the synchronized data improves data synchronization security. Parsing the offline time-series data yields offline operation data at each time point. The interface information corresponding to each offline operation data is queried from the configuration information. Based on the interface information, each offline operation data, and user information, target time-series data is constructed. By converting synchronized data into time-series data, the user's operation timing and sequence are accurately represented, effectively preventing data tampering and improving data consistency. Finally, based on the data synchronization engine, the microservice interface is called to transmit each offline operation data and user information from the target time-series data to the microservices. This allows each microservice to record user operations sequentially according to execution time and simultaneously store the target time-series data on the server for archiving, making data synchronization traceable and improving data synchronization security and consistency.

[0113] The computer-readable storage medium includes read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.

[0114] The computer-readable storage medium provided in one embodiment of this application can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0115] Furthermore, another embodiment of this application provides another computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the following process: Obtain offline operation data submitted by the user after performing offline operations within the application, and construct offline time-series data based on the offline operation data; The offline time-series data is submitted to the central offline device, and the encrypted time-series data returned by the central offline device after encrypting the offline time-series data is obtained. After detecting that the offline device is online, the encrypted time-series data is sent to the server; the server parses and decrypts the obtained offline time-series data to obtain offline operation data at each time point, and calls the microservice interface corresponding to each offline operation data to perform offline operation data transmission.

[0116] The computer-readable storage medium provided in this embodiment acquires offline operation data submitted by the user after performing offline operations in the application during the data synchronization process. It constructs offline time-series data based on the offline operation data and converts the offline operation data into offline time-series data according to the time sequence. This facilitates verification while reducing the risk of data tampering, ensuring data consistency and security. The offline time-series data is submitted to the central offline device, and encrypted time-series data is obtained and returned by the central offline device after encrypting the offline time-series data. The encrypted time-series data is then sent to the server. The encryption of the offline time-series data by the central offline device further enhances data security.

[0117] The computer-readable storage medium includes read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.

[0118] The computer-readable storage medium provided in one embodiment of this application can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0119] Furthermore, another embodiment of this application also provides a computer program product that, when executed by a processor, implements the following process: Receive encrypted timing data sent by the offline device after the user submits offline operation data through the application, and decrypt the encrypted timing data to obtain offline timing data; Parse the offline time-series data to obtain offline operation data at each time point, and query the interface information of the microservice corresponding to each offline operation data in the configuration information; Target time-series data is constructed based on the interface information, the offline operation data, and the user information. The data synchronization engine calls the microservice interface to transmit the offline operation data and user information from the target time-series data to the microservice.

[0120] The computer product program provided in this embodiment receives encrypted time-series data sent by offline devices after submitting offline operation data through the application during data synchronization. It decrypts the encrypted time-series data to obtain offline time-series data. By encrypting the synchronized data, the security of data synchronization is improved. The program parses the offline time-series data to obtain offline operation data at each time point. It queries the interface information corresponding to each offline operation data in the configuration information. Based on the interface information, each offline operation data, and user information, it constructs target time-series data. By converting synchronized data into time-series data, it accurately represents the user's operation time sequence and order, effectively preventing data tampering and improving data consistency. Finally, based on the data synchronization engine, it calls the microservice interface to transmit each offline operation data and user information from the target time-series data to the microservices. This allows each microservice to record user operations sequentially according to execution time and simultaneously stores the target time-series data on the server for archiving, making data synchronization traceable and improving the security and consistency of data synchronization.

[0121] The computer program product provided in one embodiment of this application can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0122] Furthermore, another embodiment of this application provides another computer program product that, when executed by a processor, implements the following process: Obtain offline operation data submitted by the user after performing offline operations within the application, and construct offline time-series data based on the offline operation data; The offline time-series data is submitted to the central offline device, and the encrypted time-series data returned by the central offline device after encrypting the offline time-series data is obtained. After detecting that the offline device is online, the encrypted time-series data is sent to the server; the server parses and decrypts the obtained offline time-series data to obtain offline operation data at each time point, and calls the microservice interface corresponding to each offline operation data to perform offline operation data transmission.

[0123] The computer product program provided in this embodiment acquires offline operation data submitted by the user after performing offline operations in the application during the data synchronization process. It constructs offline time-series data based on the offline operation data and converts the offline operation data into offline time-series data according to the time sequence. This facilitates verification while reducing the risk of data tampering, ensuring data consistency and security. The offline time-series data is submitted to the central offline device, and encrypted time-series data is obtained from the central offline device after encrypting the offline time-series data. The encrypted time-series data is then sent to the server. The encryption of the offline time-series data by the central offline device further enhances data security.

[0124] The computer program product provided in one embodiment of this application can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0125] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-readable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0126] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data synchronization device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data synchronization device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0127] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data synchronization device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0128] These computer program instructions can also be loaded onto a computer or other programmable data synchronization device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0129] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0130] Memory may include non-persistent storage in computer-readable storage media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable storage media.

[0131] Computer-readable storage media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer-readable storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable storage media does not include transient media, such as modulated data signals and carrier waves.

[0132] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0133] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0134] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A data synchronization method, characterized in that, Applied to a server, the method includes: Receive encrypted timing data sent by the offline device after the user submits offline operation data through the application, and decrypt the encrypted timing data to obtain offline timing data; Parse the offline time-series data to obtain offline operation data at each time point, and query the interface information of the microservice corresponding to each offline operation data in the configuration information; Target time-series data is constructed based on the interface information, the offline operation data, and the user information. The data synchronization engine calls the microservice interface to transmit the offline operation data and user information from the target time-series data to the microservice.

2. The data synchronization method according to claim 1, characterized in that, The process involves parsing the offline time-series data to obtain offline operation data for each time point, and querying the interface information of the microservice corresponding to each offline operation data in the configuration information, including: The offline time-series data is traversed and read from each data block to obtain the operation time, operation type and operation information corresponding to the offline operation; Query the microservices of the application corresponding to each operation type in the configuration information, and query the interface information of each microservice in the configuration information; The traversal start position includes the first data block corresponding to the sign-in operation in the offline time series data, and the traversal end position includes the second data block corresponding to the sign-out operation in the offline time series data.

3. The data synchronization method according to claim 1, characterized in that, Calling the microservice interface to transmit the offline operation data and user information from the target time-series data to the microservice includes: Read multiple data blocks from the target time-series data and extract the interface information and target operation data of the target microservice contained in each data block; The system iterates through the microservice interfaces corresponding to the interface information to transmit the target operation data and the user information, and obtains the data synchronization result returned by the target microservice after recording the target operation data.

4. A data synchronization method, characterized in that, Applied to offline devices, the method includes: Obtain offline operation data submitted by the user after performing offline operations within the application, and construct offline time-series data based on the offline operation data; The offline time-series data is submitted to the central offline device, and the encrypted time-series data returned by the central offline device after encrypting the offline time-series data is obtained. After detecting that the offline device is online, the encrypted time-series data is sent to the server; the server parses and decrypts the obtained offline time-series data to obtain offline operation data at each time point, and calls the microservice interface corresponding to each offline operation data to perform offline operation data transmission.

5. The data synchronization method according to claim 4, characterized in that, The step of constructing offline time-series data based on the offline operation data includes: Based on the offline operation data, data blocks corresponding to each offline operation are generated, and the data blocks are written into the original time-series data in chronological order to obtain the offline time-series data; the original time-series data is constructed and distributed based on the user's user information after the server receives the user's login request. The offline time-series data includes a first data block corresponding to the sign-in operation and a second data block corresponding to the sign-out operation.

6. The data synchronization method according to claim 4, characterized in that, Any data block in the data block is generated in the following manner: Query the operation information, operation time, and operation type of the previous offline operation corresponding to any of the data blocks; The operation information, operation time, and operation type are converted according to a preset strategy to obtain the hash value of the previous offline operation; The data block is generated based on the hash value and the operation information, operation time, and operation type of the target offline operation.

7. A data synchronization device, characterized in that, The device includes: The data decryption module is used to receive encrypted time-series data sent by the offline device after the user submits offline operation data through the application, and decrypt the encrypted time-series data to obtain offline time-series data; The interface information query module is used to parse the offline time series data to obtain offline operation data at each time point, and query the interface information of the microservice corresponding to each offline operation data in the configuration information. The target time series data construction module is used to construct target time series data based on the interface information, the offline operation data, and the user information. The data transmission module is used to transmit the offline operation data and user information in the target time-series data to the microservice by calling the microservice interface based on the data synchronization engine.

8. A data synchronization device, characterized in that, The device includes a memory and a processor. The memory stores computer-executable instructions that, when executed on the processor, enable the implementation of the steps of the data synchronization method according to any one of claims 1-3 or 4-6.

9. A computer-readable storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed by the processor, they can implement the steps of the data synchronization method described in any one of claims 1-3 or 4-6.

10. A computer program product, characterized in that, The computer program product includes a data synchronization program, which, when executed by a processor, can implement the steps of the data synchronization method according to any one of claims 1-3 or 4-6.