Stateful task execution system and method
By introducing a stateful task execution system into the cloud environment, the problems of low flexibility in stateless pod names and high manual costs are solved. This achieves efficient and flexible use of resources and stable task execution, reduces manual intervention, and adapts to the dynamic changes in the cloud environment.
Patent Information
- Application Number
- CN202511048693.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-14
AI Technical Summary
In existing technologies, stateless pod names have low flexibility and high manual costs, leading to uneven resource allocation and unstable task execution. In particular, manual reconfiguration is required when the cluster changes in a cloud environment.
A stateful task execution system is provided, including a cloud environment startup preprocessing module, a task execution inspection module, a task execution module, and a pod status query module. By detecting and updating the name status of stateless pods, allocating and updating task status according to task execution strategies, and periodically querying pod status, the system achieves automated and flexible task execution.
Without changing the existing system deployment model, improve resource utilization efficiency, reduce manpower input, ensure the flexibility and integrity of task execution, and avoid task failures caused by changes in business scenarios and cluster changes.
Smart Images

Figure CN120950179A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud-native technology, and in particular to a stateful task execution system and method. Background Technology
[0002] With the popularization of cloud environments and the deployment of a large number of production systems to the cloud to provide services, the labor costs of deployment and maintenance have been greatly reduced. At the same time, with the rapid growth of various business functions, more and more stateful tasks (hereinafter referred to as tasks) need to be executed.
[0003] Currently, pods deployed in cloud environments are mainly categorized into stateful and stateless pods, with stateless pods playing a dominant role. When using stateless pods, tasks are allocated to pods based on the policies configured in the load balancing component. However, because pods are unaware of the overall task status and cannot accurately know the execution status of other pods, tasks may not be evenly distributed across pods, leading to resource imbalance. Furthermore, if a pod or program is interrupted, forcing a task to be interrupted, the pod, after restarting, will be randomly assigned a name and will be unable to retrieve the task's status and execution information before the interruption. If pod names are not uniquely configured, task loss may occur. While stateful pods can be assigned a unique sequence number and have fixed hostnames and network identifiers, which can solve the randomness of stateless pods to some extent, the unique sequence number, fixed hostname, and network identifier of stateless pods cannot be obtained in advance before production deployment. Furthermore, once the pod cluster and DNS address change, the unique sequence number, fixed hostname, and network identifier will also change. At the same time, stateful pods are less flexible than stateless pods due to their fixed hostnames and other information.
[0004] Currently, when a task requires a fixed pod name in advance, the hostname of the pod is obtained beforehand, which is not very flexible. When the cluster changes, the hostname needs to be obtained again and manually configured. This requires deep integration of development and operations personnel, with a dedicated person configuring the pod name, which greatly increases the investment of human resources. Summary of the Invention
[0005] This invention provides a stateful task execution system and method to solve the problems of low flexibility in stateless pod names and high manual costs in the prior art.
[0006] According to one aspect of the present invention, a stateful task execution system is provided, the system comprising: a cloud environment startup preprocessing module, a task execution checking module, a task execution module, and a pod status query module; wherein,
[0007] The cloud environment startup preprocessing module is used to detect and update the name status of the stateless pods that are currently starting when the cloud environment starts.
[0008] The task execution checking module is used to assign stateful tasks to be executed to each stateless pod according to the task execution strategy corresponding to each stateless pod.
[0009] The task execution module is used to execute the stateful task to be executed according to the corresponding task execution strategy, and to update the task status of the stateful task to be executed.
[0010] The pod status query module is used to periodically query the status of stateless pods executing tasks, and to update or remove stateless pods that are in an invalid state.
[0011] According to another aspect of the present invention, a stateful task execution method is provided, the stateful task execution method being implemented using a stateful task execution system, the stateful task execution method comprising:
[0012] The cloud environment startup preprocessing module is used to detect and update the name status of the stateless pods that are currently starting when the cloud environment starts.
[0013] The task execution inspection module assigns stateful tasks to be executed to each stateless pod based on the task execution strategy corresponding to each stateless pod.
[0014] The task execution module executes the stateful task to be executed according to the corresponding task execution strategy, and updates the task status of the stateful task to be executed.
[0015] The pod status query module is used to periodically query the status of stateless pods executing tasks, and to update or remove stateless pods that are in an invalid state.
[0016] The technical solution of this invention includes a system comprising: a cloud environment startup preprocessing module, a task execution checking module, a task execution module, and a pod status query module. The cloud environment startup preprocessing module detects and updates the name status of stateless pods currently running when the cloud environment starts. The task execution checking module assigns stateful tasks to each stateless pod according to the corresponding task execution strategy. The task execution module executes the stateful tasks according to the corresponding task execution strategy and updates the task status of the stateful tasks. The pod status query module periodically queries the status of stateless pods executing tasks and updates or removes stateless pods that are in an invalid state. This solves the problems of low flexibility in stateless pod names and high manual costs in existing technologies. It achieves the beneficial effect of making system resource utilization more reasonable, task execution more efficient, flexible, and complete without changing the existing system deployment mode. It improves automation and flexibility while incorporating manual intervention strategies, greatly reducing manpower input and avoiding production environment task execution failures due to changes in business scenarios or cluster variations.
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the structure of a stateful task execution system according to Embodiment 1 of the present invention;
[0020] Figure 2 This is a schematic diagram of the structure of a cloud environment startup preprocessing module provided in Embodiment 2 of the present invention;
[0021] Figure 3 This is a schematic diagram of the structure of a task execution checking module according to Embodiment 2 of the present invention;
[0022] Figure 4 This is a schematic diagram of the structure of a task execution module according to Embodiment 2 of the present invention;
[0023] Figure 5 This is a schematic diagram of the structure of a pod status query module provided in Embodiment 2 of the present invention;
[0024] Figure 6 This is a schematic diagram of the structure of a task configuration module according to Embodiment 2 of the present invention;
[0025] Figure 7 This is a schematic diagram of the structure of a storage module according to Embodiment 2 of the present invention;
[0026] Figure 8 This is a schematic diagram of the cooperation relationship between various modules according to Embodiment 2 of the present invention;
[0027] Figure 9 This is a schematic diagram of a pod collection call relationship provided in Embodiment 2 of the present invention;
[0028] Figure 10 This is a flowchart illustrating a stateful task execution method according to Embodiment 3 of the present invention. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] The acquisition, storage, use, and processing of data in the technical solution of this application all comply with relevant laws and regulations. It should be noted that the terms "first," "second," "target," and "original," etc., in the specification, claims, and accompanying drawings of this invention 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 so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising," "etc.," and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes 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.
[0031] Example 1
[0032] Figure 1This is a schematic diagram of a stateful task execution system provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where stateless pods are used to execute stateful tasks, such as... Figure 1 As shown, the stateful task execution system provided in this embodiment of the invention includes a cloud environment startup preprocessing module 110, a task execution checking module 120, a task execution module 130, and a pod status query module 140; wherein,
[0033] The cloud environment startup preprocessing module 110 is used to detect and update the name status of the stateless pods that are currently started when the cloud environment starts.
[0034] In Kubernetes (K8s), a pod is the basic unit of resource scheduling and management. A pod is a lightweight resource container that contains one or more containers, along with the infrastructure (such as networking and storage) provided for these containers. Pods are an important component of a K8s cluster, used to coordinate and manage multiple containers to achieve efficient resource utilization and automated service management.
[0035] Stateless pods do not store persistent data locally. Multiple service instances respond identically to the same user request, and there are no dependencies between these service instances, as in web applications. In a Kubernetes controller, dynamically starting and stopping a stateless pod does not affect other pods. The creation order of multiple pods within a stateless service is unpredictable. The names of multiple pods within a stateless service are randomly assigned. After a stateless pod is restarted and scheduled, its name and IP address will change. Multiple pods within a stateless service share common storage.
[0036] Stateful pods require persistent local storage for data, typically in distributed database applications where distributed node instances have dependent topologies, such as master-slave relationships. If any stateful pod in a Kubernetes distributed cluster stops, it could lead to data loss or cluster crashes. In the Kubernetes controller, each stateful pod is assigned a unique sequence number; pod startup, updates, and destruction occur sequentially, providing stable network identification; the hostname and DNS address of a stateful pod do not change when the pod is rescheduled; and it has stable persistent storage, ensuring that even after a stateful pod is rescheduled, it can still mount its original page views (PVs), thus guaranteeing data integrity and consistency.
[0037] Since the name and IP address of a stateless pod change after it is restarted and scheduled, this embodiment of the invention uses a cloud environment startup preprocessing module to detect and update the name status of the currently started stateless pods during cloud environment startup. Detecting the name status of stateless pods refers to determining whether the name of the stateless pod was still in use before startup or whether the name of the stateless pod was still associated with an unfinished stateful task. By detecting the name status of the stateless pods, unique names are set for each stateless pod, and the name status is updated, thus solving the problem in the prior art where the name of a stateless pod changes after a restart.
[0038] The task execution inspection module 120 is used to assign stateful tasks to be executed to each stateless pod according to the task execution strategy corresponding to each stateless pod.
[0039] The stateful task refers to a specific execution function implemented to achieve a certain scenario or business in the system. During execution, the task status of the function needs to be recorded to mark the execution status. When an exception occurs and re-execution is required, the function can be processed according to the task status. Processing the function includes, but is not limited to, online and batch processing functions. The task status includes, but is not limited to, waiting, executing, exception, and execution completed states.
[0040] The task execution strategy can refer to the task execution strategy corresponding to the stateless pod, and the task execution strategy includes, but is not limited to, polling, single execution, and random execution strategies. The polling execution strategy can refer to the stateless pod executing the stateful tasks to be executed sequentially; the single execution strategy can refer to the stateless pod executing the corresponding type of stateful task to be executed, with the task type corresponding to the name of the stateless pod; the random execution strategy can refer to the stateless pod randomly processing the stateful tasks to be executed.
[0041] The task execution check module is used to assign corresponding stateful tasks to be executed for the stateless pod according to the corresponding task execution strategy.
[0042] The task execution module 130 is used to execute the stateful task to be executed according to the corresponding task execution strategy, and to update the task status of the stateful task to be executed.
[0043] The task execution module is used to execute stateful tasks assigned according to the task execution strategy and to update the task status of the stateful tasks. The task status includes, but is not limited to, completed, incomplete, and in progress; "in progress" may mean that the stateful task has been assigned to the corresponding stateless pod.
[0044] The pod status query module 140 is used to periodically query the status of stateless pods executing tasks, and update or remove stateless pods that are in an invalid state.
[0045] Specifically, after the stateless pod completes the execution of the stateful task to be executed, the state of the stateless pod needs to be queried periodically in order to update or remove any stateless pods that are in an invalid state.
[0046] This invention provides a stateful task execution system, comprising a cloud environment startup preprocessing module, a task execution checking module, a task execution module, and a pod status query module. The cloud environment startup preprocessing module detects and updates the name status of stateless pods currently running when the cloud environment starts. The task execution checking module allocates stateful tasks to each stateless pod according to its corresponding task execution strategy. The task execution module executes the stateful tasks according to the corresponding task execution strategy and updates their task status. The pod status query module periodically queries the status of stateless pods executing tasks and updates or removes stateless pods that are in an invalid state. Using the technical solution of this invention, when stateless pods execute stateful tasks in the cloud, the system provides functions such as pod startup pre-detection and allocation, status update and polling monitoring, pod failure handling mechanism, dynamic pod allocation, and configuration of task execution strategies. Without changing the existing system deployment mode, the system can make more rational use of resources, more efficient, flexible and complete task execution, improve automation and flexibility while also having a human intervention strategy, greatly reduce human input and avoid production environment task execution failure due to changes in business scenarios and cluster changes.
[0047] Example 2
[0048] The embodiments of the present invention further optimize the aforementioned embodiments, and can be combined with various optional solutions in one or more of the above embodiments. The stateful task execution system provided in the embodiments of the present invention further includes:
[0049] Optionally, the cloud environment startup preprocessing module is specifically used in steps A1-A2:
[0050] Step A1: When starting up the cloud environment, check the name status of the stateless pod that is currently running.
[0051] Step A2: Obtain available pod names within a certain time period through a polling mechanism, configure the names of the stateless pods started at the current time with the available pod names, and update the name status of the stateless pods.
[0052] Among them, see Figure 2 The cloud environment startup preprocessing module is responsible for detecting and allocating program startup tasks. After the program starts, this module checks the stateless pod name status based on the query service provided by the storage module; it obtains available stateless pod names within a certain period of time through a polling mechanism and sets them as the unique names of the currently started stateless pods, while updating the stateless pod name status.
[0053] Among them, the stateless pod started at the current moment may have been interrupted at the previous moment. It is necessary to determine whether the stateless pod name used at the previous moment is still in use. If it has expired, the stateless pod can be reused. If it has not expired, a new name needs to be configured for the stateless pod started at the current moment.
[0054] In this embodiment of the invention, when the cluster performs pod startup and scaling, it is not necessary to obtain a fixed stateless pod name in advance. The stateless pod name is automatically set through a detection and allocation mechanism, which has high flexibility and maximizes compatibility with the cluster's operating environment and configuration modifications.
[0055] Optionally, the task execution check module is specifically used in steps B1-B3:
[0056] Step B1: Identify unassigned stateful tasks to be executed; wherein, the stateful tasks to be executed refer to tasks whose corresponding states need to be recorded during task execution.
[0057] Step B2: Determine the task execution strategy corresponding to the stateless pod, and assign the corresponding stateful task to be executed to the stateless pod according to the task execution strategy.
[0058] Step B3: Update the task status of the assigned stateful tasks to be executed, and update the name status of the stateless pods.
[0059] Among them, see Figure 3The task execution inspection module is responsible for assigning stateful tasks to each stateless pod according to the allocated task execution strategy. Based on the polling, single, or random task execution strategy configured for the stateless pod, when a stateless pod completes its task, it updates the task status and simultaneously updates the execution status corresponding to the name of the stateless pod to which it belongs.
[0060] Optionally, the task execution check module is also specifically used in steps C1-C2:
[0061] Step C1: After the stateless pod starts and obtains its name, perform a task query on the started stateless pod to determine whether there were any unfinished stateful tasks before the stateless pod started. There is a correlation between the stateful tasks and the name of the stateless pod. The name of the stateless pod is used to determine whether there were any unfinished stateful tasks before the stateless pod started.
[0062] Step C2: If there are any unfinished stateful tasks before the stateless pod starts, then retrieve the unfinished stateful tasks and continue execution.
[0063] Specifically, after a stateless pod starts and obtains its name, it performs a task query on the started stateless pod to determine if there were any unfinished stateful tasks before the stateless pod started. If there were any unfinished stateful tasks before the stateless pod started, the stateful tasks that were previously assigned to that name and those that were in progress will be loaded and executed.
[0064] Optionally, the task execution module is specifically used in steps D1-D3:
[0065] Step D1: Detect the stateful tasks to be executed assigned to the stateless pod to determine whether the stateful tasks need to be executed.
[0066] Step D2: If the stateful task to be executed needs to be executed, the stateless pod is used to execute the stateful task to be executed, and the task status of the stateful task to be executed is updated.
[0067] Step D3: If the stateful task to be executed does not need to be executed, then a new stateful task to be executed is selected from the task pool according to the task execution strategy of the stateless pod, and the task status of the newly selected stateful task is updated.
[0068] Among them, see Figure 4The task execution module is responsible for performing specific task functions. Based on the configured task identifier, the stateless pod executes the stateful task to be executed and updates the task status of the stateful task. The task status switches sequentially between three states: pending execution, executing, and execution completed. If required, additional functional status identifiers besides the above three states can be set.
[0069] The task execution module has task pool management and scheduling management functions. If the stateful task to be executed does not need to be executed, the stateful task to be executed is reselected from the task pool according to the task execution strategy of the stateless pod, and the task status of the reselected stateful task to be executed is updated.
[0070] Optionally, the pod status query module is also specifically used in steps E1-E2:
[0071] Step E1: When a stateless pod is dynamically scaled up, idle stateless pods are dynamically allocated according to the corresponding task execution strategy.
[0072] Step E2: If there is no free stateless pod, create a new stateless pod to execute the corresponding stateful task.
[0073] Among them, see Figure 5 The pod status query module is responsible for periodically checking stateless pods executing tasks, and promptly updating or removing invalid stateless pods. When stateless pods are dynamically expanded, the pod status check module will periodically check the status of all current stateless pods. If there are available pods, the expanded stateless pods will be allocated; if there are no available pods, new stateless pod names will be created and the corresponding information will be configured to execute the corresponding stateful tasks.
[0074] Optionally, the pod status query module is also specifically used in steps F1-F2:
[0075] Step F1: When a stateless pod is dynamically scaled down, periodically check the name status of all stateless pods.
[0076] Step F2: Set the name status of the invalidated stateless pod to invalid in a timely manner, and update the stateful task to be executed or the stateful task to be executed corresponding to the stateless pod to managed status.
[0077] When a stateless pod is dynamically scaled down, the pod status query module will periodically check the name status of all stateless pods and promptly set them to invalid, and update the stateful tasks to be executed and in execution under its responsibility to managed status.
[0078] Optionally, the system further includes a task configuration module, specifically used for:
[0079] Adaptive manual management and configuration are performed for the task status, task execution strategy, name status, and execution method of each stateful task to be executed, as well as the stateless pod name status and execution method.
[0080] Among them, see Figure 6 The task configuration module is responsible for adaptive manual management and configuration of the task status, task execution strategy, name status, and execution method of each stateful task to be executed, as well as stateless pods. When the model is first built or when the strategy needs to be adjusted, additions or modifications can be made through the task configuration module.
[0081] The embodiments of the present invention support manual management through manual configuration, which combines automation and flexibility with manual intervention strategies, reduces the number of times stateless pod names are manually configured, decouples people from operations and maintenance, and greatly reduces the input of human resources costs.
[0082] Optionally, the system further includes a storage module, specifically used for:
[0083] The system stores first information related to stateless pods and second information related to stateful tasks; wherein the first information includes the name prefix of the stateless pod, the naming rules of the stateless pod, and the management information when the stateless pod fails; the second information includes task identification information and task execution strategy.
[0084] Among them, see Figure 7 The storage module is responsible for storing and querying naming-related information and task information of stateless pods, including the name prefix of stateless pods, naming rules of stateless pods, management information when stateless pods fail, task identification information, and task execution strategies.
[0085] Among them, see Figure 8 The system includes a task configuration module, a storage module, a cloud environment startup preprocessing module, a task execution check module, a task execution module, and a pod status query module. Each module cooperates with the others to complete the execution of a certain task, but does not participate in the internal execution logic of the specific task. Figure 8 The document describes the execution order between various modules. Each module also has its own execution logic and functions. Stateless pods deployed in cloud systems typically provide services to the outside world through a set of stateless pods. Each stateless pod introduces various modules through component import, enabling each stateless pod to reuse the five major modules and data. The pod collection call relationship is described in [reference needed]. Figure 9 .
[0086] This invention provides a stateful task execution system. Addressing the scenario where, with the increasing deployment of growing systems to the cloud, more and more production systems are operating in virtual environments with dynamic and changing conditions, and the execution of specific or batch stateful tasks cannot be evenly distributed, easily leading to resource waste, the system achieves the fixation of the cloud virtual operating environment and configures the task execution type and method based on the fixed operating service. This solves the pain points of cloud environments caused by virtualization, such as random task execution on cloud servers, uneven task distribution, lack of configurability, and resource waste.
[0087] Example 3
[0088] Figure 10 This is a flowchart of a stateful task execution method provided in an embodiment of the present invention. This embodiment is applicable to situations where stateless pods are used to execute stateful tasks. This method can be executed by the stateful task execution system provided in any embodiment of the present invention. Figure 10 As shown, the stateful task execution method provided in this embodiment of the invention specifically includes the following steps:
[0089] S1010: The cloud environment startup preprocessing module detects and updates the name and status of the stateless pods that are currently starting when the cloud environment starts.
[0090] S1020. The task execution inspection module assigns stateful tasks to be executed to each stateless pod based on the task execution strategy corresponding to each stateless pod.
[0091] S1030. The task execution module executes the stateful task to be executed according to the corresponding task execution strategy, and updates the task status of the stateful task to be executed.
[0092] S1040. Use the pod status query module to periodically query the status of stateless pods executing tasks, and update or remove stateless pods that are in an invalid state.
[0093] The data transmission method provided in the embodiments of the present invention can be applied to the data transmission system provided in any of the above embodiments of the present invention, and has the corresponding functions and beneficial effects of the data transmission system. For technical details not described in detail in the above embodiments, please refer to the data transmission system provided in any of the embodiments of this application.
[0094] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0095] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A stateful task execution system, characterized in that, The system includes: a cloud environment startup preprocessing module, a task execution check module, a task execution module, and a pod status query module; wherein, The cloud environment startup preprocessing module is used to detect and update the name status of the stateless pods that are currently starting when the cloud environment starts. The task execution checking module is used to assign stateful tasks to be executed to each stateless pod according to the task execution strategy corresponding to each stateless pod. The task execution module is used to execute the stateful task to be executed according to the corresponding task execution strategy, and to update the task status of the stateful task to be executed. The pod status query module is used to periodically query the status of stateless pods executing tasks, and to update or remove stateless pods that are in an invalid state.
2. The system according to claim 1, characterized in that, The cloud environment startup preprocessing module is specifically used for: When starting up in the cloud environment, check the name status of the stateless pods that are currently starting. The system obtains available pod names within a certain time period through a polling mechanism, configures the names of stateless pods started at the current time with the available pod names, and updates the name status of the stateless pods.
3. The system according to claim 1, characterized in that, The task execution check module is specifically used for: Identify unassigned stateful tasks to be executed; wherein, the stateful tasks to be executed refer to tasks whose corresponding states need to be recorded during task execution. Determine the task execution strategy corresponding to the stateless pod, and allocate corresponding stateful tasks to be executed to the stateless pod according to the task execution strategy; Update the task status of the assigned stateful tasks to be executed, and update the name status of the stateless pods.
4. The system according to claim 1, characterized in that, The task execution check module is also specifically used for: After the stateless pod starts and obtains its name, a task query is performed on the started stateless pod to determine whether there were any unfinished stateful tasks before the stateless pod started. There is a correlation between the stateful tasks and the name of the stateless pod, and the existence of any unfinished stateful tasks before the stateless pod started is determined by the name of the stateless pod. If there are any unfinished stateful tasks before the stateless pod starts, then those unfinished stateful tasks will be retrieved and executed.
5. The system according to claim 1, characterized in that, The task execution module is specifically used for: The stateless pod is assigned a stateful task to be executed, and it is determined whether the stateful task needs to be executed. If the stateful task to be executed needs to be executed, the stateless pod is used to execute the stateful task to be executed and the task status of the stateful task to be executed is updated. If the stateful task to be executed does not need to be executed, then a new stateful task to be executed is selected from the task pool according to the task execution strategy of the stateless pod, and the task status of the newly selected stateful task is updated.
6. The system according to claim 1, characterized in that, The pod status query module is also specifically used for: When stateless pods are dynamically scaled up, idle stateless pods are dynamically allocated according to the corresponding task execution strategy. If there are no available stateless pods, create a new stateless pod to execute the corresponding stateful task.
7. The system according to claim 1, characterized in that, The pod status query module is also specifically used for: When a stateless pod is dynamically scaled down, periodically check the name status of all stateless pods. The name status of the stateless pod that has expired should be set to expire in a timely manner, and the stateful tasks to be executed or the stateful tasks in execution corresponding to the stateless pod should be updated to managed status.
8. The system according to claim 1, characterized in that, The system also includes a task configuration module, specifically used for: Adaptive manual management and configuration are performed for the task status, task execution strategy, name status, and execution method of each stateful task to be executed, as well as the stateless pod name status and execution method.
9. The system according to claim 1, characterized in that, The system also includes a storage module, specifically used for: The system stores first information related to stateless pods and second information related to stateful tasks; wherein the first information includes the name prefix of the stateless pod, the naming rules of the stateless pod, and the management information when the stateless pod fails; the second information includes task identification information and task execution strategy.
10. A stateful task execution method, characterized in that, The stateful task execution method is implemented using a stateful task execution system, and the stateful task execution method includes: The cloud environment startup preprocessing module is used to detect and update the name status of the stateless pods that are currently starting when the cloud environment starts. The task execution inspection module assigns stateful tasks to be executed to each stateless pod based on the task execution strategy corresponding to each stateless pod. The task execution module executes the stateful task to be executed according to the corresponding task execution strategy, and updates the task status of the stateful task to be executed. The pod status query module is used to periodically query the status of stateless pods executing tasks, and to update or remove stateless pods that are in an invalid state.