Task execution method and system, device, and storage medium

By receiving task execution requests from the target device and determining target tasks based on the device group and task configuration, the problem that some devices cannot participate in task execution is solved, ensuring that the task execution results of all devices can be obtained, and the credibility of task execution results is improved.

WO2025113011A1PCT designated stage expired Publication Date: 2025-06-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/127115
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-27
Filing Date
2024-10-24
Publication Date
2025-06-05

AI Technical Summary

Technical Problem

In some technologies, some types of devices participate in task execution at a low frequency or cannot participate in task execution, resulting in the task execution results of some devices being unavailable.

Method used

By receiving the task execution request sent by the target device, the target task to be executed by the equipment under the target device group is determined, the number of times the target task has been executed and the total number of times allowed to be executed, and when the number of times the execution has not reached the total number of times, the target device is issued a task instruction to execute the target task.

Benefits of technology

Ensure that all types of devices have the opportunity to perform tasks, thereby obtaining task execution results and improving the credibility of task execution results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024127115_05062025_PF_FP_ABST
    Figure CN2024127115_05062025_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of the Internet. Disclosed are a task execution method and system, a device, and a storage medium. The task execution method comprises: receiving a task execution request sent by a target device, the task execution request comprising a target device group to which the target device belongs, wherein different device groups comprise different devices; determining from an established task list a target task to be executed by a device under the target device group; and acquiring the number of times the target task has been executed and the total number of times the target task is allowed to be executed, and when the number of times the target task has been executed does not reach the total number of times, issuing to the target device a task instruction for executing the target task, so that the target device executes the target task.
Need to check novelty before this filing date? Find Prior Art

Description

Task execution method, system, device and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of Chinese Patent Application No. 202311595189.9, filed on November 27, 2023. The entire teachings of the above application are incorporated herein by reference. Technical Field

[0003] The present disclosure relates to the field of computer technology, and in particular to a task execution method, system, device, and storage medium. Background Art

[0004] In some scenarios, different types of devices may produce different results when performing the same task, influenced by various factors such as device attributes, hardware and software resources. To improve the credibility of task execution results, it is necessary to obtain task execution results for different types of devices separately.

[0005] Currently, in some technologies, some types of devices participate in task execution more frequently, while some types of devices participate in task execution less frequently or cannot participate in task execution, resulting in the inability to obtain task execution results for some devices.

[0006] Summary of the Invention

[0007] In view of this, embodiments of the present disclosure provide a task execution method, a task execution system, an electronic device, and a computer-readable storage medium.

[0008] In one aspect, the present disclosure provides a task execution method, the method comprising:

[0009] receiving a task execution request sent by a target device, wherein the task execution request includes a target device group to which the target device belongs, wherein different device groups include different devices;

[0010] Determine the target tasks to be executed by the devices in the target device group in the established task list;

[0011] The number of times the target task has been executed and the total number of times it is allowed to be executed are obtained, and if the number of times the target task has been executed does not reach the total number of times, a task instruction to execute the target task is issued to the target device, so that the target device executes the target task.

[0012] Another aspect of the present disclosure provides a task execution system, the system comprising:

[0013] a request receiving module, configured to receive a task execution request sent by a target device, wherein the task execution request includes a target device group to which the target device belongs, wherein different device groups include different devices;

[0014] A target task determination module is used to determine the target tasks to be executed by the devices under the target device group in the established task list;

[0015] The task issuing module is used to obtain the number of times the target task has been executed and the total number of times it is allowed to be executed, and if the number of times the target task has been executed does not reach the total number, issue a task instruction to the target device to execute the target task, so that the target device executes the target task.

[0016] On the other hand, the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0017] On the other hand, the present disclosure further provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method described above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:

[0019] FIG1 shows a schematic diagram of a task system provided by an embodiment of the present application;

[0020] FIG2 is a schematic diagram showing a flow chart of a task execution method provided by an embodiment of the present application;

[0021] FIG3 shows a schematic diagram of a task list provided by an embodiment of the present application;

[0022] FIG4 shows a schematic diagram of a task list provided by another embodiment of the present application;

[0023] FIG5 shows a schematic diagram of a task list provided by another embodiment of the present application;

[0024] FIG6 shows a schematic diagram showing the relationship between a task list and a subtask list provided in one embodiment of the present application;

[0025] FIG7 shows a schematic diagram of a task execution system provided by an embodiment of the present application;

[0026] FIG8 shows a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0027] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0028] Please refer to Figure 1, which is a schematic diagram of a task system 100 provided in one embodiment of the present application. In Figure 1, the task system 100 includes a task management platform 11 and multiple devices 12. The task management platform 11 is in communication with each device 12. The process of executing a task in the task system 100 can be as follows:

[0029] 11) When each device 12 meets the task execution conditions, it sends a task execution request to the task management platform 11 to request the execution of the task.

[0030] Specifically, a task execution condition refers to a preset condition that must be met when device 12 executes a task. For example, when the device status of device 12 meets a preset state or when device 12 performs a preset operation, a task execution request may be sent to task management platform 11. In the embodiment shown in Figure 1, a task execution request may be sent to task management platform 11 when device 12 cold-starts a specified application.

[0031] 12) The task management platform 11 sends the task to the device 12 that initiated the task execution request, so that the device 12 executes the sent task and obtains the task execution result.

[0032] Specifically, tasks may include but are not limited to data calculation, data acquisition, etc. For example, Task 1 may be to obtain the time consumed and CPU utilization of device 12 when performing a specified operation. After Task 1 is sent to device 12, device 12 can time the operation process and monitor the CPU utilization when performing the specified operation, and use the obtained time consumed and CPU utilization as the task execution result of Task 1. For another example, Task 2 may be to obtain the device information of device 12 (such as CPU model, memory size, etc.). After Task 2 is sent to device 12, device 12 can collect its own device information and use the collected device information as the task execution result of Task 2.

[0033] It is understandable that since different types of devices may have different hardware and software resources, different task execution results may be obtained when executing tasks on different types of devices. For example, assuming that the CPU resources on device A are more abundant than those on device B, when executing Task 1 above, device A may take a shorter time and have a lower CPU utilization rate, while device B may take a longer time and have a higher CPU utilization rate.

[0034] 13) Obtain the task execution result returned by device 12.

[0035] After obtaining the task execution results of different types of devices 12, different types of devices 12 can be controlled separately based on the task execution results. For example, assuming that based on the task execution results of Task 2 in step 12) above, it is known that device A has sufficient memory size, CPU resources, etc., while device B has limited memory size, CPU resources, etc., then the video file sent to device A for playback on device A can be a higher-resolution video file, while the video file sent to device B for playback on device B can be a lower-resolution video file. This can avoid problems such as video freezes caused by insufficient hardware resources on device B.

[0036] In some technologies, in the above step 12), the task management platform 11 issues tasks based on the preset total number of task issuances. Specifically, after receiving the task execution request, the task management platform 11 determines whether the number of task issuances reaches the preset total number of task issuances (for example, 1,000 times). If not, the task to be executed is issued to the device 12 so that the device 12 executes the task; if it is reached, the task is refused to be issued. The problem with this is that for devices that easily meet the task execution conditions, there is a greater probability of obtaining the tasks issued by the task management platform 11; while for devices that are not easy to meet the task execution conditions, it may not be possible to obtain the tasks issued by the task management platform 11. In this way, the task execution results of some devices cannot be obtained.

[0037] For example, suppose the task execution condition is that device 12 cold starts the specified application. When the total number of tasks issued is 1,000 times, if within a week, type A device 12 cold starts the specified application 500 times, type B device 12 cold starts the specified application 550 times, and type C device 12 does not cold start the specified application, then within this week, the task management platform 11 will issue a total of 1,000 tasks to type A device 12 and type B device 12. After the number of tasks issued exceeds 1,000 times, the task management platform 11 will refuse to issue tasks to any type of device 12. In this case, if type C device 12 cold starts the specified application and sends a task execution request in the subsequent stage, it will not be able to obtain the task issued by the task management platform 11, and thus, it will not be able to obtain the task execution result of type C device 12.

[0038] In view of this, the present application provides a task execution method that can solve the problem of being unable to obtain task execution results on some devices. The task execution method can be applied to the task management platform in Figure 1. Please refer to Figure 2, which is a flowchart of the task execution method provided in one embodiment of the present application. In Figure 2, the task execution method includes the following steps:

[0039] Step S21 : receiving a task execution request sent by a target device, wherein the task execution request includes a target device group to which the target device belongs, wherein different device groups include different devices.

[0040] Specifically, the target device may be a device that meets the task execution conditions. For the task execution conditions, please refer to the relevant description of FIG1 and will not be repeated here.

[0041] The target device group to which a target device belongs can be determined based on a target device attribute of the target device. In this embodiment, the target device attribute is the device model. Simply put, devices can be divided into multiple device groups based on the device model. Devices with the same device model constitute a device group. The target device group to which a target device belongs is the device group corresponding to the device model of the target device.

[0042] The target device attributes can be selected based on actual circumstances, and this application does not impose any restrictions on the target device attributes. For example, in some embodiments, the target device attribute is the manufacturer of the device. That is, devices with the same manufacturer are divided into a device group. The target device group to which the target device belongs is the device group corresponding to the manufacturer of the target device. For another example, in some embodiments, the target device attributes are the device model and memory size of the device. That is, devices with the same device model and the same memory size are divided into a device group. The target device group to which the target device belongs is the device group corresponding to the device model and memory size of the target device.

[0043] In this embodiment, the target device attributes of the target device can be used in the task execution request to indicate the target device group to which the target device belongs. For example, if the device model of the target device is XXYY, XXYY can be directly set in the task execution request. In this way, based on XXYY in the task execution request, the target device group to which the target device belongs can be determined.

[0044] In some other embodiments, each device group may have its own corresponding device group identifier. In a task execution request, the device group identifier of a target device group may be used to indicate the target device group to which the target device belongs.

[0045] Step S22: Determine the target tasks to be executed by the devices in the target device group in the established task list.

[0046] Specifically, each task in a task list may have configuration information. This configuration information includes pre-configured device groups. Tasks in a task list can be isolated based on the device groups in the configuration information, with each task only allowed to be executed by devices in the device groups included in the configuration information. For ease of understanding, please refer to Figure 3, which shows a schematic diagram of a task list according to one embodiment of the present application. Figure 3 shows an example of four task lists. Each task list has its own corresponding configuration information. The "Device Group" list item in the configuration information can be used to configure the device groups that are allowed to execute each task. As shown in Figure 3, tasks 1 and 3 are allowed to be executed by devices in device group A, while tasks 2 and 4 are allowed to be executed by devices in device group B. Executing different tasks can produce different task execution results. For example, executing Task 1 will result in the time taken for devices in device group A to execute a specified operation; executing Task 2 will result in the time taken for devices in device group B to execute a specified operation; executing Task 3 will result in information about devices in device group A, while executing Task 4 will result in information about devices in device group B. In this way, tasks can be isolated by device group.

[0047] Based on the description of the task list, the target tasks to be executed by the devices in the target device group in the established task list may include:

[0048] For any task in the task list, if the configuration information of the task contains the same device group as the target device group, the task is used as the target task.

[0049] For example, assume that the target device group is device group A. In the task list shown in FIG3 , Task 1 and Task 3 are the target tasks to be executed by the devices under the target device group.

[0050] Step S23: Obtain the number of times the target task has been executed and the total number of times it is allowed to be executed. If the number of times the target task has been executed does not reach the total number, issue a task instruction to execute the target task to the target device, so that the target device executes the target task.

[0051] With reference to FIG3 , in the task list, the configuration information of each task may include a pre-configured total number of times the task is allowed to be executed. The total number of times different tasks are allowed to be executed may be different. Specifically, the total number of times each task is allowed to be executed may be determined based on the credibility of the task execution results. That is, for a task, if a task execution result with a higher credibility can be obtained after executing the task a relatively small number of times, then the total number of times the task is allowed to be executed may be correspondingly smaller; if a task execution result with a higher credibility can be obtained after executing the task a relatively large number of times, then the total number of times the task is allowed to be executed may be correspondingly increased.

[0052] Based on the above description of the total number of times, after the target task is determined in step S22 , the total number of times the target task is allowed to be executed may be obtained from the configuration information of the target task.

[0053] Furthermore, in the task list, each task can have its own corresponding count field. The count field can start at 0 and increment by 1 each time the corresponding task is executed. In this way, the value of the count field can be used to represent the number of times the task has been executed.

[0054] Based on the description of the above counting field, after the target task is determined in step S22, the value of the counting field corresponding to the target task can be obtained as the number of times the target task has been executed.

[0055] If the target task's execution count and total allowed execution count do not reach the total count, the target task needs to be executed further to obtain more task execution results and improve the credibility of the task execution results. In this case, a task instruction to execute the target task can be issued to the target device, prompting it to perform the task. Conversely, if the execution count has reached the total allowed execution count, the obtained task execution results are highly credible, and the target task can be executed further. In this case, there is no need to issue a task instruction to execute the target task to the target device. For ease of understanding, consider Figure 3 as an example. Assume that device group A is the target device group. When a target device in device group A initiates a task execution request, it can be determined that the tasks permitted for the target device to execute are Task 1 and Task 3. However, Task 3's execution count has already reached the total allowed execution count, so only a task instruction to execute Task 1 will be issued to the target device.

[0056] Furthermore, it can be seen from Figure 3 that after isolating different tasks based on the device group, the devices under each device group can only execute their corresponding tasks. In this way, between different device groups, the situation where the devices under some device groups send task execution requests at a higher frequency will not cause the devices in other device groups to be unable to obtain tasks, thus solving the problem of the inability to obtain the task execution results of some devices. For example, in Figure 3, it is assumed that the devices under device group A send task execution requests at a lower frequency, and the devices under device group B send task execution requests at a higher frequency. Since the devices under device group B can only execute tasks 2 and 4, and cannot execute tasks 1 and 3 (that is, it will not cause the number of times tasks 1 and 3 have been executed to increase), the devices under device group A always have the opportunity to execute tasks 1 and 3, and can then obtain the task execution results after the devices under device group A execute the tasks.

[0057] In summary, in the technical solutions of some embodiments of the present application, based on the target device group to which the target device belongs, the target task to be executed by the target device is determined, and if the number of times the target task has been executed has not reached the total number of times, a task instruction to execute the target task is issued to the target device. Since different tasks are isolated by the device group, the number of times the target task has been executed can only be consumed by the devices under the target device group. That is, if the devices under the target device group do not initiate a task execution request in a timely manner, the number of times the target task has been executed will not be consumed by the devices under other device groups. In this way, it can be ensured that the devices under the target device group always have the opportunity to execute the target task, so that the task execution results after the devices under the target device group execute the target task can be obtained. This solves the problem that the task execution results of some devices cannot be obtained.

[0058] The solution of this application is further described below.

[0059] In some embodiments, executing some tasks may cause device anomalies, such as device reboots and data loss. To prevent all devices in a device group from experiencing anomalies, only some devices in the group can be allowed to execute tasks. This prevents all devices in the group from experiencing anomalies.

[0060] Based on the above description, refer to FIG4 , which is a schematic diagram of a task list provided in another embodiment of the present application. The configuration information of each task may also include a task dispatch ratio, wherein the task dispatch ratio represents the ratio of devices to be executed in a single device group. The above-mentioned task instruction to the target device to execute the target task may include:

[0061] Get the actual percentage of devices that have executed the target task under the target device group;

[0062] If the actual ratio is less than the task delivery ratio in the configuration information of the target task, a task instruction to execute the target task is delivered to the target device.

[0063] Specifically, on the task management platform side, the devices that have executed the target task under the target device group can be counted to obtain the number of devices that have executed the target task. The actual proportion can be obtained by dividing the number of devices that have executed the target task by the total number of devices under the target device group. If the actual proportion reaches the task issuance proportion in the configuration information of the target task, it means that under the target device group, the number of devices that execute the target task has reached the maximum number allowed. In this case, the task execution request sent by the target device can be rejected, and the task instruction to execute the target task will not be issued to the target device. If the actual proportion is less than the task issuance proportion in the configuration information of the target task, it means that under the target device group, the number of devices that execute the target task has not yet reached the maximum number allowed. In this case, the task instruction to execute the target task can be issued to the target device. In this way, the problem of all devices under the target device group being abnormal due to the execution of the task can be avoided.

[0064] Furthermore, in some embodiments, to quickly and accurately locate devices within a device group that are performing a task, the devices within a device group can be divided into multiple device subgroups based on device characteristics. Devices with the same device characteristics form a device subgroup. When issuing task execution instructions to devices within a device group based on their task issuance ratio, the task instructions can be issued to devices within a specified device subgroup. This allows for quick and accurate locating of devices within a device group that are performing a task based on device characteristics. Here, the device characteristics can be device ID characteristics.

[0065] Specifically, if the actual ratio is less than the task issuance ratio in the configuration information of the target task, issuing a task instruction to the target device to execute the target task may include:

[0066] Performing a modulo operation on the devices in the target device group according to the device ID to divide the devices in the target device group into multiple device subgroups;

[0067] According to the task delivery ratio in the configuration information of the target task, among the multiple device subgroups, devices in one or more target device subgroups are selected as devices to execute the target task;

[0068] In the case that the target device belongs to the target device subgroup, a task instruction to execute the target task is issued to the target device.

[0069] For ease of understanding, let's use a 70% task dispatch percentage as an example. If the task dispatch percentage is 70%, the device IDs under the target device group can be modulo 1, dividing the devices under the target device group into 10 device subgroups. Devices with IDs 1, 11, 21, 31, and so on are the first device subgroup, devices with IDs 2, 12, 22, 32, and so on are the second device subgroup, devices with IDs 3, 13, 23, 33, and so on are the third device subgroup, and so on. Of the 10 resulting device subgroups, the first seven can be used as the target device subgroups. This way, the devices in the target device subgroups account for 70% of the target device group. If the target device's device ID is in the target device subgroup, a task instruction to execute the target task can be issued to the target device. If the target device's device ID is not in the target device subgroup, no task instruction to execute the target task is issued to the target device. In this way, based on the device ID, you can quickly and accurately find the device that performs the task under the target device group.

[0070] In some embodiments, referring to FIG4 , in order to make the obtained task execution results more credible, the configuration information of each task includes one or more pre-configured time windows. Here, a time window represents a continuous time interval. For example, in FIG4 , for Task 1, from January 1, 2023 to March 1, 2023, 10:00 to 12:00 every day can be used as a time window. That is, 10:00 to 12:00 on January 1, 2023 is the first time window, and 10:00 to 12:00 on January 2, 2023 is the second time window, and so on.

[0071] Tasks can be issued in different time windows to obtain task execution results in different time windows. In this way, if the task execution results obtained in some time windows are inaccurate, they can be corrected by using the task execution results obtained in other time windows, thereby improving the credibility of the task execution results.

[0072] Based on the above description of the time window, the above-mentioned task instruction to execute the target task to the target device may include:

[0073] Get the time when the task execution request is received;

[0074] If the time point is within one of the time windows in the configuration information of the target task, obtain the number of times the target task has been executed within the time window;

[0075] If the number of executions within the time window does not reach the total number of times the target task is allowed to be executed, a task instruction to execute the target task is sent to the target device.

[0076] Simply put, within a single time window, if the target task has been executed the number of times it is allowed to execute, a task instruction is issued to the target device to execute the target task. This allows you to obtain the target device's task execution results across multiple time windows, increasing the credibility of the task execution results.

[0077] In some embodiments, referring to FIG4 , the configuration information of each task may further include pre-configured device extension attributes. Device extension attributes refer to device attributes that are different from the target device attributes used for device group division. Device extension attributes may include the hardware and software attributes of the device. For example, assuming that the target device attribute used for device group division is the device model, then the device extension attributes may be the CPU model, memory model, the application currently running on the device, etc. Based on the device extension attributes, the devices under the same device group can be further screened to improve the applicability of the solution. For example, among the devices under device group A, devices with a CPU model of XX and running the YY application are further screened.

[0078] Based on the above description of the device extended attributes, the above task instruction to execute the target task to the target device may include:

[0079] When the device attributes of the target device are consistent with the device extension attributes in the configuration information of the target task, a task instruction for executing the target task is issued to the target device.

[0080] In this way, based on device extended attributes, you can further filter the devices in the target device group that are allowed to execute the target task. For example, within the target device group, you can only allow devices with CPU model XX to run the target task. This improves the applicability of the solution.

[0081] In some embodiments, refer to Figure 5, which is a schematic diagram of a task list provided for another embodiment of the present application. Part or all of the configuration information of each task can be set in a configuration template, and the configuration information in different configuration templates is not exactly the same. When configuring each task in the task list, the corresponding configuration template can be referenced. The configuration information in the configuration template of each task is the configuration information of the corresponding task. In this way, on the one hand, when configuring each task, only the configuration template can be selected, which simplifies the configuration process. On the other hand, when multiple tasks have the same configuration information, only one configuration template needs to be maintained, and there is no need to repeat the configuration for each task. For example, in Figure 5, the configuration information of Task 2 and Task 4 is the same, and these two tasks can reference the same configuration template. In this way, only one information configuration needs to be performed in the configuration template once, and there is no need to repeat the information configuration for each task.

[0082] Based on the above description of the configuration template, after receiving the task execution request, the task execution method of the present application may further include:

[0083] Get the target configuration template referenced by the target task, and use the configuration information in the target configuration template as the configuration information of the target task.

[0084] Furthermore, it can be understood that if multiple target tasks reference the same target configuration template, and since the time windows and task issuance ratios for each target task are identical, each time a target device sends a task execution request, it can receive task instructions to execute multiple target tasks. That is, the execution counts for each of these multiple target tasks should be the same. For example, in Figure 5, each time a target device in device group B sends a task execution request, it needs to execute Task 2 and Task 4 once, respectively. Therefore, the execution counts for Task 2 and Task 4 are always the same.

[0085] In view of this, the configuration information in the target configuration template may include the total number of times a task is allowed to be executed. In some embodiments, the total number of times in the target configuration template may be the total number of times a single target task is allowed to be executed. In the case where multiple target tasks reference the same target configuration template, the task instruction for executing the target task sent to the target device may include:

[0086] When the number of executions of a single target task does not reach the total number in the target configuration template, a task instruction to execute the target task is sent to the target device.

[0087] For example, in Figure 5, assuming that Task 2 and Task 4 are target tasks, if the number of executions of Task 2 or Task 4 has not reached 150, a task instruction to execute the target task is issued to the target device.

[0088] In other embodiments, the total number of times in the target configuration template may be the sum of the total number of times that multiple target tasks that reference the target configuration template are allowed to be executed. The above-mentioned task instruction to execute the target task to the target device may include:

[0089] The sum of the execution times of the multiple target tasks is used as the total execution times, and when the total execution times does not reach the total times in the target configuration template, a task instruction to execute the target task is issued to the target device.

[0090] For example, in Figure 5, assume that Task 2 and Task 4 are the target tasks. If the total number of executions for Task 2 and Task 4 does not reach 150, a task instruction to execute the target task is issued to the target device. In this case, the total number of times Task 2 and Task 4 can be executed is 75, and the total number of times Task 4 can be executed is 75.

[0091] The total number of times the target task is allowed to be executed is set in the target configuration template, and the total number of times each target task is allowed to be executed is calculated according to the corresponding total number calculation logic. In this way, there is no need to separately configure the total number of times each target task is allowed to be executed outside the target configuration template, which simplifies the configuration process.

[0092] Referring to Figure 6 , in some embodiments, a target task may include multiple subtasks. For example, a target task for obtaining device information may be further divided into multiple subtasks, such as obtaining CPU utilization, obtaining memory size, and obtaining hard disk model. When the task management platform issues a task instruction to execute the target task to the target device, the target device must execute each subtask under the target task.

[0093] Different subtasks may have different execution logics. Specifically, the execution logic may include the task execution logic and the processing logic of the task execution results. Among them, the task execution logic includes but is not limited to the interface that the target device needs to call during the task execution process, the algorithm used, the data to be collected, etc. The processing logic of the task execution results includes but is not limited to the field values ​​that the target device needs to extract from the task execution results and return to the task management platform after the task is successfully executed, and the number of times the target device needs to re-execute the task after the task fails. The task execution logic can be set in the task execution file, and the processing logic of the task execution results can be represented by the task result processing method. For the subtasks under a task, the task execution files and task result processing methods of the corresponding subtasks can be maintained in the configuration interface of each subtask respectively.

[0094] Based on the description of FIG6 , the task instruction to execute the target task to the target device may include:

[0095] The task execution files and task result processing methods required to execute each subtask are sent to the target device, so that the target device runs the task execution files, obtains the task execution results, and processes the task execution results according to the task result processing method.

[0096] In this embodiment, the task execution file and task result processing method are stored on the task management platform. When the target device needs to execute a task, the corresponding task execution file and task result processing method are then sent to the target device. This reduces storage consumption on the target device and prevents the target device from storing too many unnecessary task execution files.

[0097] Furthermore, since the task execution logic included in the task execution file defines the logic in the subtask execution process, and the task result processing method defines the processing logic of the subtask execution result, this may cause the subtask execution to fail if the versions of the task execution file and the task result processing method do not match. For example, in the task execution file, the collected data is saved in the AAA field, but the task result processing method specifies that the collected data is extracted from the BBB field. Since there is no BBB field in the task execution file, the target device will not be able to extract the collected data, which will lead to the execution of the subtask. In view of this, the task execution method of the present application may also include:

[0098] In the event that the versions of the task execution file and the task result processing method do not match, a prompt message indicating that the target task execution failed and returned by the target device is received and displayed.

[0099] In this way, maintenance personnel can handle the version mismatch between the task execution file and the task result processing method based on the prompt information.

[0100] This completes the description of the task execution method of this application.

[0101] Corresponding to the task execution method, the present application also provides a task execution system. Please refer to Figure 7, which is a schematic diagram of a task execution system provided by an embodiment of the present application. In Figure 7, the task execution system includes:

[0102] a request receiving module, configured to receive a task execution request sent by a target device, wherein the task execution request includes a target device group to which the target device belongs, wherein different device groups include different devices;

[0103] A target task determination module is used to determine the target tasks to be executed by the devices under the target device group in the established task list;

[0104] The task issuing module is used to obtain the number of times the target task has been executed and the total number of times it is allowed to be executed, and if the number of times it has been executed does not reach the total number, issue a task instruction to execute the target task to the target device so that the target device executes the target task.

[0105] Please refer to Figure 8, which is a schematic diagram of an electronic device provided in one embodiment of the present application. The electronic device includes a processor and a memory, wherein the memory is used to store a computer program. When the computer program is executed by the processor, the above method is implemented.

[0106] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0107] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods described in the embodiments of the present invention. The processor executes the non-transitory software programs, instructions, and modules stored in the memory to perform various processor functions and data processing, thereby implementing the methods described in the aforementioned method embodiments.

[0108] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0109] One embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, the above method is implemented.

[0110] Although the embodiments of the present disclosure have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A task execution method, comprising: receiving a task execution request sent by a target device, wherein the task execution request includes a target device group to which the target device belongs, wherein different device groups include different devices; In the established task list, determine the target tasks to be executed by the devices under the target device group; The number of times the target task has been executed and the total number of times it is allowed to be executed are obtained, and when the number of times the target task has been executed does not reach the total number of times, a task instruction to execute the target task is issued to the target device, so that the target device executes the target task.

2. The method of claim 1, wherein: Each task in the task list has configuration information, and the configuration information includes a pre-configured device group; Determining the target tasks to be executed by the devices under the target device group in the established task list includes: For any task in the task list, if the configuration information of the task contains a device group that is the same as the target device group, the task is used as the target task.

3. The method of claim 2, wherein: The configuration information also includes a task issuance ratio, where the task issuance ratio represents a ratio of devices to be executed in a single device group; The sending of a task instruction to the target device to execute the target task includes: Obtaining the actual proportion of devices in the target device group that have executed the target task; If the actual proportion is less than the task issuance proportion in the configuration information of the target task, a task instruction for executing the target task is issued to the target device.

4. The method of claim 3, wherein: If the actual proportion is less than the task issuance proportion in the configuration information of the target task, issuing a task instruction to execute the target task to the target device includes: Performing a modulo operation on the devices under the target device group according to the device IDs, so as to divide the devices under the target device group into a plurality of device subgroups; According to the task delivery ratio in the configuration information of the target task, among the multiple device subgroups, devices in one or more target device subgroups are used as devices to execute the target task; In a case where the target device belongs to the target device subgroup, a task instruction for executing the target task is issued to the target device.

5. The method of claim 1, wherein: Each task in the task list has configuration information, and the configuration information includes one or more preconfigured time windows; The sending of a task instruction to the target device to execute the target task includes: Obtaining the time point when the task execution request is received; If the time point is within one of the time windows in the configuration information of the target task, obtaining the number of times the target task has been executed within the time window; If the number of executions within the time window does not reach the total number of times the target task is allowed to be executed, a task instruction to execute the target task is sent to the target device.

6. The method of claim 1, wherein: Each task in the task list has configuration information, and the configuration information includes pre-configured device extension attributes; The sending of a task instruction to the target device to execute the target task includes: When the device attribute of the target device is consistent with the device extension attribute in the configuration information of the target task, a task instruction for executing the target task is issued to the target device.

7. The method according to any one of claims 1 to 6, wherein: Part or all of the configuration information of each task is set in a configuration template, and the configuration information in different configuration templates is not completely the same. After receiving the task execution request, the method further includes: A target configuration template referenced by the target task is obtained, and configuration information in the target configuration template is used as configuration information of the target task.

8. The method of claim 7, wherein: The configuration information in the target configuration template includes the total number of times the task is allowed to be executed; In the case where multiple target tasks reference the same target configuration template, the step of sending a task instruction to the target device to execute the target task includes: Taking the sum of the execution times of the multiple target tasks as the total execution times, and when the total execution times does not reach the total times in the target configuration template, issuing a task instruction to execute the target task to the target device; or When the number of executions of a single target task does not reach the total number of executions in the target configuration template, a task instruction for executing the target task is issued to the target device.

9. The method of claim 1, wherein: The target task includes a plurality of subtasks, and the sending of the task instruction for executing the target task to the target device includes: The task execution files and task result processing methods required for executing each of the subtasks are sent to the target device, so that the target device runs the task execution files, obtains the task execution results, and processes the task results according to the task results. The result processing method is to process the task execution result.

10. The method of claim 9, further comprising: In the case that the versions of the task execution file and the task result processing method do not match, prompt information returned by the target device indicating that the target task execution has failed is received and displayed.

11. A task execution system, comprising: A request receiving module, used for receiving a task execution request sent by a target device, wherein the task execution request includes a target device group to which the target device belongs, wherein different device groups include different devices; A target task determination module, used to determine the target tasks to be executed by the devices under the target device group in the established task list; The task issuing module is used to obtain the number of times the target task has been executed and the total number of times it is allowed to be executed, and if the number of times the target task has been executed does not reach the total number of times, issue a task instruction to the target device to execute the target task, so that the target device executes the target task.

12. A computer-readable storage medium, wherein: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

13. An electronic device, wherein: The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Task execution method and device and computer readable storage medium

    CN114461363A

  • Task processing method and device, equipment, storage medium and program product

    CN115480897A

  • Task execution method and device, equipment, medium and product

    CN115879713A

  • Task execution method and device, equipment and medium

    CN116263707A

  • Systems and methods for efficiently expediting execution of tasks in isolated environments

    US10621001B1