Task execution method, system and equipment and storage medium

By receiving the task execution request of the target device in the task execution system, determining the tasks to be executed under the target device group, and issuing task instructions when the number of executions has not reached the total number of times, the problem that some devices cannot obtain the task execution results is solved, and the devices under the target device group can execute tasks in a timely manner and obtain results.

CN120045304APending Publication Date: 2025-05-27BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311595189.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-27
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The task execution results of some devices cannot be obtained because some devices participate in task execution at a low frequency or cannot participate in task execution.

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, and if the number of times the target task has been executed 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 the devices under the target device group always have the opportunity to perform target tasks, so that the task execution results of the devices under the target device group can be obtained after the target device group performs the target tasks, solving the problem that the task execution results of some devices cannot be obtained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045304A_ABST
    Figure CN120045304A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of the Internet, and discloses a task execution method, system and device and a storage medium, the task execution method comprises the steps that a task execution request sent by a target device is received, the task execution request comprises a target device group to which the target device belongs, and different device groups comprise different devices; in an established task list, determining a target task to be executed by equipment in the target equipment group; and obtaining the number of executed times of the target task and the total number of times allowed to be executed, and issuing a task instruction for executing the target task to the target equipment under the condition that the number of executed times does not reach the total number of times, so that the target equipment executes the target task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

[0002] In some scenarios, different types of devices may obtain different task execution results when executing the same task due to the influence of device attributes, software and hardware resources, etc. In order to improve the credibility of task execution results, it is necessary to obtain task execution results for different types of devices separately.

[0003] 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 that task execution results of some devices cannot be obtained. Summary of the invention

[0004] In view of this, the embodiments of the present disclosure provide a task execution method, a task execution system, an electronic device and a computer-readable storage medium, which can solve the problem that the task execution results of some devices cannot be obtained.

[0005] On the one hand, the present disclosure provides a task execution method, the method comprising:

[0006] 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;

[0007] In the established task list, determine the target tasks to be executed by the devices under the target device group;

[0008] 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.

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

[0010] 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;

[0011] 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;

[0012] 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.

[0013] Another aspect of 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.

[0014] Another aspect of the present disclosure 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.

[0015] 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 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. 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, when the devices under the target device group do not initiate a task execution request in time, 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. The problem that the task execution results of some devices cannot be obtained is solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] 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:

[0017] Figure 1 A schematic diagram of a task system provided by an embodiment of the present application is shown;

[0018] Figure 2 A schematic diagram showing a flow chart of a task execution method provided by an embodiment of the present application is shown;

[0019] Figure 3 A schematic diagram showing a task list provided by an embodiment of the present application is shown;

[0020] Figure 4 A schematic diagram showing a task list provided by another embodiment of the present application is shown;

[0021] Figure 5A schematic diagram showing a task list provided by another embodiment of the present application is shown;

[0022] Figure 6 A schematic diagram showing the relationship between a task list and a subtask list provided by an embodiment of the present application is shown;

[0023] Figure 7 A schematic diagram of a task execution system provided by an embodiment of the present application is shown;

[0024] Figure 8 A schematic diagram of an electronic device provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, 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 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 creative work are within the scope of protection of the present disclosure.

[0026] See also Figure 1 , which is a schematic diagram of a task system 100 provided for one embodiment of the present application. Figure 1 In the example, the task system 100 includes a task management platform 11 and multiple devices 12. The task management platform 11 is connected to each device 12 in communication. The process of the task system 100 executing a task may be as follows:

[0027] 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.

[0028] Specifically, the task execution condition refers to the preset condition that the device 12 must meet when executing the task. For example, when the device state of the device 12 meets the preset state or when the device 12 performs a preset operation, a task execution request can be sent to the task management platform 11. Figure 1 In the illustrated embodiment, when the device 12 cold-starts a designated application, a task execution request may be sent to the task management platform 11 .

[0029] 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.

[0030] Specifically, tasks may include but are not limited to data calculation, data acquisition, etc. For example, Task 1 may be to obtain the time consumption 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 consumption 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.

[0031] 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 the above-mentioned Task 1, the time taken by device A may be shorter and the CPU utilization rate may be lower, but the time taken by device B may be longer and the CPU utilization rate may be higher.

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

[0033] 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 the above step 12), the memory size, CPU resources, etc. of device A are relatively sufficient, and the memory size, CPU resources, etc. of device B are relatively tight, then the video file sent to device A that needs to be played on device A can be a video file with a higher resolution, and the video file sent to device B that needs to be played on device B can be a video file with a lower resolution, so as to avoid problems such as video freeze caused by insufficient hardware resources of device B.

[0034] 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, 1000 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.

[0035] For example, suppose that the task execution condition is that the device 12 cold starts the specified application. When the total number of task issuances is 1,000 times, if within a week, the type A device 12 cold starts the specified application 500 times, the type B device 12 cold starts the specified application 550 times, and the 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 the type A device 12 and the type B device 12. After the number of task issuances exceeds 1,000 times, the task management platform 11 will refuse to issue tasks to any type of device 12. In this case, if the 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 the type C device 12.

[0036] In view of this, the present application provides a task execution method, which can solve the problem that the task execution results of some devices cannot be obtained. The task execution method can be applied to Figure 1 See the task management platform in Figure 2 , which is a flowchart of a task execution method provided in one embodiment of the present application. Figure 2 In the task execution method, the task execution method includes the following steps:

[0037] 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.

[0038] Specifically, the target device may be a device that meets the task execution conditions. For more information about the task execution conditions, see Figure 1 The relevant description is not repeated here.

[0039] The target device group to which the target device belongs may be determined based on the target device attribute of the target device. In this embodiment, the target device attribute is the device model. In short, the devices may be divided into a plurality of device groups based on the device model. Devices with the same device model constitute a device group. The target device group to which the target device belongs is the device group corresponding to the device model of the target device.

[0040] The target device attributes can be selected according to actual conditions, and the present application does not limit 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 attribute is 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.

[0041] In this embodiment, in the task execution request, the target device attribute of the target device can be used to indicate the target device group to which the target device belongs. For example, when 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.

[0042] In some other embodiments, each device group may have a 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.

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

[0044] Specifically, each task in the task list may have configuration information. The configuration information includes a pre-configured device group. The tasks in the task list may be isolated based on the device group in the configuration information, and each task is only allowed to be executed by devices in the device group included in the configuration information. Figure 3 , is a schematic diagram of a task list provided for an embodiment of the present application. Figure 3 In the example, 4 task lists are included. Each task list has its own corresponding configuration information. The list item "device group" in the configuration information can be used to configure the device group that is allowed to execute each task. Figure 3 It can be seen that tasks 1 and 3 are allowed to be executed by devices under device group A, and tasks 2 and 4 are allowed to be executed by devices under device group B. Executing different tasks can get different task execution results. For example, executing task 1 can get the time taken by devices under device group A to execute the specified operation; executing task 2 can get the time taken by devices under device group B to execute the specified operation; executing task 3 can get the device information under device group A, and executing task 4 can get the device information under device group B. In this way, tasks can be isolated according to device groups.

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

[0046] 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.

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

[0048] Step S23, obtaining the number of times the target task has been executed and the total number of times it 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, sending a task instruction to execute the target task to the target device, so that the target device executes the target task.

[0049] Combined with reference Figure 3 In the task list, the configuration information of each task may include the total number of times the pre-configured 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 result. That is, for a task, if a task execution result with a higher credibility can be obtained after executing the task a few times, then the total number of times the task is allowed to be executed can 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 can be correspondingly increased.

[0050] 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 can be obtained from the configuration information of the target task.

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

[0052] 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.

[0053] Between 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 it has been executed has not reached the total number of times, it means that the target task needs to be continued to be executed in order 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 sent to the target device so that the target device can execute the target task. Conversely, if the number of times it has been executed has reached the total number of times it is allowed to be executed, it means that the obtained task execution results already have a high credibility and there is no need to execute the target task again. In this case, there is no need to send a task instruction to execute the target task to the target device. For ease of understanding, Figure 3 For example, assume that device group A is the target device group. When the target device under device group A initiates a task execution request, it can be determined that the tasks allowed to be executed by the target device are task 1 and task 3. However, the number of times task 3 has been executed has reached the total number of times task 3 is allowed to be executed, so only the task instruction to execute task 1 will be issued to the target device.

[0054] Furthermore, it can be seen from 3 that after isolating different tasks based on device groups, 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 high frequency will not cause the devices in other device groups to be unable to obtain tasks, thus solving the problem that the task execution results of some devices cannot be obtained. Figure 3 In the example, it is assumed that the devices under device group A send task execution requests less frequently, while the devices under device group B send task execution requests more frequently. Since the devices under device group B can only execute tasks 2 and 4, but not tasks 1 and 3 (i.e., the number of times tasks 1 and 3 have been executed will not increase), the devices under device group A always have the opportunity to execute tasks 1 and 3, and thus can obtain the task execution results after the devices under device group A execute the tasks.

[0055] 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 when the number of executions of the target task does not reach 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 executions of the target task can only be consumed by the devices under the target device group. That is, when the devices under the target device group do not initiate a task execution request in time, the number of executions of the target task 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. The problem that the task execution results of some devices cannot be obtained is solved.

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

[0057] In some embodiments, the execution of some tasks may cause abnormal risks to the device, such as device restart, device data loss, etc. In order to prevent all devices in a device group from having abnormal situations, only some devices in a device group may be allowed to execute tasks. In this way, all devices in a device group may be prevented from having abnormal situations.

[0058] Based on the above description, combined with reference Figure 4 , which is a schematic diagram of a task list provided by another embodiment of the present application. The configuration information of each task may also include a task distribution ratio, wherein the task distribution ratio represents the ratio of devices to be executed in a single device group. The above-mentioned task instruction to send the target device to execute the target task may include:

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

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

[0061] 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 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 tasks can be avoided.

[0062] Furthermore, in some embodiments, in order to be able to quickly and accurately find the devices that perform tasks under a device group, the devices under a device group can be divided into multiple device subgroups according to device characteristics. Devices with the same device characteristics are a device subgroup. When issuing task instructions to perform tasks to devices under a device group according to the task issuance ratio, the task instructions can be issued to devices under a specified device subgroup. In this way, based on device characteristics, it is possible to quickly and accurately find devices that perform tasks under a device group. Here, the device characteristics can be the characteristics of the device ID.

[0063] Specifically, 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 may include:

[0064] Performing a modulo operation on the devices under the target device group according to the device ID, so as to divide the devices under the target device group into multiple device subgroups;

[0065] 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;

[0066] In the 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.

[0067] For ease of understanding. Take the task delivery ratio of 70% as an example for explanation. When the task delivery ratio is 70%, the device ID under the target device group can be modulo-operated according to the modulo value 1, and the devices under the target device group can be divided into 10 device subgroups. Among them, the devices with IDs of 1, 11, 21, 31... are the first device subgroup, the devices with IDs of 2, 12, 22, 32... are the second device subgroup, the devices with IDs of 3, 13, 23, 33... are the third device subgroup, and so on. Among the 10 device subgroups obtained by division, the first 7 device subgroups can be used as target device subgroups. In this way, under the target device group, the proportion of devices in the target device subgroup is 70%. When the device ID of the target device belongs to the device ID in the target device subgroup, the task instruction to execute the target task can be issued to the target device; when the device ID of the target device does not belong to the device ID in the target device subgroup, the task instruction to execute the target task is not issued to the target device. In this way, based on the device ID, the device that performs the task under the target device group can be quickly and accurately found.

[0068] In some embodiments, in conjunction with Figure 4 In order to make the obtained task execution results more reliable, 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 Figure 4 For Task 1, 10:00 to 12:00 every day from January 1, 2023 to March 1, 2023 can be used as a time window. That is, 10:00 to 12:00 on January 1, 2023 is the first time window, 10:00 to 12:00 on January 2, 2023 is the second time window, and so on.

[0069] 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 the task execution results obtained in other time windows, thereby achieving the purpose of improving the credibility of the task execution results.

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

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

[0072] 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;

[0073] 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.

[0074] In simple terms, within a single time window, if the number of times the target task has been executed is not greater than 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. In this way, the task execution results of the target device in multiple time windows can be obtained, improving the credibility of the task execution results.

[0075] In some embodiments, in conjunction with Figure 4 , the configuration information of each task can also include pre-configured device extension attributes. Among them, device extension attributes refer to device attributes that are different from the target device attributes used for device group division. Device extension attributes can include the software and hardware 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 can 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 YY application are further screened.

[0076] Based on the above description of the device extended attributes, the above task instruction for executing the target task to the target device may include:

[0077] 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.

[0078] In this way, based on the device extension attributes, the devices that are allowed to execute the target task under the target device group can be further filtered. For example, under the target device group, only devices with CPU model XX can be allowed to run the target task. The solution is more applicable.

[0079] In some embodiments, in conjunction with Figure 5 , is a schematic diagram of a task list provided as 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, you only need to select a configuration template, which simplifies the configuration process. On the other hand, when multiple tasks have the same configuration information, you only need to maintain one configuration template, and there is no need to repeat the configuration multiple times for each task. For example Figure 5 In the example, the configuration information of Task 2 and Task 4 is the same, so these two tasks can reference the same configuration template. In this way, you only need to configure the information once in the configuration template, without having to repeat the information configuration for each task.

[0080] 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:

[0081] 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.

[0082] Furthermore, it is understandable that when there are multiple target tasks that reference the same target configuration template, since the time windows and task distribution ratios of each target task are the same, each time the target device sends a task execution request, the target device can receive task instructions for executing multiple target tasks. That is, among the multiple target tasks, the number of times each target task has been executed should be the same. For example Figure 5 In the example, each time the target device under device group B sends a task execution request, the target device needs to execute task 2 and task 4 once respectively. That is, the number of times task 2 and task 4 have been executed is always the same.

[0083] In view of this, the configuration information in the target configuration template may include the total number of times the 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:

[0084] 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.

[0085] for example Figure 5 In the example, it is assumed that Task 2 and Task 4 are target tasks. For Task 2 and Task 4, when the number of executions of Task 2 or Task 4 does not reach 150, a task instruction to execute the target task is issued to the target device.

[0086] In some 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 sending of the task instruction to execute the target task to the target device may include:

[0087] The sum of the execution times of the multiple target tasks is taken 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.

[0088] for example Figure 5 In the example, it is assumed that Task 2 and Task 4 are target tasks. For Task 2 and Task 4, when the sum of the number of times Task 2 and Task 4 have been executed does not reach 150 times, a task instruction to execute the target task is issued to the target device. In this case, it is equivalent to that the total number of times Task 2 is allowed to be executed is 75 times, and the total number of times Task 4 is allowed to be executed is 75 times.

[0089] 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.

[0090] Combined with reference Figure 6 In some embodiments, the target task may include multiple subtasks. For example, for a target task of obtaining device information, it can be further divided into multiple subtasks such as obtaining CPU utilization, obtaining memory size, and obtaining hard disk model. When the task management platform sends a task instruction to execute the target task to the target device, the target device needs to execute each subtask under the target task respectively.

[0091] 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.

[0092] Based on Figure 6 The above-mentioned task instruction for sending the target device to execute the target task may include:

[0093] The task execution files and task result processing methods required for executing 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 methods.

[0094] In this embodiment, the task execution file and the task result processing method are stored on the task management platform side. When the target device needs to execute the task, the corresponding task execution file and the task result processing method are sent to the target device. In this way, on the one hand, the storage consumption on the target device can be reduced. On the other hand, it can avoid storing too many task execution files that do not need to be executed on the target device.

[0095] 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:

[0096] In the case where 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.

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

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

[0099] Corresponding to the task execution method, the present application also provides a task execution system. Figure 7 , is a schematic diagram of a task execution system provided for one embodiment of the present application. Figure 7 In the task execution system, the task execution system includes:

[0100] 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;

[0101] 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;

[0102] 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 execute the target task to the target device so that the target device executes the target task.

[0103] See also Figure 8 , is a schematic diagram of an electronic device provided by an embodiment of the present application. The electronic device includes a processor and a memory, the memory is used to store a computer program, and when the computer program is executed by the processor, the above method is implemented.

[0104] 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.

[0105] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the embodiment of the present invention. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiment.

[0106] 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 disposed 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.

[0107] 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.

[0108] Although the embodiments of the present disclosure have been described in conjunction with 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, characterized in that, the method includes: receiving a task execution request sent by a target device, where the task execution request includes a target device group to which the target device belongs, and different device groups include different devices; determining, in an established task list, a target task to be executed by devices under the target device group; obtaining the number of times the target task has been executed and the total number of times it is allowed to be executed, and when the number of times executed has not reached the total number of times, sending a task instruction to the target device to execute the target task, so that the target device executes the target task.

2. The method according to claim 1, characterized in that, each task in the task list has configuration information, and the configuration information includes a pre-configured device group; the determining, in the established task list, a target task to be executed by devices under the target device group includes: for any task in the task list, if there is a device group in the configuration information of the task that is the same as the target device group, taking this task as the target task.

3. The method according to claim 2, characterized in that, the configuration information further includes a task distribution ratio, and the task distribution ratio represents the ratio corresponding to the devices to which tasks are to be executed under a single device group; the sending a task instruction to the target device to execute the target task includes: obtaining the actual ratio corresponding to the devices that have executed the target task under the target device group; if the actual ratio is less than the task distribution ratio in the configuration information of the target task, sending a task instruction to the target device to execute the target task.

4. The method according to claim 3, characterized in that, the if the actual ratio is less than the task distribution ratio in the configuration information of the target task, sending a task instruction to the target device to execute the target task includes: performing a modulo operation on the devices under the target device group according to the device ID to divide the devices under the target device group into multiple device subgroups; according to the task distribution ratio in the configuration information of the target task, in the multiple device subgroups, taking the devices in one or more target device subgroups as the devices to be executed for the target task; when the target device belongs to the target device subgroup, sending a task instruction to the target device to execute the target task.

5. The method according to claim 1, characterized in that, each task in the task list has configuration information, and the configuration information includes one or more pre-configured time windows; the sending 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 this time window; if the number of times executed within this time window has not reached the total number of times the target task is allowed to be executed, sending a task instruction to the target device to execute the target task.

6. The method according to claim 1, It is characterized in that each task in the task list has configuration information, and the configuration information includes pre-configured device extension attributes; the task instruction for sending the target task to the target device for execution includes: when the device attributes of the target device are consistent with the device extension attributes in the configuration information of the target task, sending a task instruction for the target device to execute the target task.

7. The method according to any one of claims 1 to 6, it is characterized in that partial 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: obtaining the target configuration template referred to by the target task, and using the configuration information in the target configuration template as the configuration information possessed by the target task.

8. The method according to claim 7, it is characterized in that the configuration information in the target configuration template includes the total number of times the task is allowed to be executed; when there are multiple target tasks referring to the same target configuration template, the task instruction for sending the target task to the target device for execution includes: taking the sum of the executed times of the multiple target tasks as the total executed times, and when the total executed times do not reach the total times in the target configuration template, sending a task instruction for the target device to execute the target task; or when the executed times of a single target task do not reach the total times in the target configuration template, sending a task instruction for the target device to execute the target task.

9. The method according to claim 1, it is characterized in that the target task includes multiple subtasks, and when sending a task instruction for the target device to execute the target task, it includes: sending the task execution file required for executing each subtask and the task result processing method to the target device, so that the target device runs the task execution file to obtain a task execution result, and processes the task execution result according to the task result processing method.

10. The method according to claim 9, it is characterized in that the method further includes: when the versions of the task execution file and the task result processing method do not match, receiving and displaying a prompt message returned by the target device indicating that the execution of the target task fails.

11. A task execution system, it is characterized in that the system includes: a request receiving module, configured to receive a task execution request sent by a target device, where the task execution request includes the target device group to which the target device belongs, and different device groups include different devices; a target task determination module, configured to determine a target task to be executed by a device under the target device group in a pre-established task list; a task sending module, configured to obtain the executed times and the total number of times allowed to be executed of the target task, and when the executed times do not reach the total times, send a task instruction for the target device to execute the target task, so that the target device executes the target task.

12. A computer-readable storage medium, characterized in that, 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 in any one of claims 1 to 10 is implemented.

13. An electronic device, characterized in that, the electronic device includes a processor and a memory, the memory is used to store a computer program, and when the computer program is executed by the processor, the method described in any one of claims 1 to 10 is implemented.