Configuration data updating method and device of distributed system, equipment and storage medium

By broadcasting configuration data update instructions to all work nodes in a distributed system and retrying according to the execution status, the problem of inconsistency in the configuration data update of the work node cache is solved, and the consistency of configuration data and system stability are achieved.

CN119848059APending Publication Date: 2025-04-18RAJAX NETWORK &TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411999832.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In distributed systems, the configuration data cached by the work node is not updated consistently, making it difficult to guarantee the accuracy and consistency of task execution.

Method used

When the configuration data changes, the configuration data update instructions are broadcast to all work nodes, causing them to perform the configuration data update task, and decide whether to retry based on the execution status to ensure that the configuration data of all work nodes is consistent.

Benefits of technology

It effectively guarantees the consistency of configuration data in the distributed system, avoids system operation abnormalities caused by inconsistent configuration updates, and improves the stability and reliability of system operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848059A_ABST
    Figure CN119848059A_ABST
Patent Text Reader

Abstract

One or more embodiments of the invention provide a configuration data updating method and device of a distributed system, equipment and a storage medium. The method comprises the following steps: if configuration data is changed, sending a configuration data updating instruction to each working node, so that each working node executes a configuration data updating task and returns an execution state of the configuration data updating task; the configuration data updating task comprises the step of replacing the historical configuration data of the local cache by using the updated configuration data indicated by the configuration data updating instruction; the execution state comprises a success state or a failure state; detecting whether the execution states returned by all the working nodes are successful states or not; if not, repeatedly executing the step of sending the configuration data updating instruction to each working node, so that each working node repeatedly executes the configuration data updating task; if yes, ending the configuration data updating task. According to the embodiment, the requirements of configuration data consistency and timely updating in the distributed system can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of computer software technology, and in particular, to a configuration data updating method, device, electronic device, computer-readable storage medium, and computer program product for a distributed system. Background Art

[0002] In a distributed system, worker nodes often need to perform specified tasks based on the configuration data of the tasks to be executed. These configuration data define the execution requirements of the tasks and are usually cached in the local storage of each worker node to provide low-latency access during task execution. As the task requirements are adjusted, the configuration data may change, and the configuration data update method in the related art has the problem of inconsistent update of the configuration data cached by different worker nodes. Summary of the invention

[0003] In view of this, one or more embodiments of the present specification provide a configuration data updating method for a distributed system, an electronic device, a computer-readable storage medium, and a computer program product.

[0004] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0005] According to a first aspect of one or more embodiments of this specification, a method for updating configuration data of a distributed system is proposed, wherein the configuration data is cached in each working node included in the distributed system, and the configuration data is used to define the execution requirements of the periodic tasks that the working node needs to execute; the method includes:

[0006] If the configuration data for the periodic task changes, a configuration data update instruction is sent to each of the working nodes, so that each of the working nodes executes the configuration data update task and returns the execution status of the configuration data update task; the configuration data update task includes: replacing the historical configuration data cached locally with the updated configuration data indicated by the configuration data update instruction; the execution status includes a success status or a failure status;

[0007] Detect whether the execution status returned by all the working nodes is the success status;

[0008] If not, repeatedly executing the step of sending the configuration data update instruction to each of the working nodes, so that each of the working nodes repeatedly executes the configuration data update task;

[0009] If so, end the configuration data update task.

[0010] According to a second aspect of an embodiment of this specification, a configuration data updating device for a distributed system is provided, wherein the configuration data is cached in each working node included in the distributed system, and the configuration data is used to define the execution requirements of the periodic tasks that the working node needs to execute; the device includes:

[0011] A configuration data update module, configured to send a configuration data update instruction to each of the working nodes if the configuration data for the periodic task changes, so that each of the working nodes executes the configuration data update task and returns the execution status of the configuration data update task; the configuration data update task includes: replacing the historical configuration data cached locally with the updated configuration data indicated by the configuration data update instruction; the execution status includes a success status or a failure status;

[0012] A judgment module, used to detect whether the execution status returned by all the working nodes is the success status;

[0013] The configuration data updating module is further used to, if not, repeatedly execute the step of sending the configuration data updating instruction to each of the working nodes, so that each of the working nodes repeatedly executes the configuration data updating task;

[0014] The ending module is used to end the configuration data updating task if yes.

[0015] According to a third aspect of the embodiments of this specification, there is provided an electronic device, including:

[0016] processor;

[0017] a memory for storing processor-executable instructions;

[0018] When the processor executes the executable instructions, it is used to implement the method described in the first aspect.

[0019] According to a fourth aspect of the embodiments of this specification, there is provided a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of any of the above methods are implemented.

[0020] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, including a computer program, which implements the steps of any of the above methods when executed by a processor.

[0021] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0022] In the embodiments of this specification, when the configuration data changes, the configuration data update instruction can be broadcast to all working nodes in a timely manner, so that the change of the configuration data can be perceived and reflected in all relevant working nodes in a timely manner, and whether to retry is determined according to the execution status returned by the working node, so as to effectively ensure the consistency of the configuration data in the distributed system and avoid system operation abnormalities caused by inconsistent configuration updates. Through the above steps, the requirements for consistency and timely update of configuration data in the distributed system can be met, and the stability and reliability of system operation can be improved.

[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a schematic diagram of a distributed system provided by an exemplary embodiment.

[0025] Figure 2 The diagram is a schematic diagram of distributing periodic tasks in a distributed system provided by an exemplary embodiment.

[0026] Figure 3 It is a schematic diagram of the connection between a distributed system and a scheduling platform provided by an exemplary embodiment.

[0027] Figure 4 It is a flowchart of a method for updating configuration data of a distributed system provided by an exemplary embodiment.

[0028] Figure 5 It is a schematic diagram of a configuration data update process provided by an exemplary embodiment.

[0029] Figure 6 It is a schematic diagram of another configuration data update process provided by an exemplary embodiment.

[0030] Figure 7 It is a schematic structural diagram of an electronic device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0031] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0032] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0033] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0034] See also Figure 1 The distributed system includes multiple working nodes, which may include but are not limited to a physical server of an independent host, a virtual server carried by a host cluster, a server cluster, a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, network services and cloud communications, smart phones / mobile phones, tablet computers, personal digital assistants (PDAs), laptop computers, desktop computers or any other type of device. Figure 1 Six working nodes are used as an example. Multiple working nodes can be used to execute different periodic tasks, such as periodic indicator monitoring tasks. Different periodic tasks have corresponding configuration data. The configuration data of periodic tasks is used to define the execution requirements of periodic tasks, such as the execution mode, behavior, required resources, and input and output requirements of tasks. The configuration data of tasks is the core element of task execution, which provides detailed guidance and support for the smooth execution of tasks.

[0035] Since the execution requirements of periodic tasks are usually relatively stable, and the configuration data is relatively small and updated less frequently, the working node needs to efficiently obtain these configuration data when executing tasks in order to quickly start the task and ensure the normal execution of the task. For example, see Figure 2Any worker node in the distributed system can be used as the master node to initiate the periodic task execution process. For example, if worker node 2 is used as the master node to initiate the periodic task, worker node 2 needs to distribute 50 periodic tasks to worker nodes 1 to 6 in the distributed system for execution. In this case, the master node needs to quickly access the configuration data of all related periodic tasks before assigning tasks to other worker nodes for execution. In order to reduce the delay in the task distribution process and improve the overall efficiency, it is an ideal solution for the worker node to cache these configuration data locally.

[0036] The configuration data corresponding to the 50 periodic tasks are cached locally on each working node. When any working node initiates the periodic task execution process as the master node, the cached configuration data can be directly obtained locally, which greatly reduces the performance bottleneck caused by network delays and bandwidth limitations. The access speed of the locally cached configuration data is much higher than the access speed of the remote data source, especially in high-concurrency scenarios. It can significantly improve the speed of task distribution and the throughput of the overall system. The local caching mechanism can ensure that the master node quickly obtains the configuration data of all tasks, thereby reducing unnecessary delays when distributing tasks and ensuring the timely execution of periodic tasks.

[0037] However, as the task requirements are adjusted, the configuration data may change, and the configuration data update method in the related technology has the problem of inconsistent configuration data updates cached by different working nodes. For example, due to the design of the configuration data management architecture, the configuration data update method in the related technology may be based on a request-driven model. When a certain type of interface is used to call the change configuration data, the call request is usually randomly routed to a certain working node in the distributed system, which will cause the configuration data update to stay only on the called working node, and other working nodes cannot perceive the update.

[0038] Therefore, it is necessary to provide a configuration data update method to timely perceive and update these changes, thereby ensuring the accuracy and consistency of task execution by each working node.

[0039] See also Figure 3 as well as Figure 4, the embodiments of this specification provide a configuration data updating method for a distributed system, which can be executed by a scheduling platform, which can be connected to the distributed system, and the scheduling platform can include but is not limited to a physical server of an independent host, a virtual server carried by a host cluster, a server cluster, a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, network services, and cloud communications, smart phones / mobile phones, tablet computers, personal digital assistants (PDAs), laptop computers, desktop computers, or any other type of device. The configuration data is cached in each working node included in the distributed system, and the configuration data is used to define the execution requirements of the periodic tasks that the working nodes need to execute. The configuration data updating method includes:

[0040] In S401, if the configuration data for the periodic task changes, a configuration data update instruction is sent to each working node so that each working node executes the configuration data update task and returns the execution status of the configuration data update task; the configuration data update task includes: replacing the historical configuration data cached locally with the updated configuration data indicated by the configuration data update instruction; the execution status includes a success status or a failure status.

[0041] In this step, when the configuration data changes, the scheduling platform will send configuration data update instructions to all working nodes to ensure that all working nodes can receive consistent configuration update information and trigger local updates of the configuration data. After the working node receives the update notification, each working node will execute the configuration data update task and return the execution status (success or failure) of the configuration data update task to the scheduling platform. The execution status includes: (1) Successful status, indicating that the update is successful and the new configuration data has been cached locally and is effective. (2) Failed status, indicating that the update task is not completed due to network problems, insufficient resources or other abnormalities.

[0042] The scheduling platform will summarize the execution status of all nodes to ensure that the scheduling platform can understand the overall completion status of the configuration update task in real time and provide a basis for subsequent processing.

[0043] In S402, it is detected whether the execution status returned by all working nodes is a success status.

[0044] If not, continue to execute S401, that is, repeat the step of sending the configuration data update instruction to each working node, so that each working node repeatedly executes the configuration data update task.

[0045] In this step, when the scheduling platform finds that the execution status returned by some working nodes is a failure status, it will resend the configuration data update instruction to all working nodes again, thereby improving the reliability of the configuration update and ensuring that the configuration data of all nodes is consistent as much as possible.

[0046] In one possible implementation, when the scheduling platform finds that the execution status returned by some working nodes is a failure status, it can output a retry reminder to the user so that the user manually triggers the retry mechanism and allows the scheduling platform to resend the configuration data update instruction to all working nodes again.

[0047] In another possible implementation, when the scheduling platform finds that the execution status returned by some working nodes is a failure status, it can automatically retry and automatically resend the configuration data update instruction to all working nodes.

[0048] In S403, if yes, the configuration data update task is terminated.

[0049] In this step, when the scheduling platform detects that the execution status of all working nodes is successful, the configuration data update task is declared completed and the entire update process ends, ensuring the consistency of the system after the configuration data is changed and providing support for the stable operation of the distributed system.

[0050] In this embodiment, when the configuration data changes, the scheduling platform can broadcast the configuration data update instruction to all working nodes in a timely manner, so that the configuration data change can be perceived and reflected in all relevant working nodes in a timely manner, and decide whether to retry according to the execution status returned by the working node, so as to effectively ensure the consistency of the configuration data in the distributed system and avoid system operation abnormalities caused by inconsistent configuration updates. Through the above steps, the requirements for consistency and timely update of configuration data in the distributed system can be met, and the stability and reliability of system operation can be improved.

[0051] For example, the scheduling platform can output the execution status returned by each working node. By aggregating the execution status of each working node in real time through the scheduling platform, system operation and maintenance personnel can clearly understand the execution status of the configuration update task, which helps to quickly locate the problem node and take corresponding measures.

[0052] In some embodiments, see Figure 5 as well as Figure 6, the user can perform at least one of the following operations on the configuration data through the input device: (1) Modification operation, adjusting the content or parameters of the existing configuration data, such as modifying the running frequency of the task, dependent resources, etc. (2) Deletion operation, removing configuration data that is no longer needed, such as deleting the configuration entries of certain tasks to stop them from running. (3) Addition operation, adding new configuration data, such as specifying new task execution requirements for the working nodes in the distributed system. In this embodiment, the input device supports the user's modification, deletion and addition operations on the configuration data to meet the needs of the distributed system for flexible adjustment of task requirements. The input device includes but is not limited to smart phones / mobile phones, tablet computers, personal digital assistants (PDAs), laptop computers, desktop computers, or any other type of device.

[0053] The input device can receive at least one of a modification operation, a deletion operation, and a new addition operation of the user for the configuration data. The input device is connected to the configuration database, and the input device can write the changed configuration data pointed to by at least one of the modification operation, the deletion operation, and the new addition operation into the configuration database to ensure the persistent storage of the data change. The input device can also notify the relevant modules in the distributed system to process through the communication mechanism to realize the dynamic update of the system configuration data.

[0054] In one possible implementation, see Figure 5 As can be seen from the above description, in the existing configuration data management architecture, the user's configuration data update operation is usually sent to a certain working node in the distributed system through random routing. Due to the limitations of this mechanism, the configuration data update may only stay in the called working node, and other working nodes cannot perceive the update, resulting in data inconsistency. This embodiment can improve the configuration data update process through the forwarding mechanism of the working node without significantly changing the original architecture, thereby solving the above problem.

[0055] Specifically, when the input device receives at least one of a modification operation, a deletion operation, and a new addition operation of the user for the configuration data, the configuration data change notification can be sent to any working node in the distributed system by calling the first specified interface, such as Figure 5 The working node 2 in the example may also be other working nodes, and this embodiment does not impose any restrictions on this. The working node that receives the configuration data change notification does not directly update the configuration, but forwards the configuration data change notification to the scheduling platform. This forwarding mechanism ensures that the configuration data change is uniformly managed by the scheduling platform, avoiding direct modification of the original configuration data management architecture, and is less invasive.

[0056] When the scheduling platform receives a configuration data change notification, it can be informed that the configuration data for the periodic task has changed, and can broadcast the configuration data update instruction to each working node in the distributed system, so that each working node performs the configuration data update task. Specifically, the updated configuration data indicated by the configuration data update instruction is stored in the configuration database. When each working node performs the configuration data update task, it can read the updated configuration data from the configuration database, and use the updated configuration data to replace the historical configuration data cached locally, and finally return the execution status (successful status or failed status) of the configuration data update task to the scheduling platform. The scheduling platform collects the execution status of all working nodes. If there is a working node that fails to execute, the scheduling platform will trigger a retry mechanism to ensure that all working nodes eventually complete the configuration data update task.

[0057] This implementation method does not require large-scale reconstruction of the original architecture, reducing development workload; and through the random receiving and forwarding mechanism of the working nodes, it avoids frequent interaction between the input device and the scheduling platform, improving the flexibility and load balancing of the system.

[0058] In another possible implementation, each working node of the distributed system is also used to register a configuration data update listener with the scheduling platform. The function of the configuration data update listener is to enable the working node to perceive the changes in the configuration data in real time and receive notifications from the scheduling platform in a timely manner when the configuration data is updated. This mechanism is similar to the "subscribe-publish" mode, in which the working node acts as a "subscriber" and the scheduling platform acts as a "publisher".

[0059] See also Figure 6 When the input device receives at least one of the modification operation, deletion operation and addition operation of the user on the configuration data, the configuration data change notification can be sent to the scheduling platform by calling the second designated interface. The scheduling platform serves as the core control center for the configuration data update in this solution. All configuration changes are directly processed through the scheduling platform, which can centrally manage and monitor the update process of the configuration data, and facilitate the audit, tracking and management of the update operation.

[0060] When the scheduling platform receives a configuration data change notification, it can be informed that the configuration data for the periodic task has changed. It can then send a configuration data update instruction to each working node through the callback of the configuration data update listener, so that each working node performs the configuration data update task. Specifically, the updated configuration data indicated by the configuration data update instruction is stored in the configuration database. When each working node performs the configuration data update task, it can read the updated configuration data from the configuration database and use the updated configuration data to replace the historical configuration data cached locally. Finally, the execution status of the configuration data update task is returned to the scheduling platform. The scheduling platform collects the execution status of all working nodes. If there is a working node that fails to execute, the scheduling platform will trigger a retry mechanism to ensure that all working nodes eventually complete the configuration data update task.

[0061] This embodiment provides two improved configuration data management implementation methods: the first is to achieve global consistency of configuration data updates through the random reception and forwarding mechanism of the working nodes without significantly changing the original architecture; the second is to configure the data update listener to the scheduling platform through the working nodes, thereby improving the real-time performance and communication efficiency of the configuration data update. Both methods can meet the configuration data management requirements of distributed systems, and the specific selection can be flexibly determined according to the system scale and real-time requirements. Among them, the scheduling platform that implements the first solution and the scheduling platform that implements the second solution can be the same scheduling platform or different scheduling platforms. The first designated interface and the second designated interface are different types of interfaces. The first designated interface is used for the input device to send the configuration data change notification to any working node in the distributed system, and the second designated interface is used for the input device to directly send the configuration data change notification to the scheduling platform.

[0062] The design of the configuration data update instruction can be flexibly adjusted according to the requirements of the scheduling platform and the distributed system, and this embodiment does not impose any limitation on this.

[0063] In one possible scenario, the configuration data update instruction may not carry any information. The configuration data update instruction only serves as a trigger. When each working node receives the configuration data update instruction, it will assume by default that the configuration data has changed, that is, it knows that the configuration data update task needs to be executed, and directly queries the configuration database for the latest configuration data, and uses the latest configuration data to refresh the cache. In this embodiment, the configuration data update instruction does not need to contain additional information, and the scheduling platform only needs to be responsible for the notification function, reducing the implementation complexity.

[0064] In another possible scenario, the configuration data update instruction may carry relevant information, such as version information of the updated configuration data, so that each working node can refer to the version information to query the corresponding version of the configuration data from the configuration database when executing the configuration data update task. It is understandable that the configuration data update instruction may also carry other information, and this embodiment does not impose any restrictions on this. In this embodiment, by carrying update information through the configuration data update instruction, the dependence of the working node on the database can be reduced, and the frequency of database queries can be reduced. The version information in the configuration data update instruction can be used as a reference to facilitate debugging and tracing problems.

[0065] In some embodiments, when multiple input devices trigger data changes at the same time, the scheduling platform may receive multiple configuration data change notifications at the same time, which means that the configuration data update logic will have concurrency problems, which may cause the local cache data of each working node to be polluted. This embodiment uses the following three methods to deal with concurrency problems.

[0066] In the first possible implementation, if the configuration data changes at least twice at the same time, for example, the scheduling platform receives at least two configuration data change notifications at the same time, the scheduling platform will not send all configuration data change notifications to each working node. The corresponding configuration data update instructions, but will be processed in batches and in sequence, only one at a time. In other words, the scheduling platform can send a configuration data update instruction corresponding to one of the changes (or one of the configuration data change notifications) to each working node; and, when the execution status returned by all working nodes for the configuration data update task corresponding to the one of the changes is a successful state, send a configuration data update instruction corresponding to another change in at least two changes to each working node, and repeat the above steps in sequence until all changes are processed. In this embodiment, by processing the configuration data change notifications in sequence, it is ensured that only one update task is executed each time, the cache consistency of each working node will not be affected by concurrency, the scheduling platform is responsible for controlling the concurrent processing logic, the working nodes do not need additional modification, and the maintenance cost is low.

[0067] In the second possible implementation, the concurrency capability of each working node can be improved. If each working node receives at least two configuration data update instructions at the same time, the configuration data update tasks corresponding to at least two configuration data update instructions can be executed based on the first mechanism; the first mechanism indicates the use of a concurrent hash map (ConcurrentHashMap), and the concurrent hash map ensures that only one configuration data update task corresponding to the updated configuration data can replace the historical configuration data in the local cache at the same time, while other configuration data update tasks need to wait for the previous configuration data update task to be completed before they can continue to be executed. This embodiment implements the queuing and sequential update of configuration data update tasks through a concurrent hash map, avoiding the data pollution problem caused by modifying the local cache at the same time.

[0068] In a third possible implementation, each working node can be improved. If each working node receives at least two configuration data update instructions at the same time, the configuration data update tasks corresponding to the at least two configuration data update instructions can be executed based on the second mechanism; the second mechanism indicates that the configuration data update task that competes for the lock is executed first, and only one configuration data update task can successfully obtain the lock at the same time, and other configuration data update tasks need to wait for the lock to be released before they can continue to execute. Specifically, each configuration data update task needs to try to obtain the competing lock; only the configuration data update task that successfully obtains the lock can replace the historical configuration data in the local cache, and other configuration data update tasks need to wait for the lock to be released; after the lock is released, other configuration data update tasks are executed one by one in the order of competition until all tasks are completed. This embodiment uses a competitive lock to ensure that only one update task modifies the local cache at the same time to avoid data pollution problems.

[0069] In practical applications, any suitable implementation method mentioned above can be selected according to the characteristics of the distributed system, or two or more methods can be combined to meet specific needs.

[0070] The various technical features in the above embodiments can be arbitrarily combined as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, any combination of the various technical features in the above embodiments also falls within the scope of this specification.

[0071] In some embodiments, the embodiments of this specification also provide an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements any of the above methods by running the executable instructions.

[0072] Figure 7 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 7At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 702 reading the corresponding computer program from the non-volatile memory 710 into the memory 708 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0073] The configuration data updating device of the distributed system can be applied to Figure 7 The configuration data is cached in each working node included in the distributed system, and the configuration data is used to define the execution requirements of the periodic tasks that the working node needs to execute. Among them, the configuration data updating device of the distributed system may include:

[0074] A configuration data update module is used to send a configuration data update instruction to each of the working nodes if the configuration data for the periodic task changes, so that each of the working nodes executes the configuration data update task and returns the execution status of the configuration data update task; the configuration data update task includes: replacing the historical configuration data cached locally with the updated configuration data indicated by the configuration data update instruction; the execution status includes a success status or a failure status.

[0075] The judgment module is used to detect whether the execution status returned by all the working nodes is the success status.

[0076] The configuration data updating module is further used to, if not, repeatedly execute the step of sending the configuration data updating instruction to each of the working nodes, so that each of the working nodes repeatedly executes the configuration data updating task.

[0077] The ending module is used to end the configuration data updating task if yes.

[0078] In some embodiments, the updated configuration data indicated by the configuration data update instruction is stored in a configuration database. The configuration database is connected to an input device for communication, and the input device is used to receive at least one of a modification operation, a deletion operation, and a new addition operation of the configuration data by a user, and write the changed configuration data pointed to by at least one of the modification operation, the deletion operation, and the new addition operation into the configuration database. The configuration data update task specifically includes: reading the updated configuration data from the configuration database, and replacing the historical configuration data cached locally with the updated configuration data read.

[0079] In some embodiments, the distributed system is connected to a scheduling platform, and the method is applied to the scheduling platform.

[0080] The configuration data update module is specifically used to send a configuration data update instruction to each of the working nodes if a configuration data change notification is received; wherein the configuration data change notification is sent to any one of the working nodes in the distributed system by calling a first designated interface when the input device receives at least one of a modification operation, a deletion operation and a new operation of the configuration data by the user, and then forwarded to the scheduling platform by the working node that receives the configuration data change notification.

[0081] In some embodiments, the distributed system is connected to a scheduling platform, and the method is applied to the scheduling platform; each of the working nodes of the distributed system is also used to register a configuration data update listener with the scheduling platform.

[0082] The configuration data update module is specifically used to send the configuration data update instruction to each of the working nodes through the callback of the configuration data update listener if a configuration data change notification sent by the input device is received; wherein, the configuration data change notification is sent to the scheduling platform by calling the second designated interface when the input device receives at least one of the user's modification operation, deletion operation and addition operation on the configuration data.

[0083] In some embodiments, the configuration data update module is specifically used to send a configuration data update instruction corresponding to one of the changes to each of the working nodes if the configuration data changes at least twice at the same time; and, when the execution status returned by all of the working nodes for the configuration data update tasks corresponding to one of the changes is a success status, send a configuration data update instruction corresponding to the other change of the at least two changes to each of the working nodes.

[0084] In some embodiments, if each of the working nodes receives at least two configuration data update instructions simultaneously, the configuration data update tasks corresponding to the at least two configuration data update instructions are executed based on the first mechanism or the second mechanism.

[0085] The first mechanism indicates the use of a concurrent hash mapping table so that at the same time only one configuration data update task corresponding to the updated configuration data can replace the locally cached historical configuration data, while other configuration data update tasks need to wait for the previous configuration data update task to be completed before they can continue to execute.

[0086] The second mechanism indicates that the configuration data update task that competes for the lock is executed first, and only one configuration data update task can successfully acquire the lock at the same time, and other configuration data update tasks need to wait for the lock to be released before they can continue to execute.

[0087] In some embodiments, the configuration data update instruction carries version information of the updated configuration data.

[0088] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0089] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.

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

[0091] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.

[0092] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A method for updating configuration data of a distributed system, wherein the configuration data is cached in each working node included in the distributed system, and the configuration data is used to define the execution requirements of periodic tasks that the working node needs to execute; the method comprises: If the configuration data for the periodic task changes, a configuration data update instruction is sent to each of the working nodes, so that each of the working nodes executes the configuration data update task, and returns the execution status of the configuration data update task; The configuration data update task includes: replacing the historical configuration data cached locally with the updated configuration data indicated by the configuration data update instruction; the execution status includes a success status or a failure status; Detect whether the execution status returned by all the working nodes is the success status; If not, repeatedly executing the step of sending the configuration data update instruction to each of the working nodes, so that each of the working nodes repeatedly executes the configuration data update task; If so, end the configuration data update task.

2. The method according to claim 1, wherein the updated configuration data indicated by the configuration data update instruction is stored in a configuration database; in, The configuration database is communicatively connected to an input device, and the input device is used to receive at least one of a modification operation, a deletion operation, and a new addition operation of the user for the configuration data, and write the changed configuration data pointed to by at least one of the modification operation, the deletion operation, and the new addition operation into the configuration database; The configuration data update task specifically includes: reading the updated configuration data from the configuration database, and replacing the historical configuration data cached locally with the updated configuration data.

3. The method according to claim 1 or 2, wherein the distributed system is connected to a scheduling platform, and the method is applied to the scheduling platform; If the configuration data for the periodic task is changed, sending a configuration data update instruction to each of the working nodes includes: If a configuration data change notification is received, a configuration data update instruction is sent to each of the working nodes; wherein the configuration data change notification is sent by the input device to any one of the working nodes in the distributed system by calling the first designated interface when the input device receives at least one of the user's modification operation, deletion operation and addition operation on the configuration data, and then forwarded to the scheduling platform by the working node that receives the configuration data change notification.

4. The method according to claim 1 or 2, wherein the distributed system is connected to a scheduling platform, and the method is applied to the scheduling platform; each of the working nodes of the distributed system is also used to register a configuration data update listener with the scheduling platform; If the configuration data for the periodic task is changed, sending a configuration data update instruction to each of the working nodes includes: If a configuration data change notification is received from an input device, the configuration data update instruction is sent to each of the working nodes through the callback of the configuration data update listener; wherein, the configuration data change notification is sent to the scheduling platform by calling the second designated interface when the input device receives at least one of a modification operation, a deletion operation and a new operation on the configuration data by the user.

5. The method according to claim 1, wherein if the configuration data for the periodic task is changed, sending a configuration data update instruction to each of the working nodes comprises: If the configuration data is changed at least twice at the same time, a configuration data update instruction corresponding to one of the changes is sent to each of the working nodes; as well as, When the execution statuses returned by all the working nodes for the configuration data update tasks corresponding to one of the changes are all success statuses, a configuration data update instruction corresponding to another change of the at least two changes is sent to each of the working nodes.

6. The method according to claim 1, if each of the working nodes receives at least two configuration data update instructions at the same time, the configuration data update tasks corresponding to the at least two configuration data update instructions are executed based on the first mechanism or the second mechanism; The first mechanism indicates the use of a concurrent hash mapping table so that at the same time, only one configuration data update task corresponding to the updated configuration data can replace the locally cached historical configuration data, and other configuration data update tasks need to wait for the previous configuration data update task to be completed before they can continue to execute; The second mechanism indicates that the configuration data update task that competes for the lock is executed first, and only one configuration data update task can successfully acquire the lock at the same time, and other configuration data update tasks need to wait for the lock to be released before they can continue to execute.

7. A configuration data updating device for a distributed system, wherein the configuration data is cached in each working node included in the distributed system, and the configuration data is used to define the execution requirements of the periodic tasks that the working node needs to execute; the device comprises: A configuration data update module, configured to send a configuration data update instruction to each of the working nodes if the configuration data for the periodic task changes, so that each of the working nodes executes the configuration data update task, and returns the execution status of the configuration data update task; The configuration data update task includes: replacing the historical configuration data cached locally with the updated configuration data indicated by the configuration data update instruction; the execution status includes a success status or a failure status; A judgment module, used to detect whether the execution status returned by all the working nodes is the success status; The configuration data updating module is further used to, if not, repeatedly execute the step of sending the configuration data updating instruction to each of the working nodes, so that each of the working nodes repeatedly executes the configuration data updating task; The ending module is used to end the configuration data updating task if yes.

8. An electronic device comprising: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method according to any one of claims 1 to 6 by executing the executable instructions.

9. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 6.