Task processing method and system and electronic equipment
By receiving task requests and predicting device execution time, and dynamically identifying load conditions, the problem of uneven resource allocation in isolated devices is solved, thereby improving task processing efficiency and response speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-04-03
AI Technical Summary
In isolated devices, uneven resource allocation leads to some devices being overloaded while others are idle, resulting in low task processing efficiency and limited response speed.
By receiving task requests, predicting the time required for the device to execute the task based on the task identifier, dynamically identifying the load status, and sending a response message only when the predicted time is less than the expected time, instructing the task to be reassigned to the best device.
It improves task processing efficiency and system response speed, optimizes resource utilization, avoids unnecessary message transmission, and enhances the overall system's task processing capabilities.
Smart Images

Figure CN121785765A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and more specifically, to a task processing method and system, and an electronic device. Background Technology
[0002] In related technologies, various devices usually operate in isolation. However, this isolated operation mode often leads to extremely uneven resource utilization due to unreasonable task allocation. Some devices may be under high load for a long time, while the resources of other devices may be largely idle.
[0003] In isolated operation mode, resource allocation depends entirely on the initial design or manual static settings. Devices cannot share resources. When a target task arrives, high-load devices may delay task execution or even drop some tasks due to limited processing capacity, resulting in limited task processing efficiency and response speed, thus limiting the overall processing capacity of the system. Summary of the Invention
[0004] This application provides a task processing method, system, and electronic device to at least solve the technical problem of low task processing efficiency in related technologies.
[0005] According to one aspect of the embodiments of this application, a task processing method is provided, comprising: receiving a task request sent by a first device, wherein the task request includes a task identifier of a target task and a first duration, the first duration being a duration predicted by the first device for processing the target task; responding to the task request and determining a second duration based on the task identifier, wherein the second duration is a duration predicted by a second device for processing the target task, the second device being any one of N devices distributedly connected to the first device, wherein N is an integer greater than or equal to 1; and, if the second duration is less than the first duration, sending a first response message to the first device to instruct the first device to determine a target device for processing the target task, wherein the first response message includes the second duration.
[0006] In an exemplary embodiment, in response to the task request, determining a second duration based on the task identifier includes: predicting the duration required for the second device to execute the target task based on the task identifier, and obtaining a third duration; determining a first pending task included in the first task queue that is waiting for the second device to execute; predicting a fourth duration for waiting for the second device to execute the target task based on the first pending task; and determining the second duration based on the third duration and the fourth duration.
[0007] In one exemplary embodiment, predicting the time required for the second device to execute the target task based on the task identifier to obtain a third time includes: filtering a first task set from a first historical task set based on the task identifier, wherein the first historical task set includes historical tasks executed by the second device, and the first task set includes a first task with the same task identifier as the target task; and determining the third time based on the execution time required for the second device to execute the first task.
[0008] In one exemplary embodiment, predicting the queuing time for the second device to execute the target task based on the first task to be executed includes at least one of the following: predicting the fourth duration based on the task volume of the first task to be executed; determining the target execution priority of the target task; and predicting the fourth duration based on the target execution priority.
[0009] In one exemplary embodiment, predicting the fourth duration based on the task volume of the first task to be executed includes: when the task volume of the first task to be executed is one, determining the execution duration of the second device executing the first task to be executed as the fourth duration; when the task volume of the first task to be executed is multiple, determining the fourth duration based on the task type and execution duration of the multiple first tasks to be executed.
[0010] In an exemplary embodiment, when there are multiple first tasks to be executed, determining the fourth duration based on the task type and execution duration of the multiple first tasks to be executed includes: when the task types of the multiple first tasks to be executed are the same, filtering a second task set from a first historical task set based on the identifier corresponding to each first task to be executed, wherein the first historical task set includes historical tasks executed by the second device, and the second task set includes multiple second tasks with identifiers that are the same as the identifiers of the multiple first tasks to be executed; and determining the fourth duration based on the execution duration of the multiple second tasks executed by the second device and the task quantity of the first tasks to be executed.
[0011] In an exemplary embodiment, when there are multiple first tasks to be executed, determining the fourth duration based on the task types and execution durations of the multiple first tasks to be executed includes: when the task types of the multiple first tasks to be executed are not completely the same, filtering multiple third task sets from a first historical task set based on the identifier corresponding to each first task to be executed, wherein the first historical task set includes historical tasks executed by the second device, and the identifier of a third task included in a third task set is the same as the task identifier of a first task to be executed; determining first parallel processing information that allows parallel processing of tasks of the multiple task types from a first historical task log set based on the multiple task types included in the first tasks to be executed; and determining the fourth duration based on the first parallel processing information, the task volume of the multiple first tasks to be executed, and the execution duration of each first task to be executed by the second device.
[0012] In one exemplary embodiment, determining the fourth duration based on the first parallel processing information, the workload of the first task to be executed, and the execution time of the second device executing multiple first tasks to be executed includes: calculating the average of the execution times of multiple third tasks in each third task set to obtain the execution time of the second device executing each first task to be executed; and determining the fourth duration based on the first parallel processing information, the workload of the multiple first tasks to be executed, and the execution time of the second device executing each first task to be executed.
[0013] In one exemplary embodiment, determining the fourth duration based on the first parallel processing information, the workload of the plurality of first tasks to be executed, and the execution time of the second device for each of the first tasks to be executed further includes: dividing the plurality of first tasks to be executed into a plurality of task sets according to task type, wherein each task set includes tasks of the same type; determining the association relationship of the plurality of task sets to be executed according to the first parallel processing information, wherein the association relationship is used to indicate whether the first tasks included in different task sets to be executed are allowed to be executed in parallel; determining the execution order of the plurality of task sets to be executed according to the association relationship; and determining the total duration required to execute the plurality of task sets to be executed in the execution order according to the execution time of each of the first tasks to be executed, thereby obtaining the fourth duration.
[0014] In one exemplary embodiment, determining the target execution priority of the target task and predicting the fourth duration based on the target execution priority includes: when there are multiple first tasks to be executed, determining the execution priority of each of the first tasks to be executed; comparing the execution priorities of the multiple first tasks to be executed with the target execution priority, and determining multiple first target tasks to be executed from the multiple first tasks to be executed based on the comparison results, wherein the execution priority of the first target tasks to be executed is higher than or equal to the target execution priority; calculating the total duration required for the second device to execute the multiple first target tasks to be executed, and obtaining the fourth duration.
[0015] According to another aspect of the embodiments of this application, a method for determining a device is also provided, comprising: sending task requests to N devices, wherein N is an integer greater than or equal to 1, the task requests including a task identifier of a target task and a first duration, the first duration being a duration predicted by a first device for processing the target task, and the N devices being devices distributedly connected to the first device; receiving M response messages sent by M devices included in the N devices, wherein the response messages include a duration predicted by the device sending the response messages for processing the target task, and M is an integer less than or equal to N; and determining a target device for processing the target task from the M devices using the durations included in the M response messages.
[0016] In an exemplary embodiment, the method further includes determining the first duration by: predicting the duration required for the first device to execute the target task based on the task identifier, and obtaining a fifth duration; determining a second task to be executed included in the second task queue; predicting a sixth duration for waiting for the first device to execute the target task based on the second task to be executed; and determining the first duration based on the fifth duration and the sixth duration.
[0017] In one exemplary embodiment, predicting the time required for the first device to execute the target task based on the task identifier to obtain a fifth duration includes: filtering a fourth task set from a second historical task set based on the task identifier, wherein the second historical task set includes historical tasks already executed by the first device, and the fourth task set includes a fourth task with the same task identifier as the target task; and determining the fifth duration based on the execution time required for the first device to execute the fourth task.
[0018] In one exemplary embodiment, predicting a sixth duration for waiting for the first device to execute the target task based on the second task to be executed includes at least one of the following: predicting the sixth duration based on the workload of the second task to be executed; determining the target execution priority of the target task; and predicting the sixth duration based on the target execution priority.
[0019] In one exemplary embodiment, predicting the sixth duration based on the workload of the second task to be executed includes: when the workload of the second task to be executed is one, determining the execution duration of the first device executing the second task to be executed as the sixth duration; when the workload of the second task to be executed is multiple, determining the sixth duration based on the task type and execution duration of the multiple second tasks to be executed.
[0020] In one exemplary embodiment, when there are multiple second tasks to be executed, determining the sixth duration based on the task type and execution duration of the multiple second tasks to be executed includes: when the task types of the multiple second tasks to be executed are the same, filtering a fifth task set from the second historical task set based on the identifier corresponding to each second task to be executed, wherein the second historical task set includes historical tasks executed by the first device, and the fifth task set includes multiple fifth tasks with identifiers that are the same as the identifiers of the multiple second tasks to be executed; determining the sixth duration based on the execution duration of the multiple fifth tasks executed by the first device and the task quantity of the second tasks to be executed.
[0021] In one exemplary embodiment, when there are multiple tasks of the second tasks to be executed, determining the sixth duration based on the task types and execution durations of the multiple second tasks to be executed includes: when the task types of the multiple second tasks to be executed are not completely the same, filtering multiple sixth task sets from the second historical task set based on the identifier corresponding to each second task to be executed, wherein the second historical task set includes historical tasks executed by the first device, and the identifier of the sixth task included in one sixth task set is the same as the task identifier of one second task to be executed; determining second parallel processing information that allows parallel processing of tasks of the multiple task types from the second historical task log set based on the multiple task types included in the second tasks to be executed; and determining the sixth duration based on the second parallel processing information, the task volume of the multiple second tasks to be executed, and the execution duration of each second task to be executed by the first device.
[0022] In one exemplary embodiment, determining the sixth duration based on the second parallel processing information, the workload of the plurality of second tasks to be executed, and the execution time of the first device executing each of the second tasks to be executed includes: calculating the average of the execution times of the plurality of sixth tasks in each sixth task set to obtain the execution time of the first device executing each of the second tasks to be executed; and determining the sixth duration based on the second parallel processing information, the workload of the plurality of second tasks to be executed, and the execution time of the first device executing each of the second tasks to be executed.
[0023] In one exemplary embodiment, determining the sixth duration based on the second parallel processing information, the workload of the plurality of second tasks to be executed, and the execution time of each of the second tasks to be executed by the first device further includes: dividing the plurality of second tasks to be executed into a plurality of seventh task sets according to task type, wherein each of the seventh task sets includes tasks of the same type; determining the association relationship of the plurality of seventh task sets according to the second parallel processing information, wherein the association relationship is used to indicate whether the second tasks to be executed included in different seventh task sets are allowed to be executed in parallel; determining the execution order of the plurality of seventh task sets according to the association relationship; and determining the total duration required to execute the plurality of seventh task sets in the execution order according to the execution time of each of the second tasks to be executed, thereby obtaining the sixth duration.
[0024] In one exemplary embodiment, determining the target execution priority of the target task and predicting the sixth duration based on the target execution priority includes: when there are multiple second tasks to be executed, determining the execution priority of each of the second tasks to be executed; comparing the execution priorities of the multiple second tasks to be executed with the target execution priority, and determining multiple second target tasks to be executed from the multiple second tasks to be executed based on the comparison results, wherein the execution priority of the second target tasks to be executed is higher than or equal to the target execution priority; calculating the total duration required for the first device to execute the multiple second target tasks to be executed, and obtaining the sixth duration.
[0025] In one exemplary embodiment, sending a task request to N devices includes: comparing the first duration with a first threshold; and if it is determined that the first duration is greater than the first threshold, sending the task request to the N devices.
[0026] In one exemplary embodiment, determining the target device for processing the target task from the M devices using the durations included in the M response messages includes: comparing the M durations; and determining the device corresponding to the shortest duration among the M durations as the target device.
[0027] According to another aspect of the embodiments of this application, a task processing system is also provided, the task processing system including a first device and N devices, wherein the N devices are distributedly connected to the first device, a second device is used to implement the steps in the task processing method, the second device is any one of the N devices, and the first device is used to implement the steps in the device determination method.
[0028] In one exemplary embodiment, the first device and the N devices are equipped with the same type of bus system, wherein the first device and the second device communicate through the bus system.
[0029] According to another aspect of the embodiments of this application, a task processing apparatus is also provided, comprising: a receiving module, configured to receive a task request sent by a first device, wherein the task request includes a task identifier of a target task and a first duration, the first duration being a duration predicted by the first device for processing the target task; a response module, configured to respond to the task request and determine a second duration based on the task identifier, wherein the second duration is a duration predicted by a second device for processing the target task, the second device being any one of N devices distributedly connected to the first device, wherein N is an integer greater than or equal to 1; and a sending module, configured to send a first response message to the first device when the second duration is less than the first duration, to instruct the first device to determine a target device for processing the target task, wherein the first response message includes the second duration.
[0030] According to another aspect of the embodiments of this application, a device determination apparatus is also provided, comprising: a sending module, configured to send task requests to N devices, wherein N is an integer greater than or equal to 1, the task requests including a task identifier of a target task and a first duration, the first duration being a duration predicted by a first device for processing the target task, and the N devices being devices distributedly connected to the first device; a receiving module, configured to receive M response messages sent by M devices included in the N devices, wherein the response messages include a duration predicted by the device sending the response messages for processing the target task, and M is an integer less than or equal to N; and a determination module, configured to determine a target device for processing the target task from the M devices using the durations included in the M response messages.
[0031] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed by a processor.
[0032] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the steps in any of the method embodiments described above.
[0033] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to perform the steps of any of the above method embodiments through the computer program.
[0034] This application involves receiving a task request from a first device, including a task identifier and a first duration. A second duration is predicted based on the task identifier. If the second duration is shorter than the first duration, a response message is sent to the first device instructing task reallocation. Predicting the second duration based on the task identifier makes the predicted duration more accurate. This allows for intelligent identification of device load conditions in the network, sending a response message only when the second duration is shorter than the first duration. This reduces unnecessary message transmission and helps the first device dynamically identify the optimal device for processing the target task. This facilitates the first device's subsequent dynamic distribution of tasks to the most suitable device, thereby improving the overall system's response speed and task processing capacity. Therefore, this addresses the problem of low task processing efficiency in related technologies, achieving the technical effect of improving task processing efficiency. Attached Figure Description
[0035] Figure 1 This is a schematic diagram illustrating an application scenario of a task processing method according to an embodiment of this application;
[0036] Figure 2 This is a flowchart illustrating a task processing method according to an embodiment of this application;
[0037] Figure 3 This is a flowchart illustrating a method for determining a device according to an embodiment of this application;
[0038] Figure 4 This is a flowchart illustrating a method for determining a target device according to an embodiment of this application;
[0039] Figure 5 This is a structural block diagram of a task processing system according to an embodiment of this application;
[0040] Figure 6 This is a flowchart illustrating a task processing method based on a distributed software bus according to an embodiment of this application;
[0041] Figure 7 This is a schematic diagram of an interaction process between devices according to an embodiment of this application;
[0042] Figure 8 This is a structural block diagram of a task processing apparatus according to an embodiment of this application;
[0043] Figure 9 This is a structural block diagram of a device determining an apparatus according to an embodiment of this application. Detailed Implementation
[0044] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application. Furthermore, in the absence of conflict, the various embodiments and features in the embodiments of the present application can be arbitrarily combined with each other in principle.
[0045] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0046] According to one aspect of the embodiments of this application, a task processing method is provided. Optionally, in this embodiment, the above-described task processing method may be applied to, but is not limited to, [examples of tasks]. Figure 1 The hardware environment shown includes terminal device 102 and server 104. Server 104 can be connected to terminal device 102 via a network and can be used to provide services (e.g., application services, etc.) to terminal device 102 or clients installed on terminal device 102. A database can be set up on server 104 or independently of server 104 to provide data storage services for server 104.
[0047] The aforementioned network may include, but is not limited to, at least one of the following: wired network and wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network (WAN), metropolitan area network (MAN), and local area network (LAN). The aforementioned wireless network may include, but is not limited to, at least one of the following: Wireless Fidelity (WIFI) and Bluetooth. Terminal device 102 may be, but is not limited to, a personal computer (PC), mobile phone, tablet computer, etc. Server 104 may be, but is not limited to, a cloud server, server cluster, or other server types.
[0048] A task processing method according to an embodiment of this application can be executed by a server 104, a terminal device 102, or jointly by the server 104 and the terminal device 102. Alternatively, the task processing method of this embodiment can be executed by a client installed on the terminal device 102.
[0049] Taking a task processing method executed by terminal device 102 in this embodiment as an example, Figure 2 This is a flowchart illustrating a task processing method according to an embodiment of this application, such as... Figure 2 As shown, the process of this method may include the following steps:
[0050] Step S202: Receive a task request sent by the first device, wherein the task request includes a task identifier of the target task and a first duration, wherein the first duration is the duration predicted by the first device for processing the target task.
[0051] Optionally, the application scenarios of the solution in this embodiment include, but are not limited to, distributed camera networks, IoT device clusters, cloud computing and edge computing resource scheduling, intelligent transportation systems, and industrial automation control networks. For example, in a distributed camera network, the task performed by one camera can be distributed to other cameras according to the technical solution of this embodiment to improve task processing efficiency and the response speed of the entire network, and avoid system performance degradation caused by resource bottlenecks of a single device.
[0052] Optionally, the first device in this embodiment is the device that initiates the task request in the network system, or the device with a high load or the device that is expected to take longer than a reasonable time to process a specific task.
[0053] Optionally, the target task in this embodiment is a specific task that needs to be processed, as specified in the task request. It can be any task that can run on the device, such as video analysis or image recognition.
[0054] Optionally, in this embodiment, the task identifier is a unique identifier for the target task, used to explicitly identify and request a specific task among devices in the network. For example, an image recognition task may be assigned a unique task identifier based on features such as its input image and the target to be recognized.
[0055] Optionally, in this embodiment, the task request is a message sent from the first device to the second device, including the task identifier of the target task and the first duration predicted by the first device, used to request the second device to assess its ability to process the task.
[0056] Step S204: In response to the above task request, determine the second duration based on the above task identifier, wherein the second duration is the duration predicted by the second device for processing the above target task, and the second device is any one of N devices distributedly connected to the above first device, where N is an integer greater than or equal to 1.
[0057] Optionally, the second device in this embodiment is any one of a series of devices distributed and connected to the first device. It is capable of receiving and predicting the time required to process the task, and is usually one of the candidate target processing devices. For example, in a multi-camera network, any camera or server with sufficient resources, other than the camera that initiated the request (i.e., the first device mentioned above), can be the second device.
[0058] Optionally, the first and second devices in this embodiment can be various devices with computing, storage and network communication capabilities, including but not limited to: smart cameras, edge servers, mobile terminals (e.g., smartphones, tablets, etc.), Internet of Things devices (e.g., smart sockets, temperature sensors, smoke detectors, etc. in smart homes), vehicles, and drones.
[0059] Step S206: If the second duration is less than the first duration, a first response message is sent to the first device to instruct the first device to determine the target device for processing the target task, wherein the first response message includes the second duration.
[0060] Optionally, in this embodiment, the target device refers to the device ultimately selected by the first device to process the target task. This device may be the first device that initiated the request itself, or it may be the device with the shortest predicted duration among N devices.
[0061] For example, in a surveillance system consisting of multiple cameras, one camera (i.e., the first device mentioned above) is currently processing a large number of video stream analysis tasks. It predicts that the next high-resolution image recognition task (i.e., the target task mentioned above) may take a long time (i.e., the first duration mentioned above), potentially exceeding the predetermined response time and affecting system performance or user experience. At this time, the first device will send a task request to all distributed connected devices in the system (i.e., the N devices mentioned above). The request includes the task identifier of the image recognition task and the predicted first duration. After receiving the request, each of the N devices (including the second device mentioned above) estimates the time required to process the task (i.e., the second duration mentioned above) and compares it with the first duration. If the second duration is less than the first duration, the device sends a response message to the first device, instructing the first device to determine the target device for processing the target task.
[0062] Through the above steps, a task request including a task identifier and a first duration is received from the first device. A second duration is predicted based on the task identifier. If the second duration is shorter than the first duration, a response message is sent to the first device instructing task reallocation. Predicting the second duration based on the task identifier makes the predicted duration more accurate. This allows for intelligent identification of the load status of devices in the network, sending a response message only when the second duration is shorter than the first duration. This reduces unnecessary message transmission and helps the first device dynamically identify the best device to process the target task. This facilitates the first device dynamically distributing the task to the most suitable device, thereby improving the overall system response speed and task processing capacity. Therefore, this solves the problem of low task processing efficiency in related technologies, achieving the technical effect of improving task processing efficiency.
[0063] In an exemplary embodiment, in response to the task request, determining a second duration based on the task identifier includes: predicting the duration required for the second device to execute the target task based on the task identifier, and obtaining a third duration; determining a first pending task included in the first task queue that is waiting for the second device to execute; predicting a fourth duration for waiting for the second device to execute the target task based on the first pending task; and determining the second duration based on the third duration and the fourth duration.
[0064] Optionally, the third duration in this embodiment is the time required for the second device to predict the execution of the target task based on the task identifier, without considering the impact of existing tasks to be executed in the current queue on the processing time.
[0065] Optionally, in this embodiment, the first task queue is located on the second device and includes a series of tasks currently waiting to be processed by the second device. These tasks may include task requests received from other devices, as well as tasks that the second device itself needs to process.
[0066] Optionally, in this embodiment, after receiving a task request, the second device searches for a first task queue by looking up a mapping table stored in the bus system deployed on the second device, and adds the target task to the first task queue.
[0067] Optionally, in actual use, the second device can have one or more task queues. When a new task arrives, the second device determines which task queue to place the new task in based on preset rules. Then, by looking up the mapping table stored in the bus system deployed on the second device, the new task is actually added to the corresponding task queue.
[0068] Optionally, in this embodiment, the first task to be executed is a task in the first task queue, that is, a task that has not yet started processing but is ready to be executed.
[0069] Optionally, the fourth duration in this embodiment is based on the first task to be executed, predicting the time the second device needs to wait before executing the target task. It takes into account the impact of processing existing tasks in the queue on the new task.
[0070] Optionally, the second duration in this embodiment is obtained by combining the third and fourth durations, reflecting the entire processing cycle of the second device from now until the completion of the target task.
[0071] Through the above steps, the second device predicts the third duration of task execution, and simultaneously considers the time required to execute the first task in the first task queue to predict the fourth duration. Combining these two factors, the second duration is determined. By considering not only the time required to execute the target task but also the time required to process the first task before executing the target task, the actual second duration of task processing can be predicted more accurately, reducing errors in subsequent target task allocation and optimizing task scheduling.
[0072] In one exemplary embodiment, predicting the time required for the second device to execute the target task based on the task identifier to obtain a third time includes: filtering a first task set from a first historical task set based on the task identifier, wherein the first historical task set includes historical tasks executed by the second device, and the first task set includes a first task with the same task identifier as the target task; and determining the third time based on the execution time required for the second device to execute the first task.
[0073] Optionally, in this embodiment, the first historical task set is a record set of all tasks executed by the second device. The first historical task set includes, but is not limited to, information such as the task identifier, task details, start and end times of each task.
[0074] Optionally, in this embodiment, the first task set is a group of tasks selected from the first historical task set. These tasks have the same task identifier as the current target task identifier, meaning they are similar or identical in nature or requirements. For example, in a video analytics application, if the target task is license plate recognition, then the first task set would include all license plate recognition tasks previously performed by the second device.
[0075] Through the above steps, a first task set is obtained by selecting tasks with the same task identifier as the target task from the first historical task set. The third duration is then predicted based on the time required to execute the first task. Utilizing the processing time of historical tasks in historical data can improve the accuracy of the prediction and ensure that subsequent target task allocation decisions are generated based on actual execution conditions.
[0076] In one exemplary embodiment, predicting the queuing time for the second device to execute the target task based on the first task to be executed includes at least one of the following: predicting the fourth duration based on the task volume of the first task to be executed; determining the target execution priority of the target task; and predicting the fourth duration based on the target execution priority.
[0077] Optionally, in this embodiment, the task quantity refers to the number of tasks in the first task to be executed.
[0078] Optionally, in this embodiment, the target execution priority refers to the priority level of the target task. In a multi-tasking environment, the execution priority of a task determines the processing order of the tasks, and higher-priority tasks will be processed first.
[0079] For example, in a smart city management scenario, the second device is an edge server that processes various urban events, responsible for real-time analysis of data such as traffic conditions and public safety incidents to support immediate response and decision-making. The second device currently has 10 tasks waiting to be executed in its task queue (corresponding to the first task queue mentioned above). At this time, the second device receives a sudden event analysis task (corresponding to the target task mentioned above). It needs to predict how long it will need to wait before it can process this new task (corresponding to the fourth duration mentioned above). Based on the existing task load, the second device can predict the minimum waiting time before it can begin processing this sudden event analysis task. If the second device's task queue uses priority scheduling, the newly added target task will be arranged in the appropriate position in the queue according to its priority. For example, the sudden event analysis task is marked as the highest priority. The second device currently has 5 ordinary priority tasks in its task queue. Since the sudden event analysis task has the highest priority, it will be inserted at the front of the queue and begin execution immediately. In this case, the fourth duration may approach zero because the task does not need to wait for other tasks in the queue to finish processing.
[0080] Through the above steps, the fourth duration is predicted based on the workload of the first task to be executed or the execution priority of the target task. Through these two prediction methods, the second device can intelligently evaluate the task queue status and the execution conditions of new tasks, thereby optimizing the allocation of system resources, ensuring the timely processing of urgent and high-priority tasks, and improving the response efficiency and adaptability of the entire system.
[0081] In one exemplary embodiment, predicting the fourth duration based on the task volume of the first task to be executed includes: when the task volume of the first task to be executed is one, determining the execution duration of the second device executing the first task to be executed as the fourth duration; when the task volume of the first task to be executed is multiple, determining the fourth duration based on the task type and execution duration of the multiple first tasks to be executed.
[0082] Optionally, the execution time in this embodiment is the time required for the second device to execute a task.
[0083] Optionally, the task type in this embodiment refers to the nature of the task to be performed, such as video analysis, image recognition, data processing, etc. Different task types can be processed in parallel.
[0084] Through the above steps, in the case of a single first task to be executed, the fourth duration is directly equal to the remaining execution time of the current task. When there are multiple first tasks to be executed, the prediction of the fourth duration takes into account the task type and its average processing time. Predicting and determining the execution duration of a single task and multiple tasks to be executed separately enhances the system's ability to predict task processing time, providing more refined task processing time predictions, adapting to the prediction needs of different task volumes, making resource scheduling more intelligent and efficient, and significantly improving the response speed of task processing and the overall performance of the system.
[0085] In an exemplary embodiment, when there are multiple first tasks to be executed, determining the fourth duration based on the task type and execution duration of the multiple first tasks to be executed includes: when the task types of the multiple first tasks to be executed are the same, filtering a second task set from a first historical task set based on the identifier corresponding to each first task to be executed, wherein the first historical task set includes historical tasks executed by the second device, and the second task set includes multiple second tasks with identifiers that are the same as the identifiers of the multiple first tasks to be executed; and determining the fourth duration based on the execution duration of the multiple second tasks executed by the second device and the task quantity of the first tasks to be executed.
[0086] Optionally, in this embodiment, the second task set is a subset selected from the first historical task set, and the task identifiers of these tasks are the same as the task identifiers of the first task to be executed in the current task queue.
[0087] For example, in an intelligent security system, a second device (actually a high-performance video analytics server) handles various types of video analytics tasks, such as facial recognition, license plate scanning, and anomaly detection. The second device's first task queue contains five facial recognition tasks (i.e., the same type of tasks listed above) awaiting processing. Specifically, two of these tasks are for male facial recognition, and three are for female facial recognition (i.e., the tasks are categorized into two types). The second device filters all previously executed facial recognition tasks (male and female facial recognition tasks) from the first historical task set based on their task identifiers, obtaining a second task set. It then analyzes the average execution time of these tasks. The average execution time for male facial recognition tasks is found to be 10 seconds, and for female facial recognition tasks, it is 11 seconds. Based on these durations and the current number of tasks (5), the second device predicts the total time required to process all these first tasks, i.e., the fourth time = 10s × 2 + 11s × 3 = 53s.
[0088] Through the above steps, when multiple first tasks to be executed have the same task type, historical tasks are filtered based on the identifier corresponding to each first task to be executed to obtain a second task set. The fourth execution time is then determined based on the average execution time of second tasks with different task identifiers within the second task set. By learning from historical data, the accuracy of predicting the execution time of tasks of the same type but with different task identifiers can be improved.
[0089] In an exemplary embodiment, when there are multiple first tasks to be executed, determining the fourth duration based on the task types and execution durations of the multiple first tasks to be executed includes: when the task types of the multiple first tasks to be executed are not completely the same, filtering multiple third task sets from a first historical task set based on the identifier corresponding to each first task to be executed, wherein the first historical task set includes historical tasks executed by the second device, and the identifier of a third task included in a third task set is the same as the task identifier of a first task to be executed; determining first parallel processing information that allows parallel processing of tasks of the multiple task types from a first historical task log set based on the multiple task types included in the first tasks to be executed; and determining the fourth duration based on the first parallel processing information, the task volume of the multiple first tasks to be executed, and the execution duration of each first task to be executed by the second device.
[0090] Optionally, in this embodiment, the third task set is a subset selected from the first historical task set based on the task identifier of the first task to be executed in the current queue. Each third task set includes historical tasks with the same task identifier as a first task to be executed, used to predict the execution duration of tasks with such task identifiers.
[0091] Optionally, the first parallel processing information in this embodiment is information about the parallel task processing capabilities allowed by the hardware and software resources of the second device, including which types of tasks can be processed simultaneously, and the efficiency or time discount factor during parallel processing.
[0092] Optionally, in this embodiment, multiple parallel execution processes can be determined based on the first parallel processing information. The execution time of each process can be calculated based on the execution time of the task to be executed in each process. Then, the specific time corresponding to the process with the longest execution time is selected as the fourth time.
[0093] Through the above steps, when multiple task types are not entirely identical, parallel processing information is considered to determine the execution order. Then, based on the first parallel processing information, the workload of multiple first tasks to be executed, and the execution time of each first task to be executed by the second device, a fourth duration is determined. This prediction mechanism based on the execution history of multiple different types of tasks helps the system dynamically evaluate resource allocation, optimize task execution order, and improve overall operating efficiency. By accurately predicting the fourth duration, the system can better coordinate task scheduling among multiple devices, fully utilize the parallel processing capabilities of the devices, further improve task processing efficiency, and avoid resource waste.
[0094] In one exemplary embodiment, determining the fourth duration based on the first parallel processing information, the workload of the first task to be executed, and the execution time of the second device executing multiple first tasks to be executed includes: calculating the average of the execution times of multiple third tasks in each third task set to obtain the execution time of the second device executing each first task to be executed; and determining the fourth duration based on the first parallel processing information, the workload of the multiple first tasks to be executed, and the execution time of the second device executing each first task to be executed.
[0095] Optionally, the fourth duration and the first parallel processing information in this embodiment have been described above and will not be repeated here.
[0096] For example, in an intelligent security system, a second device (actually a high-performance video analytics server) handles various types of video analytics tasks, such as facial recognition, license plate scanning, and anomaly detection. The second device's first task queue contains two facial recognition tasks, one license plate scanning task, and two anomaly detection tasks awaiting processing. Specifically, one of the facial recognition tasks is for male faces, and the other is for female faces. Based on the task identifier of the first task to be executed, the second device filters all previously executed facial recognition tasks (male and female facial recognition tasks), license plate scanning tasks, and anomaly detection tasks from the first historical task set, obtaining multiple third task sets. The average execution time of these tasks is then analyzed. The average execution time for male facial recognition tasks is 10 seconds, for female facial recognition tasks it is 11 seconds, for license plate scanning tasks it is 5 seconds, and for anomaly detection tasks it is 15 seconds. Meanwhile, the second device determines that these different types of tasks cannot be processed in parallel and does not obtain the corresponding first parallel processing information. Based on the above duration and the current number of tasks (5), the second device predicts the total time required to process all these first tasks to be executed, that is, the fourth duration = 10s×1 + 11s×1 + 5s×1 + 15s×2 = 56s.
[0097] Through the above steps, the average execution time of each type of task is calculated, and the fourth duration is determined by combining this with parallel processing information. Through this comprehensive analysis of detailed parallel processing information and historical average task execution times, the system can intelligently schedule tasks, maximize the utilization of the second device's processing power, reduce waiting time, and ensure that the predicted fourth duration takes into account the average processing time of all types of tasks, thus improving the comprehensiveness of the prediction.
[0098] In one exemplary embodiment, determining the fourth duration based on the first parallel processing information, the workload of the plurality of first tasks to be executed, and the execution time of the second device for each of the first tasks to be executed further includes: dividing the plurality of first tasks to be executed into a plurality of task sets according to task type, wherein each task set includes tasks of the same type; determining the association relationship of the plurality of task sets to be executed according to the first parallel processing information, wherein the association relationship is used to indicate whether the first tasks included in different task sets to be executed are allowed to be executed in parallel; determining the execution order of the plurality of task sets to be executed according to the association relationship; and determining the total duration required to execute the plurality of task sets to be executed in the execution order according to the execution time of each of the first tasks to be executed, thereby obtaining the fourth duration.
[0099] Optionally, in this embodiment, the set of tasks to be executed is a collection of multiple first tasks to be executed grouped by task type, with each set containing tasks of the same type.
[0100] Optionally, the association in this embodiment describes the possibility of parallel execution among multiple sets of tasks to be executed, and can indicate which types of task sets can be executed simultaneously and which need to be executed serially.
[0101] Optionally, the total duration in this embodiment is the estimated time required for the second device to complete all tasks within the set of tasks to be executed, taking into account both parallel and serial execution.
[0102] The following examples illustrate the possible scenarios in which the above method may be used. It should be noted that the examples in this application are for illustrative purposes only, and actual use may not necessarily involve such parallel processing information.
[0103] For example, in a smart city security monitoring system, a second device (a high-performance video analytics server) has multiple different types of tasks waiting to be executed simultaneously in its task queue, such as facial recognition, vehicle classification, and behavior analysis (corresponding to the aforementioned multiple first tasks to be executed). At a certain moment, the second device suddenly receives an urgent abnormal behavior analysis task (corresponding to the aforementioned target task), which needs to be processed as quickly as possible. It first analyzes the current task queue and finds three facial recognition tasks, two vehicle classification tasks, and four behavior analysis tasks, thus obtaining three sets of tasks to be executed. Then, the second device analyzes and finds that the average execution time for facial recognition tasks is 10 seconds, for vehicle classification tasks is 8 seconds, and for behavior analysis tasks is 12 seconds. Based on the multiple task types included in the first tasks to be executed, it determines the first parallel processing information from the first historical task log set that allows parallel processing of multiple task types, determining that the second device can simultaneously process facial recognition and vehicle classification tasks, and can execute the behavior analysis task after the vehicle classification task is completed. The second device determines the association between the three sets of tasks to be executed based on the aforementioned first parallel processing information, and finally obtains the execution order of the sets of tasks to be executed, which is divided into two parallel processes. The first process executes two vehicle classification tasks in sequence, followed by four behavior analysis tasks in sequence. The second process executes three facial recognition tasks in sequence. Based on the above execution order, the time required to execute the tasks in the first process is calculated to be 8s × 2 + 12s × 4 = 64s, and the time required to execute the tasks in the second process is calculated to be 10s × 3 = 30s. Finally, the longest time is taken as the fourth time, that is, the fourth time is 64s.
[0104] For example, in an intelligent medical image analysis system, the second device is a high-performance server specifically designed for medical image analysis. The task queue of the second device has multiple different types of tasks (corresponding to the multiple first tasks to be executed mentioned above) waiting to be executed simultaneously, including 5 lung computed tomography (CT) scan analysis tasks, 3 X-ray bone analysis tasks, and 4 brain magnetic resonance imaging (MRI) tumor detection tasks. At this time, the second device suddenly receives a task request from the first device, which includes the task identifier of the target task. The second device, through analysis, determined the average execution time for lung CT scan analysis (10s), X-ray bone analysis (8s), and brain MRI tumor detection (15s). It then divided these tasks into three sets based on their type. Based on the first parallel processing information, the second device could process lung CT, brain MRI, and X-ray bone analysis tasks in parallel. The execution order of these tasks was determined, consisting of three parallel processes: process one executes five lung CT scan analysis tasks sequentially; process two executes three X-ray bone analysis tasks sequentially; and process three executes four brain MRI tumor detection tasks sequentially. Based on this execution order, the time required for process one was calculated to be 10s × 5 = 50s, process two to be 8s × 3 = 24s, and process three to be 15s × 4 = 60s. The longest time was then taken as the fourth execution time, i.e., the fourth execution time was 60s.
[0105] Through the above steps, multiple sets of tasks are divided according to the task type of the first task to be executed. Then, based on the first parallel processing information, the relationship between the multiple sets of tasks to be executed is determined to obtain the execution order, and the fourth duration is further calculated. By meticulously dividing the task types, determining the relationships, and the execution order, the system can fully utilize the parallel processing capabilities of the second device while avoiding resource conflicts, and can more intelligently manage the task queue and optimize resource allocation.
[0106] In one exemplary embodiment, determining the target execution priority of the target task and predicting the fourth duration based on the target execution priority includes: when there are multiple first tasks to be executed, determining the execution priority of each of the first tasks to be executed; comparing the execution priorities of the multiple first tasks to be executed with the target execution priority, and determining multiple first target tasks to be executed from the multiple first tasks to be executed based on the comparison results, wherein the execution priority of the first target tasks to be executed is higher than or equal to the target execution priority; calculating the total duration required for the second device to execute the multiple first target tasks to be executed, and obtaining the fourth duration.
[0107] Optionally, in this embodiment, the execution priority is determined by each first task to be executed based on its type, urgency, or a measure of its system resource requirements, to determine which tasks in the task queue should be executed first.
[0108] Optionally, in this embodiment, the first target task to be executed refers to the task in the current queue whose execution priority is higher than or equal to that of the target task.
[0109] For example, in an intelligent traffic management system, the second device is a high-performance traffic monitoring and analysis server responsible for processing real-time video data from multiple surveillance cameras. Currently, the server's task queue includes 10 regular road monitoring tasks with medium execution priority, 3 traffic violation detection tasks with high execution priority, and 2 emergency event response tasks with the highest execution priority. The second device then receives an emergency event response task (the aforementioned target task) and analyzes it to determine its corresponding target execution priority. The second device compares the target execution priorities of all first-to-be-executed tasks with the newly received emergency event response task. Since the emergency event response task has the highest priority, the two emergency event response tasks in the current task queue are considered the first-to-be-executed target tasks. Because the average execution time of emergency event response tasks can be determined from the first historical task set to be 12 seconds, the second device needs to process the two existing emergency event response tasks in the current queue before it can begin processing the newly received emergency event response task, resulting in a fourth execution time of 12 seconds × 2 = 24 seconds. In intelligent traffic management systems, such mechanisms help ensure that emergencies can be responded to in a timely manner, prioritizing high-priority tasks without waiting for routine monitoring tasks to be completed, thereby effectively shortening emergency response time and improving traffic management efficiency.
[0110] Through the above steps, the task priority of the first task to be executed is determined, and the first target task to be executed is selected based on the target task's execution priority. The execution duration of the first target task to be executed is calculated as the fourth duration. By comparing the execution priorities of tasks, high-priority tasks can be processed first, improving the response speed of critical tasks and optimizing overall resource allocation.
[0111] In another embodiment of this application, taking the execution of a device determination method of this embodiment by a terminal device 102 as an example, Figure 3 This is a flowchart illustrating a method for determining a device according to an embodiment of this application, as shown below. Figure 3 As shown, the process of this method may include the following steps:
[0112] Step S302: Send task requests to N devices, where N is an integer greater than or equal to 1, the task request includes the task identifier of the target task and a first duration, the first duration is the duration predicted by the first device to be required to process the target task, and the N devices are devices that are distributedly connected to the first device.
[0113] Optionally, the application scenarios of the solution in this embodiment include, but are not limited to, distributed camera networks, IoT device clusters, cloud computing and edge computing resource scheduling, intelligent transportation systems, and industrial automation control networks. For example, in a distributed camera network, the task performed by this camera can be distributed to other cameras according to the technical solution of this embodiment to improve task processing efficiency and the response speed of the entire network, and avoid system performance degradation caused by resource bottlenecks of a single device.
[0114] Optionally, the first device in this embodiment is the device that initiates the task request in the network system, or the device with a high load or the device that is expected to take longer than a reasonable time to process a specific task.
[0115] Optionally, the target task in this embodiment is a specific task that needs to be processed, as specified in the task request. It can be any task that can run on the device, such as video analysis or image recognition.
[0116] Optionally, in this embodiment, the task identifier is a unique identifier for the target task, used to explicitly identify and request a specific task among devices in the network. For example, an image recognition task may be assigned a unique task identifier based on features such as its input image and the target to be recognized.
[0117] Optionally, in this embodiment, the task request is a message sent by the first device to N devices, including the task identifier of the target task and the first duration predicted by the first device, used to request each of the N devices to evaluate its own ability to process the task.
[0118] Step S304: Receive M response messages sent by M devices among the N devices, wherein the response messages include the time required by the device sending the response messages to process the target task as predicted, and M is an integer less than or equal to N.
[0119] Optionally, in this embodiment, all M response messages are messages received by the first device within a preset time. In actual use, if the preset time is set to 5 minutes, and the first device does not receive a response message within 5 minutes after sending a task request to 10 devices, it will choose to handle the target task itself. Alternatively, if the first device only receives response messages from 3 devices within 5 minutes, it will compare the duration carried in these 3 response messages and select the device with the shortest duration as the target device.
[0120] Optionally, the N devices in this embodiment are a series of devices distributed and connected to the first device. They are capable of receiving and predicting the time required to process the task, and are usually one of the candidate target processing devices. For example, in a multi-camera network, any camera or server with sufficient resources other than the requesting camera (i.e., the first device mentioned above) is included among the N devices.
[0121] Optionally, the first device and the N devices in this embodiment can be various devices with computing, storage and network communication capabilities, including but not limited to: smart cameras, edge servers, mobile terminals (e.g., smartphones, tablets, etc.), Internet of Things devices (e.g., smart sockets, temperature sensors, smoke detectors, etc. in smart homes), vehicles, and drones.
[0122] Optionally, in this embodiment, the M devices are the devices among the aforementioned N devices that send response messages to the first device, and the time required for each of the M devices to process the target task is less than the aforementioned first time.
[0123] Step S306: Use the duration included in the M response messages to determine the target device for processing the target task from the M devices.
[0124] Optionally, in this embodiment, the target device refers to the device ultimately selected by the first device to process the target task. This device may be the first device that initiated the request itself, or it may be the device with the shortest predicted duration among N devices.
[0125] For example, in a surveillance system consisting of multiple cameras, one camera (i.e., the first device mentioned above) is currently processing a large number of video stream analysis tasks. It predicts that the next high-resolution image recognition task (i.e., the target task mentioned above) may take a long time (i.e., the first duration mentioned above), potentially exceeding the predetermined response time and affecting system performance or user experience. At this time, the first device will send a task request to all distributed connected devices in the system (i.e., the N devices mentioned above). The request includes the task identifier of the image recognition task and the predicted first duration. After receiving the request, each of the N devices (including the second device mentioned above) estimates the time required to process the task (i.e., the second duration mentioned above) and compares it with the first duration. If the second duration is shorter than the first duration, it sends a response message to the first device. After receiving all response messages, the first device analyzes and compares all the second durations, and finally selects the device with the shortest second duration (e.g., camera B) as the target device to process the target task. This effectively utilizes network resources, improves task processing efficiency, and ensures that the system response time is within an acceptable range.
[0126] Through the above steps, a task request including a task identifier and a first duration is sent to N devices. Then, M response messages are received from M of the N devices. Based on the durations included in the M response messages, the target processing device is determined, thus reallocating the target task. By sending a task request including a task identifier and a first duration to N devices, the N devices can predict the second duration based on the task identifier. Through a competition mechanism among the N devices, the optimal processing device is selected, improving the overall system's response speed and task processing capacity. Therefore, this solves the problem of low task processing efficiency in related technologies, achieving the technical effect of improving task processing efficiency.
[0127] In an exemplary embodiment, the method further includes determining the first duration by: predicting the duration required for the first device to execute the target task based on the task identifier, and obtaining a fifth duration; determining a second task to be executed included in the second task queue; predicting a sixth duration for waiting for the first device to execute the target task based on the second task to be executed; and determining the first duration based on the fifth duration and the sixth duration.
[0128] Optionally, the fifth duration in this embodiment is the time required for the first device to predict the execution of the target task based on the task identifier, without considering the impact of existing tasks to be executed in the current queue on the processing time.
[0129] Optionally, the second task queue in this embodiment is located on the first device and includes a series of tasks currently waiting to be processed by the first device. These tasks may include task requests received from other devices, as well as tasks that the first device itself needs to process.
[0130] Optionally, in this embodiment, when the target task arrives, the first device searches for the second task queue by looking up the mapping table stored in the bus system deployed on the first device, and adds the target task to the second task queue.
[0131] Optionally, in actual use, there can be one or more task queues in the first device. When a new task arrives, the first device determines which task queue to place the new task in based on preset rules. Then, by looking up the mapping relationship table stored in the bus system deployed on the first device, the new task is actually added to the corresponding task queue.
[0132] Optionally, in this embodiment, the second task to be executed is a task in the second task queue, that is, a task that has not yet started processing but is ready to be executed.
[0133] Optionally, the sixth duration in this embodiment is based on the second task to be executed, predicting the time the first device needs to wait before executing the target task. It takes into account the impact of processing existing tasks in the queue on the new task.
[0134] Optionally, the first duration in this embodiment is obtained by combining the fifth duration and the sixth duration, reflecting the entire processing cycle of the first device from now until the completion of the target task.
[0135] Through the above steps, the first device predicts the fifth duration of task execution, and simultaneously considers the time required to execute the second task in the second task queue to predict the sixth duration. Combining these two factors, the first duration is determined. By considering not only the time required to execute the target task but also the time required to process the second task before executing the target task, the actual first duration of processing the target task can be predicted more accurately, reducing errors in subsequent target task allocation and optimizing task scheduling.
[0136] In one exemplary embodiment, predicting the time required for the first device to execute the target task based on the task identifier to obtain a fifth duration includes: filtering a fourth task set from a second historical task set based on the task identifier, wherein the second historical task set includes historical tasks already executed by the first device, and the fourth task set includes a fourth task with the same task identifier as the target task; and determining the fifth duration based on the execution time required for the first device to execute the fourth task.
[0137] Optionally, in this embodiment, the second historical task set is a record set of all tasks executed by the first device. The second historical task set includes, but is not limited to, information such as the task identifier, task details, start and end times of each task.
[0138] Optionally, the fourth task set in this embodiment is a group of tasks selected from the second historical task set. These tasks have the same task identifier as the current target task, meaning they are similar or identical in nature or requirements. For example, in a video analytics application, if the target task is license plate recognition, then the fourth task set would include all license plate recognition tasks previously performed by the first device.
[0139] Through the above steps, a fourth task with the same task identifier as the target task is selected from the second historical task set, resulting in a fourth task set. The duration of the fifth task is then predicted based on the time required to execute the fourth task. Utilizing the processing time of historical tasks in historical data can improve the accuracy of the prediction and ensure that subsequent target task allocation decisions are based on actual execution conditions.
[0140] In one exemplary embodiment, predicting a sixth duration for waiting for the first device to execute the target task based on the second task to be executed includes at least one of the following: predicting the sixth duration based on the workload of the second task to be executed; determining the target execution priority of the target task; and predicting the sixth duration based on the target execution priority.
[0141] Optionally, in this embodiment, the task quantity refers to the number of tasks in the second task to be executed.
[0142] Optionally, in this embodiment, the target execution priority refers to the priority level of the target task. In a multi-tasking environment, the execution priority of a task determines the processing order of the tasks, and higher-priority tasks will be processed first.
[0143] For example, in a smart city management scenario, the first device is an edge server that processes various urban events, responsible for real-time analysis of data such as traffic conditions and public safety incidents to support immediate response and decision-making. The first device currently has 10 tasks waiting to be executed in its task queue (corresponding to the second task queue mentioned above). At this time, the first device receives a sudden event analysis task (corresponding to the target task mentioned above). It needs to predict how long it will need to wait before it can process this new task (corresponding to the sixth time interval mentioned above). Based on the existing task load, the first device can predict the minimum waiting time before it can begin processing this sudden event analysis task. If the first device's task queue uses priority scheduling, the newly added target task will be arranged in the appropriate position in the queue according to its priority. For example, the sudden event analysis task is marked as the highest priority. The first device currently has 5 ordinary priority tasks in its task queue. Because the sudden event analysis task has the highest priority, it will be inserted at the front of the queue and begin execution immediately. In this case, the sixth time interval may approach zero because the task does not need to wait for other tasks in the queue to finish processing.
[0144] Through the above steps, the sixth duration is predicted based on the workload of the second task to be executed or the execution priority of the target task. Through these two prediction methods, the first device can intelligently evaluate the task queue status and the execution conditions of new tasks, thereby optimizing the allocation of system resources, ensuring the timely processing of urgent and high-priority tasks, and improving the response efficiency and adaptability of the entire system.
[0145] In one exemplary embodiment, predicting the sixth duration based on the workload of the second task to be executed includes: when the workload of the second task to be executed is one, determining the execution duration of the first device executing the second task to be executed as the sixth duration; when the workload of the second task to be executed is multiple, determining the sixth duration based on the task type and execution duration of the multiple second tasks to be executed.
[0146] Optionally, the execution time in this embodiment is the time required for the first device to execute a task.
[0147] Optionally, the task type in this embodiment refers to the nature of the task to be performed, such as video analysis, image recognition, data processing, etc. Different task types can be processed in parallel.
[0148] Through the above steps, in the case of a single second task to be executed, the sixth duration is directly equal to the remaining execution time of the current task. When there are multiple second tasks to be executed, the prediction of the sixth duration takes into account the task type and its average processing time. Predicting and determining the execution duration of a single task and multiple tasks to be executed separately enhances the system's ability to predict task processing time, providing more refined task processing time predictions, adapting to the prediction needs of different task volumes, making resource scheduling more intelligent and efficient, and significantly improving the response speed of task processing and the overall performance of the system.
[0149] In one exemplary embodiment, when there are multiple second tasks to be executed, determining the sixth duration based on the task type and execution duration of the multiple second tasks to be executed includes: when the task types of the multiple second tasks to be executed are the same, filtering a fifth task set from the second historical task set based on the identifier corresponding to each second task to be executed, wherein the second historical task set includes historical tasks executed by the first device, and the fifth task set includes multiple fifth tasks with identifiers that are the same as the identifiers of the multiple second tasks to be executed; determining the sixth duration based on the execution duration of the multiple fifth tasks executed by the first device and the task quantity of the second tasks to be executed.
[0150] Optionally, the fifth task set in this embodiment is a subset selected from the second historical task set, and the task identifiers of these tasks are the same as the task identifiers of the first task to be executed in the current task queue.
[0151] For example, in an intelligent security system, the first device (actually a high-performance video analytics server) handles various types of video analytics tasks, such as facial recognition, license plate scanning, and abnormal behavior detection. The first device's second task queue contains five facial recognition tasks (i.e., the same type of tasks listed above) awaiting processing. Specifically, two of these tasks are for male facial recognition, and three are for female facial recognition (i.e., the tasks are identified by two different identifiers). The first device filters all previously executed facial recognition tasks (male and female facial recognition tasks) from the second historical task set based on the task identifiers of the tasks awaiting execution, obtaining a fifth task set. It then analyzes the average execution time of these tasks. The average execution time for male facial recognition tasks is found to be 10 seconds, and for female facial recognition tasks, it is 11 seconds. Based on these durations and the current number of tasks (5), the first device predicts the total time required to process all these second tasks awaiting execution, i.e., the sixth execution time = 10s × 2 + 11s × 3 = 53s.
[0152] Through the above steps, when multiple second tasks to be executed have the same task type, historical tasks are filtered based on the identifier corresponding to each second task to obtain a fifth task set. The sixth task duration is then determined based on the average execution time of the fifth tasks with different task identifiers within the fifth task set. By learning from historical data, the accuracy of predicting the execution time of tasks of the same type but with different task identifiers can be improved.
[0153] In one exemplary embodiment, when there are multiple tasks of the second tasks to be executed, determining the sixth duration based on the task types and execution durations of the multiple second tasks to be executed includes: when the task types of the multiple second tasks to be executed are not completely the same, filtering multiple sixth task sets from the second historical task set based on the identifier corresponding to each second task to be executed, wherein the second historical task set includes historical tasks executed by the first device, and the identifier of the sixth task included in one sixth task set is the same as the task identifier of one second task to be executed; determining second parallel processing information that allows parallel processing of tasks of the multiple task types from the second historical task log set based on the multiple task types included in the second tasks to be executed; and determining the sixth duration based on the second parallel processing information, the task volume of the multiple second tasks to be executed, and the execution duration of each second task to be executed by the first device.
[0154] Optionally, in this embodiment, the sixth task set is a subset selected from the second historical task set based on the task identifier of the second task to be executed in the current queue. Each sixth task set includes historical tasks with the same task identifier as a second task to be executed, used to predict the execution duration of tasks with such task identifiers.
[0155] Optionally, the second parallel processing information in this embodiment is information about the parallel task processing capabilities allowed by the hardware and software resources of the first device, including which types of tasks can be processed simultaneously, and the efficiency or time discount factor during parallel processing.
[0156] Optionally, in this embodiment, multiple parallel execution processes can be determined based on the second parallel processing information. The execution time of each process can be calculated based on the execution time of the task to be executed in each process. Then, the specific time corresponding to the process with the longest execution time is selected as the sixth time.
[0157] Through the above steps, when multiple task types are not entirely identical, parallel processing information is considered to determine the execution order. Then, based on the second parallel processing information, the workload of multiple second tasks to be executed, and the execution time of each second task on the first device, the sixth duration is determined. This prediction mechanism based on the execution history of multiple different types of tasks helps the system dynamically evaluate resource allocation, optimize task execution order, and improve overall operating efficiency. By accurately predicting the sixth duration, the system can better coordinate task scheduling among multiple devices, fully utilize the parallel processing capabilities of the devices, further improve task processing efficiency, and avoid resource waste.
[0158] In one exemplary embodiment, determining the sixth duration based on the second parallel processing information, the workload of the plurality of second tasks to be executed, and the execution time of the first device executing each of the second tasks to be executed includes: calculating the average of the execution times of the plurality of sixth tasks in each sixth task set to obtain the execution time of the first device executing each of the second tasks to be executed; and determining the sixth duration based on the second parallel processing information, the workload of the plurality of second tasks to be executed, and the execution time of the first device executing each of the second tasks to be executed.
[0159] Optionally, the sixth duration and the second parallel processing information in this embodiment have been described above and will not be repeated here.
[0160] For example, in an intelligent security system, the first device (actually a high-performance video analytics server) handles various types of video analytics tasks, such as facial recognition, license plate scanning, and anomaly detection. The first device's second task queue contains two facial recognition tasks, one license plate scanning task, and two anomaly detection tasks awaiting processing. Specifically, one of the two facial recognition tasks is for male faces, and the other is for female faces. The first device, based on the task identifiers of the second set of tasks to be executed, filters all previously executed facial recognition tasks (male and female facial recognition), license plate scanning tasks, and anomaly detection tasks from the second set of historical tasks, resulting in multiple sixth task sets. The average execution time of these tasks is then analyzed. The average execution time for male facial recognition tasks is 10 seconds, for female facial recognition tasks it is 11 seconds, for license plate scanning tasks it takes an average of 5 seconds, and for anomaly detection tasks it takes an average of 15 seconds. Meanwhile, the first device determines that these different types of tasks cannot be processed in parallel and does not obtain the corresponding second parallel processing information. Based on the above duration and the current number of tasks (5), the first device predicts the total time required to process all these second tasks to be executed, that is, the fourth duration = 10s×1 + 11s×1 + 5s×1 + 15s×2 = 56s.
[0161] Through the above steps, the average execution time of each type of task is calculated, and the sixth duration is determined by combining this with parallel processing information. Through this comprehensive analysis of detailed parallel processing information and historical average task execution times, the system can intelligently schedule tasks, maximize the utilization of the primary device's processing power, reduce waiting time, and ensure that the predicted sixth duration takes into account the average processing time of all types of tasks, thus improving the comprehensiveness of the prediction.
[0162] In one exemplary embodiment, determining the sixth duration based on the second parallel processing information, the workload of the plurality of second tasks to be executed, and the execution time of each of the second tasks to be executed by the first device further includes: dividing the plurality of second tasks to be executed into a plurality of seventh task sets according to task type, wherein each of the seventh task sets includes tasks of the same type; determining the association relationship of the plurality of seventh task sets according to the second parallel processing information, wherein the association relationship is used to indicate whether the second tasks to be executed included in different seventh task sets are allowed to be executed in parallel; determining the execution order of the plurality of seventh task sets according to the association relationship; and determining the total duration required to execute the plurality of seventh task sets in the execution order according to the execution time of each of the second tasks to be executed, thereby obtaining the sixth duration.
[0163] Optionally, the seventh task set in this embodiment is a set of multiple second tasks to be executed grouped by task type, with each set containing tasks of the same type.
[0164] Optionally, the association in this embodiment describes the possibility of parallel execution among multiple seventh task sets, and can indicate which types of task sets can be executed simultaneously and which need to be executed serially.
[0165] Optionally, the total duration in this embodiment is the estimated time required for the first device to complete all tasks within the seventh task set, taking into account both parallel and serial execution.
[0166] The following examples illustrate the possible scenarios in which the above method may be used. It should be noted that the examples in this application are for illustrative purposes only, and actual use may not necessarily involve such parallel processing information.
[0167] For example, in a smart city security monitoring system, the first device (a high-performance video analytics server) has multiple different types of tasks waiting to be executed simultaneously in its task queue, such as facial recognition, vehicle classification, and behavior analysis (corresponding to the aforementioned multiple second tasks to be executed). At a certain moment, the first device suddenly receives an urgent abnormal behavior analysis task (corresponding to the aforementioned target task), which needs to be processed as quickly as possible. It first analyzes the current task queue and finds three facial recognition tasks, two vehicle classification tasks, and four behavior analysis tasks, thus obtaining three seventh task sets. Then, the first device analyzes and finds that the average execution time for the facial recognition task is 10 seconds, the average execution time for the vehicle classification task is 8 seconds, and the average execution time for the behavior analysis task is 12 seconds. Based on the multiple task types included in the second tasks to be executed, it determines the second parallel processing information from the second historical task log set, which allows parallel processing of multiple task types. It determines that the first device can process the facial recognition task and the vehicle classification task simultaneously, and can execute the behavior analysis task after the vehicle classification task is completed. Based on the aforementioned second parallel processing information, the first device determines the association between the three seventh task sets, ultimately obtaining the execution order of the seventh task sets, which is divided into two parallel processes. Process one executes two vehicle classification tasks sequentially, followed by four behavior analysis tasks. Process two executes three facial recognition tasks sequentially. Based on the above execution order, the time required for process one to execute tasks is calculated as 8s × 2 + 12s × 4 = 64s, and the time required for process two to execute tasks is calculated as 10s × 3 = 30s. Finally, the longest time is taken as the sixth duration, i.e., the sixth duration = 64s.
[0168] For example, in an intelligent medical image analysis system, the first device is a high-performance server specifically designed for medical image analysis. The task queue of the first device simultaneously holds multiple tasks of different types (corresponding to the aforementioned multiple second tasks awaiting execution), including 5 lung CT scan analysis tasks, 3 X-ray bone analysis tasks, and 4 brain MRI tumor detection tasks. At a certain moment, the first device receives a new target task. Through analysis, the first device determines that the average execution time for the lung CT scan analysis task is 10 seconds, the average execution time for the X-ray bone analysis task is 8 seconds, and the average execution time for the brain MRI tumor detection task is 15 seconds. Simultaneously, the aforementioned second tasks awaiting execution are divided into three seventh task sets according to their type. Based on the second parallel processing information, it is known that the first device can process the lung CT, brain MRI, and X-ray bone analysis tasks in parallel. Finally, the execution order of the seventh task sets is obtained, divided into three parallel processes: process one executes the 5 lung CT scan analysis tasks sequentially; process two executes the 3 X-ray bone analysis tasks sequentially; and process three executes the 4 brain MRI tumor detection tasks sequentially. Based on the above execution order, the time required to execute task 1 is calculated as 10s × 5 = 50s, the time required to execute task 2 is calculated as 8s × 3 = 24s, and the time required to execute task 3 is calculated as 15s × 4 = 60s. Finally, the longest time is taken as the sixth time, that is, the sixth time is 60s.
[0169] Through the above steps, multiple seventh task sets are divided according to the task type of the second task to be executed. Then, based on the second parallel processing information, the relationship between the multiple seventh task sets is determined to obtain the execution order, and the sixth duration is further calculated. By meticulously dividing the task types, determining the relationships, and the execution order, the system can fully utilize the parallel processing capabilities of the first device while avoiding resource conflicts, and can more intelligently manage the task queue and optimize resource allocation.
[0170] In one exemplary embodiment, determining the target execution priority of the target task and predicting the sixth duration based on the target execution priority includes: when there are multiple second tasks to be executed, determining the execution priority of each of the second tasks to be executed; comparing the execution priorities of the multiple second tasks to be executed with the target execution priority, and determining multiple second target tasks to be executed from the multiple second tasks to be executed based on the comparison results, wherein the execution priority of the second target tasks to be executed is higher than or equal to the target execution priority; calculating the total duration required for the first device to execute the multiple second target tasks to be executed, and obtaining the sixth duration.
[0171] Optionally, in this embodiment, the execution priority is determined by each second task to be executed based on its type, urgency, or a measure of its system resource requirements, to determine which tasks in the task queue should be executed first.
[0172] Optionally, in this embodiment, the second target task to be executed refers to the task in the current queue whose execution priority is higher than or equal to that of the target task.
[0173] Currently, the server's task queue includes 10 regular road monitoring tasks with medium execution priority, 3 traffic violation detection tasks with high execution priority, and 2 emergency response tasks with the highest execution priority. At this moment, the first device receives an emergency response task (i.e., the aforementioned target task) and obtains its corresponding target execution priority through analysis. The first device compares the target execution priorities of all second-to-be-executed tasks with the newly received emergency response task. Since the emergency response task has the highest priority, the two emergency response tasks in the current task queue are considered as the second-to-be-executed target tasks. Because the average execution time of emergency response tasks is determined to be 12 seconds based on the second historical task set, the first device needs to process the two existing emergency response tasks in the current queue before it can begin processing the newly received emergency response task, resulting in a sixth execution time of 12 seconds × 2 = 24 seconds. In the intelligent traffic management system, this mechanism helps ensure that emergencies are responded to promptly, prioritizing high-priority tasks without waiting for regular monitoring tasks to complete, thereby effectively shortening the emergency response time and improving traffic management efficiency.
[0174] Through the above steps, the task priority of the second task to be executed is determined, and the second target task to be executed is selected based on the target task's execution priority. The execution time of the second target task to be executed is calculated as the sixth execution time. By comparing the execution priorities of tasks, high-priority tasks can be processed first, improving the response speed of critical tasks and optimizing overall resource allocation.
[0175] In one exemplary embodiment, sending a task request to N devices includes: comparing the first duration with a first threshold; and if it is determined that the first duration is greater than the first threshold, sending the task request to the N devices.
[0176] Optionally, in this embodiment, the first threshold is a time standard set by the system to measure whether a task should be distributed for processing. When the first duration exceeds this threshold, it means that the processing of the task exceeds the device's real-time processing capacity, and it needs to be determined whether it can be distributed to other devices for processing to speed up the task processing.
[0177] By comparing the predicted first duration with a first threshold through the above steps, when the first duration exceeds the first threshold, a task request is sent to N devices. This threshold mechanism filters tasks that may need to be assigned to other devices, avoiding resource waste and improving system response speed.
[0178] In one exemplary embodiment, determining the target device for processing the target task from the M devices using the durations included in the M response messages includes: comparing the M durations; and determining the device corresponding to the shortest duration among the M durations as the target device.
[0179] Optionally, in this embodiment, the M durations are the estimated times required for each device to process the same target task, as contained in the M response messages. These durations reflect the current load, processing efficiency, and resource availability of the devices.
[0180] Optionally, in this embodiment, the target device is selected from M time periods as the device with the fastest processing speed and the ability to process the target task in the shortest time.
[0181] For example, Figure 4 This is a flowchart illustrating a method for determining a target device according to an embodiment of this application. When constructing an intelligent agricultural monitoring system, the first device needs to handle an urgent target task—analyzing the crop health status of a specific area in the field to predict pests and diseases in a timely manner. However, the current processing capacity of the first device is insufficient to quickly complete this task. Therefore, the first device needs to use methods such as... Figure 4 The steps shown identify the target device capable of performing the target task. The specific process is as follows:
[0182] Step S402: Send an external service request (corresponding to the task request mentioned above). The first device sends an external service request to all 10 available devices in the network (i.e., the N devices mentioned above).
[0183] Step S404: Determine whether a response message has been received within the preset time. If not, proceed to step S406; if yes, proceed to step S408.
[0184] Step S406: This device processes the target task;
[0185] Step S408: Determine whether the received response message is only 1. If not, proceed to step S410. If yes, determine the device that sent the response message as the target device, and then proceed to step S412.
[0186] Step S410: Compare the durations included in the M response messages, and determine the device corresponding to the shortest duration among the M durations as the target device. The first device receives response messages from 8 devices (i.e., M=8 above) within a preset time. They report the duration required to process the target task. The first device parses the 8 response messages and finds that the duration required for device A to process the target task is 15 minutes, the duration required for device B to process the target task is 20 minutes, the duration required for device C to process the target task is 12 minutes, the duration required for device D to process the target task is 18 minutes, the duration required for device E to process the target task is 14 minutes, the duration required for device F to process the target task is 17 minutes, the duration required for device G to process the target task is 13 minutes, and the duration required for device H to process the target task is 16 minutes. Comparing the above 8 durations, device C is finally determined as the target device for processing the target task.
[0187] Step S412: The first device instructs the target device to process the target task.
[0188] The above process can improve the responsiveness and resource utilization efficiency of intelligent agricultural monitoring systems. When the system needs to quickly analyze the health status of crops in the field to prevent pests and diseases, it can significantly shorten the analysis time by sending task requests to multiple devices and selecting the target device with the fastest processing speed to execute the task. This ensures the efficient operation of the agricultural monitoring and early warning system, thereby helping farmers to take timely measures to reduce crop losses.
[0189] By comparing the durations of the received response messages through the above steps, the device with the shortest duration is selected as the target device. This ensures that the target task is assigned to the device with the highest processing efficiency, reducing task processing wait time and improving overall task processing capacity.
[0190] According to another aspect of the embodiments of this application, a task processing system is also provided, the task processing system including a first device and N devices, wherein the N devices are distributedly connected to the first device, a second device is used to implement the steps in the task processing method, the second device is any one of the N devices, and the first device is used to implement the steps in the device determination method.
[0191] In one exemplary embodiment, the first device and the N devices are equipped with the same type of bus system, wherein the first device and the second device communicate through the bus system.
[0192] Optionally, in actual use, the devices in this system can be dynamically expanded. Since the N devices are distributedly connected to the first device, the system is easily scalable. Adding devices to the system or the failure of one device will not affect the normal execution of other devices, and the entire task processing system has strong stability.
[0193] For example, Figure 5 This is a structural block diagram of a task processing system according to an embodiment of this application. In actual use, the task processing system can be as follows: Figure 5 The architecture shown (only devices 1 and 2 are shown in the diagram; the connections between devices 1 and devices 3, 4, and N are similar) deploys the same type of software bus system in devices 1 and 2. Each task has a globally unique task identifier, and services corresponding to tasks can communicate via messages and address each other using the task identifier. All tasks are deployed on the software bus, and message transmission relies on the software bus. External services in different devices do not handle actual business processes but receive task requests from other devices and send response messages via network transmission, completing network interaction and device selection services with other devices. Since all devices in the task processing system use the same type of software bus system, a cross-device service proxy mechanism can be built to achieve intelligent collaboration and resource integration between devices, as well as cross-device interaction and proxying between services. The same tasks on different devices have the same task identifier, and the message request and response formats are consistent. Therefore, a task request from device 1 can be responded to by the same service on device 2, achieving the effect of multi-device collaborative work. The software bus is similar to a bus in computer hardware, providing a standardized communication channel for different software components or services, enabling them to interact with low coupling without directly depending on each other's specific implementations.
[0194] The methods in the embodiments of this application will be explained and described below with reference to optional examples. Figure 6 This is a flowchart illustrating a task processing method based on a distributed software bus according to an embodiment of this application, as shown below. Figure 6 As shown, the process of this method may include the following steps:
[0195] Step S602: The first device calculates the first time to process the target task. The first device assesses its current resource usage and, in combination with the characteristics of the target task, predicts the time required for it to complete the task alone.
[0196] Step S604: The first device compares the first duration with the first threshold. When it is determined that the first duration exceeds the threshold, it sends a task request to N devices, where N is an integer greater than or equal to 1. The task request includes the task identifier of the target task and the first duration. In this step, the first device broadcasts the task request through the distributed software bus and queries the N potential resource assistance devices to see if they can handle the target task and the required duration.
[0197] Step S606: After receiving the task request, the N devices predict the processing time of the target task based on the task identifier.
[0198] In step S608, the first device receives M response messages from M devices among N devices within a preset time. The response messages include the predicted processing time required for the target task by the device that sent the response message, where M is an integer less than or equal to N. In this step, each device compares the predicted processing time required for the target task with a first time. If it determines that the processing time required for the target task is less than the first time, it sends a response message to the first device via the software bus.
[0199] Step S610: The first device parses M response messages to obtain M durations. The first device organizes all received response messages and extracts the duration required for each device to process the target task.
[0200] Step S612: The first device uses the above M time periods to determine the target device for processing the target task from the M devices. After comparison, the first device selects the device with the shortest time period as the target device.
[0201] Step S614: The first device sends a specific task execution request to the target device, formally entrusting it with the task.
[0202] Step S616: The target device executes the task and returns the processing result to the first device;
[0203] In step S618, the first device receives the processing result and completes the target task.
[0204] It should be noted that the specific execution flow of the steps in this embodiment can refer to the steps described in the above embodiments and exemplary implementations, and will not be repeated here.
[0205] Through this optional example, when encountering resource bottlenecks, the first device can dynamically seek and utilize the resources of other devices in the network. N devices predict the duration based on the task identifier and send response messages only when the required duration is less than the first duration, reducing unnecessary message transmission. This helps the first device dynamically identify the best device to process the target task, making it easier for the first device to dynamically distribute the task to the most suitable device, thereby improving the utilization rate of device resources and enhancing the overall system's response speed and task processing capabilities.
[0206] Figure 7 This is a schematic diagram of an interaction process between devices according to an embodiment of this application, such as... Figure 7 As shown above, Figure 6 From the perspective of the first device, the illustrated process steps can be divided into four stages: Stage 1, sending a task request; Stage 2, optimal decision-making; Stage 3, external processing; and Stage 4, result response. Stage 1 includes... Figure 6 Steps S602 to S606 in the process shown, stage 2 includes Figure 6 Steps S608 to S612 in the process shown, stage 3 includes Figure 6 Steps S614 to S616 in the process shown, stage 4 includes Figure 6Step S618 in the illustrated process. For example, in stage 1, device 1 predicts that its first processing time for the target task is 50 seconds, which is greater than the first threshold of 45 seconds. It broadcasts a task request (i.e., N=3 above) to devices 2, 3, and 4 via the distributed software bus, including the task identifier of the target task and the first processing time of 50 seconds. Device 2 predicts that its processing time for the target task is 55 seconds, device 3 predicts that its processing time for the target task is 45 seconds, and device 4 predicts that its processing time for the target task is 40 seconds. Then, devices 2, 3, and 4 compare the processing time required for the target task with the first processing time. Device 2 determines that its processing time for the target task is greater than the first processing time and chooses not to reply to device 1's task request. Devices 3 and 4 determine that their processing time for the target task is less than the first processing time and send a response message to device 1 via the software bus. In stage 2, device 1 receives response messages from devices 3 and 4, including the task identifier of the target task and the time required to process the target task (i.e., M=2 above). By parsing the response messages, device 1 clarifies that device 3 predicts its processing time for the target task to be 45 seconds, and device 4 predicts its processing time to be 40 seconds. Comparing these two times, device 4, with the shortest time, is selected as the target device. In stage 3, device 1 sends specific processing request information to device 4, sending the specific details of the target task to the target device, formally entrusting it with the task processing. Device 4 processes the target task and returns the processing result to device 1. In stage 4, device 1 receives the processing result sent by device 4, completes the task, and realizes the response of the processing result.
[0207] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0208] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0209] According to another aspect of the embodiments of this application, a task processing apparatus is also provided, which can be used to implement a task processing method provided in the above embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0210] Figure 8 This is a structural block diagram of a task processing apparatus according to an embodiment of this application, such as... Figure 8 As shown, the device includes:
[0211] The receiving module 82 is configured to receive a task request sent by the first device, wherein the task request includes a task identifier of the target task and a first duration, wherein the first duration is the duration predicted by the first device for processing the target task.
[0212] The response module 84 is used to respond to the above task request and determine a second duration based on the above task identifier, wherein the second duration is the duration predicted by the second device for processing the above target task, and the second device is any one of N devices distributedly connected to the above first device, where N is an integer greater than or equal to 1.
[0213] The sending module 86 is configured to send a first response message to the first device when the second duration is less than the first duration, so as to instruct the first device to determine the target device for processing the target task, wherein the first response message includes the second duration.
[0214] It should be noted that the receiving module 82 in this embodiment can be used to perform the above step S202, the response module 84 in this embodiment can be used to perform the above step S204, and the sending module 86 in this embodiment can be used to perform the above step S206.
[0215] The apparatus in the embodiments provided in this application predicts the second duration based on the task identifier, making the predicted duration more accurate. This allows for intelligent identification of the load status of devices in the network, sending a response message only when the second duration is less than the first duration. This reduces unnecessary message transmission and helps the first device dynamically identify the optimal device for processing the target task. This facilitates the first device dynamically distributing the task to the most suitable device, thereby improving the overall system's response speed and task processing capacity. Therefore, it solves the problem of low task processing efficiency in related technologies, achieving the technical effect of improving task processing efficiency.
[0216] In an exemplary embodiment, the response module 84 is further configured to predict the time required for the second device to execute the target task based on the task identifier, and obtain a third time; determine a first task to be executed included in the first task queue; predict a fourth time to wait for the second device to execute the target task based on the first task to be executed; and determine the second time based on the third time and the fourth time.
[0217] In an exemplary embodiment, the response module 84 is further configured to filter a first task set from a first historical task set based on the task identifier, wherein the first historical task set includes historical tasks executed by the second device, and the first task set includes a first task with the same task identifier as the target task; and to determine the third duration based on the execution time required for the second device to execute the first task.
[0218] In an exemplary embodiment, the response module 84 is further configured to predict the fourth duration based on the workload of the first task to be executed; determine the target execution priority of the target task; and predict the fourth duration based on the target execution priority.
[0219] In an exemplary embodiment, the response module 84 is further configured to determine the execution time of the first task to be executed by the second device as the fourth duration when the task quantity of the first task to be executed is one; and to determine the fourth duration based on the task type and execution duration of the multiple first tasks to be executed when the task quantity of the first task to be executed is multiple.
[0220] In an exemplary embodiment, the response module 84 is further configured to, when the task types of the multiple first tasks to be executed are all the same, filter a second task set from the first historical task set based on the identifier corresponding to each of the first tasks to be executed, wherein the first historical task set includes historical tasks executed by the second device, and the second task set includes multiple second tasks whose identifiers are the same as the identifiers of the multiple first tasks to be executed; and determine the fourth duration based on the execution time of the second device executing the multiple second tasks and the task volume of the first tasks to be executed.
[0221] In an exemplary embodiment, the response module 84 is further configured to: filter multiple third task sets from a first historical task set based on the identifier corresponding to each of the multiple first tasks to be executed when the task types of the multiple first tasks to be executed are not completely the same; wherein the first historical task set includes historical tasks executed by the second device, and the identifier of a third task included in a third task set is the same as the task identifier of a first task to be executed; determine first parallel processing information from the first historical task log set that allows parallel processing of tasks of the multiple task types based on the multiple task types included in the first tasks to be executed; and determine the fourth duration based on the first parallel processing information, the task volume of the multiple first tasks to be executed, and the execution time of the second device executing each of the first tasks to be executed.
[0222] In an exemplary embodiment, the response module 84 is further configured to calculate the average execution time of the plurality of third tasks in each third task set to obtain the execution time of the second device for each of the first tasks to be executed; and to determine the fourth duration based on the first parallel processing information, the task amount of the plurality of first tasks to be executed and the execution time of the second device for each of the first tasks to be executed.
[0223] In an exemplary embodiment, the response module 84 is further configured to divide the plurality of first tasks to be executed into a plurality of task sets to be executed according to task type, wherein each task set to be executed includes tasks of the same type; determine the association relationship of the plurality of task sets to be executed according to the first parallel processing information, wherein the association relationship is used to indicate whether the first tasks to be executed included in different task sets to be executed are allowed to be executed in parallel; determine the execution order of the plurality of task sets to be executed according to the association relationship; and determine the total time required to execute the plurality of task sets to be executed in the execution order according to the execution time of each first task to be executed, thereby obtaining the fourth time.
[0224] In an exemplary embodiment, the response module 84 is further configured to: determine the execution priority of each of the first tasks to be executed when there are multiple first tasks to be executed; compare the execution priorities of the multiple first tasks to be executed with the target execution priority; determine multiple first target tasks to be executed from the multiple first tasks to be executed based on the comparison result, wherein the execution priority of the first target tasks to be executed is higher than or equal to the target execution priority; and calculate the total time required for the second device to execute the multiple first target tasks to be executed, thereby obtaining the fourth time.
[0225] Figure 9 This is a structural block diagram of a device determining an apparatus according to an embodiment of this application, such as... Figure 9 As shown, the device includes:
[0226] Sending module 92 is used to send task requests to N devices, where N is an integer greater than or equal to 1, the task request includes a task identifier of the target task and a first duration, the first duration is the duration predicted by the first device to be required to process the target task, and the N devices are devices that are distributedly connected to the first device.
[0227] The receiving module 94 is configured to receive M response messages sent by M devices among the N devices, wherein the response messages include the time required by the device sending the response messages to process the target task, and M is an integer less than or equal to N.
[0228] The determination module 96 is used to determine the target device for processing the target task from the M devices by utilizing the duration included in the M response messages.
[0229] By using the apparatus in the embodiments provided in this application, a task request including a task identifier and a first duration is sent to N devices. This allows the N devices to predict a second duration based on the task identifier, and the optimal processing device is selected through a competition mechanism among the N devices. This improves the overall system's response speed and task processing capability. Therefore, it solves the problem of low task processing efficiency in related technologies and achieves the technical effect of improving task processing efficiency.
[0230] In an exemplary embodiment, the sending module 92 is further configured to determine the first duration by: predicting the duration required for the first device to execute the target task based on the task identifier, and obtaining a fifth duration; determining a second task to be executed that is waiting for the first device to execute and included in the second task queue; predicting a sixth duration for waiting for the first device to execute the target task based on the second task to be executed; and determining the first duration based on the fifth duration and the sixth duration.
[0231] In an exemplary embodiment, the sending module 92 is further configured to predict the time required for the first device to execute the target task based on the task identifier, and obtain a fifth duration by: filtering a fourth task set from a second historical task set based on the task identifier, wherein the second historical task set includes historical tasks executed by the first device, and the fourth task set includes a fourth task with the same task identifier as the target task; and determining the fifth duration based on the execution time required for the first device to execute the fourth task.
[0232] In an exemplary embodiment, the sending module 92 is further configured to predict a sixth duration of waiting for the first device to execute the target task based on the second task to be executed in the following manner: predicting the sixth duration based on the task volume of the second task to be executed; determining the target execution priority of the target task; and predicting the sixth duration based on the target execution priority.
[0233] In an exemplary embodiment, the sending module 92 is further configured to predict the sixth duration based on the task quantity of the second task to be executed in the following manner: when the task quantity of the second task to be executed is one, the execution duration of the first device executing the second task to be executed is determined as the sixth duration; when the task quantity of the second task to be executed is multiple, the sixth duration is determined based on the task type and execution duration of the multiple second tasks to be executed.
[0234] In an exemplary embodiment, the sending module 92 is further configured to determine the sixth duration based on the task type and execution duration of the multiple second tasks to be executed when there are multiple tasks to be executed: when the task types of the multiple second tasks to be executed are the same, a fifth task set is selected from the second historical task set based on the identifier corresponding to each second task to be executed, wherein the second historical task set includes historical tasks executed by the first device, and the fifth task set includes multiple fifth tasks with identifiers that are the same as the identifiers of the multiple second tasks to be executed; the sixth duration is determined based on the execution duration of the multiple fifth tasks executed by the first device and the task quantity of the second tasks to be executed.
[0235] In an exemplary embodiment, the sending module 92 is further configured to determine the sixth duration based on the task type and execution duration of the multiple second tasks to be executed when there are multiple tasks to be executed: when the task types of the multiple second tasks to be executed are not completely the same, multiple sixth task sets are filtered from the second historical task set based on the identifier corresponding to each second task to be executed, wherein the second historical task set includes historical tasks executed by the first device, and the identifier of the sixth task included in one sixth task set is the same as the task identifier of one second task to be executed; based on the multiple task types included in the second tasks to be executed, second parallel processing information that allows parallel processing of tasks of the multiple task types is determined from the second historical task log set; the sixth duration is determined based on the second parallel processing information, the task quantity of the multiple second tasks to be executed, and the execution duration of each second task to be executed by the first device.
[0236] In an exemplary embodiment, the sending module 92 is further configured to determine the sixth duration based on the second parallel processing information, the task volume of the plurality of second tasks to be executed, and the execution time of the first device executing each of the second tasks to be executed, in the following manner: calculating the average of the execution times of the plurality of sixth tasks in each of the sixth task sets to obtain the execution time of the first device executing each of the second tasks to be executed; and determining the sixth duration based on the second parallel processing information, the task volume of the plurality of second tasks to be executed, and the execution time of the first device executing each of the second tasks to be executed.
[0237] In an exemplary embodiment, the sending module 92 is further configured to determine the sixth duration based on the second parallel processing information, the task volume of the plurality of second tasks to be executed, and the execution time of each of the second tasks to be executed by the first device, in the following manner: dividing the plurality of second tasks to be executed into a plurality of seventh task sets according to task type, wherein each of the seventh task sets includes tasks of the same type; determining the association relationship of the plurality of seventh task sets according to the second parallel processing information, wherein the association relationship is used to indicate whether the second tasks to be executed included in different seventh task sets are allowed to be executed in parallel; determining the execution order of the plurality of seventh task sets according to the association relationship; and determining the total duration required to execute the plurality of seventh task sets in the execution order according to the execution time of each of the second tasks to be executed, thereby obtaining the sixth duration.
[0238] In an exemplary embodiment, the sending module 92 is further configured to determine the target execution priority of the target task in the following manner, and predict the sixth duration based on the target execution priority: when there are multiple second tasks to be executed, determine the execution priority of each of the second tasks to be executed; compare the execution priorities of the multiple second tasks to be executed with the target execution priority, and determine multiple second target tasks to be executed from the multiple second tasks to be executed based on the comparison result, wherein the execution priority of the second target tasks to be executed is higher than or equal to the target execution priority; calculate the total duration required for the first device to execute the multiple second target tasks to be executed, and obtain the sixth duration.
[0239] In an exemplary embodiment, the sending module 92 is further configured to compare the first duration with a first threshold; and if it is determined that the first duration is greater than the first threshold, to send the task request to the N devices.
[0240] In an exemplary embodiment, the determining module 96 is further configured to compare the M durations and determine the device corresponding to the shortest duration among the M durations as the target device.
[0241] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0242] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0243] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0244] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0245] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0246] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0247] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0248] The embodiments described herein also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0249] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0250] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular hardware and software combination.
[0251] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for processing a task, characterized in that, include: Receive a task request sent by a first device, wherein the task request includes a task identifier of a target task and a first duration, the first duration being the duration predicted by the first device for processing the target task; In response to the task request, a second duration is determined based on the task identifier, wherein the second duration is the duration predicted by the second device for processing the target task, and the second device is any one of N devices distributedly connected to the first device, where N is an integer greater than or equal to 1; If the second duration is less than the first duration, a first response message is sent to the first device to instruct the first device to determine the target device for processing the target task, wherein the first response message includes the second duration.
2. The method according to claim 1, characterized in that, In response to the task request, determining a second duration based on the task identifier includes: Based on the task identifier, the time required for the second device to execute the target task is predicted, and a third time is obtained; Identify the first task to be executed in the first task queue, which is waiting to be executed by the second device; Based on the first task to be executed, predict the fourth duration of waiting for the second device to execute the target task; The second duration is determined based on the third duration and the fourth duration.
3. The method according to claim 2, characterized in that, Based on the task identifier, the time required for the second device to execute the target task is predicted, resulting in a third time, including: A first task set is filtered from the first historical task set based on the task identifier, wherein the first historical task set includes historical tasks executed by the second device, and the first task set includes a first task with the same task identifier as the target task; The third duration is determined based on the execution time required for the second device to perform the first task.
4. The method according to claim 2, characterized in that, Based on the first task to be executed, the queuing time for waiting for the second device to execute the target task is predicted, including at least one of the following: The fourth duration is predicted based on the task volume of the first task to be executed; Determine the target execution priority of the target task, and predict the fourth duration based on the target execution priority.
5. The method according to claim 4, characterized in that, Predicting the fourth duration based on the task volume of the first task to be executed includes: When there are multiple first tasks to be executed, and the task types of the multiple first tasks to be executed are all the same, a second task set is selected from the first historical task set based on the identifier corresponding to each first task to be executed. The first historical task set includes historical tasks executed by the second device, and the second task set includes multiple second tasks with identifiers that are the same as the identifiers of the multiple first tasks to be executed. The fourth duration is determined based on the execution time of the second device executing the multiple second tasks and the task volume of the first tasks to be executed. When there are multiple first tasks to be executed, and the task types of the multiple first tasks to be executed are not completely the same, multiple third task sets are selected from the first historical task set based on the identifier corresponding to each first task to be executed. The first historical task set includes historical tasks executed by the second device, and the identifier of a third task included in a third task set is the same as the task identifier of a first task to be executed. Based on the multiple task types included in the first tasks to be executed, first parallel processing information that allows parallel processing of tasks of the multiple task types is determined from the first historical task log set. Based on the first parallel processing information, the task volume of the multiple first tasks to be executed, and the execution time of the second device executing each first task to be executed, the fourth duration is determined.
6. The method according to claim 5, characterized in that, Based on the first parallel processing information, the workload of the first task to be executed, and the execution time of the second device executing multiple of the first tasks to be executed, the fourth duration is determined, including: Calculate the average execution time of multiple third tasks in each third task set to obtain the execution time of the second device for each first task to be executed; The fourth duration is determined based on the first parallel processing information, the amount of tasks of the multiple first tasks to be executed, and the execution time of the second device for each of the first tasks to be executed.
7. The method according to claim 5, characterized in that, The determination of the fourth duration based on the first parallel processing information, the task volume of the multiple first tasks to be executed, and the execution time of the second device for each of the first tasks to be executed further includes: The multiple first tasks to be executed are divided into multiple sets of tasks to be executed according to task type, wherein each set of tasks to be executed includes tasks of the same type; The association relationship of multiple sets of tasks to be executed is determined based on the first parallel processing information, wherein the association relationship is used to indicate whether the first tasks to be executed included in different sets of tasks to be executed are allowed to be executed in parallel; The execution order of the multiple sets of tasks to be executed is determined based on the aforementioned association. The total time required to execute multiple sets of tasks in the execution order is determined based on the execution time of each of the first tasks to be executed, thus obtaining the fourth time.
8. The method according to claim 4, characterized in that, Determining the target execution priority of the target task, and predicting the fourth duration based on the target execution priority, includes: When there are multiple first tasks to be executed, determine the execution priority of each first task to be executed; The execution priorities of multiple first tasks to be executed are compared with the target execution priority. Based on the comparison results, multiple first target tasks to be executed are determined from the multiple first tasks to be executed, wherein the execution priority of the first target tasks to be executed is higher than or equal to the target execution priority. The total time required for the second device to execute multiple tasks to be performed by the first target is calculated to obtain the fourth time.
9. A method for determining a device, characterized in that, include: Send task requests to N devices, where N is an integer greater than or equal to 1, the task request includes a task identifier of the target task and a first duration, the first duration is the duration predicted by the first device to be required to process the target task, and the N devices are devices that are distributedly connected to the first device. Receive M response messages sent by M devices among the N devices, wherein the response message includes the time required to process the target task as predicted by the device that sent the response message, and M is an integer less than or equal to N; The target device for processing the target task is determined from the M devices by using the duration included in the M response messages.
10. The method according to claim 9, characterized in that, The method further includes determining the first duration in the following manner: Based on the task identifier, the time required for the first device to execute the target task is predicted, and a fifth time is obtained; Identify the second task queue that is waiting to be executed by the first device; Based on the second task to be executed, predict the sixth duration of waiting for the first device to execute the target task; The first duration is determined based on the fifth duration and the sixth duration.
11. The method according to claim 10, characterized in that, Based on the task identifier, the time required for the first device to execute the target task is predicted, resulting in a fifth time duration, including: A fourth task set is selected from the second historical task set based on the task identifier, wherein the second historical task set includes historical tasks executed by the first device, and the fourth task set includes a fourth task with the same task identifier as the target task; The fifth duration is determined based on the execution time required for the first device to perform the fourth task.
12. The method according to claim 10, characterized in that, Based on the second task to be executed, a sixth duration for waiting for the first device to execute the target task is predicted, including at least one of the following: The sixth duration is predicted based on the workload of the second task to be executed; Determine the target execution priority of the target task, and predict the sixth duration based on the target execution priority.
13. The method according to claim 12, characterized in that, Predicting the sixth duration based on the workload of the second task to be executed includes: When there are multiple second tasks to be executed, and all of the second tasks to be executed have the same task type, a fifth task set is selected from the second historical task set based on the identifier corresponding to each second task to be executed. The second historical task set includes historical tasks executed by the first device, and the fifth task set includes multiple fifth tasks with identifiers that are the same as the identifiers of the multiple second tasks to be executed. The sixth duration is determined based on the execution time of the first device in executing the multiple fifth tasks and the task volume of the second tasks to be executed. When there are multiple second tasks to be executed, and the task types of the multiple second tasks to be executed are not completely the same, multiple sixth task sets are selected from the second historical task set based on the identifier corresponding to each second task to be executed. The second historical task set includes historical tasks executed by the first device, and the identifier of the sixth task included in one sixth task set is the same as the task identifier of one second task to be executed. Based on the multiple task types included in the second tasks to be executed, second parallel processing information that allows parallel processing of the multiple task types is determined from the second historical task log set. Based on the second parallel processing information, the task volume of the multiple second tasks to be executed, and the execution time of the first device executing each second task to be executed, the sixth duration is determined.
14. The method according to claim 13, characterized in that, Based on the second parallel processing information, the workload of the multiple second tasks to be executed, and the execution time of the first device for each of the second tasks to be executed, the sixth duration is determined, including: Calculate the average execution time of multiple sixth tasks in each sixth task set to obtain the execution time of the first device for each second task to be executed; The sixth duration is determined based on the second parallel processing information, the amount of work of the multiple second tasks to be executed, and the execution time of the first device for each of the second tasks to be executed.
15. The method according to claim 13, characterized in that, The sixth duration is determined based on the second parallel processing information, the workload of the multiple second tasks to be executed, and the execution time of the first device for each second task to be executed, and further includes: The multiple second tasks to be executed are divided into multiple seventh task sets according to task type, wherein each seventh task set includes tasks of the same type; The association relationship of multiple seventh task sets is determined based on the second parallel processing information, wherein the association relationship is used to indicate whether the second tasks to be executed included in different seventh task sets are allowed to be executed in parallel; The execution order of the multiple seventh task sets is determined based on the aforementioned association. The total time required to execute multiple sets of the seventh task in the execution order is determined based on the execution time of each of the second tasks to be executed, thus obtaining the sixth time.
16. The method according to claim 12, characterized in that, Determine the target execution priority of the target task, and predict the sixth duration based on the target execution priority, including: When there are multiple second tasks to be executed, determine the execution priority of each second task to be executed; The execution priorities of multiple second tasks to be executed are compared with the target execution priority. Based on the comparison results, multiple second target tasks to be executed are determined from the multiple second tasks to be executed, wherein the execution priority of the second target tasks to be executed is higher than or equal to the target execution priority. The total time required for the first device to execute multiple tasks to be performed by the second target is calculated to obtain the sixth time.
17. The method according to claim 9, characterized in that, Send task requests to N devices, including: Compare the first duration with the first threshold; If it is determined that the first duration is greater than the first threshold, the task request is sent to the N devices.
18. A task processing system, characterized in that, The task processing system includes a first device and N devices, wherein the N devices are distributedly connected to the first device, and a second device is used to implement the steps of the method according to any one of claims 1 to 8, wherein the second device is any one of the N devices, and the first device is used to implement the steps of the method according to any one of claims 9 to 17.
19. The system according to claim 18, characterized in that, The first device and the N devices are equipped with the same type of bus system, wherein the first device and the second device communicate through the bus system.
20. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8, or the steps of the method according to any one of claims 9 to 17.