Synchronization method and device of multi-node system, computer equipment and storage medium

By implementing operation information synchronization and task management between slave nodes and master nodes in a multi-node system, the problem of low synchronization efficiency of multi-node system is solved, automatic synchronization and rapid deployment are realized, and the intelligence and stability of the system are improved.

CN120011329APending Publication Date: 2025-05-16ZKTECO CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510145201.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the prior art, the synchronization efficiency of multi-node systems is not high, and manual intervention is required to lead to synchronization omissions and in real time.

Method used

A synchronization method for a multi-node system is provided, which stores it in a local registry and synchronizes it to the registry of the master node by judging the received target operation information on the slave node. When a specific condition is met, the target operation information is determined based on the registry of the master node, the task to be executed is generated and the task table is updated, and the task table is finally executed when the execution condition is met.

Benefits of technology

Automatic synchronization of operations between multiple nodes is realized, avoiding file synchronization omissions and unreal-time problems caused by manual intervention, improving synchronization efficiency, and quickly completing synchronization deployment when adding new nodes, improving the intelligence and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120011329A_ABST
    Figure CN120011329A_ABST
Patent Text Reader

Abstract

The invention provides a synchronization method of a multi-node system, the multi-node system comprises a master node and a plurality of slave nodes, the synchronization method is applied to the slave nodes, and the synchronization method comprises the following steps: judging whether an operation of a target type is received or not; if yes, the corresponding operation information is stored in a first registry of the main node, and the operation information is synchronized to a second registry of the main node; under the condition that the task discovery condition is met, determining target operation information according to a second registry; the target operation information is operation information from other nodes in the second registry in a time period when the task discovery condition is met last time and the task discovery condition is met currently; generating a to-be-executed task according to the target operation information, and updating a to-be-executed task table; and under the condition that the task execution condition is met, executing the task in the to-be-executed task table. According to the method, automatic synchronization of operation among multiple nodes is realized, the problems of file synchronization omission, non-real-time performance and the like caused by manual intervention are avoided, and the synchronization efficiency is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of multi-node system synchronization, and in particular to a synchronization method, apparatus, computer equipment and storage medium for a multi-node system. Background Art

[0002] Currently, the synchronization of operations between multiple nodes of the software system requires manual intervention. For example, when synchronizing files, staff need to manually screen which files are incremental files and then upload them to other nodes. This may cause problems such as synchronization omissions and unreal-time synchronization. Summary of the invention

[0003] The purpose of the present application is to solve at least one of the above-mentioned technical defects, especially the technical defect of low synchronization efficiency of multi-node systems in the prior art.

[0004] In a first aspect, the present application provides a synchronization method for a multi-node system, the multi-node system comprising a master node and a plurality of slave nodes, the synchronization method being applied to the slave nodes, comprising:

[0005] Determine whether an operation of the target type is received;

[0006] If yes, the corresponding operation information is saved in its own first registry, and the operation information is synchronized to the second registry of the master node;

[0007] When the task discovery condition is met, target operation information is determined according to the second registration table; the target operation information is operation information from other nodes in the second registration table during the time period between the last time the task discovery condition was met and the current time when the task discovery condition is met;

[0008] Generate pending tasks based on target operation information and update the pending tasks table;

[0009] When the task execution conditions are met, the tasks in the pending task table are executed.

[0010] In one embodiment, the operation information includes the operation time, and when the task discovery condition is met, the target operation information is determined according to the second registration table, including:

[0011] When the task discovery conditions are met, the current task discovery time is recorded;

[0012] Determine the target time period based on the current task discovery time and the previous task discovery time;

[0013] According to the target time period, target operation information is determined from the second registration table.

[0014] In one embodiment, synchronizing the operation information to the second registration table of the master node includes:

[0015] Generate a pending registration request according to the operation information, and add the pending registration request to the first registration table; the pending registration request includes an identification field whose value is empty;

[0016] When the registration conditions are met, the first registration table is synchronized with the second registration table of the master node; when the master node successfully saves any pending registration request, it fills the corresponding registration identifier in the identifier field of the pending registration request and feeds it back to the slave node;

[0017] According to the feedback from the master node, the corresponding pending registration request in the first registration table is deleted.

[0018] In one embodiment, when the task execution condition is met, executing the task in the to-be-executed task list further includes:

[0019] For any task in the to-be-executed task list, if the execution is successful, the task is deleted from the to-be-executed task list; otherwise, the number of execution failures of the task is recorded, and the task is deleted from the to-be-executed task list when the number of execution failures reaches a first threshold.

[0020] In one embodiment, the target type operation includes uploading a file, the operation information includes a file address and a service identifier, and there is a one-to-one correspondence between the service identifier and the task execution logic.

[0021] In one embodiment, the task discovery condition includes: a first timer reaches a first timing value.

[0022] In one embodiment, the task execution condition includes: a second timer reaches a second set value.

[0023] In a second aspect, the present application provides a synchronization device for a multi-node system, the multi-node system comprising a master node and a plurality of slave nodes, the synchronization device being applied to the slave node, comprising:

[0024] A judgment module, used to judge whether an operation of a target type is received;

[0025] A synchronization module, configured to save corresponding operation information in its own first registry when receiving an operation of the target type, and synchronize the operation information to a second registry of the master node;

[0026] The task discovery module is used to determine the target operation information according to the second registration table when the task discovery condition is met; the target operation information is the operation information from other nodes in the second registration table during the time period between the last time the task discovery condition was met and the current time when the task discovery condition is met;

[0027] The task generation module is used to generate tasks to be executed according to the target operation information and update the task table to be executed;

[0028] The task execution module is used to execute the tasks in the pending task table when the task execution conditions are met.

[0029] In a third aspect, the present application provides a computer device comprising one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of the multi-node system synchronization method in any of the above embodiments are executed.

[0030] In a fourth aspect, the present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the multi-node system synchronization method in any of the above embodiments.

[0031] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0032] Based on the synchronization method of the multi-node system in the present embodiment, the scheme is mainly aimed at the slave nodes in the multi-node system. When the slave node receives the operation of the target type, the corresponding operation information is saved in its own first registry and synchronized to the second registry of the master node. When the task discovery condition is met, the target operation information from other nodes is determined according to the second registry, and then the tasks to be executed are generated and the task list to be executed is updated. Finally, the tasks in the task list to be executed are executed when the task execution condition is met. This scheme realizes the automatic synchronization of operations between multiple nodes, avoids the problems of file synchronization omission and non-real-time caused by manual intervention, and greatly improves the synchronization efficiency. Secondly, when adding a new node, the new node can be quickly deployed synchronously from the master node, and the node can be quickly put online, making the entire multi-node software system more intelligent, efficient and stable in terms of operation synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0034] Figure 1 A schematic diagram of a flow chart of a synchronization method for a multi-node system provided by an embodiment of the present application;

[0035] Figure 2A schematic diagram of a process for determining target operation information from a node in one embodiment of the present application;

[0036] Figure 3 A schematic diagram of a process of synchronizing operation information from a node to a second registry in one embodiment of the present application;

[0037] Figure 4 A schematic diagram of the structure of a computer device provided for one embodiment of the present application. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0039] The present application provides a synchronization method for a multi-node system. The multi-node system includes a master node and multiple slave nodes. The synchronization method is applied to the slave nodes. Figure 1 , including steps S102 to S110.

[0040] S102, determining whether an operation of the target type is received.

[0041] It can be understood that the target type of operation refers to a specific operation that needs to be synchronized in a multi-node system, such as file upload, configuration modification or data update, etc., which require multi-node synchronization. In a multi-node system, each node will continue to receive various operation instructions from different channels. Through the judgment logic in this step, the system can effectively distinguish between ordinary operations and key operations that need to be synchronized, laying the foundation for subsequent synchronization processes, ensuring that the system is synchronized only as needed, and avoiding unnecessary waste of resources and system performance loss. Specifically, it can be to configure a request monitoring module from the node, match the information carried in the request instruction to determine the type of request received, for example, the request information includes a type field, and match the value in the type field with the target type table. If there is a hit, it is determined that the child node is receiving the target type of operation.

[0042] S104: If yes, the corresponding operation information is saved in its own first registry, and the operation information is synchronized to the second registry of the master node.

[0043] It can be understood that operation information refers to detailed data related to the target type operation, and the operation information includes all information used to support the synchronization of the operation, that is, the operation can be reproduced in other nodes according to the operation information. Taking file upload as an example, when node A uploads file X, the operation information may include the file address, service identifier, download method, etc. of file X. The first registry is a local storage structure of each node, which is used to record the detailed information of the target type operation received by the node, and provide a basis for subsequent local tracing and processing. The second registry is located at the master node, which is a centralized repository of operation information of all nodes in the entire system. The master node uses it to summarize and manage the operation dynamics of each node to achieve global control of the operation status of the entire system.

[0044] When a node determines that it has received an operation of the target type, it saves the corresponding operation information to its own first registry. This measure ensures the integrity and traceability of the node's local operation data. No matter what happens during the subsequent synchronization process, the node can review and correct errors based on the records in the first registry, providing a strong guarantee for local data consistency and the correctness of the operation process. At the same time, synchronizing the operation information to the second registry of the master node is a key link in achieving multi-node data synchronization. As the information hub of the entire system, the master node collects the operation information of all slave nodes. Through the centralized aggregation of this information, the master node can fully grasp the operation dynamics of the entire system, provide an accurate data basis for subsequent task allocation and synchronization, and then ensure the data consistency between nodes, so that the entire system can work together.

[0045] S106, when the task discovery condition is met, determine target operation information according to the second registration table. The target operation information is operation information from other nodes in the second registration table during the time period between the last time the task discovery condition was met and the current time the task discovery condition is met.

[0046] It can be understood that the task discovery condition is a set of specific conditions set by the software system to trigger the task screening process. These conditions can be set based on one or more factors such as time intervals, system status changes, and specific events. The target operation information is the operation records generated and synchronized by other nodes within a specific time period selected from the second registration table of the master node when any slave node meets the task discovery condition. These records will serve as the key data source for the subsequent generation of tasks to be executed by this node.

[0047] The system does not process all operation information continuously, but starts filtering the target operation information only when specific task discovery conditions are met. By setting task discovery conditions, the system can reasonably arrange the use of resources, avoid frequent and unnecessary information processing, and improve system operation efficiency. When the task discovery conditions are met, the target operation information is filtered out from the second registry, and the operations generated by other slave nodes within a specific time period that need to be executed synchronously on this node can be accurately located. This screening mechanism ensures that each node only obtains the latest operation information related to its own synchronization, avoids processing expired or duplicate information, and thus ensures the accuracy and timeliness of data synchronization between multiple nodes.

[0048] It is worth mentioning that the other nodes here include both slave nodes and master nodes. In some embodiments, the master node is also an operable node, and the master node can also determine whether it has received an operation of the target type, and when it is determined that the operation of the target type has been received, it saves the corresponding operation information in its own first registry, and then synchronizes the operation information to the second registry. When the master node meets the task discovery conditions, it will also execute the target operation information determined according to the second registry.

[0049] S108, generating tasks to be executed according to the target operation information, and updating the task table to be executed.

[0050] It can be understood that the pending task is a specific executable task unit converted from the target operation information. It contains all the detailed parameters, execution steps and related context information required to execute the operation. The pending task table is a storage structure used to record all generated pending tasks. The system uses it to uniformly manage, schedule and track tasks to ensure that tasks are executed in order. Newly generated pending tasks will be added to the pending task table to update the pending task table. Tasks that have been successfully executed will be deleted from the pending task table to prevent repeated execution.

[0051] S110, when the task execution condition is met, executing the task in the to-be-executed task table.

[0052] It can be understood that the task execution condition is a set of specific conditions set by the software system to trigger the task execution process. These conditions can be set based on one or more factors such as time intervals, system state changes, and specific events. When the execution condition is met, the system takes the task from the task list to be executed and executes it, thereby achieving synchronization of operations among multiple nodes, allowing each node to process according to the same operation logic, and ensuring the consistency of the data and state of the entire system.

[0053] Based on the synchronization method of the multi-node system in the present embodiment, the scheme is mainly aimed at the slave nodes in the multi-node system. When the slave node receives the operation of the target type, the corresponding operation information is saved in its own first registry and synchronized to the second registry of the master node. When the task discovery condition is met, the target operation information from other nodes is determined according to the second registry, and then the tasks to be executed are generated and the task list to be executed is updated. Finally, the tasks in the task list to be executed are executed when the task execution condition is met. This scheme realizes the automatic synchronization of operations between multiple nodes, avoids the problems of file synchronization omission and non-real-time caused by manual intervention, and greatly improves the synchronization efficiency. Secondly, when adding a new node, the new node can be quickly deployed synchronously from the master node, and the node can be quickly put online, making the entire multi-node software system more intelligent, efficient and stable in terms of operation synchronization.

[0054] In one embodiment, the operation information includes the operation time. When the task discovery condition is met, the target operation information is determined according to the second registration table. Figure 2 , including steps S202 to S206.

[0055] S202: When the task discovery condition is met, record the current task discovery time.

[0056] It can be understood that the task discovery time refers to the current moment recorded by the node when the task discovery conditions are met. The purpose of recording the current task discovery time is to provide a time reference for subsequent task screening and processing. By accurately recording this time point, the system can clearly define the time boundary of task discovery, making subsequent time-based operation information screening and processing more accurate, and avoiding information confusion and erroneous processing caused by unclear time definition.

[0057] In addition, when there is a problem with timing, the latest recorded task discovery time may be earlier than the previous task discovery time. At this time, the latest recorded task discovery time should be cleared, and a time query should be initiated from other time sources (such as third-party services or other nodes). The queried time is then used as the task discovery time and a prompt is sent to the administrator to promote the repair of the local time source.

[0058] S204: Determine a target time period according to the current task discovery time and the previous task discovery time.

[0059] It can be understood that the target time period is a time interval determined based on the current and previous task discovery times, and is used to limit the time range of filtering operation information. The target time period defines the time window for querying in the second registry, avoiding performance loss caused by full query.

[0060] S206: Determine target operation information from the second registration table according to the target time period.

[0061] It can be understood that after determining the target time period, the system will filter in the second registry according to this time range. A large amount of operation information is stored in the second registry. By limiting the target time period, the operation information generated and synchronized from other slave nodes within the time period can be accurately extracted. These target operation information is the basis for the subsequent generation of tasks to be executed. Only by accurately obtaining this information can the operation synchronization between nodes be guaranteed to be accurate and error-free, and the data consistency and collaborative work of the multi-node software system can be achieved.

[0062] Specifically, each operation information in the second registry is marked with the registration time and the source node ID. When the slave node meets the task discovery conditions, it will send a query request to the master node. The query request will carry the target time period and the slave node's own ID. The master node extracts the target time period and the slave node's ID from the query request, and can find the operation information whose registration time belongs to the target time period and whose source node ID is different from the slave node's own representation from the second registry by regular search as the target operation information, and package it and feed it back to the slave node.

[0063] In one embodiment, the operation information is synchronized to the second registry of the master node, see Figure 3 , including steps S302 to S306.

[0064] S302: Generate a pending registration request according to the operation information, and add the pending registration request to the first registration table. The pending registration request includes an identification field whose value is empty.

[0065] It can be understood that in a multi-node system, after receiving the operation information from the node, it needs to be registered with the master node to realize centralized management and synchronization of information. Generating a request to be registered is to convert the operation information into a format suitable for transmission in the network and recognizable by the master node. The identification field is set to an empty value so that the subsequent master node can uniquely identify the request after successfully processing the request, which facilitates information interaction and management between the slave node and the master node. The operation information is converted into a request to be registered and saved in the first registration table, so that the system can manage these requests in a unified manner and process them in a certain order or rule to ensure that the request will not be lost and can be sent to the master node in an orderly manner.

[0066] S304, when the registration condition is met, the first registration table is synchronized with the second registration table of the master node. When the master node successfully saves any pending registration request, it fills the corresponding registration identifier in the identifier field of the pending registration request and feeds it back to the slave node.

[0067] It can be understood that the registration condition is the condition set by the system to allow the pending registration request to be sent to the master node for registration, which may involve one or more factors such as network status, system resources, time interval, etc. The registration identifier is a unique identifier assigned by the master node to each successfully saved pending registration request, which is used to distinguish different requests and track the processing status of the request.

[0068] Specifically, meeting the registration conditions is a prerequisite for ensuring that the pending registration requests can be successfully sent and processed. When the conditions are met, the slave node sends the pending registration requests in the first registration table to the master node according to the request list, and the master node saves the operation information in these requests to the second registration table. By filling the registration identifier in the identification field of the pending registration request, the master node can assign a unique identity to each request, which is convenient for subsequent management and query. Feedback of the registration identifier to the slave node allows the slave node to confirm the processing result of the request based on this identifier, and can accurately reference the request in subsequent operations, realizing information synchronization and interaction between the slave node and the master node.

[0069] In addition, since registration requires communication between the slave node and the master node, there may be communication delays when the number of operation information that needs to be synchronized is large. In order to ensure that some important operations are synchronized first, a business type identifier can be added to the operation information. The slave node determines the synchronization priority of each operation information based on the business type identifier and the first mapping relationship (reflecting the correspondence between the business type identifier and the synchronization priority). During synchronization, synchronization is performed in order of synchronization priority from high to low.

[0070] S306: According to the feedback from the master node, the corresponding pending registration request in the first registration table is deleted.

[0071] It can be understood that the feedback from the master node includes the processing results of the pending registration requests. The slave node can determine whether the previous batch of pending registration requests have successfully completed registration based on whether the identification field in this feedback is filled with a unique identifier. If it is determined that the unique identifier is filled, the corresponding pending registration request in the first registration table can be deleted to maintain the accuracy and effectiveness of the request list and avoid repeated processing of requests that have been successfully registered. This can improve the processing efficiency of the system, reduce resource waste, and ensure the consistency of the system state, making the information synchronization between the slave node and the master node more reliable.

[0072] In one of the embodiments, when the execution conditions of the task are met, the task in the task list to be executed is executed, and the task is also deleted from the task list to be executed if the execution is successful; otherwise, the number of execution failures of the task is recorded, and the task is deleted from the task list to be executed if the number of execution failures reaches a first threshold.

[0073] It can be understood that in a multi-node software system, the tasks in the task list need to be executed according to certain rules and conditions. When the execution conditions of the task are met, the task is started to ensure that the task is carried out under the appropriate environment and resource conditions, and the success rate of task execution is improved. For successfully executed tasks, they are deleted from the task list to clean up the completed tasks, avoid occupying system resources and causing data redundancy, so that the task list always keeps an accurate record of unfinished tasks. For tasks that fail to execute, the number of execution failures is recorded in order to monitor and evaluate the execution of the task. When the number of execution failures reaches the first threshold, the task is deleted to avoid certain tasks from occupying system resources all the time due to problems that are difficult to solve, resulting in a decrease in system performance, and it can also avoid the waste of resources caused by infinite retries.

[0074] In one embodiment, the target type operation includes uploading a file, the operation information includes a file address and a service identifier, and there is a one-to-one correspondence between the service identifier and the task execution logic.

[0075] It can be understood that each business identifier corresponds to a specific set of task execution logic. For example, different types of file uploads can correspond to different processing flows. For example, after uploading picture files, format conversion and thumbnail generation are required. After uploading document files, content indexing and permission settings are required. After uploading firmware files, the corresponding download method needs to be configured. The business identifier can accurately match the corresponding execution logic. In this embodiment, the file address enables each node to accurately find the file to be processed and avoid file positioning errors. The business identifier is like an instruction code, guiding each node to call the corresponding execution logic according to different business types. This one-to-one correspondence ensures the flexibility and scalability of the system. Different types of file upload operations can be processed according to their own rules. There is no need to design complex synchronization processes for each operation, which improves the system processing efficiency and accuracy.

[0076] In one embodiment, the master node in the multi-node system is not fixed and can change with the operation of the system. Specifically, each node in the multi-node system obtains the first parameters of multiple dimensions in real time, and the first parameters are used to reflect the operation status of the node itself, such as CPU occupancy, memory occupancy, storage capacity, etc., and the weighted sum of each first parameter is used to determine its own election score. The first number of nodes are selected as candidate nodes in order from high to low, which can be selected by the current master node summing up all the election scores, or by any other node. Each node other than the candidate node will serve as a voting node, and each voting node will then evaluate the second parameter of each candidate node separately. The second parameter is used to reflect the communication quality between the candidate node and its own node, such as communication delay, packet loss rate, communication bandwidth, etc. Each voting node selects a second number of nodes from the candidate nodes for voting, wherein the second number is the set number of master nodes, which is less than the first number. Finally, the first number of nodes with the highest votes in the candidate nodes will be re-determined as the master node.

[0077] In addition, the re-election of the master node can be triggered by an event, such as when any of the first parameters is lower than the corresponding first threshold, it means that there is a problem with the node's own state, and a re-election is triggered at this time to ensure the continuous and stable synchronization. It can also be triggered by time, such as re-election according to a set period.

[0078] In one embodiment, the task discovery condition includes: the first timer reaches the first timing value. In this embodiment, the task discovery is triggered by time. The first timer is a tool configured in the node for the task discovery timing. The first timing value is a specific time value set for the first timer. When the timing of the first timer reaches this value, it means that the task discovery condition is met. Assume that the first timing value is set to every 30 minutes. When the system starts, the first timer starts timing. During these 30 minutes, the system runs its own business normally and does not perform task discovery operations. When the timing reaches 30 minutes, the first timer sends a signal indicating that the task discovery condition is met. At this time, the slave node sends a request to the master node to obtain the operation information generated by other nodes in the previous 30 minutes. According to the request, the master node selects the target operation information that meets the conditions in the second registration table and returns it to the slave node. After receiving the information, the slave node performs subsequent tasks and other operations. After that, the first timer restarts the timing and waits for the next time to reach the first timing value to trigger the task discovery process again.

[0079] In one embodiment, the task execution condition includes: the second timer reaches the second set value. In this embodiment, the task execution is triggered by time. The second timer is a tool configured in the node for the task execution timing. The second timing value is a specific time value set for the second timer. When the second timer reaches this value, it means that the task discovery condition is met. Assume that the second set value is set to every 15 minutes. After a plurality of tasks to be executed are accumulated in the task list to be executed, the second timer starts timing. Within 15 minutes, the system will not execute these tasks, but wait for the right time. When the timing reaches 15 minutes, the second timer sends a signal indicating that the task execution condition is met. The system will take out the tasks from the task list to be executed in order according to the priority or time sequence of the tasks for execution. For example, for a data collection task, the system will call the corresponding collection module, obtain data from the specified data source, and process and store it. After executing a task, the system will check whether there are other tasks to be executed. If there are, it will continue to execute until the task list to be executed is empty or other termination conditions are met. After that, the second timer restarts timing and waits for the next time to reach the second set value to trigger the task execution process again.

[0080] Specifically, the first timer and the second timer can work under the distributed timer task framework of Powerjob. It can realize the scheduling and execution of tasks in a distributed environment, solve the problem that traditional memory timers will be triggered multiple times when deployed in a node cluster, and ensure the accurate execution of timed tasks in a distributed system.

[0081] The present application provides a synchronization device for a multi-node system. The multi-node system includes a master node and multiple slave nodes. The synchronization device is applied to the slave nodes and includes a judgment module, a synchronization module, a task discovery module, a task generation module and a task execution module.

[0082] The judgment module is used to judge whether an operation of the target type is received. The synchronization module is used to save the corresponding operation information in its own first registry when an operation of the target type is received, and synchronize the operation information to the second registry of the master node. The task discovery module is used to determine the target operation information according to the second registry when the task discovery conditions are met. The target operation information is the operation information from other nodes in the second registry during the time period between the last time the task discovery conditions were met and the current time when the task discovery conditions are met. The task generation module is used to generate tasks to be executed according to the target operation information and update the table of tasks to be executed. The task execution module is used to execute the tasks in the table of tasks to be executed when the task execution conditions are met.

[0083] For the specific definition of the synchronization device of the multi-node system, please refer to the definition of the synchronization method of the multi-node system in the above text, which will not be repeated here. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0084] The present application provides a computer device, including one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the multi-node system synchronization method in any of the above embodiments are executed.

[0085] Indicatively, if Figure 4 As shown, Figure 4 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. Figure 4 , the computer device 400 includes a processing component 402, which further includes one or more processors, and a memory resource represented by a memory 401, for storing instructions that can be executed by the processing component 402, such as an application. The application stored in the memory 401 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 402 is configured to execute instructions to perform the synchronization method of the multi-node system of any of the above embodiments.

[0086] The computer device 400 may further include a power supply component 403 configured to perform power management of the computer device 400, a wired or wireless network interface 404 configured to connect the computer device 400 to a network, and an input / output (I / O) interface 405. The computer device 400 may operate based on an operating system stored in the memory 401, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.

[0087] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0088] The present application provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the synchronization method for a multi-node system in any of the above embodiments.

[0089] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0090] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0091] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A synchronization method for a multi-node system, characterized in that: The multi-node system includes a master node and a plurality of slave nodes, and the synchronization method is applied to the slave nodes, including: Determine whether an operation of the target type is received; If yes, the corresponding operation information is saved in its own first registry, and the operation information is synchronized to the second registry of the master node; In the case where the task discovery condition is met, target operation information is determined according to the second registry; the target operation information is the operation information from other nodes in the second registry during the time period between the last time the task discovery condition was met and the current time the task discovery condition is met; Generate tasks to be executed according to the target operation information, and update the task table to be executed; When the task execution conditions are met, the tasks in the to-be-executed task table are executed.

2. The synchronization method according to claim 1, characterized in that: The operation information includes an operation time, and when the task discovery condition is met, determining the target operation information according to the second registration table includes: When the task discovery condition is met, the current task discovery time is recorded; Determine a target time period according to the current task discovery time and the previous task discovery time; The target operation information is determined from the second registration table according to the target time period.

3. The synchronization method according to claim 2, characterized in that: The step of synchronizing the operation information to the second registration table of the master node includes: Generate a pending registration request according to the operation information, and add the pending registration request to the first registration table; the pending registration request includes an identification field whose value is empty; When the registration conditions are met, the first registration table is synchronized with the second registration table of the master node; when the master node successfully saves any of the pending registration requests, the identification field of the pending registration request is filled with the corresponding registration identification and fed back to the slave node; According to the feedback from the master node, the corresponding to-be-registered request in the first registration table is deleted.

4. The synchronization method according to claim 2, characterized in that: When the task execution condition is met, executing the task in the to-be-executed task list also includes: For any task in the to-be-executed task list, if the execution is successful, the task is deleted from the to-be-executed task list; otherwise, the number of execution failures of the task is recorded, and the task is deleted from the to-be-executed task list when the number of execution failures reaches a first threshold.

5. The synchronization method according to claim 1, characterized in that: The target type operation includes uploading a file, and the operation information includes a file address and a service identifier. There is a one-to-one correspondence between the service identifier and the task execution logic.

6. The synchronization method according to claim 1, characterized in that: The task discovery condition includes: a first timer reaches a first timing value.

7. The synchronization method according to claim 1, characterized in that: The task execution condition includes: a second timer reaches a second set value.

8. A synchronization device for a multi-node system, characterized in that: The multi-node system includes a master node and a plurality of slave nodes, and the synchronization device is applied to the slave nodes, including: A judgment module, used to judge whether an operation of a target type is received; A synchronization module, configured to save corresponding operation information in its own first registry when receiving an operation of the target type, and synchronize the operation information to a second registry of the master node; A task discovery module, configured to determine target operation information according to the second registry when a task discovery condition is met; the target operation information is the operation information from other slave nodes in the second registry during a time period between when the task discovery condition was previously met and when the task discovery condition is currently met; A task generation module, used to generate tasks to be executed according to the target operation information, and update the task table to be executed; The task execution module is used to execute the tasks in the to-be-executed task table when the task execution conditions are met.

9. A computer device, characterized in that: It includes one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the synchronization method of the multi-node system as described in any one of claims 1 to 7 are executed.

10. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the synchronization method for a multi-node system as described in any one of claims 1 to 7.