Asynchronous task visual management system and method
By introducing an asynchronous task visual management system into the network communication system, the complex problem of asynchronous task state management is solved, and the system management and visual display of tasks are realized, which improves system performance and user experience.
Patent Information
- Application Number
- CN202411612053.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-04
AI Technical Summary
In network communication, the state management of asynchronous tasks is complicated, resulting in the inability to perceive business status, control execution functions in real time, and understand the actual processing progress of the task.
Provides an asynchronous task visual management system, including a task receiver, a task manager, a task executor and a monitoring module. The system generates asynchronous task messages and IDs, performs task queue scheduling, and monitors task status to realize visual display and management of tasks.
It realizes systematic management and visual display of asynchronous tasks. Users can view the task execution progress and completion status at any time, improving the observability and system performance of asynchronous tasks.
Smart Images

Figure CN119557171A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communications, and in particular to an asynchronous task visualization management system and method. Background Art
[0002] In network communications, asynchronous tasks are widely used, such as asynchronous file transmission, asynchronous loading of web page content, asynchronous request and response data, etc. Asynchronous tasks can improve the efficiency and performance of network communications.
[0003] The modules of the system are isolated from each other, and the tasks are not managed in a unified system, which complicates the state management of asynchronous tasks. Some long-time tasks in the system are processed asynchronously. The system puts the tasks into a queue, and then processes them asynchronously by independent task execution threads. The main thread does not wait for the task to be completed, but continues to perform other operations. The user thinks that the task is over after the save is completed. The task status cannot be known, so the user dare not close the current window or switch to other places, fearing that the task will be interrupted. Therefore, the current system cannot perceive the business status, control the execution function, and understand the actual processing progress of the task in real time. Summary of the invention
[0004] The purpose of this application is to provide an asynchronous task visualization management system and method, which can effectively manage and monitor the status of asynchronous tasks and improve the observability of asynchronous tasks.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides an asynchronous task visualization management system, comprising:
[0007] A task receiver, used for receiving an asynchronous task and generating an asynchronous task message and an asynchronous task ID according to event parameters of the asynchronous task;
[0008] A task manager, connected to the task receiver, performs task queue scheduling according to the asynchronous task message and the asynchronous task ID;
[0009] A task executor, connected to the task manager, for executing asynchronous tasks in sequence according to the scheduled task queue;
[0010] The monitoring module is connected to the task executor and is used to monitor the execution status of each asynchronous task, visualize the execution progress and execution results, and send the execution results to the user.
[0011] In a second aspect, the present application provides a method for visual management of asynchronous tasks, including:
[0012] Receive an asynchronous task, and generate an asynchronous task message and an asynchronous task ID according to event parameters of the asynchronous task;
[0013] Perform task queue scheduling according to the asynchronous task message and the asynchronous task ID;
[0014] Execute asynchronous tasks in sequence according to the scheduled task queue;
[0015] Monitor the execution status of each asynchronous task and visualize the execution progress and results;
[0016] Send the execution results to the user.
[0017] According to the specific embodiments provided in this application, this application has the following technical effects:
[0018] The present application provides an asynchronous task visualization management system and method. The task manager schedules the task queue according to the asynchronous task message and the asynchronous task ID. The task executor executes the asynchronous tasks in sequence according to the scheduled task queue. The asynchronous tasks are executed in sequence according to the order in which they are created. Then, the execution progress and completion status of the asynchronous tasks can be checked at any time through the monitoring module, thereby realizing the systematic management and visualization display of asynchronous tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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 will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A schematic diagram of the structure of an asynchronous task visualization management system provided by an embodiment of the present application;
[0021] Figure 2 This is a diagram of the prompt box that pops up after the asynchronous task is successfully submitted;
[0022] Figure 3 This is a schematic diagram of the prompt box after the asynchronous task starts;
[0023] Figure 4 A pop-up window diagram showing the execution progress and status of an asynchronous task;
[0024] Figure 5 It is a schematic diagram of the execution status and progress of asynchronous tasks;
[0025] Figure 6 This is a schematic diagram of the pop-up window after the asynchronous task is completed;
[0026] Figure 7 This is a schematic diagram of the pop-up window when an asynchronous task is abnormal;
[0027] Figure 8 A flowchart of a method for visual management of asynchronous tasks provided in one embodiment of the present application;
[0028] Fig. 9 A schematic diagram of an asynchronous task processing flow provided in one embodiment of the present application. DETAILED DESCRIPTION
[0029] 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 application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] This application is mainly aimed at high-concurrency, long-time asynchronous processing tasks in the system. Asynchronous tasks include: tasks that the system refreshes spontaneously (such as refreshing policy, refreshing connection, refreshing topology, resource cleanup (such as deleting wan, deleting site) and manually submitted tasks (such as creating / editing / deleting Topology, Site Label, CPE, PolicyTemplate, Access List, subscription). This application will display these asynchronous tasks in a unified interface, and you can view the progress and specific status of task processing.
[0031] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0032] In an exemplary embodiment, Figure 1 As shown, an asynchronous task visualization management system is provided, including: a task receiver, a task manager, a task executor and a monitoring module.
[0033] The task receiver is used to receive an asynchronous task and generate an asynchronous task message and an asynchronous task ID according to event parameters of the asynchronous task.
[0034] Specifically, the task receiver uses aiohttp to create an http server given to asyncio. After receiving the asynchronous task creation / cancellation request, it uses asyncio to implement asynchronous network services and receive asynchronous task requests from users.
[0035] The task manager is connected to the task receiver and performs task queue scheduling according to the asynchronous task message and the asynchronous task ID.
[0036] Specifically, the asyncio event loop task manager is used to implement the asynchronous task management function. The task manager is responsible for the submission, scheduling, queue management and execution of asynchronous tasks to ensure that asynchronous tasks can be executed in the order of the task queue.
[0037] The task executor is connected to the task manager and is used to execute asynchronous tasks in sequence according to the scheduled task queue.
[0038] Specifically, asyncio performs task execution: creates an event loop and executes asynchronous tasks in the event loop to achieve concurrent processing. Multiple asynchronous tasks are created through the asyncio.run(...) function, and multiple asynchronous tasks are executed concurrently to improve system performance and efficiency.
[0039] The monitoring module is connected to the task executor and is used to monitor the execution status of each asynchronous task, visualize the execution progress and execution results, and send the execution results to the user.
[0040] Specifically, the Python log module is combined to realize the monitoring and notification functions of the execution status of each asynchronous task during the asynchronous task processing, and the execution results are displayed in the system interface to realize the systematic management and visual display of asynchronous tasks.
[0041] The interface interaction of the asynchronous task visualization management system provided by this application is as follows:
[0042] The user performs an operation on the interface, triggering a task request that needs to be processed asynchronously. The system receives the user's operation, identifies that the task needs to be processed asynchronously, and pops up a prompt box on the interface to inform the user that asynchronous processing is required and estimates the execution time. The system adds the asynchronous task to the task queue for asynchronous processing and saves the user's selection status.
[0043] After the asynchronous task is successfully submitted, the system pops up a prompt box to remind the user that the asynchronous task has been saved successfully and displays the option of [Enable tracking mode]. Figure 2-Figure 3 If the user chooses to turn on [Tracking Mode], the system records the user's choice and prepares to start the tracking function of the asynchronous task. During the execution of the asynchronous task, the system updates the pop-up window content in real time according to the progress of the asynchronous task, and displays the execution progress and status of the asynchronous task, such as Figure 4 The pop-up window includes relevant information such as the task execution percentage, remaining time, current status, etc. The pop-up window is always in the visible area of the screen and will not be blocked or hidden by the page.
[0044] Asynchronous task management list: After the asynchronous task is assigned to the task executor, the asynchronous operation is performed, including task initialization, operation, etc. During the execution of the asynchronous task, the system monitors the execution status of the asynchronous task and records the execution progress, such as Figure 5 The contents displayed on the system interface are shown in Table 1.
[0045] Table 1
[0046]
[0047] For each asynchronous task, the system will record the state change process of the asynchronous task and provide real-time state query capabilities. You can view the specific state of the asynchronous task. The current states of the asynchronous task are shown in Table 2.
[0048] Table 2
[0049]
[0050]
[0051] After the asynchronous task is completed in the background, the system will mark the task status as completed and generate the result data of the task execution. After the asynchronous task is completed, a pop-up window will be displayed to notify the result, such as Figure 6 shown.
[0052] When an asynchronous task fails, a pop-up window displays the cause of the failure and tells the user how to resolve the failure. Figure 7 shown.
[0053] The above asynchronous task visualization management system provided by this application has the following advantages:
[0054] (1) Better task operation management: All tasks are managed uniformly in the asynchronous task visualization management system. Asynchronous tasks are executed in the order of creation, and the execution progress and completion status of asynchronous tasks can be viewed at any time. The execution of multiple asynchronous tasks is highly parallelized, and a large number of asynchronous tasks can be completed faster at a reasonable cost. Link tracking capabilities allow asynchronous tasks to be better observed and problems to be diagnosed more easily.
[0055] (2) Improve system performance: Through asynchronous processing, the system will not be blocked when executing I / O intensive tasks, thereby improving the performance and throughput of the overall system. The asynchronous task visualization management system can process multiple asynchronous tasks at the same time, fully utilize system resources, and improve the system's concurrency capabilities.
[0056] (3) Effective utilization of resources: Through asynchronous task processing, the system can better utilize computing resources, reduce unnecessary idle time, and improve resource utilization.
[0057] (4) Flexibility and scalability: The asynchronous task visualization management system has good flexibility and scalability, and can easily add new task types or adjust the system architecture according to business needs.
[0058] (5) Simplify concurrent programming: Asynchronous programming can simplify the complex concurrent programming process and realize asynchronous execution of tasks through mechanisms such as event loops and coroutines, thereby reducing programming complexity.
[0059] (6) Logging and monitoring: Asynchronous task visualization management systems usually record asynchronous task execution logs and monitor system status to facilitate troubleshooting and performance optimization.
[0060] (7) Improve user experience and help users understand the status of asynchronous task processing: Visually distinguish the unfinished and completed states of asynchronous tasks, and display some asynchronous tasks that users are concerned about on the interface. This makes the process of users waiting for tasks clear and smooth, relieves users' anxiety, and promotes a positive and effective transition of system response time differences, improving user experience and satisfaction.
[0061] In an exemplary embodiment, Figure 8-Figure 9 As shown, a method for visual management of asynchronous tasks is provided, including:
[0062] S1: receiving an asynchronous task, and generating an asynchronous task message and an asynchronous task ID according to event parameters of the asynchronous task.
[0063] S2: Perform task queue scheduling according to the asynchronous task message and the asynchronous task ID.
[0064] S3: Execute asynchronous tasks in sequence according to the scheduled task queue.
[0065] S4 controls the execution status of each asynchronous task and displays the execution status visually; the execution status includes execution progress and execution results.
[0066] S5: Send the execution result to the user.
[0067] Before receiving the asynchronous task, it also includes: judging whether asynchronous processing is required according to the nature of the task; if not, executing synchronous task processing.
[0068] After receiving an asynchronous task, this application will pop up a window to inform the user of the estimated execution time, and use asyncio asynchronous collaboration OI operations to execute and monitor the task. During the execution of the asynchronous task, a pop-up window will be displayed, and the content of the pop-up window includes: task execution progress and task execution results. When an exception occurs in the execution of an asynchronous task, a pop-up window will display the cause of the exception.
[0069] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0070] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. An asynchronous task visualization management system, characterized in that: include: A task receiver, used for receiving an asynchronous task and generating an asynchronous task message and an asynchronous task ID according to event parameters of the asynchronous task; A task manager, connected to the task receiver, performs task queue scheduling according to the asynchronous task message and the asynchronous task ID; A task executor, connected to the task manager, for executing asynchronous tasks in sequence according to the scheduled task queue; A monitoring module, connected to the task executor, for monitoring the execution status of each asynchronous task and visually displaying the execution status; the execution status includes execution progress and execution results; The monitoring module is also used to send the execution result to the user.
2. The asynchronous task visualization management system according to claim 1, characterized in that: The asynchronous tasks include tasks refreshed spontaneously by the system and tasks submitted manually.
3. The asynchronous task visualization management system according to claim 1, characterized in that: The task receiver uses asyncio to implement asynchronous network services.
4. A method for visual management of asynchronous tasks, characterized in that: include: Receive an asynchronous task, and generate an asynchronous task message and an asynchronous task ID according to event parameters of the asynchronous task; Perform task queue scheduling according to the asynchronous task message and the asynchronous task ID; Execute asynchronous tasks in sequence according to the scheduled task queue; Monitor the execution status of each asynchronous task and display the execution status visually; the execution status includes execution progress and execution results; Send the execution results to the user.
5. The method for visual management of asynchronous tasks according to claim 4, characterized in that: Use asyncio asynchronous collaborative OI operations for task execution and monitoring.
6. The method for visual management of asynchronous tasks according to claim 4, characterized in that: Before receiving the asynchronous task, also include: Determine whether asynchronous processing is required based on the nature of the task; If not, execute synchronous task processing.
7. The method for visual management of asynchronous tasks according to claim 4, characterized in that: The asynchronous task will display a pop-up window during execution.
8. The method for visual management of asynchronous tasks according to claim 7, characterized in that: The content of the pop-up window includes: task execution progress and task execution results.
9. The method for visual management of asynchronous tasks according to claim 4, characterized in that: When an exception occurs during asynchronous task execution, a pop-up window displays the cause of the exception.
10. The method for visual management of asynchronous tasks according to claim 4, characterized in that: After receiving an asynchronous task, a pop-up window informs the user of the estimated execution time.