Configuration deployment method, apparatus, and electronic device
By managing configuration information through a state machine, the problems of low timeliness and efficiency in configuration deployment between heterogeneous processes in distributed systems are solved, configuration consistency and resource optimization are achieved, and system performance and stability are improved.
Patent Information
- Application Number
- CN202611338384.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-06
AI Technical Summary
In distributed systems, the timeliness and efficiency of configuration and deployment between heterogeneous processes are low, leading to inconsistencies in state and excessive performance consumption.
Configuration information is managed through a state machine. The target configuration information is received and stored as expected information. The current configuration information is compared with the expected information, and the configuration information is only issued when an update is needed. The state machine manages each business process separately to achieve asynchronous configuration deployment.
It improves the timeliness and efficiency of configuration deployment, ensures configuration consistency, reduces unnecessary resource consumption and frequent updates, and enhances system performance and stability.
Smart Images

Figure CN123048058A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a configuration and deployment method, apparatus, and electronic device. Background Technology
[0002] A distributed system is a computing system that connects multiple independent computing nodes through a network to achieve collaborative work, resource sharing, and task distribution. Its main characteristic is that geographically dispersed nodes communicate across the network to collaboratively complete tasks, thus providing an efficient, scalable, and fault-tolerant solution. Kubernetes (K8s) is a typical example of a distributed system.
[0003] APIServer is one of the core components of Kubernetes, providing excellent configuration monitoring and awareness capabilities, making it suitable for configuration sharing in Kubernetes-based distributed systems. Through APIServer, configurations can be issued from the control center (called the controller) of the distributed system, and monitored on nodes (called agents) to achieve business collaboration.
[0004] In distributed systems, a common scenario exists where configurations need to be deployed across multiple heterogeneous processes of an agent. Due to various anomalies, these processes may fail to quickly achieve consistency in their configurations. This is especially true for configurations requiring rapid changes and responses within a short timeframe, leading to frequent responses from agent processes to configuration-related state changes, resulting in performance waste due to configuration variations. These two phenomena contribute to the problems of failing to achieve eventual state consistency among multiple heterogeneous processes on an agent in distributed systems, and the excessive performance overhead of maintaining state consistency.
[0005] There is currently no effective solution to the problem of low timeliness and efficiency in deploying configurations to heterogeneous processes in nodes in related technologies. Summary of the Invention
[0006] This application provides a configuration deployment method, apparatus, and electronic device to solve the problems of low timeliness and efficiency in deploying configurations to heterogeneous processes in nodes in related technologies.
[0007] According to one aspect of this application, a configuration deployment method is provided, applied to a state machine. The method includes: receiving target configuration information sent by a configuration management module, and storing the target configuration information as expected information in the local memory of the state machine, wherein the configuration management module receives the target configuration information sent by a controller; obtaining the current configuration information of a target business process from the local memory, and determining whether the current configuration information needs to be updated based on the current configuration information and the expected information; if the current configuration information needs to be updated, issuing the target configuration information to the target business process through the configuration management module, wherein the target business process performs configuration deployment operations based on the target configuration information.
[0008] Optionally, the current configuration information includes status data or configuration data. Determining whether to update the current configuration information based on the current configuration information and the expected information includes: determining whether the current configuration information contains status data, wherein the status data is used to characterize the configuration status of the information configuration operation performed by the target service; if the current configuration information contains status data, determining whether to update the current configuration information based on the status data; if the current configuration information contains configuration data, comparing the configuration data with the expected information; if the configuration data and the expected information are the same, determining that no update of the current configuration information is needed; if the configuration data and the expected information are different, determining that an update of the current configuration information is needed.
[0009] Optionally, determining whether to update the current configuration information based on the status data includes: if the status data is in an abnormal state, determining that the current configuration information needs to be updated; if the status data is in an update state, determining that the current configuration information does not need to be updated; if the status data is in a normal state, storing the configuration data sent by the target business process and replacing the status data with the configuration data.
[0010] Optionally, when the status data is in an abnormal state, the method further includes: obtaining the target number of consecutive abnormal states of the status data, and determining whether the target number is greater than a preset number; if the target number is greater than the preset number, determining that the target business process is abnormal, and sending a prompt message to the operation and maintenance terminal, wherein the prompt message is used to characterize the abnormality of the target business process; if the target number is less than or equal to the preset number, determining that the current configuration information needs to be updated.
[0011] Optionally, after the target business process performs configuration deployment operations based on the target configuration information, the method further includes: receiving configuration data sent by the target business process and determining whether the configuration data is the same as the expected information stored in the state machine; if the configuration data is the same as the expected information, determining that the target business process has completed the configuration data update operation and running the target business process; if the configuration data is different from the expected information, issuing target configuration information to the target business process through the configuration management module.
[0012] Optionally, storing the target configuration information as expected information in the local memory of the state machine includes: determining whether the local memory contains historical expected information; if the local memory does not contain historical expected information, determining the target configuration information as expected information and storing it in the local memory; if the local memory contains historical expected information, determining whether the historical expected information is the same as the target configuration information; if the historical expected information is the same as the target configuration information, keeping the historical expected information unchanged; if the historical expected information is different from the target configuration information, replacing the historical expected information in the local memory with the target configuration information.
[0013] Optionally, when the status data is in an updated state, the method further includes: recording the duration of the status data being in an updated state, and determining whether the duration is greater than a preset duration; if the duration is greater than the preset duration, determining that the status data is in an abnormal state.
[0014] According to another aspect of this application, a configuration deployment apparatus is provided. The apparatus includes: a first receiving unit, configured to receive target configuration information sent by a configuration management module, and store the target configuration information as expected information in the local memory of a state machine, wherein the configuration management module receives the target configuration information sent by a controller; a first obtaining unit, configured to obtain the current configuration information of a target service process from the local memory, and determine whether the current configuration information needs to be updated based on the current configuration information and the expected information; and a first distributing unit, configured to distribute the target configuration information to the target service process through the configuration management module when the current configuration information needs to be updated, wherein the target service process performs configuration deployment operations based on the target configuration information.
[0015] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements a configuration deployment method provided in the foregoing embodiments of the present application.
[0016] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein the computer-readable instructions, when executed, perform a configuration deployment method provided in the foregoing embodiments.
[0017] This application employs the following steps: receiving target configuration information sent by the configuration management module and storing the target configuration information as expected information in the local memory of the state machine; the configuration management module receives the target configuration information sent by the controller; obtains the current configuration information of the target business process from the local memory, and determines whether the current configuration information needs to be updated based on the current configuration information and the expected information; if the current configuration information needs to be updated, the configuration management module issues the target configuration information to the target business process, whereby the target business process performs configuration deployment operations based on the target configuration information. This solves the problem of low timeliness and efficiency in deploying configurations to heterogeneous processes in nodes in related technologies. By storing the target configuration information as expected information, when configuring the target business process, the need for configuration operations can be determined by comparing the expected information with the current configuration information, thereby reducing the configuration frequency. Furthermore, by setting up state machines, each state machine manages one target business process, thus improving the timeliness of configuration deployment operations, thereby achieving the technical effect of improving the timeliness and efficiency of configuration deployment to processes. Attached Figure Description
[0018] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a framework diagram of the configuration and deployment system provided according to the embodiments of this application;
[0020] Figure 2 This is a flowchart of the configuration and deployment method provided according to the embodiments of this application;
[0021] Figure 3 This is a flowchart of an optional configuration and deployment method provided according to an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of a configuration and deployment apparatus provided according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0024] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] It should be noted that the configuration and deployment methods, apparatuses, and electronic devices defined in this disclosure can be used in the computer field, or in any field other than the computer field, and the application fields of the configuration and deployment methods, apparatuses, and electronic devices defined in this disclosure are not limited.
[0028] It should be noted that all information, 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, and displayed data) used in this application are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with the relevant regulations and standards of the relevant regions, have taken necessary measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse use. If the user chooses to refuse, the process proceeds to the expert decision-making process. For example, this system has interfaces with relevant users or institutions. Before obtaining relevant information, a request to obtain the information needs to be sent to the aforementioned user or institution through the interface, and the relevant information is obtained only after receiving consent from the aforementioned user or institution.
[0029] The embodiments or examples disclosed herein are not exhaustive, but merely illustrative of some embodiments or examples, and are not intended to limit the scope of protection of this disclosure. Unless otherwise specified, each step in a particular embodiment or example can be implemented as an independent embodiment, and the steps can be arbitrarily combined. For example, a solution after removing some steps in a particular embodiment or example can also be implemented as an independent embodiment, and the order of the steps in a particular embodiment or example can be arbitrarily interchanged. Furthermore, optional methods or examples in a particular embodiment or example can be arbitrarily combined; moreover, embodiments or examples can be arbitrarily combined. For example, some or all steps of different embodiments or examples can be arbitrarily combined, and a particular embodiment or example can be arbitrarily combined with optional methods or examples of other embodiments or examples.
[0030] According to embodiments of this application, a configuration deployment system is provided for executing the above-described configuration deployment method. Figure 1 This is a framework diagram of the configuration and deployment system provided according to the embodiments of this application, such as... Figure 1 As shown, the system includes:
[0031] The control center is used to receive configuration information sent by users and, based on the deployment requirements of the configuration information (such as deployment to a process in node 1), send the configuration information to the nodes that need to deploy the configuration information.
[0032] A node, comprising a configuration management module and multiple heterogeneous service processes, is an independent computing unit within a network. It can be a physical server, a virtual machine, a container, or any entity capable of performing computational tasks and storing data. Nodes communicate with other nodes in the system via the network to collaboratively complete the tasks of the distributed system.
[0033] The configuration management module in the node includes multiple state machines, each corresponding to a heterogeneous service process. These state machines communicate with the control center to receive configuration information from the control center and store this information in their respective state machines. Each state machine then retrieves the current configuration information from its corresponding heterogeneous service process and checks if it matches the information from the control center. If they match, no configuration deployment operation is needed for the heterogeneous service process. If they differ, the current configuration information in the heterogeneous service process needs to be updated, requiring a configuration deployment operation. By comparing the configuration information, the accuracy of the configuration information in the heterogeneous service processes is ensured. Furthermore, each heterogeneous service process is managed by its corresponding state machine, guaranteeing timely updates of the configuration information.
[0034] According to an embodiment of this application, a configuration and deployment method is provided, which is applied to a state machine.
[0035] Figure 2 This is a flowchart of the configuration and deployment method provided according to the embodiments of this application. For example... Figure 2 As shown, the method includes the following steps:
[0036] Step S201: Receive target configuration information sent by the configuration management module and store the target configuration information as expected information in the local memory of the state machine. The configuration management module receives the target configuration information sent by the controller.
[0037] For example, in this embodiment, the execution subject is the state machine corresponding to any business process, and the state machines corresponding to other business processes have the same application function as this state machine.
[0038] For example, when the configuration management module receives the target configuration information sent by the control center, it needs to distribute the target configuration information to the state machine corresponding to each business process. When the state machine receives the target configuration information, it needs to store the target configuration information as expected information in the local storage of the state machine, so as to update the configuration information in the process according to the expected information and complete the configuration deployment operation.
[0039] Step S202: Obtain the current configuration information of the target business process from local memory, and determine whether the current configuration information needs to be updated based on the current configuration information and the expected information.
[0040] For example, after the state machine stores the target configuration information, a configuration information comparison operation is required. At this time, it is necessary to obtain the current configuration information of the target business process corresponding to the state machine, and determine whether to update the current configuration information in the business process based on the comparison result of the current configuration information and the expected information, so as to ensure the accuracy of the update operation.
[0041] For example, by comparing the current configuration information with the expected information, the state machine can determine whether the state of the target business process matches the new configuration requirements issued by the control center. If the current configuration is inconsistent with the expected information, it means that the state of the business process needs to be adjusted to meet the new configuration requirements; if they are consistent, it indicates that there is no need to update the configuration immediately, thereby avoiding unnecessary resource consumption and interference with the business process. In scenarios where configuration changes are not frequent, the comparison and decision-making in step S102 can reduce unnecessary business process wake-ups and resource consumption. Especially for resource-sensitive business processes, when their state matches the expected information, there is no need for repeated calls, which helps to optimize resource utilization efficiency.
[0042] Step S203: When it is necessary to update the current configuration information, the target configuration information is sent to the target business process through the configuration management module, wherein the target business process performs configuration deployment operations based on the target configuration information.
[0043] For example, if the determination result indicates that the target business process needs to be configured and updated, then feedback needs to be provided through a state machine so that the configuration management module can asynchronously call the API of the target business process to send the expected information to the target business process. This allows the target business process to perform configuration deployment operations based on the target configuration information and complete the configuration information update operation in the target business process.
[0044] It should be noted that since each state machine corresponds to a target business process, the distribution of configuration information is asynchronous. This means that the target business process can choose an appropriate time to update its configuration based on its own resource status and execution environment. This avoids being forced to update the configuration when resources are scarce or when performing critical operations, which would affect business stability and performance. At the same time, the configuration management module will continuously maintain a comparison between the current configuration information and the expected information to ensure that the business process can eventually reach the expected state.
[0045] It should be noted that by sending target configuration information to the target business processes, the configuration management module ensures that even if some business processes fail to perform configuration updates, it can promptly detect the failure through status comparison and take remedial measures, such as resending the configuration information, thereby ensuring the consistency of configuration across all business processes on the entire node.
[0046] It should be noted that by comparing the current configuration information and the expected information in the state machines in the configuration management module, the system determines whether and to which target business processes it is necessary to send target configuration information. This greatly improves the flexibility and efficiency of configuration updates for target business processes. Especially when configuration changes are frequent but not all business processes need to respond in real time, this sending mechanism helps to reduce unnecessary resource consumption and processing delays.
[0047] The configuration deployment method provided in this application embodiment receives target configuration information sent by a configuration management module and stores the target configuration information as expected information in the local memory of a state machine. The configuration management module receives the target configuration information sent by the controller; retrieves the current configuration information of the target business process from the local memory; and determines whether the current configuration information needs to be updated based on the current configuration information and the expected information. If an update is needed, the configuration management module sends the target configuration information to the target business process, which then performs configuration deployment operations based on the target configuration information. This solves the problem of low timeliness and efficiency in deploying configurations to heterogeneous processes in nodes in related technologies. By storing the target configuration information as expected information, when configuring a target business process, the method compares the expected information with the current configuration information to determine whether configuration operations are needed, thereby reducing the configuration frequency. Furthermore, by setting up a state machine, each state machine manages one target business process, improving the timeliness of configuration deployment operations. This achieves the technical effect of improving the timeliness and efficiency of configuration deployment to processes.
[0048] Optionally, in the configuration deployment method provided in this application embodiment, the current configuration information includes status data or configuration data. Determining whether the current configuration information needs to be updated based on the current configuration information and expected information includes: determining whether the current configuration information contains status data, wherein the status data is used to characterize the configuration status of the information configuration operation performed by the target service; if the current configuration information contains status data, determining whether to update the current configuration information based on the status data; if the current configuration information contains configuration data, comparing the configuration data with the expected information; if the configuration data and the expected information are the same, determining that the current configuration information does not need to be updated; if the configuration data and the expected information are different, determining that the current configuration information needs to be updated.
[0049] It should be noted that the current configuration information may include status data or configuration data. That is, if the target business process has not completed the deployment of configuration information, since it is impossible to determine which configuration information the target business process is configuring at the current moment, the current configuration information will only store status data, such as whether the configuration information is being deployed or the deployment has failed.
[0050] It should be noted that, upon successful deployment, the current configuration information will change the current configuration information of the target business process, i.e., the configuration data. This allows us to determine whether deployment of the configuration information in the target business process is necessary by comparing the expected information with the configuration data, thus ensuring the accuracy of the configuration information deployed in the target business process.
[0051] For example, when determining whether to perform deployment operations on the configuration information in the target business process, it is necessary to first determine whether the current configuration information contains status data. If it contains status data, it is necessary to determine whether to perform deployment operations on the configuration information based on the status data.
[0052] For example, if the current configuration information contains configuration data, indicating that the configuration information has been successfully deployed to the target business process, it is necessary to determine whether the configuration data deployed in the current configuration information of the target business process is the same as the expected information. If they are the same, the representation does not need to update the configuration data in the current configuration information, and the deployment operation of the configuration information is completed. If they are different, the representation needs to update the configuration data in the current configuration information. In this case, a configuration deployment operation needs to be performed to change the current configuration information to the expected information, ensuring the accuracy of the configuration information in the target business process.
[0053] This embodiment compares configuration data with expected data to ensure that configuration update decisions are based on the analysis of the latest state data. Through intelligent comparison, it ensures that the configuration state of the business processes eventually matches the controller's expected information, thereby maintaining system state consistency. Furthermore, in heterogeneous systems, since different business processes may have different response times and resource requirements for configuration updates, comparing state data and configuration data enables coordination among the various business processes, ensuring that the configuration states of all processes eventually reach consistency. Moreover, in scenarios where multiple business processes execute configuration updates in parallel, it can coordinate the update operations of each process, avoiding resource contention and conflicts that may arise from simultaneous updates, and ensuring the smooth execution of the update operation.
[0054] Optionally, in the configuration deployment method provided in this application embodiment, determining whether to update the current configuration information based on the status data includes: if the status data is in an abnormal state, determining that the current configuration information needs to be updated; if the status data is in an updated state, determining that the current configuration information does not need to be updated; if the status data is in a normal state, storing the target business process sent to the configuration data and replacing the status data with the configuration data.
[0055] For example, if the status data is in an abnormal state, it indicates that the target business process encountered a problem when performing the configuration deployment operation, causing the deployment operation to fail and the configuration information deployment operation to be unable to be completed. At this time, the status machine will determine that the current configuration information of the target business process needs to be updated, that is, the configuration operation will be re-executed to try to correct the abnormal state and ensure that the configuration eventually reaches consistency.
[0056] For example, when the status data is in the updated state, it indicates that the target business process is performing a configuration deployment operation. At this time, since the configuration data of the configuration information currently being deployed by the target business process cannot be determined, there is no need to perform a deployment operation. This avoids the situation where the currently deployed configuration data is the same as the expected information, which would lead to duplicate deployment and thus reduce resource waste and possible conflicts.
[0057] For example, when the status data reflects that the target business process has successfully completed the configuration deployment operation, the target business process is in a normal state. At this time, the state machine stores the latest configuration data fed back by the target business process and uses this configuration data to update the status data, thereby replacing the status information stored in the state machine with the configuration data, thus ensuring that the state machine can track the configuration status of the business process in real time and provide accurate data for subsequent configuration update decisions.
[0058] This embodiment, by inspecting status data, enables the state machine to promptly detect failures in the execution of configuration requirements by the business process when the status data is abnormal. It then takes measures, such as resending configuration commands, to recover from the fault and ensure configuration consistency. Simultaneously, based on real-time feedback from the status data, the state machine can intelligently determine whether configuration information needs to be updated, avoiding unnecessary update operations, saving system resources, and reducing the interference of update operations on the business process.
[0059] Through the above process, the configuration management module can intelligently manage the configuration update process through a state machine, ensuring that business processes in heterogeneous systems can maintain eventual consistency of configuration even when encountering various situations, thereby improving the system's performance, stability, and efficiency.
[0060] Optionally, in the configuration deployment method provided in the embodiments of this application, when the status data is in an abnormal state, the method further includes: obtaining the target number of consecutive abnormal states of the status data, and determining whether the target number is greater than a preset number; if the target number is greater than the preset number, determining that the target business process is abnormal, and sending a prompt message to the operation and maintenance terminal, wherein the prompt message is used to characterize the abnormality of the target business process; if the target number is less than or equal to the preset number, determining that the current configuration information needs to be updated.
[0061] For example, each time the state machine receives status feedback from the target business process, it checks whether the status data indicates that the business process is in an abnormal state. Abnormal states may include, but are not limited to, situations where the business process fails to complete the task according to the controller's configuration requirements, encounters errors during execution, or remains unresponsive for an extended period. Whenever the status data indicates that the business process is in an abnormal state, the configuration management module increments a counter. This counter records the number of consecutive abnormal states, i.e., the target number.
[0062] For example, after each recorded target number of times, the state machine compares the target number with a preset number. The preset number takes into account factors such as network jitter, transient failures, and business process restart times to avoid prematurely judging a business process as abnormal due to temporary instability, thereby reducing erroneous operations. If the target number exceeds the preset number, it indicates that the target business process has experienced multiple consecutive anomalies during the deployment of configuration information. In this case, it can be determined that the target business process itself is abnormal, rather than the deployment operation itself. Therefore, a notification can be sent to the operations and maintenance team, allowing for timely maintenance of the target business process and ensuring the normal operation of services within the node to which the target business process belongs.
[0063] This embodiment filters out transient anomalies caused by factors such as network latency and momentary failures by comparing the target number of attempts with a preset threshold, avoiding unnecessary fault recovery or alarms. Furthermore, if the target number of attempts is less than or equal to the preset number, the system considers the business process potentially recoverable, such as due to temporary network unavailability or temporary processing delays. In this case, the state machine determines that the current configuration information needs to be updated, i.e., it attempts to send the latest configuration requirements to the business process again, giving the business process one or more opportunities to return to normal. This achieves dynamic self-healing of the system, improving its robustness and availability.
[0064] Meanwhile, by continuously detecting and counting abnormal states, resources can be managed more granularly. For example, within a preset number of attempts, the system will prioritize restoring business processes by redistributing configuration information, rather than immediately taking resource-intensive recovery measures such as restarting or redeploying. This reduces resource waste and also prevents potential continuous anomalies in the short term, allowing for a more robust fault recovery strategy.
[0065] In other words, by comparing the target number of attempts with the preset number of attempts, the configuration management module achieves intelligent detection and fault-tolerant self-healing of abnormal states in business processes. This mechanism not only ensures stable system operation but also improves resource utilization efficiency and plays a crucial role in maintaining eventual configuration consistency in heterogeneous systems. By setting a preset number of attempts, transient anomalies are distinguished from genuine faults, allowing for more appropriate response measures. This provides maintenance personnel with accurate fault information and automatically attempts recovery, reducing maintenance costs and improving overall system performance.
[0066] Optionally, in the configuration deployment method provided in this application embodiment, after the target business process performs configuration deployment operations according to the target configuration information, the method further includes: receiving configuration data sent by the target business process and determining whether the configuration data is the same as the expected information stored in the state machine; if the configuration data is the same as the expected information, determining that the target business process has completed the configuration data update operation and running the target business process; if the configuration data is different from the expected information, issuing target configuration information to the target business process through the configuration management module.
[0067] For example, when deploying configuration information for a target business process, the configuration information may not be deployed completely, or the expected information in the state machine may change. In this case, after completing the configuration information deployment operation for the target business process, it is still necessary to compare the configuration data of the target business process with the expected data. First, the state machine checks whether the configuration data of the target business process matches the expected information stored in the state machine. If the configuration data matches the expected information, it means that the target business process has been deployed according to the correct and latest configuration information. At this time, it can be determined that the configuration deployment operation is complete. At this time, the target business process can run normally and continue to execute subsequent tasks without needing to perform a configuration update operation.
[0068] For example, if the configuration data is inconsistent with the expected information, it means that the configuration state of the target service process has not yet met the controller's requirements. At this time, the state machine will send the target configuration information to the target service process again, causing the target service process to re-execute the configuration update operation until the configuration state is consistent with the expected information.
[0069] This embodiment achieves closed-loop control of configuration consistency by continuously comparing configuration data with expected information. Only when the configuration state matches the expected value will the business process be allowed to execute other tasks, ensuring that the business process is always in the specified correct configuration state.
[0070] Optionally, in the configuration deployment method provided in this application embodiment, storing the target configuration information as expected information in the local memory of the state machine includes: determining whether the local memory contains historical expected information; if the local memory does not contain historical expected information, determining the target configuration information as expected information and storing it in the local memory; if the local memory contains historical expected information, determining whether the historical expected information is the same as the target configuration information; if the historical expected information is the same as the target configuration information, keeping the historical expected information unchanged; if the historical expected information is different from the target configuration information, replacing the historical expected information in the local memory with the target configuration information.
[0071] For example, when storing expected information, the system first checks whether historical expected information, referring to configuration requirements previously received from the controller, is already stored in the state machine's local memory. If no historical expected information is present in local memory, meaning the state machine in the configuration management module is in the startup or initialization phase, the received target configuration information will be directly identified as new expected information and stored in local memory for subsequent state comparisons and configuration updates. Conversely, if historical expected information is already stored in local memory, the state machine will perform further comparison checks to avoid duplicate configuration expected information.
[0072] For example, if the historical expected information is the same as the received target configuration information, it means that the controller's requirements for the business process configuration have not changed, and the historical expected information stored in the state machine remains unchanged, avoiding unnecessary memory updates and saving system resources. If the historical expected information is different from the target configuration information, it indicates that the controller's configuration requirements for the business process have changed. The state machine needs to update the historical expected information in its local memory to the target configuration information to ensure that the expected information in the state machine is up-to-date, facilitating subsequent configuration updates and consistency checks.
[0073] This embodiment ensures that the expected information stored in the state machine always matches the latest requirements of the controller by checking the consistency between historical expected information and target configuration information, thus avoiding configuration errors caused by inconsistencies. Furthermore, when historical expected information and target configuration information are identical, it avoids repeated writes to local memory, saving system resources and improving the efficiency of configuration updates. Memory update operations are only performed when the expected information changes, ensuring the rational utilization of resources.
[0074] Optionally, in the configuration deployment method provided in the embodiments of this application, when the status data is in an updated state, the method further includes: recording the duration of the status data being in an updated state, and determining whether the duration is greater than a preset duration; if the duration is greater than the preset duration, determining that the status data is in an abnormal state.
[0075] For example, when the state machine receives status feedback from the business process and finds that the status data is an updated state (i.e., the business process is performing a configuration update operation), the state machine will start recording the duration of this state to obtain the duration. The recording of the duration starts from the moment the updated state is detected and continues until the business process completes the configuration update and returns to the final state.
[0076] For example, the state machine continuously monitors the duration of the update state and compares it with a preset duration. The preset duration is a threshold pre-set based on the processing performance and system resource availability of the business process, used to determine whether the configuration update operation exceeds the normal time range. If the duration exceeds the preset duration, it indicates that the business process encountered an anomaly while performing the configuration update, possibly due to insufficient resources, processing delays, or other faults. This allows for timely maintenance of the target business process, ensuring its normal operation. By recording and comparing the duration of the update state, the state machine can promptly detect potential anomalies in the configuration update operation, such as excessively long processing delays. This helps to quickly locate problems and prevent the business process from being in an unstable update state for extended periods, thus affecting the overall system performance.
[0077] In this embodiment, the state machine can effectively monitor and manage the timeliness of configuration update operations in heterogeneous systems. When a configuration update operation is detected to have exceeded a preset time, indicating that the business process may encounter an anomaly, the system can respond quickly, marking the state data as abnormal and triggering corresponding anomaly handling procedures, such as resending configuration, resource optimization, or fault alarms. This mechanism not only improves the system's anomaly detection and response speed but also enhances the intelligence of configuration management, helping to maintain eventual consistency in system configuration and improve system robustness.
[0078] Figure 3 This is a flowchart of an optional configuration and deployment method provided according to an embodiment of this application, such as... Figure 3 As shown, the state machine first obtains the target configuration information received by the configuration management module and compares the target configuration information with the current expected information of the target business process. If the current configuration information and the target configuration information are the same, the deployment operation of the configuration information is completed. If they are different, it is determined whether the target business process is in the operating (updating) state. If the target business process is in the operating state, it waits for the target business process to complete the update and obtains the current configuration information of the target business process.
[0079] If the current configuration information and the target configuration information are the same, complete the deployment of the configuration information. If the current configuration information and the target configuration information are different, deploy the target configuration information to the target business process.
[0080] If the target business process is in an abnormal state, the number of abnormal occurrences is obtained. If the number of occurrences exceeds the threshold, the target business process is determined to be abnormal. If the number of occurrences is less than or equal to the threshold, the target configuration information is deployed to the target business process.
[0081] In this embodiment, by maintaining a single-process configuration state machine, strong fault tolerance and low maintenance and retry costs are achieved. If a business process fails, it can be retried individually, without needing to re-operate on every business process. Maintaining the small loop of a single-process configuration state is relatively simple and offers the advantage of traceable state. This solves the problem of achieving eventual consistency of configuration states among multiple processes on heterogeneous system nodes in a distributed environment. Furthermore, by combining declarative configuration and a state machine, business processes within a node only need a few actions to achieve the final configuration requirements in scenarios with frequent configuration changes, thus reducing node resource consumption while maintaining configuration consistency with the controller.
[0082] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0083] This application also provides a configuration and deployment apparatus. It should be noted that the configuration and deployment apparatus of this application can be used to execute the configuration and deployment method provided in this application. The configuration and deployment apparatus provided in this application will be described below.
[0084] Figure 4 This is a schematic diagram of a configuration and deployment apparatus provided according to an embodiment of this application. For example... Figure 4 As shown, the device includes: a first receiving unit 41, a first acquiring unit 42, and a first sending unit 43.
[0085] The first receiving unit 41 is used to receive the target configuration information sent by the configuration management module and store the target configuration information as expected information in the local memory of the state machine. The configuration management module receives the target configuration information sent by the controller.
[0086] The first acquisition unit 42 is used to acquire the current configuration information of the target business process from local memory, and determine whether the current configuration information needs to be updated based on the current configuration information and the expected information.
[0087] The first distribution unit 43 is used to distribute target configuration information to the target business process through the configuration management module when it is necessary to update the current configuration information. The target business process performs configuration deployment operations based on the target configuration information.
[0088] The configuration deployment apparatus provided in this application embodiment receives target configuration information sent by a configuration management module through a first receiving unit 41, and stores the target configuration information as expected information in the local memory of a state machine. The configuration management module receives the target configuration information sent by a controller. A first obtaining unit 42 obtains the current configuration information of the target business process from the local memory and determines whether the current configuration information needs to be updated based on the current configuration information and the expected information. If the current configuration information needs to be updated, a first issuing unit 43 issues the target configuration information to the target business process through the configuration management module. The target business process performs configuration deployment operations based on the target configuration information. This solves the problem of low timeliness and efficiency in deploying configurations to heterogeneous processes in nodes in related technologies. By storing the target configuration information as expected information, when configuring a target business process, the need for configuration operations can be determined by comparing the expected information with the current configuration information, thereby reducing the configuration frequency. Furthermore, by setting up a state machine, each state machine manages one target business process, thereby improving the timeliness of configuration deployment operations and achieving the technical effect of improving the timeliness and efficiency of configuration deployment to processes.
[0089] Optionally, in the configuration deployment apparatus provided in this application embodiment, the current configuration information includes status data or configuration data. The first acquisition unit 42 includes: a first judgment module, used to judge whether the current configuration information contains status data, wherein the status data is used to characterize the configuration status of the information configuration operation performed by the target service; a second judgment module, used to judge whether to update the current configuration information based on the status data if the current configuration information contains status data; a comparison module, used to compare the configuration data with the expected information if the current configuration information contains configuration data; a first determination module, used to determine that no update of the current configuration information is needed if the configuration data and the expected information are the same; and a second determination module, used to determine that an update of the current configuration information is needed if the configuration data and the expected information are different.
[0090] Optionally, in the configuration deployment apparatus provided in this application embodiment, the second determination module includes: a first determination submodule, used to determine that the current configuration information needs to be updated when the status data is in an abnormal state; a second determination submodule, used to determine that the current configuration information does not need to be updated when the status data is in an updated state; and a replacement submodule, used to store the configuration data sent by the target business process and replace the status data with the configuration data when the status data is in a normal state.
[0091] Optionally, in the configuration deployment apparatus provided in this application embodiment, when the status data is in an abnormal state, the apparatus further includes: a second acquisition unit, used to acquire the target number of consecutive abnormal states of the status data, and determine whether the target number is greater than a preset number; a first determination unit, used to determine that the target business process is abnormal when the target number is greater than the preset number, and send a prompt message to the operation and maintenance terminal, wherein the prompt message is used to characterize the target business process as abnormal; and a second determination unit, used to determine that the current configuration information needs to be updated when the target number is less than or equal to the preset number.
[0092] Optionally, in the configuration deployment apparatus provided in this application embodiment, after the target service process performs configuration deployment operations according to the target configuration information, the apparatus further includes: a second receiving unit, used to receive configuration data sent by the target service process and determine whether the configuration data is the same as the expected information stored in the state machine; a third determining unit, used to determine that the target service process has completed the configuration data update operation and run the target service process when the configuration data is the same as the expected information; and a second sending unit, used to send the target configuration information to the target service process through the configuration management module when the configuration data is different from the expected information.
[0093] Optionally, in the configuration deployment apparatus provided in this application embodiment, the first receiving unit 41 includes: a third judging module, used to judge whether the local memory contains historical expected information; a third determining module, used to determine the target configuration information as expected information and store it in the local memory when the local memory does not contain historical expected information; a fourth judging module, used to judge whether the historical expected information is the same as the target configuration information when the local memory contains historical expected information; a holding module, used to keep the historical expected information unchanged when the historical expected information is the same as the target configuration information; and a replacement module, used to replace the historical expected information in the local memory with the target configuration information when the historical expected information is different from the target configuration information.
[0094] Optionally, in the configuration deployment apparatus provided in the embodiments of this application, when the status data is in an updated state, the apparatus further includes: a judgment unit, used to record the duration of the status data being in an updated state, and to determine whether the duration is greater than a preset duration; and a fourth determination unit, used to determine that the status data is in an abnormal state when the duration is greater than the preset duration.
[0095] The above-mentioned configuration and deployment device includes a processor and a memory. The first receiving unit 41, the first acquiring unit 42, the first sending unit 43, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0096] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured; by adjusting kernel parameters, the timeliness and efficiency issues of deploying configurations to heterogeneous processes on nodes in related technologies can be addressed.
[0097] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0098] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements the configuration deployment method.
[0099] This invention provides a processor for running a program, wherein the program executes the configuration deployment method during runtime.
[0100] Figure 5 This is a schematic diagram of an electronic device provided according to an embodiment of this application, such as... Figure 5 As shown, this embodiment of the invention provides an electronic device 50, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the configuration and deployment method described above. The device in this document can be a server, PC, PAD, mobile phone, etc.
[0101] This application also provides a computer program product that, when executed on a data processing device, is adapted to perform the steps of initializing the configuration deployment method described above.
[0102] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0103] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0104] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0105] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0106] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0107] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0108] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0109] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0110] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A configuration and deployment method, characterized in that, Applied to state machines, including: The configuration management module receives target configuration information sent by the configuration management module and stores the target configuration information as expected information in the local memory of the state machine. Obtain the current configuration information of the target business process from the local memory, and determine whether the current configuration information needs to be updated based on the current configuration information and the expected information; When it is necessary to update the current configuration information, the configuration management module sends the target configuration information to the target business process, wherein the target business process performs configuration deployment operations based on the target configuration information.
2. The method according to claim 1, characterized in that, The current configuration information includes status data or configuration data. Determining whether the current configuration information needs to be updated based on the current configuration information and the expected information includes: Determine whether the current configuration information contains the status data, wherein the status data is used to characterize the configuration status of the information configuration operation performed by the target service; If the current configuration information contains the status data, determine whether to update the current configuration information based on the status data; If the current configuration information includes the configuration data, the configuration data is compared with the desired information; If the configuration data is the same as the expected information, it is determined that there is no need to update the current configuration information; If the configuration data is different from the expected information, it is determined that the current configuration information needs to be updated.
3. The method according to claim 2, characterized in that, Determining whether to update the current configuration information based on the status data includes: If the status data is in an abnormal state, it is determined that the current configuration information needs to be updated; If the status data is in an update state, it is determined that the current configuration information does not need to be updated; If the status data is in a normal state, the target service process is stored in the configuration data, and the status data is replaced with the configuration data.
4. The method according to claim 3, characterized in that, If the status data is in an abnormal state, the method further includes: Obtain the target number of consecutive abnormal states in the status data, and determine whether the target number is greater than a preset number; If the target number of times exceeds the preset number of times, the target business process is determined to be abnormal, and a prompt message is sent to the operation and maintenance terminal, wherein the prompt message is used to indicate that the target business process is abnormal; If the target number is less than or equal to the preset number, it is determined that the current configuration information needs to be updated.
5. The method according to claim 1, characterized in that, After the target service process performs configuration and deployment operations based on the target configuration information, the method further includes: Receive configuration data sent by the target service process and determine whether the configuration data is the same as the expected information stored in the state machine; If the configuration data is the same as the expected information, determine that the target service process has completed the configuration data update operation and run the target service process; If the configuration data is different from the expected information, the target configuration information is sent to the target business process through the configuration management module.
6. The method according to claim 1, characterized in that, Storing the target configuration information as expected information in the local memory of the state machine includes: Determine whether the local memory contains historical expectation information; If the historical expected information is not contained in the local memory, the target configuration information is determined as the expected information and stored in the local memory; If the historical expectation information is contained in the local memory, determine whether the historical expectation information is the same as the target configuration information; If the historical expected information is the same as the target configuration information, the historical expected information remains unchanged; If the historical expected information is different from the target configuration information, the historical expected information in the local memory is replaced with the target configuration information.
7. The method according to claim 3, characterized in that, If the status data is in an updated state, the method further includes: Record the duration of the updated state data and determine whether the duration is greater than a preset duration; If the duration exceeds the preset duration, the status data is determined to be in an abnormal state.
8. A configuration and deployment device, characterized in that, include: The first receiving unit is used to receive target configuration information sent by the configuration management module, and store the target configuration information as expected information in the local memory of the state machine, wherein the configuration management module receives the target configuration information sent by the controller; The first acquisition unit is used to acquire the current configuration information of the target business process from the local memory, and determine whether the current configuration information needs to be updated based on the current configuration information and the expected information. The first distribution unit is used to distribute the target configuration information to the target business process through the configuration management module when it is necessary to update the current configuration information, wherein the target business process performs configuration deployment operations based on the target configuration information.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium resides to perform the configuration deployment method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the configuration deployment method according to any one of claims 1 to 7.
