A task processing method, device and system
By storing target tasks in the task pool and allocating them according to the task processing queue information of the code packaging device, the problems of unreasonable task allocation and low processing efficiency in the existing technology are solved, and the dynamic allocation and efficiency of tasks in the task processing queue are realized. promote.
Patent Information
- Application Number
- CN202010574916.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-22
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-06-22
AI Technical Summary
The existing technology cannot flexibly schedule the code packaging device under certain circumstances, resulting in unreasonable task allocation and the inability to realize dynamic allocation of tasks in the task processing queue, resulting in low task processing efficiency.
By storing target tasks in the task pool, dynamic allocation is performed based on the task processing queue information of the code packaging device, monitoring the status of the device, ensuring reasonable task allocation, and allocating when the code packaging device is in a non-resting state.
It realizes flexible scheduling of code packaging devices under specific circumstances, making the distribution of tasks to be processed more reasonable and improving the efficiency of dynamic allocation of tasks in the task processing queue.
Smart Images

Figure CN113760482B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a task processing method, device and system. Background Art
[0002] With the rapid development of Internet technology, how to efficiently and rationally handle a large number of tasks is an urgent problem to be solved. For example, in the process of continuous integration using Jenkins (an open source software project platform, a continuous integration tool developed based on Java), after completing multiple code tasks, the code tasks can be packaged and processed through multiple code packaging devices. The specific process is: after creating multiple tasks, a task is matched for each code packaging device, and the remaining tasks directly enter the waiting queue of a code packaging device to wait for processing, while other code packaging devices may be idle.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0004] 1. In certain situations (such as when multiple tasks need to be processed and each task takes a long time to process), the code packaging device cannot be flexibly scheduled, and the allocation of tasks to be processed is unreasonable;
[0005] 2. It is impossible to dynamically allocate tasks in the task processing queue, and the task processing efficiency is low. Summary of the invention
[0006] In view of this, an embodiment of the present invention provides a task processing method and device, which can realize flexible scheduling of code packaging devices under specific circumstances, making the allocation of tasks to be processed more reasonable, and can also realize dynamic allocation of tasks in the task processing queue, thereby improving task processing efficiency.
[0007] To achieve the above object, according to a first aspect of an embodiment of the present invention, a task processing method is provided, comprising:
[0008] Obtaining a target task to be processed according to a task status of the target task, wherein multiple target tasks are stored in a task pool, and the target task includes code-related files;
[0009] According to the queue information of the task processing queue corresponding to the code packaging device, the code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages the target task to be processed.
[0010] Furthermore, before the step of allocating a code packaging device to a target task to be processed according to queue information of a task processing queue corresponding to the code packaging device, the task processing method further includes: monitoring a processing status of the code packaging device.
[0011] Furthermore, the task status of the target task is obtained by monitoring the target task according to a task monitoring cycle determined according to the historical task processing duration.
[0012] Furthermore, the task processing queue corresponding to the code packaging device is determined based on the code packaging device information, wherein the code packaging device information includes at least one of the following information: Internet Protocol address information, host address information, device quantity information, and a task quantity threshold corresponding to the task processing queue.
[0013] Furthermore, the queue information includes one or more of the following information: the number of tasks corresponding to the target tasks to be processed in the current queue, the task type, and the processing priority.
[0014] Furthermore, according to the queue information of the task processing queue corresponding to the code packaging device, the step of allocating the code packaging device to the target task to be processed includes: according to the queue information of the task processing queue corresponding to the code packaging device and the task information of the target task to be processed, allocating the code packaging device to the target task to be processed.
[0015] Furthermore, after the code packaging device performs the step of packaging the target tasks to be processed, the task processing method further includes: adjusting the task status of the processed target tasks.
[0016] According to a second aspect of an embodiment of the present invention, there is provided a task processing device, comprising:
[0017] An acquisition module, used for acquiring a target task to be processed according to a task status of the target task, wherein a plurality of target tasks are stored in a task pool, and the target task includes code-related files;
[0018] The task processing module is used to allocate a code packaging device to a target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device, and send the target task to be processed to the code packaging device so that the code packaging device packages the target task to be processed.
[0019] According to a third aspect of an embodiment of the present invention, there is provided a task processing system, including:
[0020] A task creation device, used to create a target task and send the target task to the task pool;
[0021] A task pool is used to obtain a target task to be processed according to the task status of the target task, wherein multiple target tasks are stored in the task pool, and the target task includes code-related files; according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device;
[0022] The code packaging device is used to receive the target tasks to be processed and package the target tasks to be processed.
[0023] According to a fourth aspect of an embodiment of the present invention, there is provided an electronic device, including:
[0024] one or more processors;
[0025] a storage device for storing one or more programs,
[0026] When one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned task processing methods.
[0027] According to a fifth aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored. When the program is executed by a processor, any one of the above-mentioned task processing methods is implemented.
[0028] An embodiment of the above invention has the following advantages or beneficial effects: because the target task to be processed is obtained according to the task status of the target task, wherein multiple target tasks are stored in a task pool, and the target task includes code-related files; according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages the target task to be processed. The technical means overcomes the technical problems that the code packaging device cannot be flexibly scheduled under specific circumstances, the code packaging device is not allocated reasonably, the dynamic allocation of tasks in the task processing queue cannot be realized, and the task processing efficiency is low, thereby achieving the technical effect of being able to flexibly schedule the code packaging device under specific circumstances, making the allocation of tasks to be processed more reasonable, and also being able to realize the dynamic allocation of tasks in the task processing queue, thereby improving the task processing efficiency.
[0029] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0031] Figure 1 is a schematic diagram of the main process of the task processing method provided according to the first embodiment of the present invention;
[0032] Figure 2 is a schematic diagram of the main process of the task processing method provided according to the second embodiment of the present invention;
[0033] Figure 3 is a schematic diagram of main modules of a task processing device provided according to an embodiment of the present invention;
[0034] Figure 4 is a schematic diagram of a framework of a task processing system provided according to an embodiment of the present invention;
[0035] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0036] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0038] Figure 1 is a schematic diagram of the main process of the task processing method provided according to the first embodiment of the present invention; Figure 1 As shown, the task processing method provided by the embodiment of the present invention mainly includes:
[0039] Step S101, obtaining a target task to be processed according to the task status of the target task, wherein a plurality of target tasks are stored in a task pool, and the target task includes code-related files.
[0040] Through the above settings, the target tasks are stored in the task pool. When task processing is required, the target tasks to be processed are obtained from the task pool according to the task status of the target tasks, so as to facilitate the subsequent allocation of code packaging devices to the target tasks to be processed, thereby avoiding the problem of unreasonable task allocation caused by sending the target tasks to be processed directly from the task creation device to the code packaging device in the prior art, and the inability of the code packaging device to be flexibly scheduled. On the other hand, storing multiple (here refers to greater than or equal to two) target tasks in the task pool is also convenient for recording the entire processing status of the target tasks, which is convenient for subsequent traceability inquiries.
[0041] Specifically, according to an embodiment of the present invention, the above-mentioned code-related files include source code, executable code, related configuration files, resource files, etc.
[0042] According to an embodiment of the present invention, before the above-mentioned step of allocating a code packaging device to the target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device, the task processing method also includes: monitoring the processing status of the code packaging device to confirm that the code packaging device is not in a rest state.
[0043] The processing status of the code packaging device includes: processing, idle and resting (i.e., resting status means that the code packaging device is temporarily not processing related tasks due to problems such as failures, system settings, etc.) The code packaging device in the resting state will not be assigned to the target task to be processed.
[0044] Further, according to an embodiment of the present invention, the task status of the target task is obtained by monitoring the target task according to a task monitoring cycle determined according to the historical task processing duration.
[0045] Specifically, the task monitoring cycle is determined according to the historical task processing time, and the task status of each target task is obtained according to the task monitoring cycle. This step can be performed by the task pool, and the task pool can perform real-time monitoring when executing (that is, the task monitoring cycle is short enough); it can also be performed by building a task status monitoring device, using the task status monitoring device to obtain the task status of each target task, and then sending the task status of each target task to the task pool. When the polling device is executed, the monitoring frequency can be reduced, avoiding the pressure on computer performance caused by frequent monitoring operations.
[0046] Step S102, according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages the target task to be processed.
[0047] Through the above settings, the task platform for creating tasks is decoupled from the code packaging device for performing task processing, and the target tasks to be processed are allocated through the task pool, thereby achieving flexible scheduling of the code packaging device under specific circumstances, making task processing allocation more reasonable.
[0048] Specifically, according to an embodiment of the present invention, the task processing queue corresponding to the above-mentioned code packaging device is determined based on the code packaging device information, wherein the code packaging device information includes at least one of the following information: IP (Internet Protocol Address) address information, host address information, device quantity information, and a task quantity threshold corresponding to the task processing queue.
[0049] According to an embodiment of the present invention, the queue information includes one or more of the following information: the number of tasks corresponding to the target tasks to be processed in the current queue, the task type, and the processing priority.
[0050] Further, according to an embodiment of the present invention, the above-mentioned step of allocating a code packaging device to a target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device includes: allocating a code packaging device to a target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device and the task information of the target task to be processed.
[0051] According to a specific implementation of the embodiment of the present invention, the task information of the target task to be processed indicates the task type and processing priority corresponding to the target task to be processed.
[0052] According to a specific implementation of an embodiment of the present invention, after a code packaging device is assigned to a target task to be processed based on the queue information of the task processing queue corresponding to the code packaging device and the task information of the target task to be processed, when the processing status of the code packaging device obtained through the above monitoring is idle, the target task to be processed can be directly selected to be sent to the code packaging device for packaging processing; when the processing status of the code packaging device obtained through the above monitoring is processing, the target task to be processed can be sent to the task processing queue corresponding to the code packaging device, and when the code packaging device is idle, the target task to be processed can be obtained from the corresponding task processing queue for packaging processing.
[0053] Furthermore, according to a specific implementation of an embodiment of the present invention, the queue information indicates the processing priority of the pending target tasks already in the task processing queue, and the task information indicates the processing priority of the currently assigned pending target tasks. For pending target tasks that need to be processed urgently (i.e., with a high processing priority), they can be packaged and processed before the pending tasks in the task processing queue.
[0054] Further, according to an embodiment of the present invention, after the step of the code packaging device packaging the target task to be processed, the task processing method further includes: adjusting the task status of the processed target task.
[0055] According to the technical solution of the embodiment of the present invention, the target task to be processed is obtained according to the task status of the target task, wherein multiple target tasks are stored in a task pool, and the target task includes code-related files; according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages the target task to be processed. The technical means overcomes the technical problems that the code packaging device cannot be flexibly scheduled under specific circumstances, the code packaging device is not allocated reasonably, the dynamic allocation of tasks in the task processing queue cannot be achieved, and the task processing efficiency is low. Therefore, the technical effect of being able to flexibly schedule the code packaging device under specific circumstances, making the allocation of tasks to be processed more reasonable, and being able to achieve dynamic allocation of tasks in the task processing queue, and improving the task processing efficiency is achieved.
[0056] Figure 2 is a schematic diagram of the main flow of the task processing method provided according to the second embodiment of the present invention; Figure 2 As shown, one application scenario of the embodiment of the present invention is to package and process code tasks created by the Jenkins (a continuous integration tool developed based on Java) platform. The task processing method provided by the embodiment of the present invention mainly includes:
[0057] Step S201 : monitoring a target task according to a task monitoring period determined by a historical task processing duration to obtain a task status of the target task.
[0058] According to an embodiment of the present invention, before the step of monitoring the target task and obtaining the task status of the target task according to the task monitoring period determined according to the historical task processing duration, the task processing method further includes: receiving the target task created by the task creation device (Jenkins platform).
[0059] Through the above settings, the task platform for creating the target task is decoupled from the code packaging device for performing task processing, and each target task to be processed is allocated through the task pool, thereby achieving flexible scheduling of the code packaging device under specific circumstances, making the task processing allocation more reasonable.
[0060] Further, according to an embodiment of the present invention, the above-mentioned target task is sent to the task pool in a certain data parsing form, including data parsing forms such as string, xml (Extensible Markup Language), list (a class in the class library, referring to a list; a detailed list), etc., preferably in the form of json (JavaScript Object Notation, a lightweight data exchange format). This is because json is a common data parsing method, and various platforms have a corresponding parsing method for json data, which makes the json data not restricted due to different language forms when it is transmitted and used between various platforms, thereby improving the versatility and ease of use in the data transmission process.
[0061] Step S202: obtaining the target task to be processed according to the task status of the target task.
[0062] Specifically, according to an embodiment of the present invention, a task status monitoring device is used to determine a task monitoring period according to the historical task processing duration, and the task status of each target task is obtained according to the task monitoring period. The task pool receives the task status of each target task sent by the task status monitoring device.
[0063] Through the above settings, by setting the task monitoring cycle, the pressure on computer performance caused by frequent monitoring operations is avoided.
[0064] Specifically, according to a specific implementation of an embodiment of the present invention, firstly, a task status monitoring device (the following steps can also be performed by a task pool) can be used to initialize a map (an object that maps keys to values) for each code packaging machine to record the time nodes of the code packaging machine, obtain the time nodes of 7 historical target tasks from the processed target task stack, and then calculate the packaging processing time of the 6 target tasks, and take one-fourth of the average packaging processing time of the 6 target tasks as the duration corresponding to the monitoring cycle, and obtain the task status of each target task and the processing status of each code packaging device according to the task monitoring cycle. As the packaging process progresses, the task monitoring cycle can also be re-determined in a recursive manner, thereby reducing the triggering frequency of the task status monitoring device and reducing the pressure on the CPU (Central Processing Unit / Processor). It should be noted that the above numerical values are only examples in this specific implementation and do not represent the limitation of the present invention. In the specific implementation process, the above numerical values can be adjusted according to actual conditions.
[0065] Step S203, monitoring the processing state of the code packaging device to determine whether the code packaging device is in a non-resting state.
[0066] According to an embodiment of the present invention, the monitoring of the code packaging device can be performed by the above-mentioned polling device, or can be performed directly by the task pool. Among them, the processing status of the code packaging device includes: processing, idle and resting (i.e., the resting state means that the code packaging device does not perform related task processing due to problems such as failures, system settings, etc.). For the code packaging device in the resting state, no target task to be processed is allocated.
[0067] Step S204: assigning a code packaging device to the target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device.
[0068] Through the above settings, the Jenkins platform is decoupled from the code packaging device, and the target tasks to be processed are allocated through the task pool, so that the code packaging device can be flexibly scheduled under specific circumstances, making the task processing allocation more reasonable.
[0069] Specifically, according to an embodiment of the present invention, the task processing queue corresponding to the above-mentioned code packaging device is determined based on the code packaging device information, wherein the code packaging device information includes at least one of the following information: IP (Internet Protocol Address) address information, host address information, device quantity information, and a task quantity threshold corresponding to the task processing queue.
[0070] According to an embodiment of the present invention, the queue information includes one or more of the following information: the number of tasks corresponding to the target tasks to be processed in the current queue, the task type, and the processing priority.
[0071] Step S205: When the processing state corresponding to the code packaging device is idle, the target task to be processed is sent to the code packaging device for packaging processing.
[0072] Furthermore, according to a specific implementation of an embodiment of the present invention, the queue information indicates the processing priority of the pending target tasks already in the task processing queue, and the task information indicates the processing priority of the currently assigned pending target tasks. For pending target tasks that need to be processed urgently (i.e., with a high processing priority), they can be packaged and processed before the pending tasks in the task processing queue.
[0073] Step S206, when the processing status corresponding to the code packaging device is processing, the target task to be processed is sent to the task processing queue corresponding to the code packaging device, so that when the code packaging device is in an idle state, the target task to be processed is obtained from the corresponding task processing queue for packaging processing.
[0074] Further, according to an embodiment of the present invention, after the step of the code packaging device packaging the target task to be processed, the task processing method further includes: adjusting the task status of the processed target task.
[0075] Through the above settings, the page display platform can obtain the latest status of the target task and display the corresponding page, so that the user can obtain the execution status of the target task. According to an embodiment of the present invention, the page display platform can display through HTML5 (a core language of the World Wide Web and an application of Hypertext Markup Language under the standard universal markup language).
[0076] According to the technical solution of the embodiment of the present invention, the target task to be processed is obtained according to the task status of the target task, wherein multiple target tasks are stored in a task pool, and the target task includes code-related files; according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages the target task to be processed. The technical means overcomes the technical problems that the code packaging device cannot be flexibly scheduled under specific circumstances, the code packaging device is not allocated reasonably, the dynamic allocation of tasks in the task processing queue cannot be achieved, and the task processing efficiency is low. Therefore, the technical effect of being able to flexibly schedule the code packaging device under specific circumstances, making the allocation of tasks to be processed more reasonable, and being able to achieve dynamic allocation of tasks in the task processing queue, and improving the task processing efficiency is achieved.
[0077] Figure 3 is a schematic diagram of the main modules of the task processing device provided according to an embodiment of the present invention; Figure 3 As shown, the task processing device 300 provided in this embodiment of the present invention mainly includes:
[0078] The acquisition module 301 is used to acquire a target task to be processed according to the task status of the target task, wherein a plurality of target tasks are stored in a task pool, and the target task includes code-related files.
[0079] Through the above settings, the target tasks are stored in the task pool. When task processing is required, the target tasks to be processed are obtained from the task pool according to the task status of the target tasks, so as to facilitate the subsequent allocation of code packaging devices to the target tasks to be processed, thereby avoiding the problem of unreasonable task allocation caused by sending the target tasks to be processed directly from the task creation device to the code packaging device in the prior art, and the inability of the code packaging device to be flexibly scheduled. On the other hand, storing multiple (here refers to greater than or equal to two) target tasks in the task pool is also convenient for recording the entire processing status of the target tasks, which is convenient for subsequent traceability inquiries.
[0080] Specifically, according to an embodiment of the present invention, the above-mentioned code-related files include source code, executable code, related configuration files, resource files, etc.
[0081] According to an embodiment of the present invention, the above-mentioned task processing device 300 also includes a processing status monitoring device. Before the step of allocating a code packaging device to a target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device, the processing status monitoring device is used to: monitor the processing status of the code packaging device to confirm that the code packaging device is not in a rest state.
[0082] The processing status of the code packaging device includes: processing, idle and resting (i.e., resting status means that the code packaging device is temporarily not processing related tasks due to problems such as failures, system settings, etc.) The code packaging device in the resting state will not be assigned to the target task to be processed.
[0083] Further, according to an embodiment of the present invention, the task status of the target task is obtained by monitoring the target task according to a task monitoring cycle determined according to the historical task processing duration.
[0084] Specifically, the task monitoring cycle is determined according to the historical task processing time, and the task status of each target task is obtained according to the task monitoring cycle. This step can be performed by the task pool, and the task pool can perform real-time monitoring when executing (that is, the task monitoring cycle is short enough); it can also be performed by building a task status monitoring device, using the task status monitoring device to obtain the task status of each target task, and then sending the task status of each target task to the task pool. When the task status monitoring device is executed, the monitoring frequency can be reduced, avoiding the pressure on computer performance caused by frequent monitoring operations.
[0085] The task processing module 302 is used to allocate a code packaging device to the target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device, and send the target task to be processed to the code packaging device so that the code packaging device packages the target task to be processed.
[0086] Through the above settings, the task platform for creating tasks is decoupled from the code packaging device for performing task processing, and the target tasks to be processed are allocated through the task pool, thereby achieving flexible scheduling of the code packaging device under specific circumstances, making task processing allocation more reasonable.
[0087] Specifically, according to an embodiment of the present invention, the task processing queue corresponding to the above-mentioned code packaging device is determined based on the code packaging device information, wherein the code packaging device information includes at least one of the following information: IP (Internet Protocol Address) address information, host address information, device quantity information, and a task quantity threshold corresponding to the task processing queue.
[0088] According to an embodiment of the present invention, the queue information includes one or more of the following information: the number of tasks corresponding to the target tasks to be processed in the current queue, the task type, and the processing priority.
[0089] Further, according to an embodiment of the present invention, the task processing module 302 is further configured to allocate a code packaging device to the target task to be processed according to queue information of the task processing queue corresponding to the code packaging device and task information of the target task to be processed.
[0090] According to a specific implementation of the embodiment of the present invention, the task information of the target task to be processed indicates the task type and processing priority corresponding to the target task to be processed.
[0091] According to a specific implementation of an embodiment of the present invention, after a code packaging device is assigned to a target task to be processed based on the queue information of the task processing queue corresponding to the code packaging device and the task information of the target task to be processed, when the processing status of the code packaging device obtained through the above monitoring is idle, the target task to be processed can be directly selected to be sent to the code packaging device for packaging processing; when the processing status of the code packaging device obtained through the above monitoring is processing, the target task to be processed can be sent to the task processing queue corresponding to the code packaging device, and when the code packaging device is idle, the target task to be processed can be obtained from the corresponding task processing queue for packaging processing.
[0092] Furthermore, according to a specific implementation of an embodiment of the present invention, the queue information indicates the processing priority of the pending target tasks already in the task processing queue, and the task information indicates the processing priority of the currently assigned pending target tasks. For pending target tasks that need to be processed urgently (i.e., with a high processing priority), they can be packaged and processed before the pending tasks in the task processing queue.
[0093] Further, according to an embodiment of the present invention, the task processing device 300 further includes an adjustment module. After the code packaging device performs a step of packaging the target task to be processed, the adjustment module is used to adjust the task status of the processed target task.
[0094] According to the technical solution of the embodiment of the present invention, the target task to be processed is obtained according to the task status of the target task, wherein multiple target tasks are stored in a task pool, and the target task includes code-related files; according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages the target task to be processed. The technical means overcomes the technical problems that the code packaging device cannot be flexibly scheduled under specific circumstances, the code packaging device is not allocated reasonably, the dynamic allocation of tasks in the task processing queue cannot be achieved, and the task processing efficiency is low. Therefore, the technical effect of being able to flexibly schedule the code packaging device under specific circumstances, making the allocation of tasks to be processed more reasonable, and being able to achieve dynamic allocation of tasks in the task processing queue, and improving the task processing efficiency is achieved.
[0095] Figure 4 is a schematic diagram of a framework of a task processing system provided according to an embodiment of the present invention; Figure 4 As shown, the task processing system 400 provided in this embodiment of the present invention mainly includes:
[0096] The task creation device 401 is used to create a target task and send the target task to the task pool.
[0097] According to an embodiment of the present invention, the task creation device 401 is also used to construct a code packaging device ( Figure 4 The three code packaging devices shown in the figure are only examples, and the specific number of code packaging devices can be set according to actual conditions).
[0098] By building a task processing device through the task platform, the specific processing method indicated by the task processing device matches the target task to be processed, and the task processing process can be completed more efficiently. Preferably, there can be multiple task processing devices constructed here, and the task processing device can be a packaging machine.
[0099] Furthermore, according to an embodiment of the present invention, the task creation device 401 is also used to: convert the task processing device information and multiple target tasks into data parsing format and then send them to the task pool.
[0100] Specifically, according to an embodiment of the present invention, the task processing device information and multiple target tasks are converted into JSON format. Since JSON is a universal data parsing method, and various platforms have corresponding parsing methods for JSON data, the transmission and use of JSON data between various platforms will not be restricted due to different language forms, thereby improving the versatility and ease of use during data transmission.
[0101] The task processing device information includes the IP (Internet Protocol Address) address information corresponding to the task processing device and at least one of the following information: host address information, task processing device quantity information and task processing queue information corresponding to each task processing device. The node allocation device can be a task scheduling pool or a task matching pool.
[0102] The task pool 402 is used to obtain the target task to be processed according to the task status of the target task, wherein multiple target tasks are stored in the task pool, and the target task includes code-related files; according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device.
[0103] According to an embodiment of the present invention, the task pool 402 is further used to: allocate task processing queues for each target task to be processed according to the code packaging device information.
[0104] Through the above settings, a task processing queue is allocated to each code packaging device according to the IP address information, host address information, code packaging device quantity information and task processing queue information corresponding to each code packaging device indicated in the code packaging device information.
[0105] According to an embodiment of the present invention, before the step of using a node allocation device to allocate a task processing queue for each target task according to the task processing device information, the above-mentioned task processing method also includes: using the task pool 402 to parse the json string (including task processing device information and multiple target tasks) sent by the task creation device.
[0106] Further, according to an embodiment of the present invention, the task pool 402 is also used to determine the task monitoring period according to the historical processing time, and obtain the task status of each target task and the processing status of each code packaging device according to the task monitoring period. According to a specific implementation of the embodiment of the present invention, the above steps can also be performed by constructing a task monitoring device.
[0107] According to a specific implementation of an embodiment of the present invention, when the processing status of a code packaging device is idle, a target task to be processed can be determined from the task processing queue corresponding to the code packaging device to match the code packaging device, so that the code packaging device can package and process the target task to be processed.
[0108] According to another specific implementation of the embodiment of the present invention, when the processing state of a code packaging device is idle, a target task to be processed can be determined from all target tasks to be processed to match the code packaging device, so that the code packaging device can package and process the target task to be processed, thereby realizing the dynamic allocation of tasks in the task processing queue and improving the technical effect of task processing efficiency.
[0109] The code packaging device 403 is used to receive the target tasks to be processed and package the target tasks to be processed.
[0110] According to the embodiment of the present invention, after the code packaging device 403 completes the step of packaging the target tasks to be processed, the task status of the processed target tasks can also be adjusted through the task pool 402 .
[0111] The page display platform 404 obtains the latest state (adjusted state) of the target task and displays the corresponding page so that the user can obtain the execution status of the target task. According to an embodiment of the present invention, the page display platform can display the page using HTML5 (a core language of the World Wide Web and an application of Hypertext Markup Language under the Standard Universal Markup Language).
[0112] According to the technical solution of the embodiment of the present invention, the target task to be processed is obtained according to the task status of the target task, wherein multiple target tasks are stored in a task pool, and the target task includes code-related files; according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages the target task to be processed. The technical means overcomes the technical problems that the code packaging device cannot be flexibly scheduled under specific circumstances, the code packaging device is not allocated reasonably, the dynamic allocation of tasks in the task processing queue cannot be achieved, and the task processing efficiency is low. Therefore, the technical effect of being able to flexibly schedule the code packaging device under specific circumstances, making the allocation of tasks to be processed more reasonable, and being able to achieve dynamic allocation of tasks in the task processing queue, and improving the task processing efficiency is achieved.
[0113] Figure 5 An exemplary system architecture 500 is shown to which the task processing method or task processing apparatus according to the embodiment of the present invention can be applied.
[0114] like Figure 5As shown, the system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505 (this architecture is only an example, and the components included in the specific architecture may be adjusted according to the specific application). The network 504 is used to provide a medium for a communication link between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0115] Users can use terminal devices 501, 502, 503 to interact with server 505 through network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0116] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0117] The server 505 may be a server that provides various services, such as a background management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 501, 502, and 503. The background management server may analyze and process the received data such as the target tasks to be processed and the queue information, and feed back the processing results (such as the distribution of the target tasks to be processed to the corresponding code packaging device - only an example) to the terminal device.
[0118] It should be noted that the task processing method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the task processing device is generally disposed in the server 505 .
[0119] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0120] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device suitable for implementing an embodiment of the present invention. Figure 6 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0121] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0122] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0123] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.
[0124] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0126] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes an acquisition module and a task processing module. The names of these modules do not constitute a limitation on the modules themselves in some cases, for example, the acquisition module may also be described as "a module for acquiring a target task to be processed according to the task status of the target task".
[0127] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining a target task to be processed according to the task status of the target task, wherein multiple target tasks are stored in a task pool, and the target task includes code-related files; according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages the target task to be processed.
[0128] According to the technical solution of the embodiment of the present invention, the target task to be processed is obtained according to the task status of the target task, wherein multiple target tasks are stored in a task pool, and the target task includes code-related files; according to the queue information of the task processing queue corresponding to the code packaging device, a code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages the target task to be processed. The technical means overcomes the technical problems that the code packaging device cannot be flexibly scheduled under specific circumstances, the code packaging device is not allocated reasonably, the dynamic allocation of tasks in the task processing queue cannot be achieved, and the task processing efficiency is low. Therefore, the technical effect of being able to flexibly schedule the code packaging device under specific circumstances, making the allocation of tasks to be processed more reasonable, and being able to achieve dynamic allocation of tasks in the task processing queue, and improving the task processing efficiency is achieved.
[0129] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A task processing method, characterized in that: include: Acquire a target task to be processed according to the task status of the target task, wherein a plurality of the target tasks are stored in a task pool, and the target task includes code-related files; According to the queue information of the task processing queue corresponding to the code packaging device, the code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device, so that the code packaging device packages and processes the target task to be processed; the task processing queue corresponding to the code packaging device is determined according to the code packaging device information, wherein the code packaging device information includes at least one of the following information: Internet Protocol address information, host address information, device quantity information and a task quantity threshold corresponding to the task processing queue.
2. The task processing method according to claim 1, characterized in that: Before the step of allocating the code packaging device to the target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device, the task processing method further includes: monitoring the processing status of the code packaging device.
3. The task processing method according to claim 1, characterized in that: The task status of the target task is obtained by monitoring the target task in a task monitoring cycle determined according to the historical task processing duration.
4. The task processing method according to claim 1, characterized in that: The queue information includes one or more of the following information: the number of tasks corresponding to the target tasks to be processed in the current queue, the task type, and the processing priority.
5. The task processing method according to claim 1, characterized in that: The step of allocating the code packaging device to the target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device includes: allocating the code packaging device to the target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device and the task information of the target task to be processed.
6. The task processing method according to claim 1, characterized in that: After the code packaging device performs the step of packaging the target tasks to be processed, the task processing method further includes: adjusting the task status of the processed target tasks.
7. A task processing device, characterized in that: include: An acquisition module, used for acquiring a target task to be processed according to a task status of the target task, wherein a plurality of the target tasks are stored in a task pool, and the target task includes code-related files; A task processing module is used to allocate the code packaging device to the target task to be processed according to the queue information of the task processing queue corresponding to the code packaging device, and send the target task to be processed to the code packaging device, so that the code packaging device packages and processes the target task to be processed; the task processing queue corresponding to the code packaging device is determined according to the code packaging device information, wherein the code packaging device information includes at least one of the following information: Internet Protocol address information, host address information, device quantity information and task quantity threshold corresponding to the task processing queue.
8. A task processing system, characterized in that: include: A task creation device, used for creating a target task and sending the target task to a task pool; A task pool is used to obtain a target task to be processed according to a task status of a target task, wherein a plurality of the target tasks are stored in the task pool, and the target task includes a code-related file; according to queue information of a task processing queue corresponding to a code packaging device, the code packaging device is allocated to the target task to be processed, and the target task to be processed is sent to the code packaging device; the task processing queue corresponding to the code packaging device is determined according to code packaging device information, wherein the code packaging device information includes at least one of the following information: Internet protocol address information, host address information, device quantity information, and a task quantity threshold corresponding to the task processing queue; The code packaging device is used to receive the target tasks to be processed and package the target tasks to be processed.
9. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Task scheduling system, method and device
CN108182111A
Task management method and system, server cluster and computer readable medium
CN110096344A
Method and apparatus for processing task in smart device
US20190163524A1
Method for copying clustered data, and method and device for determining priority
WO2017167070A1
Method and apparatus for processing streaming data task
WO2018121738A1
