Data synchronization method and device

By creating data update tasks when data source updates and loading update data to the local system, the data source pressure and resource waste caused by frequent query of timed tasks are solved, and more efficient data synchronization is achieved.

CN119088875APending Publication Date: 2024-12-06BEIJING JINGDONG ZHENSHI INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310665584.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-06
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the prior art, timed tasks frequently query data sources to update data, resulting in great pressure on the data source, waste of resources and low efficiency, especially when the data is not updated, the system resources are occupied too much.

Method used

Create a data update task in response to the data update operation of the data source, obtain update data from the data source and load it on the local system, control the frequency of access to the data source and avoid unnecessary access.

Benefits of technology

It alleviates the pressure on data sources by timing tasks, saves system resources, and improves the efficiency of data synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088875A_ABST
    Figure CN119088875A_ABST
Patent Text Reader

Abstract

The invention discloses a data synchronization method and device, and relates to the technical field of computers. A specific embodiment of the method comprises the steps of obtaining a data updating task, wherein the data updating task is created in response to completion of data updating operation for a data source; acquiring updated data from a data source according to the data updating task; and loading the updated data to a local system to realize data synchronization. According to the embodiment, the access frequency of the data source is controlled through the data updating operation, the situation that the data source is still accessed all the time when the data is not updated is avoided, the pressure of the data source is relieved, system resources are saved, and efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for data synchronization. Background Art

[0002] In high-concurrency, high-traffic business scenarios, in order to cope with the increasing volume of business request data, the system will store business data in the machine memory and directly access the local memory when data is needed. In daily applications, for data that needs to be queried in real time but does not change much, the system sets up scheduled tasks to regularly query the latest data from the data source and write it to the memory.

[0003] In the process of implementing the present invention, the inventors found that the prior art has the following problems:

[0004] Although the scheduled task query method is used to update data, it can ensure data synchronization. However, this method of scheduled query of the data source and then writing it into the memory puts a lot of pressure on the data source, especially when the data has not been updated but the scheduled task has been accessing the query data source. This will cause a waste of system resources and is not conducive to improving efficiency. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for data synchronization, which obtains updated data from a data source according to a data update task created in response to the completion of a data update operation on a data source; then loads the updated data into a local system to perform data synchronization, thereby controlling the access frequency to the data source through the data update operation, avoiding the situation where the data source is still being accessed when the data is not updated, alleviating the pressure of scheduled tasks on the data source, saving system resources, and improving efficiency.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for data synchronization is provided, comprising:

[0007] Acquire a data update task, wherein the data update task is created in response to completion of a data update operation on a data source;

[0008] According to the data update task, obtaining update data from a data source;

[0009] The updated data is loaded into the local system to achieve data synchronization.

[0010] Optionally, before obtaining the data update task, the method further includes: obtaining the data to be stored from the data source by sending a data request; loading the data to be stored into the local system and initializing the system.

[0011] Optionally, after the data to be stored is loaded locally and the system is initialized, the method further includes: creating a scheduled query task to obtain the data update task through the scheduled query task.

[0012] Optionally, the data update task created in response to the completion of the data update operation on the data source is stored at the end of the task queue; obtaining the data update task includes: obtaining the data update task from the head of the task queue.

[0013] Optionally, the data update task includes a system identifier; according to the data update task, obtaining update data from a data source includes: according to the data update task, sending a data acquisition request with the system identifier to the data source, so that the data source returns corresponding system data according to the system identifier; and using the received system data as the update data.

[0014] Optionally, the data update task includes a system identifier and a data version number; and obtaining update data from a data source according to the data update task includes: sending a data acquisition request with the system identifier and the data version number to the data source according to the data update task, so that the data source returns corresponding system data according to the system identifier and the data version number; and using the received system data as the update data.

[0015] According to a second aspect of an embodiment of the present invention, there is provided a data synchronization device, including:

[0016] A task acquisition module, used to acquire a data update task, wherein the data update task is created in response to completion of a data update operation on a data source;

[0017] A data acquisition module, used to acquire update data from a data source according to the data update task;

[0018] The data synchronization module is used to load the updated data into the local system to achieve data synchronization.

[0019] According to a third aspect of an embodiment of the present invention, a data synchronization system is provided, comprising: a data synchronization device and a data management system; wherein:

[0020] The data management system performs a data update operation on the data source upon receiving the data update message, and completes the creation of a data update task in response to the data update operation on the data source;

[0021] The data synchronization device obtains the data update task, obtains update data from the data source according to the data update task, and loads the update data into the local system to achieve data synchronization.

[0022] According to a fourth aspect of an embodiment of the present invention, there is provided an electronic device for data synchronization, including:

[0023] one or more processors;

[0024] a storage device for storing one or more programs,

[0025] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0026] According to a fifth aspect of an embodiment of the present invention, there is provided a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method provided in the first aspect of the embodiment of the present invention is implemented.

[0027] An embodiment of the invention has the following advantages or beneficial effects: by obtaining a data update task, the data update task is created in response to the completion of a data update operation for a data source; according to the data update task, updated data is obtained from the data source; and the updated data is loaded into the local system to realize the technical solution of data synchronization, which realizes the data update task created in response to the completion of a data update operation for a data source, and then the updated data is loaded into the local system for data synchronization. Through the method provided by the embodiment of the present invention, the access frequency to the data source is controlled according to the data update operation, avoiding the situation where the data source is still being accessed when the data is not updated, which not only relieves the pressure of the scheduled task on the data source, but also saves system resources and improves efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0029] Figure 1 is a schematic diagram of the main process of the data synchronization method according to an embodiment of the present invention;

[0030] Figure 2 is a schematic diagram of the task queue structure of an embodiment of the present invention;

[0031] Figure 3 is a detailed flowchart of a data synchronization method according to an embodiment of the present invention;

[0032] Figure 4 is a schematic diagram of main modules of a data synchronization device according to an embodiment of the present invention;

[0033] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0034] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0035] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of the present invention comply with the relevant provisions of national laws and regulations and do not violate public order and good morals.

[0036] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0037] Currently, in the data synchronization solution, a scheduled task query method is used to update data. Although data synchronization can be guaranteed, this method of frequently querying the data source and then writing it into the memory puts a lot of pressure on the data source, especially when the data has not been updated but the scheduled task has been accessing the query data source. This will cause a waste of system resources, is not conducive to improving efficiency, and cannot meet the actual application requirements.

[0038] In order to solve the above problems existing in the prior art, the present invention proposes a method for data synchronization, which obtains updated data from a data source according to a data update task created in response to the completion of a data update operation on a data source; then loads the updated data into a local system for data synchronization, thereby controlling the access frequency to the data source through data update operations, avoiding the situation where the data source is still being accessed when the data is not updated, alleviating the pressure of scheduled tasks on the data source, saving system resources and improving efficiency.

[0039] Figure 1 is a schematic diagram of the main process of the data synchronization method according to an embodiment of the present invention, such as Figure 1 As shown, the data synchronization method of the embodiment of the present invention includes the following steps S101 to S103.

[0040] Step S101: Acquire a data update task, where the data update task is created in response to completion of a data update operation on a data source.

[0041] According to an embodiment of the present invention, before obtaining the data update task, it also includes: obtaining the data to be stored from the data source by sending a data request; loading the data to be stored into the local system and performing system initialization.

[0042] Specifically, in the high-concurrency, high-traffic business scenarios of existing distributed systems, in order to reduce the time consumption of network calls and improve the request processing speed, business data is usually stored in local memory, and the local system can be directly accessed when data is needed. When multiple instances are used for distributed system deployment, the local system will send a data request to the data source. After receiving the data request sent by the system, the data source searches for data information matching the key fields from the data source according to the key fields in the data request, and sends the data information to the local system in a fixed format; the local system verifies and parses the received data information and loads it into the local system as the initial business data of the local system to initialize the system. The data source in the embodiment of the present invention can be a database or other storage medium for data.

[0043] According to another embodiment of the present invention, after the data to be stored is loaded locally and the system is initialized, the method further includes: creating a scheduled query task to obtain the data update task through the scheduled query task.

[0044] Specifically, in the embodiment of the present invention, data synchronization is performed by acquiring data update tasks, and a lightweight task queue is established between the data management system and the local system. The acquisition of data update tasks can be achieved by creating a scheduled query task in the local system. The scheduled query task queue acquires the data update tasks to be processed, and the timing duration is adaptively adjusted according to the needs of the business scenario. It can also be achieved by monitoring the data update tasks in the task queue. When it is monitored that there are tasks to be processed in the task queue, the data update tasks to be processed are acquired from the task queue.

[0045] Furthermore, the data update task is created in response to the completion of the data update operation for the data source. When the data management system receives the data update message, it updates the data source. When the data source completes the data update, it sends a message to the data management system that the update operation is completed. The data in the data source and the system identifier of the system to which it belongs have a corresponding relationship. The data management system confirms that the update operation of the data source has been completed based on the received completion message of the data update operation, which includes the system identifier of the system corresponding to the data update operation, creates a data update task, and writes the created data update task into the task queue.

[0046] According to one embodiment of the present invention, the data update task created in response to the completion of the data update operation on the data source is stored at the end of the task queue; obtaining the data update task includes: obtaining the data update task from the head of the task queue.

[0047] Specifically, the data management system writes the created data update task into a pre-established task queue. Figure 2It is a schematic diagram of the task queue structure of an embodiment of the present invention. The newly created task enters the queue from the tail of the task queue, and each distributed system obtains data update tasks from the head of the queue through regular query tasks.

[0048] Generally, the data update task created above is written to the end of the queue according to the task queue structure. After writing is completed, a message of writing completion is sent to the data management system. After receiving this message, the data management system completes the data update and creation of the data update task. The local system queries the head of the task queue regularly through the scheduled query task, and obtains the data update task of this system according to the system identifier in the data update task.

[0049] The above method for acquiring data update tasks effectively alleviates the pressure on the data source by writing the data update tasks into a lightweight task queue and orienting the scheduled query tasks to the task queue.

[0050] Step S102: Acquire update data from a data source according to the data update task.

[0051] According to one embodiment of the present invention, the data update task includes a system identifier; according to the data update task, obtaining update data from a data source includes: according to the data update task, sending a data acquisition request with the system identifier to the data source, so that the data source returns corresponding system data according to the system identifier; and using the received system data as the update data.

[0052] Specifically, the data management system constructs a data update task according to the completion message of the update operation returned by the data source, and the message includes the system identifier of the system corresponding to the data update operation. Accordingly, the data update task also includes the system identifier. The local system sends a query request to the task queue at regular intervals; the task queue parses the received query request, obtains the system identifier of the query request sender, and starts to query the data update task with the same system identifier from the head of the task queue according to the system identifier. When the corresponding data update task is queried, the data update task is returned to the corresponding local system; when the local system obtains the data update task of the system, it parses the received data update task and obtains relevant information such as the system identifier and the data type identifier; the local system sends a data acquisition request with the current request time to the data source according to the relevant information such as the system identifier and the data type identifier; the data source determines the data to be returned according to the relevant information such as the system identifier and the data type identifier in the received data acquisition request, and returns the data to be returned to the local system; the returned data received by the local system is the updated data.

[0053] According to another embodiment of the present invention, the data update task includes a system identifier and a data version number; according to the data update task, obtaining update data from a data source includes: according to the data update task, sending a data acquisition request with the system identifier and the data version number to the data source, so that the data source returns corresponding system data according to the system identifier and the data version number; and using the received system data as the update data.

[0054] Specifically, upon receiving the data update message, the data management system performs an update operation on the data source. Upon completing the data update, the data source sends a message to the data management system indicating that the update operation is completed. In addition to the system identifier of the system corresponding to the data update operation, the message may also include the version number of the updated data corresponding to the data update operation (data version number). The data management system constructs a data update task based on the update operation completion message returned by the data source. Accordingly, the data update task includes the system identifier and the version number of the updated data corresponding to the data update operation (data version number).

[0055] Furthermore, the local system periodically sends query requests to the task queue; the task queue parses the received query request, obtains the system identifier of the query request sender, and based on the system identifier, queries the data update task with the same system identifier from the head of the task queue, and when the corresponding data update task is found, returns the data update task to the corresponding local system; when the local system obtains the data update task of the system, it parses the received data update task, obtains the system identifier, data version number, data type identifier and other related information; based on the related information, the local system sends a data acquisition request with the current request time to the data source; the data source determines the accurate and latest data to be returned based on the system identifier, data version number, data type identifier and other related information in the received data acquisition request, and returns the data to be returned to the local system; the returned data received by the local system is the updated data.

[0056] The above method for obtaining system update data based on the system identifier and the data version number can more accurately obtain the latest update data, which is conducive to further ensuring the synchronization of data updates.

[0057] Step S103: Load the updated data into the local system to achieve data synchronization.

[0058] Specifically, the local system replaces the original data with the updated data obtained, and stores the data in the memory of the local system, thereby achieving data synchronization update of the local system by accessing the data source only when the data is updated.

[0059] Figure 3Detailed flow chart of the data synchronization method of the embodiment of the present invention. Data synchronization is mainly divided into a system initialization process, a data update task creation process, and a system data synchronization update process.

[0060] Among them, when the system initialization process adopts multiple instances for distributed system deployment, the local system will send a data request to the data source. After receiving the data request sent by the system, the data source will search for data information matching the key fields in the data request from the data source, and return the data information to the local system in a fixed format; the local system verifies and parses the received data information and loads it into the local system memory as the initial business data of the local system, completing the initialization of the system.

[0061] The data update task creation process is initiated when the data management system receives a data update message. The data management system updates the data source. When the data source completes the data update, it sends a message to the data management system indicating that the update operation is complete. The data management system confirms that the update operation of the data source is complete based on the received message indicating that the data update operation is complete, creates a data update task, and writes the created data update task into the task queue. After the writing is complete, the task queue sends a message indicating that the writing is complete to the data management system. After the data management system receives the message indicating that the writing is complete, the data management system completes the data update and the creation of the data update task.

[0062] After the system initialization is completed, the system data synchronization update process can first set the timing duration and initialize the timing query task; the local system sends a query request to the task queue at a fixed time; the task queue parses the received query request, obtains the system identifier of the query request sender, and queries the data update task with the same system identifier from the head of the task queue according to the system identifier, and returns the data update task to the local system when the corresponding data update task is found; when the local system obtains the data update task, it parses the received data update task and obtains the system identifier, data version number, data type identifier and other update related information; based on these related information, the local system sends a data acquisition request with the current request time to the data source; the data source processes the data acquisition request, determines the latest data to be returned based on the system identifier, data version number, data type identifier and other related information in the received data acquisition request, and returns the data to be returned to the local system; the local system receives the returned data, saves the returned data as updated data and loads it into the local system memory.

[0063] Through the above data synchronization method, it is realized that according to the data update task created in response to the completion of the data update operation on the data source, the updated data is obtained from the data source; and then the updated data is loaded into the local system for data synchronization. The access frequency to the data source is controlled through the data update operation, which avoids the situation where the data source is still being accessed when the data is not updated. It not only relieves the pressure of the scheduled task on the data source, but also saves system resources and improves efficiency.

[0064] In order to implement the above-mentioned data synchronization method, the present invention provides a data synchronization system, comprising: a data synchronization device and a data management system; wherein, upon receiving a data update message, the data management system performs a data update operation on the data source, and completes the creation of a data update task in response to the data update operation on the data source; the data synchronization device obtains the data update task, obtains updated data from the data source according to the data update task, and loads the updated data into the local system to achieve data synchronization.

[0065] Figure 4 Schematic diagram of the main modules of the data synchronization device according to an embodiment of the present invention. Figure 4 As shown, the data synchronization device 400 mainly includes a task acquisition module 401 , a data acquisition module 402 and a data synchronization module 403 .

[0066] The task acquisition module 401 is used to acquire a data update task, wherein the data update task is created in response to the completion of a data update operation on a data source;

[0067] The data acquisition module 402 is used to acquire update data from a data source according to the data update task;

[0068] The data synchronization module 403 is used to load the updated data into the local system to achieve data synchronization.

[0069] According to one embodiment of the present invention, the data synchronization device 400 may further include an initialization module (not shown in the figure), which is used to: before obtaining a data update task, obtain the data to be stored from the data source by sending a data request; load the data to be stored into the local system to initialize the system.

[0070] According to another embodiment of the present invention, the data synchronization device 400 may further include a task creation module (not shown in the figure), which is used to: after the data to be stored is loaded locally and the system is initialized, create a scheduled query task to obtain the data update task through the scheduled query task.

[0071] According to another embodiment of the present invention, the data update task created in response to the completion of the data update operation on the data source is stored at the end of the task queue; the task acquisition module 401 includes: acquiring the data update task from the head of the task queue.

[0072] According to another embodiment of the present invention, the data update task includes a system identifier; the data acquisition module 402 can also be used to: send a data acquisition request with the system identifier to a data source according to the data update task, so that the data source returns corresponding system data according to the system identifier; and use the received system data as the update data.

[0073] According to another embodiment of the present invention, the data update task includes a system identifier and a data version number; the data acquisition module 402 can also be used to: send a data acquisition request with the system identifier and the data version number to a data source according to the data update task, so that the data source returns corresponding system data according to the system identifier and the data version number; and use the received system data as the update data.

[0074] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention can be applied.

[0075] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0076] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications, such as data synchronization applications, etc., can be installed on terminal devices 501, 502, 503 (only as an example).

[0077] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0078] The server 505 may be a server that provides various services, such as a background management server (only an example) that provides support for data synchronization performed by users using the terminal devices 501, 502, and 503. The background management server may obtain a data update task, which is created in response to the completion of a data update operation for a data source; obtain update data from the data source according to the data update task; load the update data into a local system to implement data synchronization and other processing, and feed back the processing result (such as update data, etc. - only an example) to the terminal device.

[0079] It should be noted that the data synchronization method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the data synchronization device is generally set in the server 505 .

[0080] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0081] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 6 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0082] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0083] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0084] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.

[0085] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination thereof.

[0086] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0087] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes: a task acquisition module, a data acquisition module and a data synchronization module.

[0088] The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, a data acquisition module may also be described as “a module for acquiring update data from a data source according to the data update task”.

[0089] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiment; or may exist independently without being assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device includes: obtaining a data update task, the data update task is created in response to the completion of a data update operation for a data source; according to the data update task, obtaining update data from the data source; and loading the update data into a local system to achieve data synchronization.

[0090] The technical solution according to the embodiment of the present invention has the following advantages or beneficial effects: by obtaining a data update task, the data update task is created in response to the completion of a data update operation for a data source; according to the data update task, updated data is obtained from the data source; and the updated data is loaded into the local system to achieve data synchronization. The technical solution achieves data synchronization by obtaining updated data from the data source according to the data update task created in response to the completion of a data update operation for a data source; and then loading the updated data into the local system for data synchronization. The method provided by the embodiment of the present invention achieves the control of the access frequency to the data source according to the data update operation, avoiding the situation where the data source is still being accessed when the data is not updated, which not only alleviates the pressure of the scheduled task on the data source, but also saves system resources and improves efficiency.

[0091] The specific implementation methods described herein do not constitute limitations on the scope of protection of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A method for data synchronization, characterized in that: include: Acquire a data update task, wherein the data update task is created in response to completion of a data update operation on a data source; According to the data update task, obtaining update data from a data source; The updated data is loaded into the local system to achieve data synchronization.

2. The method according to claim 1, characterized in that Before getting the data update task, it also includes: Obtaining the data to be stored from the data source by sending a data request; The data to be stored is loaded into the local system to initialize the system.

3. The method according to claim 2, characterized in that After the data to be stored is loaded locally and the system is initialized, the following steps are also included: A scheduled query task is created to obtain the data update task through the scheduled query task.

4. The method according to claim 1, characterized in that The data update task created in response to the completion of the data update operation on the data source is stored at the end of the task queue; Acquiring the data update task includes: acquiring the data update task from the head of the task queue.

5. The method according to claim 1, characterized in that The data update task includes a system identifier; According to the data update task, update data is obtained from the data source, including: According to the data update task, sending a data acquisition request with the system identifier to a data source, so that the data source returns corresponding system data according to the system identifier; The received system data is used as the update data.

6. The method according to claim 1, characterized in that The data update task includes a system identifier and a data version number; According to the data update task, update data is obtained from the data source, including: According to the data update task, sending a data acquisition request with the system identifier and the data version number to a data source, so that the data source returns corresponding system data according to the system identifier and the data version number; The received system data is used as the update data.

7. A data synchronization device, characterized in that: include: A task acquisition module, used to acquire a data update task, wherein the data update task is created in response to completion of a data update operation on a data source; A data acquisition module, used to acquire update data from a data source according to the data update task; The data synchronization module is used to load the updated data into the local system to achieve data synchronization.

8. A data synchronization system, characterized in that: include: A data synchronization device and a data management system; wherein, The data management system performs a data update operation on the data source upon receiving the data update message, and completes the creation of a data update task in response to the data update operation on the data source; The data synchronization device obtains the data update task, obtains update data from the data source according to the data update task, and loads the update data into the local system to achieve data synchronization.

9. A mobile electronic device terminal, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Data synchronization method, apparatus and device, and monitor server

    CN107301196A

  • Data synchronous updating method and device

    CN110309157A

  • Data processing method, device and system, medium and program product

    CN115048411A