Method, device, terminal and storage medium for data synchronization
By introducing a polling mechanism into the data synchronization system, the problems of resource waste and long synchronization time are solved, and the stability and consistency of data synchronization are achieved, thereby improving the stability of the service.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHENGDU IQIYI INTELLIGENT INNOVATION TECH CO LTD
- Filing Date
- 2023-08-02
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies suffer from resource waste, long synchronization times, and data synchronization failures during data synchronization, especially under fault-tolerant mechanisms, leading to decreased service stability.
By introducing multiple data synchronization terminals into the data synchronization system, a polling mechanism is used to obtain data operation information from the operation behavior data table, and data operations are performed based on this information to achieve data synchronization without restarting or subscribing to external services.
This effectively reduces resource waste and synchronization time, improves the success rate of data synchronization, and thus enhances service stability.
Smart Images

Figure CN117149904B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, apparatus, terminal and storage medium for data synchronization. Background Technology
[0002] In anti-fraud operations, algorithmic data such as rules / models are a crucial part of the fraud cleansing process. In many cases, this algorithmic data needs to be deployed as a service for downstream businesses to access at any time, thus meeting certain real-time requirements. To ensure service stability during deployment, at least two terminals are deployed simultaneously to provide a fault tolerance mechanism that allows the service to continue operating even if one terminal fails. However, this fault tolerance mechanism can lead to a situation where, when algorithmic data is updated, only one terminal updates the data, while other terminals retain the old algorithmic data. This can result in downstream businesses potentially still using the old algorithmic data when making requests, impacting business implementation.
[0003] Currently, many platforms use restarting to synchronize algorithm data in terminals. However, this method wastes resources and takes a long time to synchronize. If a subscription method is used, it relies too much on external services. If the external services have problems, it is easy to cause data synchronization failure and reduce service stability. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method, apparatus, terminal and storage medium for data synchronization, which can realize data synchronization of multiple data synchronization terminals without restarting or subscription, effectively reducing the problems of wasted resources, long synchronization time and unsuccessful data synchronization, and greatly improving the stability of the service.
[0005] In a first aspect, embodiments of the present invention provide a data synchronization method, wherein the method is applicable to a data synchronization system, the data synchronization system including multiple data synchronization terminals and a data development terminal connected to each data synchronization terminal; the method includes:
[0006] Any target data synchronization terminal among multiple data synchronization terminals receives a data operation instruction sent by the data development terminal, parses the data operation instruction, obtains the data operation information carried in the data operation instruction, and uploads the data operation information to the operation behavior data table;
[0007] Each data synchronization terminal periodically polls the operation behavior data table to obtain data operation information according to the first preset polling time, and performs data operations based on the data operation information to achieve data synchronization.
[0008] In one possible implementation, the data operation information includes a data update operation and a first data address corresponding to the data update operation;
[0009] Data manipulation based on data manipulation information includes:
[0010] Download and obtain the updated data based on the first data address, as well as the data identifier corresponding to the updated data;
[0011] Retrieve the data to be updated based on the data identifier;
[0012] Data update operations replace the data to be updated with the updated data.
[0013] In one possible implementation, the data operation information includes a data deployment operation, as well as a service identifier and a deployment data identifier corresponding to the data deployment operation;
[0014] Data manipulation based on data manipulation information includes:
[0015] Retrieve deployment data based on deployment data identifier;
[0016] The data deployment operation deploys the data to the service corresponding to the service identifier.
[0017] In one possible implementation, the data operation information includes a data offline operation and a corresponding offline data identifier.
[0018] Data manipulation based on data manipulation information includes:
[0019] Obtain data to be taken offline based on offline data identifiers;
[0020] Data to be taken offline is taken offline based on the data offline operation.
[0021] In one possible implementation, the method further includes, prior to performing data manipulation based on data manipulation information:
[0022] For each data synchronization terminal, the terminal operation status that matches the terminal identifier corresponding to the data synchronization terminal is found in the terminal information table; the terminal information table stores the terminal identifier of each data synchronization terminal and the terminal operation status corresponding to each terminal identifier.
[0023] Update the terminal operation status to the first terminal operation status; wherein, the first terminal operation status is used to represent the incomplete state of the data synchronization terminal data operation.
[0024] In one possible implementation, after performing data manipulation based on data manipulation information, the method further includes:
[0025] For each data synchronization terminal, when the completion of the data operation is detected, the terminal operation status corresponding to the data synchronization terminal is updated to the second terminal operation status, whereby the second terminal operation status is used to characterize the completion status of the data operation of the data synchronization terminal.
[0026] In one possible implementation, the method further includes:
[0027] Each data synchronization terminal polls the terminal information table periodically according to the second preset polling time. When it is detected that all terminal operation statuses in the terminal information table are in the second terminal operation status, each data synchronization terminal deletes the operation record of the data operation, and the target data synchronization terminal deletes the data operation information in the operation behavior data table.
[0028] Secondly, embodiments of the present invention provide a data synchronization apparatus, wherein the apparatus is applicable to a data synchronization system, the data synchronization system including multiple data synchronization terminals and a data development terminal connected to each data synchronization terminal; the apparatus includes:
[0029] The parsing and uploading module is used by any target data synchronization terminal among multiple data synchronization terminals to receive data operation instructions sent by the data development terminal, parse the data operation instructions to obtain the data operation information carried in the data operation instructions, and upload the data operation information to the operation behavior data table.
[0030] The data operation synchronization module is used by each data synchronization terminal to periodically poll and obtain data operation information from the operation behavior data table according to a first preset polling time, and to perform data operations based on the data operation information to achieve data synchronization.
[0031] Thirdly, embodiments of the present invention provide a terminal, comprising: a processor and a memory, wherein the processor is configured to execute a data synchronization program stored in the memory to implement the aforementioned data synchronization method.
[0032] Fourthly, embodiments of the present invention provide a storage medium, wherein the storage medium stores one or more programs, which can be executed by one or more processors to implement the above-described data synchronization method.
[0033] This invention provides a data synchronization method, apparatus, terminal, and storage medium. The method includes: any target data synchronization terminal among multiple data synchronization terminals receives a data operation instruction sent by a data development terminal; parses the data operation instruction to obtain data operation information carried in the instruction; and uploads the data operation information to an operation behavior data table. Each data synchronization terminal periodically polls the operation behavior data table according to a first preset polling time to obtain the data operation information and performs data operations based on the information to achieve data synchronization. This invention randomly sends data operation instructions to a target data synchronization terminal, but all data synchronization terminals poll and jointly read the data operation information from the operation behavior data table. All data synchronization terminals perform data operations based on the information to complete data synchronization, ensuring data consistency across all data synchronization terminals. This method of achieving data synchronization without restarting or subscribing effectively reduces resource waste, long synchronization times, and unsuccessful data synchronization, significantly improving service stability. Attached Figure Description
[0034] Figure 1 This is a schematic diagram of the structure of a data synchronization system provided in an embodiment of the present invention;
[0035] Figure 2 A flowchart illustrating an embodiment of a data synchronization method provided by this invention;
[0036] Figure 3 A flowchart illustrating an embodiment of another data synchronization method provided by the present invention;
[0037] Figure 4 A block diagram illustrating an embodiment of an application generation apparatus provided by the present invention;
[0038] Figure 5 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0040] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0041] The data synchronization method provided in this embodiment of the invention will be described in detail below. The data synchronization system includes, for example... Figure 1 The diagram illustrates an example of an application scenario for a data synchronization method. The data synchronization system includes multiple data synchronization terminals 100 and a data development terminal 101 connected to each data synchronization terminal 100; wherein, Figure 1 Taking three data synchronization terminals 100 as an example, the specific number of data synchronization terminals 100 can be set according to actual needs and is not limited here.
[0042] The following section will detail a data synchronization method using the scenario structure diagram. (See also...) Figure 2 This is a flowchart illustrating an embodiment of a data synchronization method provided by the present invention. Figure 2 As shown, the process may include the following steps:
[0043] S201, any target data synchronization terminal among multiple data synchronization terminals receives a data operation instruction sent by the data development terminal, parses the data operation instruction, obtains the data operation information carried in the data operation instruction, and uploads the data operation information to the operation behavior data table;
[0044] A data development terminal can be understood as a terminal device that can operate on the data on a data synchronization terminal. When it is necessary to operate on the data on the data synchronization terminal, the data development terminal issues a data operation instruction. This data operation instruction will be randomly assigned to any one of the multiple data synchronization terminals, i.e., the target synchronization terminal. After receiving the data operation instruction, the target synchronization terminal needs to parse the data operation instruction to obtain the data operation information carried by the data operation instruction, and send the data operation information to the operation behavior data table for storage.
[0045] Among them, data operation information refers to specific information that enables operations on the data on the data synchronization terminal. This data is not limited to rule algorithm data, model algorithm data, or other application data that can realize business services.
[0046] The operation behavior data table is a data storage device that supports data access and data storage for all data synchronization terminals.
[0047] S202, each data synchronization terminal periodically polls to obtain data operation information from the operation behavior data table according to the first preset polling time, and performs data operations based on the data operation information to achieve data synchronization.
[0048] Multiple data synchronization terminals poll the operation behavior data table at regular intervals according to a first preset polling time. This allows them to obtain the data operation information uploaded to the operation behavior data table by the target data synchronization terminal. Each data synchronization terminal performs data operations based on the same obtained data operation information, thus synchronizing the data operations of all data synchronization terminals. This ensures the consistency of data in each data synchronization terminal and effectively improves service stability. The first preset polling time can be set according to actual needs and is not limited here.
[0049] by Figure 1 Taking the three data synchronization terminals shown as an example, if the first preset polling time is 10 seconds, the order from left to right is as follows: after the middle data synchronization terminal 100 uploads the data operation information to the operation behavior data table, the leftmost data synchronization terminal 100 accesses the operation behavior data table for the first time to obtain the data operation information. After a 10-second interval, the middle data synchronization terminal 100 accesses the operation behavior data table to obtain the data operation information, and after a 10-second interval, the rightmost data synchronization terminal 100 accesses the operation behavior data table to obtain the data operation information. When all data synchronization terminals obtain the same data operation information, each data synchronization terminal performs data operations based on the data operation information. Alternatively, each data synchronization terminal may start performing data operations based on the data operation information after obtaining it, without any limitation here.
[0050] This invention provides a data synchronization method, comprising: any target data synchronization terminal among multiple data synchronization terminals receiving a data operation instruction sent by a data development terminal; parsing the data operation instruction to obtain data operation information carried in the instruction; and uploading the data operation information to an operation behavior data table; each data synchronization terminal periodically polling the operation information in the operation behavior data table according to a first preset polling time, and performing data operations based on the operation information to achieve data synchronization. This invention randomly sends data operation instructions to a target data synchronization terminal, but all data synchronization terminals poll and jointly read the data operation information in the operation behavior data table. All data synchronization terminals perform data operations based on the operation information to complete data synchronization, ensuring data consistency across all data synchronization terminals. This method of achieving data synchronization without restarting or subscribing effectively reduces resource waste, long synchronization times, and unsuccessful data synchronization, greatly improving service stability.
[0051] In one implementation, if the data operation information includes a data update operation and a first data address corresponding to the data update operation, the data operation performed by each data synchronization terminal based on the data operation information in step 202 above can be achieved through steps A1 to A3:
[0052] Step A1: Download and obtain the updated data and the data identifier corresponding to the updated data based on the first data address;
[0053] The first data address is used to indicate the storage location of the updated data. That is, the file containing the updated data can be found through the first data address, and then the updated data can be obtained from the file containing the updated data.
[0054] The data identifier is a unique identifier for updated data, and can be represented by numbers, characters, letters or other forms, without limitation here.
[0055] Step A2: Obtain the data to be updated based on the data identifier;
[0056] Since the data synchronization terminal stores a large amount of data, each piece of data needs to be identified in order to clarify each piece of data. Using the data identifier of the updated data obtained in step A1, the data to be updated corresponding to the data identifier can be determined from the multiple pieces of data stored in the data synchronization terminal. This data to be updated is the data that needs to be updated in this data operation instruction.
[0057] Step A3: Replace the data to be updated with the updated data based on the data update operation.
[0058] The data synchronization terminal updates the data by replacing the data to be updated with the updated data.
[0059] In one implementation, if the data operation information includes a data deployment operation, and a service identifier and a deployment data identifier corresponding to the data deployment operation, the data operation performed by each data synchronization terminal based on the data operation information in step 202 above can be achieved through steps B1 to B2:
[0060] Step B1: Obtain deployment data based on the deployment data identifier;
[0061] Since the data synchronization terminal stores a large amount of data, each piece of data needs to be identified in order to distinguish each piece of data. By deploying data identifiers, the deployment data corresponding to the deployment data identifier can be determined from the multiple pieces of data stored in the data synchronization terminal. This deployment data is the data that provides data services to the service.
[0062] Step B2: Based on the data deployment operation, deploy the deployment data to the service corresponding to the service identifier.
[0063] The service identifier is a unique identifier for a service, which can clearly identify which specific service it is.
[0064] Deployment can be understood as the specific service to which deployment data is deployed for application. For example, migrating the vgg16 model in the source domain to the data monitoring service as a new scenario initialization model for data monitoring.
[0065] In one implementation, if the data operation information includes a data offline operation and an offline data identifier corresponding to the data offline operation, the data operation performed by each data synchronization terminal based on the data operation information in step 202 above can be achieved through steps C1 to C2:
[0066] Step C1: Obtain the data to be taken offline based on the offline data identifier;
[0067] Since the data synchronization terminal stores a large amount of data, each piece of data needs to be identified in order to distinguish each piece of data. The offline data identifier can be used to determine the data to be offline corresponding to the offline data identifier from the multiple data stored in the data synchronization terminal. The data to be offline is the data that needs to be offline in this data operation instruction.
[0068] Step C2: Based on the data offline operation, offline the data to be offline.
[0069] According to the data offline operation, the data to be offline is processed to achieve the data offline in the data synchronization terminal.
[0070] In practical use, data operations are not limited to data updates, data deployments, and data decommissioning. Specific data operations can also include data processing and other operations, which will be described in detail here.
[0071] See Figure 3 This is a flowchart illustrating an embodiment of another data synchronization method provided by the present invention. Figure 3 As shown, the process may include the following steps:
[0072] Step 301: Any target data synchronization terminal among multiple data synchronization terminals receives a data operation instruction sent by the data development terminal, parses the data operation instruction to obtain the data operation information carried in the data operation instruction, and uploads the data operation information to the operation behavior data table.
[0073] Step 301 above can be referred to step 201, and will not be repeated here.
[0074] Step 302: Each data synchronization terminal periodically polls to obtain data operation information from the operation behavior data table according to the first preset polling time, searches for the terminal operation status that matches the terminal identifier corresponding to the data synchronization terminal in the terminal information table, updates the terminal operation status to the first terminal operation status, and performs data operations based on the data operation information to achieve data synchronization.
[0075] The terminal information table stores the terminal identifiers of each data synchronization terminal, as well as the terminal operation status corresponding to each terminal identifier. Specifically, the target terminal identifier that matches the terminal identifier corresponding to the data synchronization terminal can be found in the terminal information table, and then the terminal operation status corresponding to the target terminal identifier can be determined as the terminal operation status corresponding to the data synchronization terminal.
[0076] The terminal operation status is used to characterize the current state of the data synchronization terminal's data operation. In this embodiment, the first terminal operation status is used to characterize the data synchronization terminal's incomplete data operation state, and the second terminal operation status is used to characterize the data synchronization terminal's completed data operation state.
[0077] Since the terminal operation status was the second terminal operation status after the last data operation command, in order to clarify the completion status of the current data operation command, it is necessary to first update the terminal operation status from the second terminal operation status to the first terminal operation status after the completion of the last data operation command. Then, after the completion of the current data operation command, the terminal operation status is updated from the first terminal operation status to the second terminal operation status to indicate the completion of the current data operation command.
[0078] Step 303: For each data synchronization terminal, when the data operation is detected to be completed, update the terminal operation status corresponding to the data synchronization terminal to the second terminal operation status.
[0079] Step 304: Each data synchronization terminal polls the terminal information table periodically according to the second preset polling time. When it is detected that all terminal operation statuses in the terminal information table are in the second terminal operation status, each data synchronization terminal deletes the operation record of the data operation, and the target data synchronization terminal deletes the data operation information in the operation behavior data table.
[0080] In actual use, the data operation process performed by the data synchronization terminal based on the data operation information is stored locally in the form of operation records. In order to save storage space in the data synchronization terminal, each data synchronization terminal polls the terminal information table at regular intervals according to the second preset polling time. When it is determined that the operation status of all terminals is the second terminal operation status, that is, all data synchronization terminals have completed the data operation of this data operation instruction, the operation record corresponding to this data operation stored locally is deleted.
[0081] In this embodiment, when each data synchronization terminal determines that all terminal operation states are in the second terminal operation state, the target data synchronization terminal deletes the data operation information in the operation behavior data table to ensure that the same data operation is only executed once, thus avoiding the data synchronization time delay caused by the data synchronization terminal performing the same data operation multiple times.
[0082] See Figure 4 This is a block diagram of an embodiment of an application generation device provided by the present invention. The device is suitable for a data synchronization system, which includes multiple data synchronization terminals and a data development terminal connected to each data synchronization terminal. The device includes:
[0083] The parsing and uploading module 401 is used to receive data operation instructions sent by the data development terminal from any target data synchronization terminal among multiple data synchronization terminals, parse the data operation instructions, obtain the data operation information carried in the data operation instructions, and upload the data operation information to the operation behavior data table;
[0084] The data operation synchronization module 402 is used for each data synchronization terminal to periodically poll and obtain data operation information from the operation behavior data table according to a first preset polling time, and to perform data operations based on the data operation information to achieve data synchronization.
[0085] This invention provides a data synchronization device, comprising: any target data synchronization terminal among multiple data synchronization terminals receiving a data operation instruction sent by a data development terminal; parsing the data operation instruction to obtain data operation information carried in the instruction; and uploading the data operation information to an operation behavior data table; each data synchronization terminal periodically polling the operation information in the operation behavior data table according to a first preset polling time, and performing data operations based on the operation information to achieve data synchronization. This invention randomly sends data operation instructions to a target data synchronization terminal, but all data synchronization terminals poll and jointly read the data operation information in the operation behavior data table. All data synchronization terminals perform data operations based on the operation information to complete data synchronization, ensuring data consistency across all data synchronization terminals. This method of achieving data synchronization without restarting or subscribing effectively reduces problems such as wasted resources, long synchronization times, and unsuccessful data synchronization, greatly improving service stability.
[0086] Figure 5 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention. Figure 5 The terminal 500 shown includes at least one processor 501, a memory 502, at least one network interface 504, and other user interfaces 503. The various components in the terminal 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to implement communication between these components. In addition to a data bus, the bus system 505 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 5 The general designated all buses as Bus System 505.
[0087] The user interface 503 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0088] It is understood that the memory 502 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Synchlink Dynamic Random Access Memory (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0089] In some implementations, memory 502 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 5021 and application program 5022.
[0090] The operating system 5021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 5022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 5022.
[0091] In this embodiment of the invention, the processor 501 executes the method steps provided in each method embodiment by calling the program or instructions stored in the memory 502, specifically the program or instructions stored in the application program 5022.
[0092] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 501. Processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 501 or by instructions in the form of software. The processor 501 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 502. Processor 501 reads the information in memory 502 and, in conjunction with its hardware, completes the steps of the above method.
[0093] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0094] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0095] The terminal provided in this embodiment can be as follows: Figure 5 The terminal shown can perform actions such as Figure 2-3 All steps of the data synchronization method in China, thereby achieving Figure 2-3 For details on the technical effects of the data synchronization method shown, please refer to [link / reference]. Figure 2-3 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0096] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.
[0097] The above-mentioned data synchronization method can be implemented when one or more programs in the storage medium can be executed by one or more processors.
[0098] The processor is used to execute a program for synchronizing data stored in memory, thereby implementing a data synchronization method.
[0099] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0100] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0101] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for data synchronization, characterized in that, The method is applicable to a data synchronization system, which includes multiple data synchronization terminals and a data development terminal connected to each of the data synchronization terminals; the method includes: Any target data synchronization terminal among the multiple data synchronization terminals receives a data operation instruction sent by the data development terminal, parses the data operation instruction to obtain the data operation information carried in the data operation instruction, and uploads the data operation information to the operation behavior data table; Each data synchronization terminal periodically polls to obtain the data operation information from the operation behavior data table according to a first preset polling time. For each data synchronization terminal, it searches the terminal information table for the terminal operation status that matches the terminal identifier corresponding to the data synchronization terminal. The terminal information table stores the terminal identifiers of each data synchronization terminal and the terminal operation status corresponding to each terminal identifier. The terminal operation status is updated to a first terminal operation status, which indicates that the data operation of the data synchronization terminal is incomplete. Data operations are performed based on the data operation information to achieve data synchronization. When the completion of the data operation is detected for each data synchronization terminal, the terminal operation status corresponding to the data synchronization terminal is updated to a second terminal operation status, which indicates that the data operation of the data synchronization terminal is complete. Each of the data synchronization terminals polls the terminal information table periodically according to a second preset polling time. When it is detected that all the terminal operation states in the terminal information table are in the second terminal operation state, each of the data synchronization terminals deletes the operation record of the data operation, and the target data synchronization terminal deletes the data operation information in the operation behavior data table.
2. The method according to claim 1, characterized in that, The data operation information includes a data update operation and a first data address corresponding to the data update operation; The data operation based on the data operation information includes: Download and obtain updated data based on the first data address, as well as the data identifier corresponding to the updated data; Obtain the data to be updated based on the data identifier; The data update operation replaces the data to be updated with the updated data.
3. The method according to claim 1, characterized in that, The data operation information includes data deployment operations, as well as service identifiers and deployment data identifiers corresponding to the data deployment operations; The data operation based on the data operation information includes: Deployment data is obtained based on the deployment data identifier; Based on the data deployment operation, the deployment data is deployed to the service corresponding to the service identifier.
4. The method according to claim 1, characterized in that, The data operation information includes data offline operation and offline data identifier corresponding to the data offline operation; The data operation based on the data operation information includes: Obtain the data to be taken offline based on the offline data identifier; The data to be taken offline is taken offline according to the data offline operation.
5. A data synchronization device, characterized in that, The device is suitable for a data synchronization system, which includes multiple data synchronization terminals and a data development terminal connected to each of the data synchronization terminals; the device includes: The parsing and uploading module is used to allow any target data synchronization terminal among the multiple data synchronization terminals to receive a data operation instruction sent by the data development terminal, parse the data operation instruction to obtain the data operation information carried in the data operation instruction, and upload the data operation information to the operation behavior data table. A data operation synchronization module is used to periodically poll each of the data synchronization terminals to obtain the data operation information in the operation behavior data table according to a first preset polling time. For each data synchronization terminal, it searches the terminal information table for a terminal operation status that matches the terminal identifier corresponding to the data synchronization terminal. The terminal information table stores the terminal identifiers of each data synchronization terminal and the terminal operation status corresponding to each terminal identifier. The module updates the terminal operation status to a first terminal operation status, where the first terminal operation status indicates that the data operation of the data synchronization terminal is incomplete. Data operations are performed based on the data operation information to achieve data synchronization. For each data synchronization terminal, when the completion of the data operation is detected, the terminal operation status corresponding to the data synchronization terminal is updated to a second terminal operation status, where the second terminal operation status indicates that the data operation of the data synchronization terminal is complete. Each of the data synchronization terminals polls the terminal information table periodically according to a second preset polling time. When it is detected that all the terminal operation states in the terminal information table are in the second terminal operation state, each of the data synchronization terminals deletes the operation record of the data operation, and the target data synchronization terminal deletes the data operation information in the operation behavior data table.
6. A terminal, characterized in that, include: A processor and a memory, the processor being configured to execute a data synchronization program stored in the memory to implement the data synchronization method according to any one of claims 1 to 4.
7. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the data synchronization method according to any one of claims 1 to 4.