Cluster application processing method and apparatus, and electronic device

By acquiring configuration information and evaluation metrics data of cluster applications, the system automatically creates task lists and executes them using multi-threading, thus solving the problem of cluster application tasks relying on human experience and improving execution efficiency and success rate.

CN114579266BActive Publication Date: 2026-04-21CHINA MOBILE GRP HENAN CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE GRP HENAN CO LTD
Filing Date
2020-12-02
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing technologies, tasks such as restarting or canary deployment of cluster applications rely on the experience of the personnel performing the tasks, which makes it impossible to guarantee execution efficiency and success rate, thus affecting normal operation.

Method used

By obtaining the configuration information of the cluster application, the target task execution strategy is determined, the evaluation index data is monitored, a task list is created, and the target task is executed automatically in a multi-threaded manner, reducing manual intervention.

Benefits of technology

It improves the efficiency and success rate of cluster application task execution, and realizes automated orchestration and execution without relying on the experience of the execution personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579266B_ABST
    Figure CN114579266B_ABST
Patent Text Reader

Abstract

This application discloses a cluster application processing method, apparatus, and electronic device to improve the efficiency and success rate of executing related tasks on cluster applications. The method includes: obtaining configuration information of the cluster application targeted by a target task, the target task being used for canary deployment or restarting of the cluster application; determining a target task execution strategy matching the cluster application based on the configuration information of the cluster application; monitoring the indicator data of the cluster application for the evaluation metrics corresponding to the target task; creating a task list based on the indicator data of the cluster application and application instance information corresponding to the cluster application, the task list including application instances to be processed corresponding to the cluster application; and executing the target task on the cluster application through multi-threading based on the target task execution strategy and the task list.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a cluster application processing method, apparatus and electronic device. Background Technology

[0002] During the operation of an application system, in scenarios such as creating a new cluster application, system updates, system cutovers, and fault recovery, it is often necessary to perform tasks such as restarting the cluster application or canary deployment.

[0003] In related technologies, when performing the above tasks on cluster applications, the executor typically determines the application instances to be processed based on experience and manually compiles a corresponding task list based on the determined application instances. The application system then executes the above tasks on the cluster application according to this task list. Because this method requires the participation of executors and depends on their experience, the execution efficiency and success rate of the above tasks cannot be guaranteed, affecting the normal operation of the cluster application. Summary of the Invention

[0004] This application provides a cluster application processing method, apparatus, and electronic device to improve the efficiency and success rate of performing related tasks on cluster applications.

[0005] To solve the above-mentioned technical problems, the embodiments of this application adopt the following technical solutions:

[0006] In a first aspect, embodiments of this application provide a cluster application processing method, including:

[0007] Obtain the configuration information of the cluster application targeted by the target task, wherein the target task is used to perform canary deployment or restart of the cluster application;

[0008] Based on the configuration information of the cluster application, determine the target task execution strategy that matches the cluster application;

[0009] Monitor the indicator data of the cluster application corresponding to the evaluation indicators of the target task;

[0010] Based on the metric data of the cluster application and the application instance information corresponding to the cluster application, a task list is created, which includes the application instances to be processed corresponding to the cluster application.

[0011] Based on the target task execution strategy and the task list, the target task is executed on the cluster application through multiple threads.

[0012] Optionally, based on the target task execution strategy and the task list, the target task is executed on the cluster application using multiple threads, including:

[0013] Determine the time period for executing the target task on the cluster application;

[0014] Based on the time period, determine the number of threads required to execute the target task;

[0015] Allocate corresponding threads to the cluster application based on the number of threads;

[0016] The allocated thread is invoked to execute the target task on the application instance to be processed corresponding to the cluster application.

[0017] Optionally, the application instance information includes the running status of the host where the application instance is located;

[0018] Based on the metric data of the cluster application and the application instance information corresponding to the cluster application, a task list is created, including:

[0019] When the indicator data of the cluster application meets the set target task execution conditions, search for the host whose running status meets the set status conditions from all hosts corresponding to the cluster application.

[0020] The application instances deployed on the found hosts are identified as the application instances to be processed corresponding to the cluster application.

[0021] The task list is created based on the application instance to be processed corresponding to the cluster application.

[0022] Optionally, before creating the task list based on the application instance to be processed corresponding to the cluster application, the method further includes:

[0023] When there are multiple cluster applications, the processing order of each cluster application is determined based on the set priority of each cluster application.

[0024] A task list is created based on the processing order of each cluster application and the corresponding application instance to be processed;

[0025] Based on the target task execution strategy and the task list, the target task is executed on the cluster application through multi-threading, including:

[0026] Based on the target task execution strategy matched with each of the cluster applications, the target tasks are executed sequentially on the application instances to be processed corresponding to each of the cluster applications in the task list.

[0027] Optionally, after monitoring the metric data of the cluster application for the evaluation metrics corresponding to the target task, the method further includes:

[0028] When the metric data of the cluster application does not meet the set target task execution conditions, the application instance corresponding to the cluster application is added to the pre-established exception pool.

[0029] Optionally, after executing the target task on the cluster application using multiple threads based on the target task execution strategy and the task list, the method further includes:

[0030] Obtain the execution result of the target task corresponding to the cluster application;

[0031] Add the pending application instances that indicate execution failure in the target task execution results to a pre-established exception pool.

[0032] Optionally, after the target task has been completed, the method further includes:

[0033] Monitor whether the indicator data of the cluster application meets the set target task execution conditions;

[0034] When the monitoring result is yes, the target task is executed on the application instance corresponding to the cluster application in the exception pool based on the target task execution strategy.

[0035] Optionally, after obtaining the execution result of the target task corresponding to the cluster application, the method further includes:

[0036] Based on the execution results of the target task, a target task execution report corresponding to the cluster application is generated.

[0037] Secondly, embodiments of this application provide a cluster application processing apparatus, including:

[0038] The first acquisition module is used to acquire the configuration information of the cluster application targeted by the target task, wherein the target task is used to perform canary deployment or restart of the cluster application;

[0039] The strategy determination module is used to determine the target task execution strategy that matches the cluster application based on the configuration of the cluster application.

[0040] The indicator monitoring module is used to monitor the indicator data of the cluster application corresponding to the evaluation indicators of the target task;

[0041] The task list creation module is used to create a task list based on the indicator data of the cluster application. The task list includes application instances to be processed corresponding to the cluster application.

[0042] The task processing module is used to execute the target task on the cluster application through multiple threads based on the target task execution strategy and the task list.

[0043] Thirdly, embodiments of this application provide an electronic device, including:

[0044] processor;

[0045] Memory used to store the processor's executable instructions;

[0046] The processor is configured to execute the instructions to implement the method as described in the first aspect.

[0047] Fourthly, embodiments of this application provide a computer-readable storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the method described in the first aspect.

[0048] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:

[0049] Based on the configuration information of the cluster application targeted by the objective task, a target task execution strategy is determined for matching the cluster application. A task list containing application instances to be processed is created based on the evaluation metrics data of the cluster application corresponding to the objective task, enabling automated orchestration of these application instances. Furthermore, the objective task is executed on the cluster application based on the objective task execution strategy and the task list, achieving automated execution of the objective task. The entire process requires no manual intervention and does not rely on the experience of the executors, thereby improving the efficiency and success rate of executing the objective task on the cluster application. On this basis, a multi-threaded approach is used during the execution of the objective task on the cluster application, further improving the execution efficiency. Attached Figure Description

[0050] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0051] Figure 1 This is a schematic diagram illustrating the operation process of the cluster application involved in the embodiments of this application;

[0052] Figure 2 A flowchart illustrating a cluster application processing method provided in this application embodiment;

[0053] Figure 3 A flowchart illustrating another cluster application processing method provided in this application embodiment;

[0054] Figure 4 A flowchart illustrating yet another cluster application processing method provided in this application embodiment;

[0055] Figure 5This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0056] Figure 6 This is a schematic diagram of the structure of a cluster application processing device provided in an embodiment of this application. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0058] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0059] Before describing the technical solutions provided in the various embodiments of this application, the cluster application involved in the embodiments of this application will first be introduced. Please refer to... Figure 1 , Figure 1 This is a schematic diagram illustrating the operation process of the cluster application involved in the embodiments of this application. For example... Figure 1 As shown, clustered applications are typically deployed on different hosts within a cluster environment, with one or more application instances corresponding to the clustered application deployed on each host. Restarting a clustered application involves first blocking access to services related to the application, then stopping the application instances deployed on some or all hosts, and finally restarting the application instances deployed on those hosts. Canary releases of clustered applications involve first blocking access to services related to the application, then stopping the application instances deployed on some or all hosts, deleting the application files corresponding to those instances and uploading new application files, and finally restarting those application instances.

[0060] Figure 1 The example shown is based solely on a cluster containing hosts 1 to n and databases 1 and 2. It can be understood that in actual applications, the number of hosts in a cluster can be greater than n or less than n; similarly, the number of data entries in a cluster can be greater than 2 or less than 2. Furthermore, the cluster may also include other types of nodes, which are not limited in this embodiment.

[0061] In related technologies, when performing tasks such as restarting or canary deployments on clustered applications, the personnel typically determine the application instances to be processed based on their experience and manually compile a corresponding task list based on these instances. The application system then executes the aforementioned tasks on the clustered applications according to this task list. Because this method requires the participation of personnel and relies on their experience, the execution efficiency and success rate of the above tasks cannot be guaranteed, affecting the normal operation of the clustered applications.

[0062] To address the aforementioned problems, embodiments of this application provide a cluster application processing method, apparatus, and electronic device. Based on the cluster application's configuration information, a target task execution strategy matching the cluster application is determined. Based on the cluster application's evaluation metrics for the corresponding task and the application instance information corresponding to the cluster application, a corresponding task list is created, achieving automated creation of the task list. Finally, based on the target task execution strategy and the task list, the corresponding task is executed on the cluster application using a multi-threaded approach. The entire process requires no manual intervention and utilizes multi-threading, which, compared to related technologies, improves the efficiency and success rate of executing tasks on the cluster application.

[0063] Please refer to Figure 2 This application provides a cluster application processing method, which can be executed by the aforementioned application system, wherein the application system can be deployed in an electronic device. Figure 2 As shown, the method may include the following steps:

[0064] S22: Obtain the configuration information of the cluster application targeted by the target task. The target task is used to perform canary deployment or restart of the cluster application.

[0065] The configuration information for cluster applications may include the type of cluster application, the IP addresses and port information of the hosts included in the cluster, etc. For example, the types of cluster applications include, but are not limited to, one or more combinations of the following types: base-web, base-itf, base-bat, irsc, customer, salecenter, etc.

[0066] S24, based on the configuration information of the cluster application, determine the target task execution strategy that matches the cluster application.

[0067] The target task execution strategy refers to the process used to define the execution of the target task. The target task execution strategy includes, but is not limited to, the target task content, the target task execution time, and the execution order. For example, if a target task comprises multiple sub-tasks, the target task execution strategy indicates that each sub-task can be executed in a specific order.

[0068] Specifically, based on the configuration information of the cluster application targeted by the target task, a preset correspondence can be queried between the cluster application's configuration information, the target task, and the task execution strategy to determine the target task execution strategy that matches the cluster application. For example, Table 1 shows an example of such a preset correspondence.

[0069] Table 1

[0070]

[0071] S26, Monitor cluster application for the evaluation metrics corresponding to the target task.

[0072] The evaluation metrics for cluster applications in the target task may include, but are not limited to, host metrics, database metrics, network metrics, and application metrics. Host metrics reflect the operational status of the hosts within the cluster corresponding to the cluster application, and may include, but are not limited to, host space utilization, file handle count, processor utilization, memory utilization, and I / O latency. Database metrics reflect the operational status of the databases within the cluster corresponding to the cluster application, and may include, but are not limited to, the number of database connections and connection duration. Network metrics reflect the network status of the hosts, and may include, but are not limited to, the host's network ping time. Application metrics reflect the attribute information of the cluster application, and may include, but are not limited to, the cluster application's busy / idle periods, set priority, and application instance number threshold. For example, Table 2 shows an example of application metrics for different cluster applications in the target task, where a smaller set priority value indicates a higher set priority.

[0073] Table 2

[0074] Set priority Cluster applications Application instance number threshold 1 base-itf 40 2 base-web 24 3 base-bat 8 4 irsc 8 5 customer 8 6 salecenter 8 …… …… ……

[0075] Furthermore, since different types of cluster applications implement different functions, the evaluation metrics for the same target task can differ. For example, for a cluster application like base-bat, the evaluation metrics for the target task may include, but are not limited to: the space utilization rate of the hosts in the cluster, the number of file handles, SSH (Secure Shell) login time, network ping time, and the aforementioned database metrics for each database, such as the retail inventory center database, order center database, customer center database, and activation center database. For a cluster application like customer, the evaluation metrics for the target task may include, but are not limited to: the space utilization rate of the hosts in the cluster, the number of file handles, SSH (Secure Shell) login time, network ping time, and the aforementioned database metrics for each database, such as the retail inventory center database and customer center database.

[0076] S28. Based on the indicator data of the evaluation indicators of the cluster application in the target task and the application instance information of the cluster application, create a task list.

[0077] The task list includes application instances to be processed corresponding to the cluster application. The application instance information corresponding to the cluster application may include, but is not limited to, the identification information of each application instance corresponding to the cluster application, and the running status of the host where each application instance is located.

[0078] By using the evaluation metrics data of cluster applications for the target task, the application instances corresponding to the cluster applications can be evaluated, thereby identifying the application instances to be processed and creating a task list containing the application instances to be processed corresponding to the cluster applications.

[0079] S30 executes target tasks on cluster applications using multi-threading, based on the target task execution strategy and task list.

[0080] Specifically, after obtaining the target task execution strategy and task list through the above steps, multithreading can be enabled to execute the target task on the application instances corresponding to the cluster applications in the task list, using the target task execution strategy. For example, if the target task is to restart the cluster application, multithreading can be enabled, and the target task execution strategy can be used to first block access to services related to the cluster application, then stop the pending application instances corresponding to that cluster application, and finally trigger the host where the pending application instances reside to restart the pending application instances. As another example, if the target task is to perform a canary release of the cluster application, multithreading can be enabled, and the target task execution strategy can be used to first block access to services related to the cluster application, then stop the pending application instances corresponding to that cluster application, delete the application files corresponding to the pending application instances and upload new application files, and finally trigger the host where the pending application instances reside to restart the pending instance.

[0081] The cluster application processing method provided in this application determines the target task execution strategy for matching the cluster application based on the configuration information of the cluster application targeted by the target task. It creates a task list containing application instances to be processed based on the evaluation metrics data of the cluster application corresponding to the target task, thereby achieving automated orchestration of the application instances to be processed. Furthermore, the target task is executed on the cluster application based on the target task execution strategy and the task list, achieving automated execution of the target task. The entire process requires no manual intervention and does not rely on the experience of the executors, thus improving the efficiency and success rate of executing target tasks on the cluster application. On this basis, a multi-threaded approach is used during the execution of the target task on the cluster application, further improving the execution efficiency of the target task.

[0082] To enable those skilled in the art to better understand the cluster application processing method provided in the embodiments of this application, the steps in the above-described cluster application processing method are described in detail below.

[0083] Regarding step S28 above, in an optional scheme, considering that the running status of the hosts where different application instances are located is different, and the running status of the hosts will affect the execution process of the target tasks of the application instances, thereby affecting the success rate of the target tasks of the entire cluster application, the application instances to be processed corresponding to the cluster application can be determined based on the running status of the hosts where the application instances are located contained in the application instance information corresponding to the cluster application, and then a corresponding task list can be created.

[0084] Specifically, such as Figure 3 As shown, step S28 above may include:

[0085] S281, when the evaluation index data of the cluster application for the target task meets the set target task execution conditions, search for the host whose running status meets the set status conditions from all hosts corresponding to the cluster application.

[0086] The execution conditions for the target task may include execution sub-conditions for each evaluation indicator. For example, taking the network indicator as an example, the execution sub-condition corresponding to this evaluation indicator is that the network ping time is less than a set time. The set time can be customized according to actual needs, and the embodiment of this application does not specifically limit the value of the set time.

[0087] Setting status conditions refers to conditions used to restrict the execution of target tasks by application instances deployed on a host. For example, setting status conditions can indicate that the host is running normally.

[0088] S282 identifies the application instances deployed on the found hosts as the application instances to be processed corresponding to the cluster application.

[0089] If the monitoring results indicate that the cluster application meets the corresponding execution sub-conditions for each average metric corresponding to the target task, then the nodes (such as hosts, databases, etc.) in the cluster corresponding to the cluster application are sufficient to support the operation of executing the target task for the cluster application. Therefore, the success rate of executing the target task for the cluster application is high. At this time, executing the target task on the application instance deployed on the host whose running status meets the set status conditions can further guarantee the success rate of executing the target task for the cluster application. Based on this, the application instance deployed on the host found through the above step S281 can be identified as the application instance to be processed corresponding to the cluster application.

[0090] It should be noted that the number of application instances deployed on the found host can be one or more.

[0091] When multiple application instances are deployed on the identified hosts, to ensure the normal operation of other services on these hosts, a preferred approach is to select a corresponding number of application instances from these instances, based on a threshold for the number of application instances corresponding to the cluster application, as the application instances to be processed for that cluster application. For example, taking the correspondence between different cluster applications and the application instance number threshold shown in Table 2 above, for the cluster application base-itf, 40 application instances can be selected from the application instances deployed on the aforementioned hosts as the application instances to be processed for that cluster application.

[0092] S283, Create a task list based on the application instances to be processed corresponding to the cluster application.

[0093] The created task list contains application instances to be processed corresponding to the cluster application.

[0094] It is understood that in this implementation scheme, when the evaluation metrics data of the cluster application meet the set target task execution conditions, the application instances to be processed are selected based on the running status of the host where each application instance is located, and a task list is created to achieve automated orchestration of the application instances to be processed, and to make the success rate of executing the target task of the cluster application based on the created task list higher.

[0095] In this embodiment, the target task can target one or more cluster applications. When the target task targets multiple cluster applications, to further improve the overall execution efficiency of the target task, the target task can be executed on each cluster application in a certain processing order. Specifically, before creating a task list based on the application instances to be processed corresponding to the cluster applications, the cluster application processing method provided in this embodiment may further include: determining the processing order of each cluster application based on its set priority, and then creating a task list based on the processing order of each cluster application and its corresponding application instances to be processed. Correspondingly, the created task list also indicates the processing order of the application instances to be processed corresponding to each cluster application. In step S30 above, the target task is executed sequentially on the application instances to be processed corresponding to each cluster application in the task list based on the target task execution strategy matching each cluster application.

[0096] For example, taking the cluster applications targeted by the target task as shown in Table 2 above and their corresponding set priorities as an example, the processing order of each cluster application can be determined to be in descending order of set priority. After the task list is created, firstly, the application instances to be processed corresponding to the cluster application base-itf can be read from the task list, and the target task can be executed on the read application instances until the target task is completed; then, the application instances to be processed corresponding to the cluster application base-web can be read from the task list, and the target task can be executed on the read application instances until the target task is completed; and so on, until the target task for the application instance corresponding to the cluster application salecenter is completed. Then, the steps of creating the task list and executing the target task for the cluster application through multi-threading are repeated.

[0097] It is understood that in this implementation scheme, when the target task targets multiple cluster applications, the processing order of each cluster application is determined based on the set priority of each cluster application. Furthermore, a task list is created based on the processing order of each cluster application and the corresponding application instances to be processed. This creates a task list that not only indicates the application instances to be proxied but also the processing order of the application instances to be processed. Then, based on the target task execution strategy that matches each cluster application, the target task is executed sequentially on the application instances to be processed corresponding to each cluster application in the task list. This ensures that the target tasks executed on each application cluster can be carried out in an orderly manner, thereby further improving the execution efficiency of the target task.

[0098] For step S30 above, the number of threads used to execute the target task for the cluster application can be customized according to actual needs. For example, the number of threads can be a fixed value, and when there are multiple cluster applications targeted by the target task, a fixed number of threads can be set for each cluster application. The number of threads for each cluster application can be the same or different.

[0099] Considering that cluster applications experience varying levels of busyness and idleness at different times, allocating too many threads to the cluster application during busy periods may affect the normal operation of some application instances, thus impacting user access to related services. Conversely, allocating too few threads to the cluster application during idle periods may affect the efficiency of executing the target task across the entire cluster application. Therefore, a more preferred approach is to determine the required number of threads based on the time period during which the target task is executed, and then call the corresponding number of threads to perform the target task.

[0100] Specifically, such as Figure 3 As shown, step S30 above may include:

[0101] S31, determine the time period for executing the target task on the cluster application.

[0102] S32, Based on the time period, determine the number of threads required to execute the target task.

[0103] More specifically, based on the time period during which the target task is executed on the cluster application, a preset correspondence between the time period and the number of threads can be queried, thereby obtaining the number of threads required to execute the target task. For example, Table 3 shows an example of a preset correspondence between time period and number of threads.

[0104] Table 3

[0105]

[0106] It should be noted that, considering the different busy and idle periods of different cluster applications, different correspondences can be set for different clusters.

[0107] S33 allocates the appropriate number of threads to the cluster application based on the required number of threads.

[0108] S34, invoke the allocated thread to execute the target task on the application instance to be processed corresponding to the cluster application.

[0109] Once the required number of threads is determined, multiple threads of that number can be allocated to the cluster application, thereby invoking the allocated threads to execute the target task on the application instance to be processed corresponding to the cluster application.

[0110] It is understood that, through this implementation scheme, based on the time period for executing the target task of the cluster application, a corresponding number of threads are allocated to the cluster application to execute the target task for the application instance to be processed corresponding to the cluster application. This ensures that the process of executing the target task of the cluster application fully considers the busy and idle states of the cluster application, thereby ensuring the normal operation of some application instances corresponding to the cluster application while ensuring the efficiency of executing the target task of the entire cluster application.

[0111] To facilitate the management of application instances corresponding to cluster applications, so that executors can easily and quickly obtain the specific details of the target task execution of the cluster application, in another embodiment of this application, after step S26 above, the cluster application processing method provided in this application embodiment may further include: when the indicator data of the cluster application does not meet the set target task execution conditions, adding the application instance corresponding to the cluster application to a pre-established exception pool.

[0112] The exception pool stores application instances that have not executed the target task and / or application instances that have failed to execute the target task.

[0113] When the evaluation metrics data of a cluster application for a target task do not meet the set target task execution conditions, the nodes (such as hosts, databases, etc.) in the cluster corresponding to the cluster application are insufficient to support the operation of executing the target task for the cluster application. Therefore, the application instance corresponding to the cluster application can be added to the exception pool to wait for the nodes in the cluster application to be able to support the operation of executing the target task for the cluster application in the future, and then the target task can be executed on such application instances again.

[0114] To further facilitate the management of application instances corresponding to cluster applications, enabling personnel to easily and quickly ascertain the specific status of target task execution for the cluster application, in another embodiment of this application, after step S30 above, the cluster application processing method provided in this embodiment may further include: obtaining the target task execution result corresponding to the cluster application, wherein the target task execution result is used to indicate whether the target task for each application instance to be processed corresponding to the cluster application was successfully executed; then, adding the application instances to be processed that are indicated as having failed execution in the target task execution result to a pre-established exception pool. Thus, relevant personnel can identify the application instances corresponding to the cluster application that have failed execution by viewing the application instances stored in the exception pool, and take timely measures to make adjustments.

[0115] Typically, for application instances that fail to execute or fail to execute in a cluster application, related technologies usually require manual recovery of these application instances to re-execute the target task. This process is time-consuming, especially when there are a large number of such application instances, thus affecting the overall execution efficiency of the target task of the cluster application. In another embodiment of this application, to ensure the normal execution of the target task for the cluster application, the cluster application processing method provided in this application embodiment may further include: monitoring whether the aforementioned indicator data of the cluster application meets the aforementioned set target task execution conditions; if the monitoring result is yes, executing the target task on the application instances corresponding to the cluster application stored in the exception pool based on the target task execution strategy matched with the cluster application.

[0116] It is understood that by introducing an exception handling mechanism for cluster applications through the cluster application processing method provided in this embodiment, when the cluster user's evaluation index data for the target task is detected to restore the target task execution conditions, the target task is executed again on the application instance corresponding to the cluster application in the exception pool. This achieves automatic and intelligent recovery of the application instances stored in the exception pool. Compared with the manual recovery method in related technologies, this ensures the execution efficiency of the target task of the entire cluster application and the normal execution of the target task of the cluster application.

[0117] Furthermore, in order to classify and organize application instances with different execution results so that relevant personnel can quickly know the results of executing the target task on the cluster application, after obtaining the execution result of the target task corresponding to the cluster application, the cluster application processing method provided in this application embodiment may further include: adding the pending application instance indicating successful execution in the target task execution result to a pre-established normal pool.

[0118] In another embodiment of this application, to further facilitate relevant personnel in quickly obtaining the results of executing the target task on the cluster application, after obtaining the execution results of the target task corresponding to the cluster application, the cluster application processing method provided in this application embodiment further includes: generating a target task execution report corresponding to the cluster application based on the obtained target task execution results. The information recorded in the target task execution report corresponding to the cluster application includes, but is not limited to: the time point of executing the target task for each application instance corresponding to the cluster application, the execution time, the execution result, and the service access status on the host after executing the target task.

[0119] To enable those skilled in the art to have a deeper and more comprehensive understanding of the cluster application processing methods provided in the various embodiments of this application, the implementation process of the above-mentioned cluster application processing methods will be described in detail below, taking the case where the number of cluster applications targeted by the target task is multiple.

[0120] like Figure 4 As shown, firstly, the configuration information of each cluster application targeted by the target task can be obtained, and based on the configuration information of each cluster application, the target task execution strategy matching each cluster application can be determined. Simultaneously, the indicator data of each cluster application in the evaluation metrics corresponding to the target task is monitored, and based on the aforementioned indicator data for each cluster application, the application instances to be processed for each cluster application are determined, and the processing order of each cluster application is determined based on the set priority of each cluster application. Next, a corresponding task list can be created based on the processing order of each cluster application and the corresponding application instances to be processed. Then, the time period for executing the target task for each cluster application can be determined, and based on the obtained time period, a corresponding number of threads and a target task execution strategy matching each cluster application are allocated to each cluster application. Following the processing order indicated by the task list, the threads allocated to each cluster application are activated to sequentially execute the target task for the application instances to be processed for each cluster application. Furthermore, for each cluster application, if the aforementioned metric data of that cluster application does not meet the set target task execution conditions, then the application instance to be processed corresponding to that cluster application is added to the pre-established exception pool, as are the application instances that failed to execute and the application instances that successfully executed. Finally, the above steps are repeated for the application instances stored in the exception pool.

[0121] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0122] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 5 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0123] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0124] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0125] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a clustered application processing device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:

[0126] Obtain the configuration information of the cluster application targeted by the target task, wherein the target task is used to perform canary deployment or restart of the cluster application;

[0127] Based on the configuration information of the cluster application, determine the target task execution strategy that matches the cluster application;

[0128] Monitor the indicator data of the cluster application corresponding to the evaluation indicators of the target task;

[0129] Based on the metric data of the cluster application and the application instance information corresponding to the cluster application, a task list is created, which includes the application instances to be processed corresponding to the cluster application.

[0130] Based on the target task execution strategy and the task list, the target task is executed on the cluster application through multiple threads.

[0131] The above is as stated in this application. Figure 2 The method executed by the cluster application processing device disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0132] The electronic device can also perform Figure 2 The method, and implement the cluster application processing device in Figures 2 to 4 The functions of the embodiments shown are not described in detail here.

[0133] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0134] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figure 2 The method of the illustrated embodiment is specifically used to perform the following operations:

[0135] Obtain the configuration information of the cluster application targeted by the target task, wherein the target task is used to perform canary deployment or restart of the cluster application;

[0136] Based on the configuration information of the cluster application, determine the target task execution strategy that matches the cluster application;

[0137] Monitor the indicator data of the cluster application corresponding to the evaluation indicators of the target task;

[0138] Based on the metric data of the cluster application and the application instance information corresponding to the cluster application, a task list is created, which includes the application instances to be processed corresponding to the cluster application.

[0139] Based on the target task execution strategy and the task list, the target task is executed on the cluster application through multiple threads.

[0140] Figure 6 This is a schematic diagram of the structure of a cluster application processing device according to an embodiment of this application. Please refer to it. Figure 6 In one software implementation, the cluster application processing device 600 may include:

[0141] The first acquisition module 610 is used to acquire the configuration information of the cluster application targeted by the target task, wherein the target task is used to perform canary deployment or restart of the cluster application.

[0142] The strategy determination module 620 is used to determine the target task execution strategy that matches the cluster application based on the configuration information of the cluster application.

[0143] The indicator monitoring module 630 is used to monitor the indicator data of the cluster application corresponding to the evaluation indicator of the target task.

[0144] The task list creation module 640 is used to create a task list based on the indicator data of the cluster application and the application instance information corresponding to the cluster application. The task list includes the application instances to be processed corresponding to the cluster application.

[0145] The task processing module 650 is used to execute the target task on the cluster application through multiple threads based on the target task execution strategy and the task list.

[0146] Optionally, the task processing module includes:

[0147] The time period determination submodule is used to determine the time period for executing the target task on the cluster application;

[0148] The thread count determination submodule is used to determine the number of threads required to execute the target task based on the time period.

[0149] The thread allocation submodule is used to allocate corresponding threads to the cluster application based on the number of threads;

[0150] The submodule is invoked to call the allocated thread to execute the target task on the application instance to be processed corresponding to the cluster application.

[0151] Optionally, the application instance information includes the running status of the host where the application instance is located;

[0152] The task list creation module includes:

[0153] The search submodule is used to search for hosts whose running status meets the set status conditions from all hosts corresponding to the cluster application when the indicator data of the cluster application meets the set target task execution conditions.

[0154] The application instance determination submodule is used to determine the application instances deployed on the found hosts as the application instances to be processed corresponding to the cluster application.

[0155] Create a submodule to create the task list based on the application instance to be processed corresponding to the cluster application.

[0156] Optionally, the device further includes:

[0157] The processing order determination module is used to determine the processing order of each cluster application based on the set priority of each cluster application when there are multiple cluster applications.

[0158] The creation submodule is specifically used to create a task list based on the processing order of each cluster application and the corresponding application instance to be processed.

[0159] The task processing module includes:

[0160] The processing submodule is used to execute the target task sequentially on the application instances to be processed corresponding to each of the cluster applications in the task list, based on the target task execution strategy matched with each of the cluster applications.

[0161] Optionally, the device further includes:

[0162] The first addition module is used to add the application instance corresponding to the cluster application to a pre-established exception pool when the indicator data of the cluster application does not meet the set target task execution conditions.

[0163] The indicator monitoring module is also used to trigger the first adding module after monitoring the indicator data of the evaluation indicator corresponding to the target task applied by the cluster application.

[0164] Optionally, the device further includes:

[0165] The second acquisition module is used to acquire the execution result of the target task corresponding to the cluster application;

[0166] The second adding module is used to add pending application instances that indicate execution failure in the target task execution results to a pre-established exception pool;

[0167] The task processing module is further configured to trigger the second acquisition module after executing the target task on the cluster application through multiple threads based on the target task execution strategy and the task list.

[0168] Optionally, the indicator monitoring module is further configured to monitor whether the indicator data of the cluster application meets the set target task execution conditions after the target task is completed.

[0169] The device further includes:

[0170] An exception handling module is used to execute the target task on the application instance corresponding to the cluster application in the exception pool based on the target task execution strategy when the indicator monitoring module detects that the indicator data of the cluster application meets the set target task execution conditions.

[0171] Optionally, the device further includes:

[0172] The report generation module is used to generate a target task execution report corresponding to the cluster application based on the target task execution result;

[0173] The second acquisition module is further configured to trigger the report generation module after acquiring the execution result of the target task corresponding to the cluster application.

[0174] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0175] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0176] 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 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.

[0177] 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 a process, method, article, or apparatus. Without further limitation, 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 said element.

[0178] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A cluster application processing method, characterized in that, include: Obtain the configuration information of the cluster application targeted by the target task, wherein the target task is used to perform canary deployment or restart of the cluster application; The cluster application corresponds to a cluster containing multiple hosts; Based on the configuration information of the cluster application, determine the target task execution strategy that matches the cluster application; Monitor the indicator data of the cluster application corresponding to the evaluation indicators of the target task; Based on the metric data of the cluster application and the application instance information corresponding to the cluster application, a task list is created, which includes the application instances to be processed corresponding to the cluster application. Based on the target task execution strategy and the task list, the target task is executed on the cluster application through multiple threads; After the creation of the task list and before the execution of the target task on the cluster application via multithreading, the method further includes: When the metric data of the cluster application does not meet the set target task execution conditions, the application instance corresponding to the cluster application is added to the pre-established exception pool, wherein the evaluation metric includes the host's space utilization rate. After executing the target task on the cluster application using multiple threads based on the target task execution strategy and the task list, the method further includes: Obtain the execution result of the target task corresponding to the cluster application; Add the pending application instances that indicate execution failure in the target task execution results to a pre-established exception pool; After the target task has been completed, the method further includes: Monitor whether the indicator data of the cluster application meets the set target task execution conditions; When the monitoring result is yes, the target task is executed on the application instance corresponding to the cluster application in the exception pool based on the target task execution strategy.

2. The method according to claim 1, characterized in that, Based on the target task execution strategy and the task list, the target task is executed on the cluster application through multi-threading, including: Determine the time period for executing the target task on the cluster application; Based on the time period, determine the number of threads required to execute the target task; Allocate corresponding threads to the cluster application based on the number of threads; The allocated thread is invoked to execute the target task on the application instance to be processed corresponding to the cluster application.

3. The method according to claim 1, characterized in that, The application instance information includes the running status of the host where the application instance is located; Based on the metric data of the cluster application and the application instance information corresponding to the cluster application, a task list is created, including: When the indicator data of the cluster application meets the set target task execution conditions, search for the host whose running status meets the set status conditions from all hosts corresponding to the cluster application. The application instances deployed on the found hosts are identified as the application instances to be processed corresponding to the cluster application. The task list is created based on the application instance to be processed corresponding to the cluster application.

4. The method according to claim 3, characterized in that, Before creating the task list based on the application instance to be processed corresponding to the cluster application, the method further includes: When there are multiple cluster applications, the processing order of each cluster application is determined based on the set priority of each cluster application. A task list is created based on the processing order of each cluster application and the corresponding application instance to be processed; Based on the target task execution strategy and the task list, the target task is executed on the cluster application through multi-threading, including: Based on the target task execution strategy matched with each of the cluster applications, the target tasks are executed sequentially on the application instances to be processed corresponding to each of the cluster applications in the task list.

5. The method according to claim 1, characterized in that, After obtaining the execution result of the target task corresponding to the cluster application, the method further includes: Based on the execution results of the target task, a target task execution report corresponding to the cluster application is generated.

6. A cluster application processing device, characterized in that, include: The first acquisition module is used to acquire the configuration information of the cluster application targeted by the target task, wherein the target task is used to perform canary deployment or restart of the cluster application; The cluster application corresponds to a cluster containing multiple hosts; The strategy determination module is used to determine the target task execution strategy that matches the cluster application based on the configuration of the cluster application. The indicator monitoring module is used to monitor the indicator data of the cluster application corresponding to the evaluation indicators of the target task; The task list creation module is used to create a task list based on the indicator data of the cluster application. The task list includes application instances to be processed corresponding to the cluster application. The task processing module is used to execute the target task on the cluster application through multiple threads based on the target task execution strategy and the task list; The cluster application processing device is further configured to, after the task list is created and before the target task is executed on the cluster application through multi-threading, add the application instance corresponding to the cluster application to a pre-established exception pool when the indicator data of the cluster application does not meet the set target task execution conditions, wherein the evaluation indicators include the host's space utilization rate. The cluster application processing device is further configured to, after executing the target task on the cluster application through multiple threads based on the target task execution strategy and the task list, obtain the target task execution result corresponding to the cluster application, and add the pending application instances indicating execution failure in the target task execution result to a pre-established exception pool. The cluster application processing device is further configured to, after the target task is completed, monitor whether the indicator data of the cluster application meets the set target task execution conditions; and if the monitoring result is yes, execute the target task on the application instance corresponding to the cluster application in the exception pool based on the target task execution strategy.

7. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data parallel processing method and system as well as load balancing scheduler

    CN103226467A

  • Intelligent smooth restarting method and device based on cloud data center

    CN106648867A