Task execution management method and device, equipment and medium
By obtaining and saving the initial information and step information of the task in the task platform and storing the latest information in the preset database, the problem of difficulty in obtaining detailed task information and task information push timeliness in the prior art is solved, and task information push with high accuracy and timeliness is achieved.
Patent Information
- Application Number
- CN202412000264.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-31
AI Technical Summary
During the execution of cloud resource tasks, existing task platforms are difficult to obtain detailed information, and there are timeliness and accuracy issues in task information push, resulting in problematic regression of task progress.
By obtaining and saving the initial information and step information of the task in the task platform, determining the push address based on the user side, and storing the latest task information and step information in the preset database, the preset thread uses the model to assemble and push the task information list according to the results.
It achieves the acquisition of more detailed task information, and improves the accuracy and timeliness of task information push, avoiding problems such as task progress fallback.
Smart Images

Figure CN119718588A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a task execution management method, device, equipment and medium. Background Art
[0002] In the era of cloud computing, as the application areas of cloud services become wider and wider, for cloud computing platforms, only computing, network and storage services are often not enough. With the increasing popularity of big data analysis, it is more important to view the task process and results of cloud resources in real time.
[0003] Currently, the task messages of the cloud resources of the task platform do not distinguish between steps. There is only one large task body, and the task progress and task status are updated inside the task body, such as Figure 1 As shown in the figure, when the progress changes or the status changes, the data will be assembled at the current time, and the message will be pushed to the front end after the data is assembled. However, first of all, only the overall progress and status of the task can be seen through the message, and it is difficult to obtain more detailed task steps; secondly, due to the long cycle of reading and assembling data, there will be timeliness problems, resulting in skipping of certain task progress, and concurrent assembly of data may cause the new data to be overwritten by the old data, resulting in low data accuracy, which will cause the task progress to roll back.
[0004] In summary, how to obtain more detailed task information and achieve accuracy and timeliness in pushing task information is a problem that needs to be solved. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a task execution management method, device, equipment and medium, which can obtain more detailed task information and achieve accuracy and high timeliness of task information push. The specific scheme is as follows:
[0006] In a first aspect, the present application discloses a task execution management method, which is applied to a task platform, comprising:
[0007] Obtain a creation request for a target task, and save the initial task information and initial task step information of the target task; the initial task information includes a task flag and an initial task status, and the initial task step information includes a step flag and an initial step status of each task step in the target task;
[0008] Determine the push address corresponding to the target task based on the user end that sends the creation request;
[0009] When the preset query condition is currently met, query the flag information corresponding to the user terminal within the target time period, and query the task content corresponding to the flag information from the preset database, so as to assemble the task content according to the predefined result display model to obtain a task information list; the flag information includes task flags and step flags, and the preset database is used to store the latest task information and the latest task step information of the target task during the execution process, the latest task information includes the latest task status, and the latest task step information includes the latest step status;
[0010] The task information list is pushed according to the push address using the preset target thread, and the push address and task information list are deleted after the push is successful.
[0011] Optionally, determining a push address corresponding to the target task based on the user end sending the creation request includes:
[0012] Acquire user session information of the user terminal that sends the creation request, so as to determine whether the user terminal is a legitimate user terminal based on the user session information;
[0013] If it is a legitimate user terminal, the push address corresponding to the target task is assembled based on the user identifier, user role information and user virtual data center identifier in the user session information.
[0014] Optionally, after assembling the task contents according to the predefined result display model to obtain the task information list, it also includes:
[0015] Construct a key-value pair based on the push address and the task information list, and store the key-value pair in a preset list; wherein the push address is the key and the task information list is the value;
[0016] Accordingly, the task information list is pushed according to the push address using the preset target thread, and the push address and the task information list are deleted after the push is successful, including:
[0017] Use the preset target thread to poll the preset list, and after detecting the key-value pair, parse the key-value pair to obtain the push address and task information list;
[0018] Push the task information list according to the push address, and delete the key-value pair from the preset list after the push is successful.
[0019] Optionally, querying each mark information corresponding to the user terminal within the target time period, and querying the task content corresponding to the mark information from a preset database, including:
[0020] Query the target tasks and task step flag information in the target state corresponding to the user terminal within the target time period, and build a task flag list based on each flag information; wherein the target state includes execution completion and execution process;
[0021] Each flag information in the task flag list is traversed, and the task content corresponding to each flag information is queried from the preset database.
[0022] Optionally, the result display model includes, in order from upper layer to lower layer, a first display model for displaying basic task information, a second display model for displaying task step information, and a third display model for displaying task step association information; wherein the second display model is a sub-model of the first display model, and the third display model is a sub-model of the second display model;
[0023] Accordingly, the task contents are assembled according to the predefined result display model to obtain a task information list, including:
[0024] Filtering out first information content corresponding to the first display model from the task content, and assembling the first information content to obtain a first assembly result;
[0025] Selecting second information content corresponding to the second display model from the task content, and assembling the second information content to obtain a second assembly result;
[0026] Selecting third information contents corresponding to the third display model from the task contents, and assembling the third information contents to obtain a third assembly result;
[0027] The first assembly result, the second assembly result and the third assembly result are sequentially integrated to obtain a task information list.
[0028] Optionally, the basic task information includes task flag, task operation type, task operation object, task operator, task status, task progress, task start execution time, task end execution time and task execution process information; the task step information includes task step flag, task step operation type, task step operation object, task step operator, task step status, task step progress, task step start execution time, task step end execution time and task step execution process information; the task step associated information includes associated task step flag, associated task step operation type, associated task step operation object, associated task step operator, associated task step status, associated task step progress, associated task step start execution time, associated task step end execution time and associated task step execution process information.
[0029] Optionally, when the preset query condition is currently met, the flag information corresponding to the user terminal in the target time period is queried, including:
[0030] During the execution of the target task, when the task status or step status is detected to have changed, query the flag information corresponding to the user end within the target time period;
[0031] Or, during the execution of the target task, when the current timestamp is consistent with the preset query timestamp, query the flag information corresponding to the user terminal in the target time period.
[0032] In a second aspect, the present application discloses a task execution management device, which is applied to a task platform, comprising:
[0033] The request acquisition module is used to obtain the creation request of the target task and save the initial task information and initial task step information of the target task; the initial task information includes the task flag and the initial task status, and the initial task step information includes the step flag and the initial step status of each task step in the target task;
[0034] A push address determination module, used to determine a push address corresponding to a target task based on a user end sending a creation request;
[0035] The result assembly module is used to query the flag information corresponding to the user terminal within the target time period when the preset query conditions are currently met, and query the task content corresponding to the flag information from the preset database, so as to assemble the task content according to the predefined result display model to obtain a task information list; the flag information includes task flags and step flags, and the preset database is used to store the latest task information and the latest task step information of the target task during the execution process, the latest task information includes the latest task status, and the latest task step information includes the latest step status;
[0036] The push module is used to push the task information list according to the push address using the preset target thread, and delete the push address and task information list after the push is successful.
[0037] In a third aspect, the present application discloses an electronic device, comprising:
[0038] Memory, used to store computer programs;
[0039] The processor is used to execute a computer program to implement the steps of the task execution management method disclosed above.
[0040] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the task execution management method disclosed above are implemented.
[0041] It can be seen that the present application obtains a creation request for a target task through a task platform, and saves the initial task information and initial task step information of the target task; the initial task information includes a task flag and an initial task status, and the initial task step information includes a step flag and an initial step status for each task step in the target task; the push address corresponding to the target task is determined based on the user end that sends the creation request; when the preset query conditions are currently met, the flag information corresponding to the user end within the target time period is queried, and the task content corresponding to the flag information is queried from the preset database, so as to assemble the task content according to a predefined result display model to obtain a task information list; the flag information includes a task flag and a step flag, and the preset database is used to store the latest task information and the latest task step information of the target task during the execution process, the latest task information includes the latest task status, and the latest task step information includes the latest step status; the task information list is pushed according to the push address using the preset target thread, and the push address and task information list are deleted after the push is successful.
[0042] Beneficial effects: In the present application, after obtaining the creation request of the target task, the task platform needs to save the initial task information and initial task step information of the target task first; wherein, the initial task information includes the task flag and the initial task status, and the initial task step information includes the step flag and the initial step status of each task step in the target task. Later, during the execution of the target task, when the task status or the task step status of the target task changes, the latest task information and the latest task step information of the target task will be cached to the preset database, that is, the latest task status and the latest step status will be stored. Further, the present application needs to determine the push address corresponding to the target task based on the user end that sends the creation request, so that the corresponding task information can be pushed according to the push address later. When the preset query conditions are currently met, the flag information corresponding to the user end in the target time period is queried, and the flag information includes the aforementioned task flag and step flag, and the task content corresponding to the flag information is queried from the preset database, so that the task content is assembled according to the predefined result display model to obtain a task information list. That is, the present application predefines a result display model. When the query conditions are met, the latest task content corresponding to the user end within the target time period, that is, the latest task status and the latest step status, etc., are queried from the preset database, so as to assemble a task information list according to the result display model and complete the push of the task information list. Through the above scheme, by subdividing each task step and setting up a preset database to specifically store the latest task information and the latest task step information of the target task during the execution process, and displaying the latest status of the target task and each task step according to the result display model, more detailed task information can be obtained, and the accuracy and timeliness of task information push can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0044] Figure 1 A schematic diagram of an existing task message push process disclosed in this application;
[0045] Figure 2 A flowchart of a task execution management method disclosed in this application;
[0046] Figure 3 A task execution management architecture diagram disclosed in this application;
[0047] Figure 4 A flowchart of a specific task execution management method disclosed in this application;
[0048] Figure 5 A relationship diagram between task basic information and task step information disclosed in this application;
[0049] Figure 6 This is a schematic diagram of the structure of a task execution management device disclosed in this application;
[0050] Figure 7 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0052] Currently, the task message of the cloud resources of the task platform does not distinguish between steps. There is only one large task body. The task progress and task status are updated inside the task body. When the progress changes or the status changes, the data will be assembled at the current time, and the message will be pushed to the front end after the data is assembled. However, first of all, only the overall progress and status of the task can be seen through the message, and it is difficult to obtain more detailed task steps; secondly, due to the long cycle of reading and assembling data, there will be timeliness problems, resulting in skipping a certain task progress, and concurrent assembly data may have the problem of new data being overwritten by old data, and the data accuracy is low, which will cause the task progress to roll back. To this end, the embodiment of the present application discloses a task execution management method, device, equipment and medium, which can obtain more detailed task information and achieve accuracy and high timeliness of task information push.
[0053] See also Figure 2 and Figure 3 As shown, the embodiment of the present application discloses a task execution management method, which is applied to a task platform, and the method includes:
[0054] Step S11: Obtain a creation request for a target task, and save the initial task information and initial task step information of the target task; the initial task information includes a task flag and an initial task status, and the initial task step information includes a step flag and an initial step status of each task step in the target task.
[0055] In this embodiment, after the task platform obtains the creation request of the target task, it needs to save the initial task information and initial task step information of the target task first; wherein, the initial task information includes the task flag (task ID) and the initial task status, and the initial task step information includes the step flag (step ID) and the initial step status of each task step in the target task. Later, during the execution of the target task, when the task status or task step status of the target task changes, the latest task information and the latest task step information of the target task will be cached to the preset database, that is, the latest task status and the latest step status will be stored. Among them, the preset database can use Redis (Remote Dictionary Server, i.e. remote dictionary service).
[0056] It should be pointed out that the task platform in this application needs to run in the K8s (Kubernetes, an open source container management platform) environment and be in a normal operating state. The user end can issue a creation request for the target task through the business module. For example, taking the target task of creating a cloud host as an example, the corresponding task steps include creating a cloud host verification, remotely creating a cloud host, waiting for the remote creation of the cloud host, and saving the cloud host into the database. Among them, the business module has built-in streaming task configuration information for cloud host creation, and the user end maintains the basic information of the cloud host, including the name of the cloud host, the vdc (Virtual Data Center) where the cloud host is located, the owner of the cloud host, the cloud host specification information, etc. After completing the basic configuration information of the cloud host, the creation request for the task is submitted.
[0057] Step S12: Determine a push address corresponding to the target task based on the user end that sends the creation request.
[0058] In this embodiment, it is necessary to determine the push address corresponding to the target task based on the user end that sends the creation request, so that the corresponding task information can be subsequently pushed according to the push address.
[0059] In a specific implementation, determining the push address corresponding to the target task based on the user end that sends the creation request specifically includes: obtaining the user session information of the user end that sends the creation request to determine whether the user end is a legitimate user end based on the user session information; if it is a legitimate user end, assembling the push address corresponding to the target task based on the user identifier, user role information and user virtual data center identifier in the user session information. It can be understood that this application needs to detect whether the received creation request is initiated by a legitimate user, that is, it needs to detect the legitimacy of the user end that sends the creation request, in order to ensure the legitimacy and security of task execution, as well as the accuracy and pertinence of the push information.
[0060] Specifically, it is necessary to obtain the user session information (i.e. user session information) of the user who sent the creation request, so as to determine whether the user is a legitimate user based on the user session information. If it is a legitimate user, the push address corresponding to the target task is assembled based on the user ID, user role information and user virtual data center ID in the user session information. If it is not initiated by a legitimate user, it is necessary to perform corresponding processing according to the specific situation, such as rejecting the request or conducting a security review, etc., to maintain the stable operation of the system and data security. This can effectively prevent illegal or malicious task requests from entering the system, protect the security and stability of cloud resources, and avoid potential security vulnerabilities and data leakage risks.
[0061] In a specific implementation, if it is detected that the creation request is not initiated by a legitimate user terminal, the system can immediately reject the request and may record relevant request information, such as the request source IP address, request time, etc., for subsequent security analysis and tracking. At the same time, an alarm is sent to the system administrator or security monitoring module to alert possible security threats.
[0062] In another specific implementation, for suspicious requests initiated by illegal user terminals, in addition to rejection, a security review process can also be initiated to conduct an in-depth analysis of the request, attempt to trace the source and intent of the request, and determine whether it is a sign of a system vulnerability or external attack. Based on the review results, appropriate measures are taken, such as repairing the vulnerability, strengthening the security protection mechanism, etc., to prevent similar situations from happening again.
[0063] In this way, by accurately identifying the initiator of the task request, it is helpful to assemble the correct push address information based on the user's specific information. This ensures that various messages and results during the task execution process can be accurately pushed to the user who initiated the task, improving the user experience and the efficiency of task management.
[0064] Step S13: When the preset query conditions are currently met, query the various flag information corresponding to the user terminal within the target time period, and query the task content corresponding to the flag information from the preset database, so as to assemble the task content according to the predefined result display model to obtain a task information list; the flag information includes task flags and step flags, and the preset database is used to store the latest task information and the latest task step information of the target task during the execution process, the latest task information includes the latest task status, and the latest task step information includes the latest step status.
[0065] In this embodiment, when the preset query conditions are currently met, the flag information corresponding to the user terminal in the target time period is queried, and the flag information includes the task flag and step flag mentioned above, and the task content corresponding to the flag information is queried from the preset database, so as to assemble the task content according to the predefined result display model to obtain a task information list. That is, the present application predefines the result display model, and when the query conditions are met, the latest task content corresponding to the user terminal in the target time period, that is, the latest task status and the latest step status, etc., is queried from the preset database, so as to assemble the task information list according to the result display model.
[0066] Among them, when the preset query conditions are currently met, the various flag information corresponding to the user end within the target time period is queried, which can specifically include: during the execution of the target task, when the task status or step status is monitored to change, the various flag information corresponding to the user end within the target time period is queried; or, during the execution of the target task, when the current timestamp is consistent with the preset query timestamp, the various flag information corresponding to the user end within the target time period is queried.
[0067] That is, in a specific implementation, the task status or step status is monitored in real time during the execution of the target task. When changes are detected in the task status or step status, the flag information corresponding to the user terminal within the target time period is queried.
[0068] In another specific implementation, during the execution of the target task, the flag information query is performed periodically, that is, the query timestamp is preset, and when the current timestamp is consistent with the preset query timestamp, the flag information corresponding to the user terminal in the target time period is queried.
[0069] In a specific implementation, query each flag information corresponding to the user end within the target time period, and query the task content corresponding to the flag information from the preset database, including: query the target task and the flag information of the task step in the target state corresponding to the user end within the target time period, and build a task flag list based on each flag information; wherein the target state includes the end of execution and the execution process; traverse each flag information in the task flag list, and query the task content corresponding to each flag information from the preset database. It can be understood that when querying, a task of reading task data and assembling task data will be automatically added to the task thread pool, and the task module will automatically query the target task and the flag information of the task step in the target state within the target time period belonging to the current user end, and the target state specifically includes the end of execution and the execution process. For example, query the flag information of all tasks completed within 3 minutes and all tasks in the execution process belonging to the current user end, and build a task flag list. Then traverse each flag information in the task flag list, and query the task content corresponding to each flag information from the preset database Redis, that is, query the latest task information and the latest task step information of the target task in the execution process, so as to assemble a task information that meets the predefined result display model, and assemble a task information list after the traversal is completed.
[0070] Among them, Redis saves the latest task information and the latest task step information. The storage period can be 24 hours, for example. The latest task information includes task flag ID, task operation type KEY, task operation type name, task operation object, task operator, task status, task progress, task start execution time, task end time, and task execution information. The latest task step information includes task flag ID, task step ID, task step operation type KEY, task step operation type name, and task step status.
[0071] Furthermore, after assembling the task content according to the predefined result display model to obtain the task information list, it also includes: constructing a key-value pair based on the push address and the task information list, and storing the key-value pair in a preset list; wherein the push address is the key and the task information list is the value. That is, this embodiment needs to store the push address as the key and the task information list as the value in the preset list.
[0072] Step S14: using a preset target thread to push the task information list according to the push address, and deleting the push address and the task information list after the push is successful.
[0073] In this embodiment, the task information list is pushed according to the push address using a preset target thread, and the push address and the task information list are deleted after the push is successful.
[0074] In a specific implementation, a preset target thread is used to push a task information list according to a push address, and the push address and task information list are deleted after the push is successful, including: using a preset target thread to poll a preset list, and after detecting a key-value pair, parsing the key-value pair to obtain a push address and a task information list; pushing a task information list according to the push address, and deleting the key-value pair from the preset list after the push is successful. That is, in this application, a preset target thread is used to poll a preset list to detect whether there is a key-value pair in the preset list, and if so, the key-value pair is parsed to obtain the push address represented by the key and the task information list represented by the value, and then the task information list is sent to the front-end task bar through a websocket according to the push address, and the sent key-value pairs are automatically cleaned up after the push is successful.
[0075] It can be seen that in this application, after obtaining the creation request of the target task, the task platform needs to save the initial task information and initial task step information of the target task first; wherein, the initial task information includes the task flag and the initial task status, and the initial task step information includes the step flag and the initial step status of each task step in the target task. Later, during the execution of the target task, when the task status or the task step status of the target task changes, the latest task information and the latest task step information of the target task will be cached to the preset database, that is, the latest task status and the latest step status are stored. Further, this application needs to determine the push address corresponding to the target task based on the user end that sends the creation request, so that the corresponding task information can be pushed according to the push address later. When the preset query conditions are currently met, the flag information corresponding to the user end in the target time period is queried, and the flag information includes the aforementioned task flag and step flag, and the task content corresponding to the flag information is queried from the preset database, so that the task content is assembled according to the predefined result display model to obtain a task information list. That is, the present application predefines a result display model. When the query conditions are met, the latest task content corresponding to the user end within the target time period, that is, the latest task status and the latest step status, etc., are queried from the preset database, so as to assemble a task information list according to the result display model and complete the push of the task information list. Through the above scheme, by subdividing each task step and setting up a preset database to specifically store the latest task information and the latest task step information of the target task during the execution process, and displaying the latest status of the target task and each task step according to the result display model, more detailed task information can be obtained, and the accuracy and timeliness of task information push can be achieved.
[0076] See also Figure 4 As shown, the embodiment of the present application discloses a specific task execution management method. Compared with the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:
[0077] Step S21: Obtain a creation request for a target task, and save the initial task information and initial task step information of the target task; the initial task information includes a task flag and an initial task status, and the initial task step information includes a step flag and an initial step status of each task step in the target task.
[0078] Step S22: Determine a push address corresponding to the target task based on the user end that sends the creation request.
[0079] Step S23: When the preset query conditions are currently met, query the various flag information corresponding to the user end within the target time period, and query the task content corresponding to the flag information from the preset database; the flag information includes task flags and step flags, and the preset database is used to store the latest task information and the latest task step information of the target task during the execution process, the latest task information includes the latest task status, and the latest task step information includes the latest step status.
[0080] Step S24: Determine a predefined result display model; the result display model includes, in order from upper layer to lower layer, a first display model for displaying basic task information, a second display model for displaying task step information, and a third display model for displaying task step association information; wherein the second display model is a sub-model of the first display model, and the third display model is a sub-model of the second display model.
[0081] In this embodiment, a predefined result display model is first determined. The result display model is a three-layer structure in order, and includes, from the upper layer to the lower layer, a first display model for displaying basic task information, a second display model for displaying task step information, and a third display model for displaying task step associated information. In addition, the second display model is a sub-model of the first display model, and the third display model is a sub-model of the second display model. The display method of the three-layer model can realize the display of richer task messages: the first layer is the basic task information, the second layer is the task step information, and the third layer is the task step associated information, and finally achieves the goal of accuracy and timeliness of pushing cloud resource task information.
[0082] Further, such as Figure 5 As shown, the basic task information includes the task flag ID, task operation type, task operation object, task operator, task status, task progress, task start execution time, task end execution time and task execution process information; the task step information includes the task step flag ID, task step operation type, task step operation object, task step operator, task step status, task step progress, task step start execution time, task step end execution time and task step execution process information; the task step associated information includes the associated task step flag ID, associated task step operation type, associated task step operation object, associated task step operator, associated task step status, associated task step progress, associated task step start execution time, associated task step end execution time and associated task step execution process information.
[0083] In this way, after the user submits a request to create a cloud host under the business module, he can query the real-time information of the task on the task platform, and can view the task progress, changes in task steps, changes in task step progress, changes in task step status, and changes in task step-related task step progress and task step-related task step status in real time.
[0084] Step S25: Filter out the first information content corresponding to the first display model from the task content, and assemble the first information content to obtain a first assembly result; filter out the second information content corresponding to the second display model from the task content, and assemble the second information content to obtain a second assembly result; filter out the third information content corresponding to the third display model from the task content, and assemble the third information content to obtain a third assembly result.
[0085] In this embodiment, the task contents corresponding to the task flag and the step flag have been queried from the preset database through the aforementioned steps. Therefore, this embodiment further selects the first information content corresponding to the first display model from the task content according to the definition of the result display model, and assembles them to obtain the first assembly result, selects the second information content corresponding to the second display model from the task content, and assembles them to obtain the second assembly result, and selects the third information content corresponding to the third display model from the task content, and assembles them to obtain the third assembly result.
[0086] Step S26: Integrate the first assembly result, the second assembly result and the third assembly result in sequence to obtain a task information list.
[0087] In this embodiment, the first assembly result, the second assembly result, and the third assembly result are integrated in sequence from the upper layer to the lower layer of the result display model to obtain a task information list.
[0088] Step S27: using a preset target thread to push the task information list according to the push address, and deleting the push address and the task information list after the push is successful.
[0089] For more specific processing procedures of the above steps S21, S22 and S27, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.
[0090] It can be seen that this application can achieve a richer display of task messages through the display method of a three-layer model: the first layer is the basic task information, the second layer is the task step information, and the third layer is the task step related information, ultimately achieving the goal of accurate and timely push of cloud resource task information. In this way, the push presentation method of cloud resource tasks is transformed from the traditional single task progress, task status information coarse granularity and low failure rate to the task progress, task status, task steps, task step progress, task step related task information and other fine granularity, and can be pushed in real time, basically without delay.
[0091] See also Figure 6 As shown, the embodiment of the present application discloses a task execution management device, which is applied to a task platform, and the device includes:
[0092] The request acquisition module 11 is used to acquire the creation request of the target task and save the initial task information and initial task step information of the target task; the initial task information includes the task flag and the initial task status, and the initial task step information includes the step flag and the initial step status of each task step in the target task;
[0093] A push address determination module 12, used to determine a push address corresponding to a target task based on a user end sending a creation request;
[0094] The result assembly module 13 is used to query the flag information corresponding to the user terminal within the target time period when the preset query condition is currently met, and query the task content corresponding to the flag information from the preset database, so as to assemble the task content according to the predefined result display model to obtain a task information list; the flag information includes a task flag and a step flag, and the preset database is used to store the latest task information and the latest task step information of the target task during the execution process, the latest task information includes the latest task status, and the latest task step information includes the latest step status;
[0095] The push module 14 is used to push the task information list according to the push address using a preset target thread, and delete the push address and the task information list after the push is successful.
[0096] It can be seen that in this application, after obtaining the creation request of the target task, the task platform needs to save the initial task information and initial task step information of the target task first; wherein, the initial task information includes the task flag and the initial task status, and the initial task step information includes the step flag and the initial step status of each task step in the target task. Later, during the execution of the target task, when the task status or the task step status of the target task changes, the latest task information and the latest task step information of the target task will be cached to the preset database, that is, the latest task status and the latest step status are stored. Further, this application needs to determine the push address corresponding to the target task based on the user end that sends the creation request, so that the corresponding task information can be pushed according to the push address later. When the preset query conditions are currently met, the flag information corresponding to the user end in the target time period is queried, and the flag information includes the aforementioned task flag and step flag, and the task content corresponding to the flag information is queried from the preset database, so that the task content is assembled according to the predefined result display model to obtain a task information list. That is, the present application predefines a result display model. When the query conditions are met, the latest task content corresponding to the user end within the target time period, that is, the latest task status and the latest step status, etc., are queried from the preset database, so as to assemble a task information list according to the result display model and complete the push of the task information list. Through the above scheme, by subdividing each task step and setting up a preset database to specifically store the latest task information and the latest task step information of the target task during the execution process, and displaying the latest status of the target task and each task step according to the result display model, more detailed task information can be obtained, and the accuracy and timeliness of task information push can be achieved.
[0097] Since the embodiments of the apparatus part correspond to the embodiments of the method part, the embodiments of the apparatus part refer to the description of the embodiments of the method part, which will not be described here. Moreover, the invention has the same beneficial effects as the task execution management method mentioned above.
[0098] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the task execution management method performed by the electronic device disclosed in any of the aforementioned embodiments.
[0099] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0100] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0101] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage.
[0102] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows, Unix, Linux, etc. In addition to including a computer program that can be used to complete the task execution management method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data transmitted from an external device received by the electronic device, the data 223 can also include data collected by its own input and output interface 25, etc.
[0103] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the steps of the task execution management method disclosed in any of the aforementioned embodiments are implemented.
[0104] Furthermore, an embodiment of the present application also discloses a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the task execution management method disclosed in any of the aforementioned embodiments.
[0105] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0106] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0107] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a compact disc read-only memory (CD-ROM), or any other form of storage medium known in the art.
[0108] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0109] The above is a detailed introduction to a task execution management method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A task execution management method, characterized in that: Applied to mission platforms, including: Obtaining a creation request for a target task, and saving initial task information and initial task step information of the target task; the initial task information includes a task flag and an initial task state, and the initial task step information includes a step flag and an initial step state of each task step in the target task; Determine a push address corresponding to the target task based on the user end sending the creation request; When the preset query condition is currently met, query each mark information corresponding to the user terminal within the target time period, and query the task content corresponding to the mark information from the preset database, so as to assemble the task content according to the predefined result display model to obtain a task information list; the mark information includes a task mark and a step mark, and the preset database is used to store the latest task information and the latest task step information of the target task during the execution process, the latest task information includes the latest task status, and the latest task step information includes the latest step status; The task information list is pushed according to the push address using a preset target thread, and the push address and the task information list are deleted after the push is successful.
2. The task execution management method according to claim 1, characterized in that: The determining the push address corresponding to the target task based on the user end sending the creation request includes: Acquire user session information of the user terminal that sends the creation request, so as to determine whether the user terminal is a legitimate user terminal based on the user session information; If the user terminal is a legitimate one, the push address corresponding to the target task is assembled based on the user identifier, user role information and user virtual data center identifier in the user session information.
3. The task execution management method according to claim 1, characterized in that: After assembling the task contents according to the predefined result display model to obtain a task information list, the method further includes: Constructing a key-value pair based on the push address and the task information list, and storing the key-value pair in a preset list; wherein the push address is the key and the task information list is the value; Correspondingly, the using of a preset target thread to push the task information list according to the push address, and deleting the push address and the task information list after the push is successful, includes: Using a preset target thread to poll the preset list, and after detecting the key-value pair, parsing the key-value pair to obtain the push address and the task information list; The task information list is pushed according to the push address, and the key-value pair is deleted from the preset list after the push is successful.
4. The task execution management method according to claim 1, characterized in that: The querying of each mark information corresponding to the user terminal within the target time period, and querying the task content corresponding to the mark information from a preset database, includes: Query the target tasks and task step flag information in the target state corresponding to the user terminal within the target time period, and construct a task flag list based on each flag information; wherein the target state includes execution completion and execution process; Each flag information in the task flag list is traversed, and the task content corresponding to each flag information is searched from a preset database.
5. The task execution management method according to claim 1, characterized in that: The result display model includes, in order from upper layer to lower layer, a first display model for displaying basic task information, a second display model for displaying task step information, and a third display model for displaying task step association information; wherein the second display model is a sub-model of the first display model, and the third display model is a sub-model of the second display model; Accordingly, the task content is assembled according to a predefined result display model to obtain a task information list, including: Filtering out first information content corresponding to the first display model from the task content, and assembling the first information content to obtain a first assembly result; Filtering out second information content corresponding to the second display model from the task content, and assembling the second information content to obtain a second assembly result; Filtering out third information content corresponding to the third display model from the task content, and assembling the third information content to obtain a third assembly result; The first assembly result, the second assembly result and the third assembly result are sequentially integrated to obtain a task information list.
6. The task execution management method according to claim 5, characterized in that: The basic task information includes task flag, task operation type, task operation object, task operator, task status, task progress, task start execution time, task end execution time and task execution process information; the task step information includes task step flag, task step operation type, task step operation object, task step operator, task step status, task step progress, task step start execution time, task step end execution time and task step execution process information; the task step associated information includes associated task step flag, associated task step operation type, associated task step operation object, associated task step operator, associated task step status, associated task step progress, associated task step start execution time, associated task step end execution time and associated task step execution process information.
7. The task execution management method according to any one of claims 1 to 6, characterized in that: When the preset query condition is currently met, querying each flag information corresponding to the user terminal within the target time period includes: During the execution of the target task, when a change in the task status or step status is detected, querying each flag information corresponding to the user terminal within the target time period; Or, during the execution of the target task, when the current timestamp is consistent with the preset query timestamp, query each mark information corresponding to the user terminal within the target time period.
8. A task execution management device, characterized in that: Applied to mission platforms, including: A request acquisition module, used to acquire a creation request of a target task, and save initial task information and initial task step information of the target task; the initial task information includes a task flag and an initial task state, and the initial task step information includes a step flag and an initial step state of each task step in the target task; A push address determination module, used to determine the push address corresponding to the target task based on the user end sending the creation request; A result assembly module is used to query each mark information corresponding to the user terminal within a target time period when a preset query condition is currently met, and query the task content corresponding to the mark information from a preset database, so as to assemble the task content according to a predefined result display model to obtain a task information list; the mark information includes a task mark and a step mark, and the preset database is used to store the latest task information and the latest task step information of the target task during the execution process, the latest task information includes the latest task status, and the latest task step information includes the latest step status; The push module is used to push the task information list according to the push address by using a preset target thread, and delete the push address and the task information list after the push is successful.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the task execution management method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the task execution management method as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Task full-life-cycle management method and device and electronic equipment
CN112488476A
Task processing method and device, electronic equipment and storage medium
CN115509714A
Task state generation system and method and electronic equipment
CN118567805A
Project task execution method and device, electronic equipment and storage medium
CN118967047A
Visualization method, device and system for global task node dependence relationship
WO2016192604A1