WO2019062182A1 - 数据同步装置、方法及计算机可读存储介质 - Google Patents

数据同步装置、方法及计算机可读存储介质 Download PDF

Info

Publication number
WO2019062182A1
WO2019062182A1 PCT/CN2018/089187 CN2018089187W WO2019062182A1 WO 2019062182 A1 WO2019062182 A1 WO 2019062182A1 CN 2018089187 W CN2018089187 W CN 2018089187W WO 2019062182 A1 WO2019062182 A1 WO 2019062182A1
Authority
WO
WIPO (PCT)
Prior art keywords
synchronization
task
data
task queue
update request
Prior art date
Application number
PCT/CN2018/089187
Other languages
English (en)
French (fr)
Inventor
李占川
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019062182A1 publication Critical patent/WO2019062182A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/20Education
    • G06Q50/205Education administration or guidance

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a data synchronization apparatus, method, and computer readable storage medium.
  • the existing data synchronization method is: the business management system opens a specific interface to the training management system, and the training management system
  • data update the operation of adding, deleting, modifying, etc. related data such as course data and personnel data
  • the update request is triggered in real time, and the update information is synchronized to the business management system, and the existing request method is in each request.
  • the synchronization code is added to the method to synchronize the information.
  • the present application provides a data synchronization apparatus, method, and computer readable storage medium, the main purpose of which is to reduce code redundancy and improve data synchronization efficiency.
  • the present application provides a data synchronization apparatus including a memory and a processor in which a data synchronization program executable on the processor is stored, the data synchronization program being processed
  • a data synchronization apparatus including a memory and a processor in which a data synchronization program executable on the processor is stored, the data synchronization program being processed
  • the thread in the thread pool is started to process the task queue.
  • the synchronization task in the middle to send the synchronization data stored in the cache area to the external management system.
  • the present application further provides a data synchronization method, where the method includes:
  • the thread in the thread pool is started to process the task queue.
  • the synchronization task in the middle to send the synchronization data stored in the cache area to the external management system.
  • the present application further provides a computer readable storage medium having a data synchronization program stored thereon, the data synchronization program being executable by one or more processors to implement The steps of the data synchronization method as described above.
  • the data synchronization device, the method, and the computer readable storage medium provided by the present application when detecting an update request, acquire data to be updated from the update request, and generate synchronization data according to the acquired data, and establish corresponding to the synchronization data.
  • the synchronization task is added to the task queue, and the synchronization data is associated with the synchronization task and cached in the cache area.
  • the startup is started.
  • the thread in the thread pool starts to process the synchronization task in the task queue to send the synchronization data cached in the cache area to the external management system.
  • the present application batches the data by creating the task list and buffering the data at the same time. Synchronization processing does not need to trigger the update request every time there is an update request, which avoids the occurrence of code redundancy.
  • the task of processing the task queue through threads in the thread pool greatly improves the efficiency of data synchronization.
  • FIG. 1 is a schematic diagram of a preferred embodiment of a data synchronization apparatus of the present application
  • FIG. 2 is a schematic diagram of functional modules of a data synchronization program in an embodiment of a data synchronization apparatus according to the present application;
  • FIG. 3 is a flow chart of a preferred embodiment of a data synchronization method of the present application.
  • the application provides a data synchronization device.
  • FIG. 1 a schematic diagram of a preferred embodiment of a data synchronization apparatus of the present application is shown.
  • the data synchronization device may be a PC (Personal Computer), or may be a smart phone, a tablet computer, an e-book reader, or an MP3 (Moving Picture Experts Group Audio Layer III). Level 3) Player, MP4 (Moving Picture Experts Group Audio Layer IV) player, portable computer and other portable terminal devices with display functions.
  • PC Personal Computer
  • MP3 Moving Picture Experts Group Audio Layer III
  • MP4 Moving Picture Experts Group Audio Layer IV
  • the data synchronization device includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 11 may be an internal storage unit of the data synchronization device, such as a hard disk of the data synchronization device, in some embodiments.
  • the memory 11 may also be an external storage device of the data synchronization device in other embodiments, such as a plug-in hard disk equipped with a data synchronization device, a smart memory card (SMC), and a secure digital (SD). Card, flash card, etc.
  • the memory 11 may also include both an internal storage unit of the data synchronization device and an external storage device.
  • the memory 11 can be used not only for storing application software installed in the data synchronization device and various types of data, such as codes of a data synchronization program, but also for temporarily storing data that has been output or is to be output.
  • the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11. Data, such as executing a data synchronization program.
  • CPU Central Processing Unit
  • controller microcontroller
  • microprocessor or other data processing chip for running program code or processing stored in the memory 11.
  • Data such as executing a data synchronization program.
  • Communication bus 13 is used to implement connection communication between these components.
  • the network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
  • a standard wired interface such as a WI-FI interface
  • Figure 1 shows only data synchronization devices having components 11-14 and data synchronization procedures, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the device may further include a user interface
  • the user interface may include a display
  • an input unit such as a keyboard
  • the optional user interface may further include a standard wired interface and a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch sensor, or the like.
  • the display may also be suitably referred to as a display screen or display unit for displaying information processed in the data synchronization device and a user interface for displaying visualizations.
  • the device may also include a touch sensor.
  • the area provided by the touch sensor for the user to perform a touch operation is referred to as a touch area.
  • the touch sensor described herein may be a resistive touch sensor, a capacitive touch sensor, or the like.
  • the touch sensor includes not only a contact type touch sensor but also a proximity type touch sensor or the like.
  • the touch sensor may be a single sensor or a plurality of sensors arranged, for example, in an array.
  • the area of the display of the device may be the same as or different from the area of the touch sensor.
  • a display is stacked with the touch sensor to form a touch display. The device detects a user-triggered touch operation based on a touch screen display.
  • a data synchronization program is stored in the memory 11; when the processor 12 executes the data synchronization program stored in the memory 11, the following steps are implemented:
  • the synchronization data corresponding to the update request is acquired, and a synchronization task corresponding to the synchronization data is established.
  • the training management system can be run in the synchronization device provided in this embodiment, and the synchronization device can be combined with one or more
  • the training course manages the client to establish remote communication. If the client generates new data during use, it needs to update the data to the external management system synchronously. For example, when there are operations such as adding, deleting, or modifying related data such as course data and personnel data in the client, the client sends an update request to the synchronization device, and the new data after the data update is sent to the synchronization device.
  • an external management system such as a business management system.
  • the synchronization device proposed in this embodiment interfaces with an external management system through a specific interface.
  • the client performs real-time detection on the above update operation, for example, an operation of adding, deleting, and modifying related data such as course data and personnel data.
  • the data content corresponding to the update operation is obtained.
  • the modified data content corresponding to the modification operation and the location of the data content are acquired, and synchronization data is generated, and the client sends an update request based on the synchronization data to the update request.
  • the synchronization device when receiving the update request, acquires synchronization data corresponding to the update request, and establishes a synchronization task corresponding to the synchronization data.
  • a synchronization task is added to the task queue, and the synchronization data is associated with the synchronization task and stored in the cache area.
  • a task queue is established in advance, and the synchronization task established in the update device is added to the task queue as a task to be processed.
  • the synchronization tasks may be added to the task queue in a first to last order according to the setup time of the synchronization tasks when a new synchronization task is generated.
  • the tasks in the task queue are arranged according to the priority order of the various institutional nodes of the training course management system.
  • the processor 12 is further configured to execute the data synchronization program to perform the following steps: after acquiring the synchronization data corresponding to the update request, before the step of adding the synchronization task to the task queue Obtaining an organization identifier from the update request, to determine a priority of the organization node corresponding to the to-be-updated request according to the organization identifier.
  • the step of adding the synchronization task to the task queue includes adding the synchronization task to the task queue in descending order of priority of the corresponding organization node.
  • the above-mentioned institutional nodes are training courses distributed in various places, and these institutions use the same training courses to manage the clients.
  • the client sends an update request to the synchronization device
  • the client carries the organization identifier of the institution in the update request.
  • the synchronization device pre-sets a different priority order for each organization node, and the data updated by the higher-priority organization node can be preferentially synchronized, and the data updated by the lower-priority organization node can be synchronized later. .
  • the synchronization device determines the structural node corresponding to the update request according to the organization identifier carried in the update request, and determines the priority of the organization node according to the priority order of the preset organization node, and stores the corresponding synchronization data into the task list. , store in order of priority.
  • the synchronization device is pre-divided with a storage area of a certain size for storing synchronization data corresponding to the synchronization task, and the size of the storage area can be set according to actual application conditions.
  • the thread in the thread pool is started to process the task queue.
  • the synchronization task in the middle to send the synchronization data stored in the cache area to the external management system.
  • the synchronization device detects the storage amount of the synchronization data in the cache area or the number of tasks in the task queue in real time, when the storage amount of the synchronization data cached in the cache area reaches a first preset threshold, or the task quantity in the task queue reaches When the second preset threshold is reached, the threads in the thread pool are started, and the synchronization task is executed in the order of the tasks in the task queue.
  • the maximum number of threads can be set in advance according to the workload of the task, and each time the thread pool is started to execute the task, multiple threads that do not exceed the maximum number of threads can be opened according to the amount of tasks in the task queue.
  • the thread in the thread pool when it is detected that the storage amount of the synchronization data cached in the cache area reaches a preset threshold, the thread in the thread pool is started to process the synchronization task in the task queue to synchronize the cached synchronization data to the first
  • the steps in the second system may be replaced by the following steps: when detecting that the synchronization time interval reaches a preset time interval, the thread in the startup thread pool processes the synchronization task in the task queue to synchronize the storage in the cache area.
  • the data is sent to an external management system.
  • the data synchronization device of the embodiment obtains the data to be updated from the update request when the update request is detected, and generates synchronization data according to the acquired data, and establishes a synchronization task corresponding to the synchronization data, and the synchronization task is generated.
  • the above synchronization data is associated with the synchronization task and cached in the cache area.
  • the thread in the thread pool starts to process.
  • the synchronization task in the task queue is used to send the synchronization data cached in the cache area to the external management system that is connected to the host.
  • the present invention performs batch synchronization processing on the data by means of establishing the task list and buffering the data at the same time.
  • the update request is triggered when there is an update request, which avoids the occurrence of code redundancy.
  • the task of processing the task queue through the thread in the thread pool greatly improves the efficiency of data synchronization.
  • the data synchronization program may also be divided into one or more modules, one or more modules being stored in the memory 11 and being processed by one or more processors (this embodiment is The processor 12) is executed to complete the application.
  • a module referred to herein refers to a series of computer program instructions capable of performing a particular function for describing the execution of a data synchronization program in a data synchronization device.
  • FIG. 2 it is a functional block diagram of a data synchronization program in an embodiment of the data synchronization apparatus of the present application.
  • the data synchronization program may be divided into a data processing module 10, a task creation module 20, and data.
  • the storage module 30 and the data sending module 40 are exemplarily:
  • the data processing module 10 is configured to: when receiving the update request, acquire synchronization data corresponding to the update request;
  • the task establishing module 20 is configured to: establish a synchronization task corresponding to the synchronization data;
  • the data storage module 30 is configured to: add a synchronization task to the task queue, and associate the synchronization data with the synchronization task and store the data in the cache area;
  • the data sending module 40 is configured to: when detecting that the storage amount of the synchronization data cached in the cache area reaches a first preset threshold, or the task quantity in the task queue reaches a second preset threshold, start the thread pool The thread processes the synchronization task in the task queue to send the synchronization data stored in the cache area to the external management system.
  • the functions or operation steps performed by the data processing module 10, the task creation module 20, the data storage module 30, and the data transmission module 40 are substantially the same as those of the foregoing embodiment, and are not described herein again.
  • the present application also provides a data synchronization method.
  • FIG. 3 it is a flowchart of a preferred embodiment of the data synchronization method of the present application.
  • the data synchronization method includes:
  • Step S10 When receiving the update request, acquire synchronization data corresponding to the update request, and establish a synchronization task corresponding to the synchronization data.
  • the method proposed in this embodiment can be performed by a device, and the synchronization device can be implemented by software and/or hardware.
  • the device can be a synchronizing device.
  • the training management system can be run in the synchronization device provided in this embodiment, and the synchronization device can be combined with one or more
  • the training course manages the client to establish remote communication. If the client generates new data during use, it needs to update the data to the external management system synchronously.
  • the client when there are operations such as adding, deleting, or modifying related data such as course data and personnel data in the client, the client sends an update request to the synchronization device, and the new data after the data update is sent to the synchronization device.
  • an external management system such as a business management system.
  • the synchronization device proposed in this embodiment interfaces with an external management system through a specific interface.
  • the client performs real-time detection on the above update operation, for example, an operation of adding, deleting, and modifying related data such as course data and personnel data.
  • the data content corresponding to the update operation is obtained.
  • the modified data content corresponding to the modification operation and the location of the data content are acquired, and synchronization data is generated, and the client sends an update request based on the synchronization data to the update request.
  • the synchronization device when receiving the update request, acquires synchronization data corresponding to the update request, and establishes a synchronization task corresponding to the synchronization data.
  • step S20 the synchronization task is added to the task queue, and the synchronization data is associated with the synchronization task and stored in the cache area.
  • a task queue is established in advance, and the synchronization task established in the update device is added to the task queue as a task to be processed.
  • the synchronization tasks may be added to the task queue in a first to last order according to the setup time of the synchronization tasks when a new synchronization task is generated.
  • the tasks in the task queue are arranged according to the priority order of the various institutional nodes of the training course management system.
  • the method further includes the following steps: after acquiring the synchronization data corresponding to the update request, acquiring the organization identifier from the update request, to Determining, according to the organization identifier, a priority of an organization node corresponding to the to-be-updated request.
  • the step of adding the synchronization task to the task queue includes adding the synchronization task to the task queue in descending order of priority of the corresponding organization node.
  • the above-mentioned institutional nodes are training courses distributed in various places, and these institutions use the same training courses to manage the clients.
  • the client sends an update request to the synchronization device
  • the client carries the organization identifier of the institution in the update request.
  • the synchronization device pre-sets a different priority order for each organization node, and the data updated by the higher-priority organization node can be preferentially synchronized, and the data updated by the lower-priority organization node can be synchronized later. .
  • the synchronization device determines the structural node corresponding to the update request according to the organization identifier carried in the update request, and determines the priority of the organization node according to the priority order of the preset organization node, and stores the corresponding synchronization data into the task list. , store in order of priority.
  • the synchronization device is pre-divided with a storage area of a certain size for storing synchronization data corresponding to the synchronization task, and the size of the storage area can be set according to actual application conditions.
  • Step S30 when it is detected that the storage amount of the synchronization data cached in the cache area reaches a first preset threshold, or the task quantity in the task queue reaches a second preset threshold, the thread processing in the thread pool is started. Synchronizing tasks in the task queue to send synchronization data stored in the cache area to an external management system.
  • the synchronization device detects the storage amount of the synchronization data in the cache area or the number of tasks in the task queue in real time, when the storage amount of the synchronization data cached in the cache area reaches a first preset threshold, or the task quantity in the task queue reaches When the second preset threshold is reached, the threads in the thread pool are started, and the synchronization task is executed in the order of the tasks in the task queue.
  • the maximum number of threads can be set in advance according to the workload of the task, and each time the thread pool is started to execute the task, multiple threads that do not exceed the maximum number of threads can be opened according to the amount of tasks in the task queue.
  • the thread in the thread pool when it is detected that the storage amount of the synchronization data cached in the cache area reaches a preset threshold, the thread in the thread pool is started to process the synchronization task in the task queue to synchronize the cached synchronization data to the first
  • the steps in the second system may be replaced by the following steps: when detecting that the synchronization time interval reaches a preset time interval, the thread in the startup thread pool processes the synchronization task in the task queue to synchronize the storage in the cache area.
  • the data is sent to an external management system.
  • the data synchronization method in this embodiment obtains the data to be updated from the update request when the update request is detected, and generates synchronization data according to the acquired data, and establishes a synchronization task corresponding to the synchronization data, and the synchronization task is generated.
  • the above synchronization data is associated with the synchronization task and cached in the cache area.
  • the thread in the thread pool starts to process.
  • the synchronization task in the task queue is used to send the synchronization data cached in the cache area to the external management system that is connected to the host.
  • the present application performs the batch synchronization processing on the data by the method of establishing the task list and buffering the data at the same time.
  • the update request is triggered when there is an update request, which avoids the occurrence of code redundancy.
  • the task of processing the task queue through the thread in the thread pool greatly improves the efficiency of data synchronization.
  • the embodiment of the present application further provides a computer readable storage medium, where the data synchronization program is stored, and the data synchronization program can be executed by one or more processors to implement the following operations:
  • the thread in the thread pool is started to process the task queue.
  • the synchronization task in the middle to send the synchronization data stored in the cache area to the external management system.
  • the thread in the thread pool is started.
  • the step of processing the synchronization task in the task queue to send the synchronization data stored in the cache area to the external management system may be replaced by the following steps:
  • the thread in the startup thread pool processes the synchronization task in the task queue to send the synchronization data stored in the cache area to the external management system.
  • the number of threads started is dynamically adjusted according to the total number of synchronization tasks to be processed and the maximum number of threads of the thread pool set in advance.
  • the synchronization tasks are added to the task queue in a first-to-last order in accordance with the setup time of the synchronization tasks.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • Tourism & Hospitality (AREA)
  • Strategic Management (AREA)
  • Educational Technology (AREA)
  • Data Mining & Analysis (AREA)
  • Educational Administration (AREA)
  • Marketing (AREA)
  • Human Resources & Organizations (AREA)
  • General Health & Medical Sciences (AREA)
  • Primary Health Care (AREA)
  • General Business, Economics & Management (AREA)
  • Computing Systems (AREA)
  • Economics (AREA)
  • Health & Medical Sciences (AREA)
  • Multi Processors (AREA)

Abstract

本申请公开了一种数据同步装置,包括存储器和处理器,存储器上存储有可在处理器上运行的数据同步程序,该程序被处理器执行时实现如下步骤:在接收到更新请求时,获取与更新请求对应的同步数据,并建立与同步数据对应的同步任务;将同步任务添加至任务队列中,并将同步数据与同步任务关联后存储至缓存区域;当检测到缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理任务队列中的同步任务,以将缓存区域中存储的同步数据发送至外部管理***。本申请还提出一种数据同步方法以及一种计算机可读存储介质。本申请减少了代码冗余,提高了数据同步效率。

Description

数据同步装置、方法及计算机可读存储介质
本申请基于巴黎公约申明享有2017年09月30日递交的申请号为201710916482.9、名称为“数据同步装置、方法及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种数据同步装置、方法及计算机可读存储介质。
背景技术
教育培训管理机构为了便于业务数据的管理,需要将培训管理***中的数据同步到营业管理***中,现有的数据同步的方式是:营业管理***开放特定的接口给培训管理***,培训管理***在有数据更新时(课程数据、人员数据等相关数据发生增加、删除、修改等操作),实时地触发更新请求,将更新信息同步到营业管理***,而现有的请求方式是在每一个请求方法中添加同步代码进行信息的同步,因此,当培训管理***比较庞大时,例如,培训机构分布在全国各地多个城市,这就造成培训管理***每天的更新请求非常频繁,需要触发大量的更新请求,导致产生大量的代码冗余,进而导致对数据的同步效率低下。
发明内容
本申请提供一种数据同步装置、方法及计算机可读存储介质,其主要目的在于减少代码冗余,提高数据同步效率。
为实现上述目的,本申请提供一种数据同步装置,同步装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的数据同步程序,所述数据同步程序被所述处理器执行时实现如下步骤:
在接收到更新请求时,获取与所述更新请求对应的同步数据,并建立与所述同步数据对应的同步任务;
将同步任务添加至任务队列中,并将所述同步数据与所述同步任务关联后存储至缓存区域;
当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
此外,为实现上述目的,本申请还提供一种数据同步方法,该方法包括:
在接收到更新请求时,获取与所述更新请求对应的同步数据,并建立与所述同步数据对应的同步任务;
将同步任务添加至任务队列中,并将所述同步数据与所述同步任务关联后存储至缓存区域;
当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有数据同步程序,所述数据同步程序可被一个或者多个处理器执行,以实现如上所述的数据同步方法的步骤。
本申请提出的数据同步装置、方法及计算机可读存储介质,在侦查到有更新请求时,从该更新请求中获取待更新的数据,并根据获取的数据生成同步数据,建立与该同步数据对应同步任务,将该同步任务添加到任务队列中,同时将上述同步数据与同步任务关联后缓存到缓存区域中,在家呢到缓存区域中的缓存的同步数据的存储量达到预设阈值时,启动线程池中的线程开始处理任务队列中的同步任务,以将缓存区域中缓存的同步数据发送到与对接的外部管理***中,本申请通过上述建立任务列表同时缓存数据的方式对数据进行批量的同步处理,不需要在每一次有更新请求时都触发更新请求,避免了出现代码冗余的情况,此外,通过线程池中的线程处理任务队列的任务,极大地提高了数据同步的效率。
附图说明
图1为本申请数据同步装置较佳实施例的示意图;
图2为本申请数据同步装置一实施例中数据同步程序的功能模块示意图;
图3为本申请数据同步方法较佳实施例的流程图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种数据同步装置。参照图1所示,为本申请数据同步装置较佳实施例的示意图。
在本实施例中,数据同步装置可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、便携计算机等具有显示功能的可移动式终端设备。
该数据同步装置包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是数据同步装置的内部存储单元,例如该数据同步装置的硬盘。存储器11在另一些实施例中也可以是数据同步装置的外部存储设备,例如数据同步装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括数据同步装置的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于数据同步装置的应用软件及各类数据,例如数据同步程序的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器 11中存储的程序代码或处理数据,例如执行数据同步程序等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置与其他电子设备之间建立通信连接。
图1仅示出了具有组件11-14以及数据同步程序的数据同步装置,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选地,该装置还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在数据同步装置中处理的信息以及用于显示可视化的用户界面。
可选地,该装置还可以包括触摸传感器。所述触摸传感器所提供的供用户进行触摸操作的区域称为触控区域。此外,这里所述的触摸传感器可以为电阻式触摸传感器、电容式触摸传感器等。而且,所述触摸传感器不仅包括接触式的触摸传感器,也可包括接近式的触摸传感器等。此外,所述触摸传感器可以为单个传感器,也可以为例如阵列布置的多个传感器。该装置的显示器的面积可以与所述触摸传感器的面积相同,也可以不同。可选地,将显示器与所述触摸传感器层叠设置,以形成触摸显示屏。该装置基于触摸显示屏侦测用户触发的触控操作。
在图1所示的装置实施例中,存储器11中存储有数据同步程序;处理器12执行存储器11中存储的数据同步程序时实现如下步骤:
在接收到更新请求时,获取与所述更新请求对应的同步数据,并建立与所述同步数据对应的同步任务。
为了便于理解,以下内容以对培训班管理***中的数据更新为例对本申请实施例的方案进行说明,培训班管理***可运行在本实施例提出的同步装置中,同步装置可以与一个或者多个培训班管理客户端建立远程通信,若客户端在使用过程中产生了新的数据,则需要同步地将这些数据更新到外部管 理***。例如客户端中有课程数据、人员数据等相关数据发生增加、删除、修改等操作时,会由客户端向同步装置发送更新请求,将这些操作对数据更新后的新数据发送到与同步装置对接的外部管理***中,如营业管理***。本实施例提出的同步装置通过特定的接口与外部管理***对接。
客户端对上述更新操作进行实时地侦测,例如,对于课程数据、人员数据等相关数据的增加操作、删除操作、修改操作等。在侦测到有上述类型的更新操作时,获取更新操作对应的数据内容。以对课程数据的修改为例,在侦测到修改操作时,获取修改操作对应的修改后的数据内容以及该数据内容所在的位置,生成同步数据,客户端基于该同步数据触发更新请求发送至同步装置,同步装置在接收到更新请求时,获取与该更新请求对应的同步数据,并建立与同步数据对应的同步任务。
用于后续通过本实施例的更新装置发送至与更新装置对接的外部管理***,以供外部管理***根据接收到的同步数据,根据修改后的数据内容对对应位置处的数据进行修改,以实现数据在不同***中的同步更新。
将同步任务添加至任务队列中,并将所述同步数据与所述同步任务关联后存储至缓存区域。
本实施例中,预先建立一个任务队列,将更新装置中建立的同步任务添加至该任务队列中,作为待处理的任务。关于同步任务的添加顺序,在一些实施例中,可以在有新的同步任务产生时,将所述同步任务按照该同步任务的建立时间由先至后的顺序添加至所述任务队列中。
或者,在其他实施例中,根据培训班管理***的各个机构节点的优先级顺序排列任务队列中的任务。
具体地,处理器12还用于执行所述数据同步程序,以在所述将同步任务添加至任务队列中的步骤之前,还实现如下步骤:在获取到与所述更新请求对应的同步数据之后,从所述更新请求中获取机构标识,以根据所述机构标识确定所述待更新请求对应的机构节点的优先级。
将同步任务添加至任务队列中的步骤包括:将所述同步任务按照对应的机构节点的优先级由高至低的顺序添加至所述任务队列中。
上述机构节点为分布在各个地方的培训班机构,这些机构使用同样的培训班管理客户端,这些客户端在向同步装置发送更新请求时,在更新请求中 携带有本机构的机构标识。此外,同步装置预先为每一机构节点设置有不同的优先级顺序,对于优先级高的机构节点更新的数据,可以优先地进行同步,对于优先级低的机构节点更新的数据,可以较迟同步。同步装置根据更新请求中携带的机构标识确定该更新请求对应的结构节点,并根据预先设置的机构节点的优先级顺序,确定该机构节点的优先级,在将对应的同步数据存储到任务列表中,按照优先级高低的顺序进行存储。
此外,同步装置中预先划分有一定大小的存储区域,用于存储同步任务对应的同步数据,该存储区域的大小可以根据实际的应用情况进行设置。
当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
同步装置实时地对缓存区域中的同步数据的存储量或者任务队列中的任务数量进行检测,当缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者任务队列中的任务量达到第二预设阈值时,启动线程池中的线程,按照任务队列中任务的顺序执行同步任务。可以理解的是,可以根据任务量的需要预先设置最大线程数,在每次启动线程池执行任务时,可以根据任务队列中的任务量开启不超过最大线程数的多个线程。
或者,作为一种实施方式,当检测到缓存区域中缓存的同步数据的存储量达到预设阈值时,启动线程池中的线程处理任务队列中的同步任务,以将缓存的同步数据同步到第二***中的步骤可以替换为如下步骤:当检测到同步时间间隔达到预设时间间隔时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
本实施例提出的数据同步装置,在侦查到有更新请求时,从该更新请求中获取待更新的数据,并根据获取的数据生成同步数据,建立与该同步数据对应同步任务,将该同步任务添加到任务队列中,同时将上述同步数据与同步任务关联后缓存到缓存区域中,在家呢到缓存区域中的缓存的同步数据的存储量达到预设阈值时,启动线程池中的线程开始处理任务队列中的同步任务,以将缓存区域中缓存的同步数据发送到与对接的外部管理***中,本申请通过上述建立任务列表同时缓存数据的方式对数据进行批量的同步处理, 不需要在每一次有更新请求时都触发更新请求,避免了出现代码冗余的情况,此外,通过线程池中的线程处理任务队列的任务,极大地提高了数据同步的效率。
可选地,在其他的实施例中,数据同步程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述数据同步程序在数据同步装置中的执行过程。
例如,参照图2所示,为本申请数据同步装置一实施例中的数据同步程序的功能模块示意图,该实施例中,数据同步程序可以被分割为数据处理模块10、任务建立模块20、数据存储模块30和数据发送模块40,示例性地:
数据处理模块10用于:在接收到更新请求时,获取与所述更新请求对应的同步数据;
任务建立模块20用于:建立与所述同步数据对应的同步任务;
数据存储模块30用于:将同步任务添加至任务队列中,并将所述同步数据与所述同步任务关联后存储至缓存区域;
数据发送模块40用于:当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
上述数据处理模块10、任务建立模块20、数据存储模块30和数据发送模块40被执行所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。
此外,本申请还提供一种数据同步方法。参照图3所示,为本申请数据同步方法较佳实施例的流程图。
在本实施例中,数据同步方法包括:
步骤S10,在接收到更新请求时,获取与所述更新请求对应的同步数据,并建立与所述同步数据对应的同步任务。
本实施例提出的方法可以由一个装置执行,同步装置可以由软件和/或硬件实现。该装置可以是一台同步装置。为了便于理解,以下内容以对培训班管理***中的数据更新为例对本申请实施例的方案进行说明,培训班管理***可运行在本实施例提出的同步装置中,同步装置可以与一个或者多个培训班管理客户端建立远程通信,若客户端在使用过程中产生了新的数据,则需要同步地将这些数据更新到外部管理***。例如客户端中有课程数据、人员数据等相关数据发生增加、删除、修改等操作时,会由客户端向同步装置发送更新请求,将这些操作对数据更新后的新数据发送到与同步装置对接的外部管理***中,如营业管理***。本实施例提出的同步装置通过特定的接口与外部管理***对接。
客户端对上述更新操作进行实时地侦测,例如,对于课程数据、人员数据等相关数据的增加操作、删除操作、修改操作等。在侦测到有上述类型的更新操作时,获取更新操作对应的数据内容。以对课程数据的修改为例,在侦测到修改操作时,获取修改操作对应的修改后的数据内容以及该数据内容所在的位置,生成同步数据,客户端基于该同步数据触发更新请求发送至同步装置,同步装置在接收到更新请求时,获取与该更新请求对应的同步数据,并建立与同步数据对应的同步任务。
用于后续通过本实施例的更新装置发送至与更新装置对接的外部管理***,以供外部管理***根据接收到的同步数据,根据修改后的数据内容对对应位置处的数据进行修改,以实现数据在不同***中的同步更新。
步骤S20,将同步任务添加至任务队列中,并将所述同步数据与所述同步任务关联后存储至缓存区域。
本实施例中,预先建立一个任务队列,将更新装置中建立的同步任务添加至该任务队列中,作为待处理的任务。关于同步任务的添加顺序,在一些实施例中,可以在有新的同步任务产生时,将所述同步任务按照该同步任务的建立时间由先至后的顺序添加至所述任务队列中。
或者,在其他实施例中,根据培训班管理***的各个机构节点的优先级顺序排列任务队列中的任务。
具体地,在所述将同步任务添加至任务队列中的步骤之前,该方法还包括如下步骤:在获取到与所述更新请求对应的同步数据之后,从所述更新请 求中获取机构标识,以根据所述机构标识确定所述待更新请求对应的机构节点的优先级。
将同步任务添加至任务队列中的步骤包括:将所述同步任务按照对应的机构节点的优先级由高至低的顺序添加至所述任务队列中。
上述机构节点为分布在各个地方的培训班机构,这些机构使用同样的培训班管理客户端,这些客户端在向同步装置发送更新请求时,在更新请求中携带有本机构的机构标识。此外,同步装置预先为每一机构节点设置有不同的优先级顺序,对于优先级高的机构节点更新的数据,可以优先地进行同步,对于优先级低的机构节点更新的数据,可以较迟同步。同步装置根据更新请求中携带的机构标识确定该更新请求对应的结构节点,并根据预先设置的机构节点的优先级顺序,确定该机构节点的优先级,在将对应的同步数据存储到任务列表中,按照优先级高低的顺序进行存储。
此外,同步装置中预先划分有一定大小的存储区域,用于存储同步任务对应的同步数据,该存储区域的大小可以根据实际的应用情况进行设置。
步骤S30,当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
同步装置实时地对缓存区域中的同步数据的存储量或者任务队列中的任务数量进行检测,当缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者任务队列中的任务量达到第二预设阈值时,启动线程池中的线程,按照任务队列中任务的顺序执行同步任务。可以理解的是,可以根据任务量的需要预先设置最大线程数,在每次启动线程池执行任务时,可以根据任务队列中的任务量开启不超过最大线程数的多个线程。
或者,作为一种实施方式,当检测到缓存区域中缓存的同步数据的存储量达到预设阈值时,启动线程池中的线程处理任务队列中的同步任务,以将缓存的同步数据同步到第二***中的步骤可以替换为如下步骤:当检测到同步时间间隔达到预设时间间隔时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
本实施例提出的数据同步方法,在侦查到有更新请求时,从该更新请求 中获取待更新的数据,并根据获取的数据生成同步数据,建立与该同步数据对应同步任务,将该同步任务添加到任务队列中,同时将上述同步数据与同步任务关联后缓存到缓存区域中,在家呢到缓存区域中的缓存的同步数据的存储量达到预设阈值时,启动线程池中的线程开始处理任务队列中的同步任务,以将缓存区域中缓存的同步数据发送到与对接的外部管理***中,本申请通过上述建立任务列表同时缓存数据的方式对数据进行批量的同步处理,不需要在每一次有更新请求时都触发更新请求,避免了出现代码冗余的情况,此外,通过线程池中的线程处理任务队列的任务,极大地提高了数据同步的效率。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有数据同步程序,所述数据同步程序可被一个或多个处理器执行,以实现如下操作:
在接收到更新请求时,获取与所述更新请求对应的同步数据,并建立与所述同步数据对应的同步任务;
将同步任务添加至任务队列中,并将所述同步数据与所述同步任务关联后存储至缓存区域;
当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
进一步地,所述当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***的步骤可以替换为如下步骤:
当检测到同步时间间隔达到预设时间间隔时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
进一步地,所述数据同步程序被处理器执行时还实现如下操作:
在启动线程池中的线程处理任务队列中的同步任务时,根据待处理的同 步任务的总数量以及预先设置的所述线程池的最大线程数量,动态地调整启动的线程的数量。
进一步地,所述数据同步程序被处理器执行时还实现如下操作:
将所述同步任务按照该同步任务的建立时间的由先至后的顺序添加至所述任务队列中。
本申请计算机可读存储介质具体实施方式与上述数据同步装置和方法各实施例基本相同,在此不作累述。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种数据同步装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的数据同步程序,所述数据同步程序被所述处理器执行时实现如下步骤:
    在接收到更新请求时,获取与所述更新请求对应的同步数据,并建立与所述同步数据对应的同步任务;
    将同步任务添加至任务队列中,并将所述同步数据与所述同步任务关联后存储至缓存区域;
    当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
  2. 根据权利要求1所述的数据同步装置,其特征在于,所述当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***的步骤可以替换为如下步骤:
    当检测到同步时间间隔达到预设时间间隔时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
  3. 根据权利要求1所述的数据同步装置,其特征在于,所述处理器还用于执行所述数据同步程序,以实现如下步骤:
    在启动线程池中的线程处理任务队列中的同步任务时,根据待处理的同步任务的总数量以及预先设置的所述线程池的最大线程数量,动态地调整启动的线程的数量。
  4. 根据权利要求1所述的数据同步装置,其特征在于,所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照该同步任务的建立时间的由先至后的顺序添加至所述任务队列中。
  5. 根据权利要求2所述的数据同步装置,其特征在于,所述将同步任务 添加至任务队列中的步骤包括:
    将所述同步任务按照该同步任务的建立时间的由先至后的顺序添加至所述任务队列中。
  6. 根据权利要求1所述的数据同步装置,其特征在于,所述处理器还用于执行所述数据同步程序,以在所述将同步任务添加至任务队列中的步骤之前,还实现如下步骤:
    在获取到与所述更新请求对应的同步数据之后,从所述更新请求中获取机构标识,以根据所述机构标识确定所述待更新请求对应的机构节点的优先级;
    所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照对应的机构节点的优先级由高至低的顺序添加至所述任务队列中。
  7. 根据权利要求2的数据同步装置,其特征在于,所述处理器还用于执行所述数据同步程序,以在所述将同步任务添加至任务队列中的步骤之前,还实现如下步骤:
    在获取到与所述更新请求对应的同步数据之后,从所述更新请求中获取机构标识,以根据所述机构标识确定所述待更新请求对应的机构节点的优先级;
    所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照对应的机构节点的优先级由高至低的顺序添加至所述任务队列中。
  8. 一种数据同步方法,其特征在于,所述方法包括:
    在接收到更新请求时,获取与所述更新请求对应的同步数据,并建立与所述同步数据对应的同步任务;
    将同步任务添加至任务队列中,并将所述同步数据与所述同步任务关联后存储至缓存区域;
    当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
  9. 根据权利要求8所述的数据同步方法,其特征在于,所述当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***的步骤可以替换为:
    当检测到同步时间间隔达到预设时间间隔时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
  10. 根据权利要求8所述的数据同步方法,其特征在于,所述数据同步方法还包括:
    在启动线程池中的线程处理任务队列中的同步任务时,根据待处理的同步任务的总数量以及预先设置的所述线程池的最大线程数量,动态地调整启动的线程的数量。
  11. 根据权利要求8所述的数据同步方法,其特征在于,在所述将同步任务添加至任务队列中的步骤之前,所述方法还包括如下步骤:
    在获取到与所述更新请求对应的同步数据之后,从所述更新请求中获取机构标识,以根据所述机构标识确定所述待更新请求对应的机构节点的优先级;
    所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照对应的机构节点的优先级由高至低的顺序添加至所述任务队列中。
  12. 根据权利要求9所述的数据同步方法,其特征在于,在所述将同步任务添加至任务队列中的步骤之前,所述方法还包括如下步骤:
    在获取到与所述更新请求对应的同步数据之后,从所述更新请求中获取机构标识,以根据所述机构标识确定所述待更新请求对应的机构节点的优先级;
    所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照对应的机构节点的优先级由高至低的顺序添加至所述任务队列中。
  13. 根据权利要求8所述的数据同步方法,其特征在于,在所述将同步 任务添加至任务队列中的步骤之前,所述方法还包括步骤:
    在获取到与所述更新请求对应的同步数据之后,从所述更新请求中获取机构标识,以根据所述机构标识确定所述待更新请求对应的机构节点的优先级;
    所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照对应的机构节点的优先级由高至低的顺序添加至所述任务队列中。
  14. 根据权利要求9所述的数据同步方法,其特征在于,在所述将同步任务添加至任务队列中的步骤之前,所述方法还包括步骤:
    在获取到与所述更新请求对应的同步数据之后,从所述更新请求中获取机构标识,以根据所述机构标识确定所述待更新请求对应的机构节点的优先级;
    所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照对应的机构节点的优先级由高至低的顺序添加至所述任务队列中。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有数据同步程序,所述数据同步程序可被一个或者多个处理器执行,以实现如下步骤:
    在接收到更新请求时,获取与所述更新请求对应的同步数据,并建立与所述同步数据对应的同步任务;
    将同步任务添加至任务队列中,并将所述同步数据与所述同步任务关联后存储至缓存区域;
    当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述当检测到所述缓存区域中缓存的同步数据的存储量达到第一预设阈值,或者所述任务队列中的任务量达到第二预设阈值时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管 理***的步骤可以替换为如下步骤:
    当检测到同步时间间隔达到预设时间间隔时,启动线程池中的线程处理所述任务队列中的同步任务,以将所述缓存区域中存储的同步数据发送至外部管理***。
  17. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述处理器还用于执行所述数据同步程序,以实现如下步骤:
    在启动线程池中的线程处理任务队列中的同步任务时,根据待处理的同步任务的总数量以及预先设置的所述线程池的最大线程数量,动态地调整启动的线程的数量。
  18. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照该同步任务的建立时间的由先至后的顺序添加至所述任务队列中。
  19. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照该同步任务的建立时间的由先至后的顺序添加至所述任务队列中。
  20. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述处理器还用于执行所述数据同步程序,以在所述将同步任务添加至任务队列中的步骤之前,还实现如下步骤:
    在获取到与所述更新请求对应的同步数据之后,从所述更新请求中获取机构标识,以根据所述机构标识确定所述待更新请求对应的机构节点的优先级;
    所述将同步任务添加至任务队列中的步骤包括:
    将所述同步任务按照对应的机构节点的优先级由高至低的顺序添加至所述任务队列中。
PCT/CN2018/089187 2017-09-30 2018-05-31 数据同步装置、方法及计算机可读存储介质 WO2019062182A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710916482.9 2017-09-30
CN201710916482.9A CN107908472A (zh) 2017-09-30 2017-09-30 数据同步装置、方法及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2019062182A1 true WO2019062182A1 (zh) 2019-04-04

Family

ID=61841078

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/089187 WO2019062182A1 (zh) 2017-09-30 2018-05-31 数据同步装置、方法及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN107908472A (zh)
WO (1) WO2019062182A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569123A (zh) * 2019-07-31 2019-12-13 苏宁云计算有限公司 线程分配方法、装置、计算机设备和存储介质
CN112187889A (zh) * 2020-09-15 2021-01-05 中信银行股份有限公司 一种数据同步方法、装置及存储介质
US20220237153A1 (en) * 2020-03-24 2022-07-28 Tencent Technology (Shenzhen) Company Limited Synchronization processing method and related apparatus
WO2023001027A1 (zh) * 2021-07-19 2023-01-26 维沃移动通信有限公司 任务同步方法、装置、设备及可读存储介质

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107908472A (zh) * 2017-09-30 2018-04-13 平安科技(深圳)有限公司 数据同步装置、方法及计算机可读存储介质
CN108572919A (zh) * 2018-05-30 2018-09-25 平安普惠企业管理有限公司 自动化测试方法、装置、计算机设备及存储介质
CN109116818B (zh) * 2018-08-08 2020-03-17 新智能源***控制有限责任公司 一种scada***升级时的实时数据转储方法和装置
CN109299122A (zh) * 2018-09-26 2019-02-01 努比亚技术有限公司 一种数据同步方法、设备和计算机可存储介质
CN111340202B (zh) * 2018-12-18 2023-06-09 上海寒武纪信息科技有限公司 运算方法、装置及相关产品
CN109542216B (zh) * 2018-10-11 2022-11-22 平安科技(深圳)有限公司 人机交互方法、***、计算机设备及存储介质
CN109542428B (zh) * 2018-10-16 2024-06-11 北京神州数码云科信息技术有限公司 业务处理方法、装置、计算机设备和存储介质
CN109634853A (zh) * 2018-11-30 2019-04-16 平安科技(深圳)有限公司 数据测试方法、***、电子装置及计算机可读存储介质
CN111865834B (zh) * 2019-04-26 2021-12-03 华为技术有限公司 一种消息处理方法及装置
CN110196884B (zh) * 2019-05-31 2022-04-29 北京大米科技有限公司 基于分布式数据库的数据写入方法、存储介质和电子设备
CN110602165B (zh) * 2019-08-08 2022-09-06 数字广东网络建设有限公司 政务数据同步方法、装置、***、计算机设备和存储介质
CN110765288B (zh) * 2019-09-04 2022-09-27 北京旷视科技有限公司 一种图像信息同步方法、装置、***及存储介质
CN111488366B (zh) * 2020-04-09 2023-08-01 百度在线网络技术(北京)有限公司 关系型数据库更新方法、装置、设备及存储介质
CN111666339B (zh) * 2020-05-26 2023-10-24 和芯星通科技(北京)有限公司 一种多线程数据同步方法
CN112818054B (zh) * 2020-10-15 2022-05-06 广州南天电脑***有限公司 数据同步方法、装置、计算机设备和存储介质
CN113504907A (zh) * 2021-07-06 2021-10-15 上海商汤智能科技有限公司 课程定制方法及装置、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6446176B1 (en) * 2000-03-09 2002-09-03 Storage Technology Corporation Method and system for transferring data between primary storage and secondary storage using a bridge volume and an internal snapshot copy of the data being transferred
CN104408048A (zh) * 2014-10-27 2015-03-11 清华大学 一种缓冲式云存储数据同步的方法和装置
CN105208060A (zh) * 2014-06-19 2015-12-30 阿里巴巴集团控股有限公司 业务数据同步方法、装置及***
CN107908472A (zh) * 2017-09-30 2018-04-13 平安科技(深圳)有限公司 数据同步装置、方法及计算机可读存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140279871A1 (en) * 2013-03-13 2014-09-18 Marcelo Ochoa System and method for providing near real time data synchronization
CN106156165A (zh) * 2015-04-16 2016-11-23 阿里巴巴集团控股有限公司 异构数据源之间的数据同步方法和装置
CN105677849A (zh) * 2016-01-06 2016-06-15 北京京东尚科信息技术有限公司 数据更新方法和装置
CN106412088B (zh) * 2016-10-25 2019-10-18 深圳市万普拉斯科技有限公司 一种数据同步方法及终端

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6446176B1 (en) * 2000-03-09 2002-09-03 Storage Technology Corporation Method and system for transferring data between primary storage and secondary storage using a bridge volume and an internal snapshot copy of the data being transferred
CN105208060A (zh) * 2014-06-19 2015-12-30 阿里巴巴集团控股有限公司 业务数据同步方法、装置及***
CN104408048A (zh) * 2014-10-27 2015-03-11 清华大学 一种缓冲式云存储数据同步的方法和装置
CN107908472A (zh) * 2017-09-30 2018-04-13 平安科技(深圳)有限公司 数据同步装置、方法及计算机可读存储介质

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569123A (zh) * 2019-07-31 2019-12-13 苏宁云计算有限公司 线程分配方法、装置、计算机设备和存储介质
CN110569123B (zh) * 2019-07-31 2022-08-02 苏宁云计算有限公司 线程分配方法、装置、计算机设备和存储介质
US20220237153A1 (en) * 2020-03-24 2022-07-28 Tencent Technology (Shenzhen) Company Limited Synchronization processing method and related apparatus
CN112187889A (zh) * 2020-09-15 2021-01-05 中信银行股份有限公司 一种数据同步方法、装置及存储介质
WO2023001027A1 (zh) * 2021-07-19 2023-01-26 维沃移动通信有限公司 任务同步方法、装置、设备及可读存储介质

Also Published As

Publication number Publication date
CN107908472A (zh) 2018-04-13

Similar Documents

Publication Publication Date Title
WO2019062182A1 (zh) 数据同步装置、方法及计算机可读存储介质
AU2020203219B2 (en) Sharing unmanaged content using a content management system
US10455542B2 (en) Method of synchronizing notification messages for electronic devices and electronic devices
CN107172182B (zh) 一种消息推送方法、消息推送服务器及终端
US10110549B2 (en) Method, server and electronic devices of synchronizing notification messages for electronic devices
US10942938B2 (en) Caching for query processing systems
WO2020082558A1 (zh) 基于函数名称的埋点方法、装置、计算机设备及存储介质
US9699276B2 (en) Data distribution method and system and data receiving apparatus
US20150116540A1 (en) Method and apparatus for applying a tag/identification to a photo/video immediately after capture
WO2019056793A1 (zh) 简历识别装置、方法及计算机可读存储介质
US10528560B2 (en) Filtering for data models
US20180285416A1 (en) Automated application of query hints
EP2939200A1 (en) Method and apparatus for secure advertising
WO2020024403A1 (zh) 目标语料数据的爬取方法、装置及存储介质
US20190073226A1 (en) Layout management for mobile applications
US11250092B2 (en) Managing multi-dimensional array of data definitions
US20200133659A1 (en) Packaged application resources for mobile applications
US20150169168A1 (en) Methods and systems for managing displayed content items on touch-based computer devices
WO2019136813A1 (zh) Api文件管理方法、服务器及存储介质
CN106941509B (zh) 用户信息流的请求方法及装置
US10909206B2 (en) Rendering visualizations using parallel data retrieval
US20200201928A1 (en) Managing Data For Rendering Visualizations
US10938949B2 (en) Notifications based on queues
US10831538B2 (en) Optimized management of application resources for mobile applications
US10097976B2 (en) Information processing apparatus and control method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18862126

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 28/09/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18862126

Country of ref document: EP

Kind code of ref document: A1