Task processing method and device, electronic equipment, storage medium and program product
Patent Information
- Application Number
- CN202411476537.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-11
AI Technical Summary
In the scenario of performing large-scale testing tasks, the existing Gitlab pipelines and Jenkins testing tools cannot fully consider the testing needs of deep learning compilers, resulting in low utilization and low processing efficiency of test devices.
By responsive to the triggered test task, prioritization of the task is determined based on the test-related parameters, and dynamically allocate the task to the most matching test equipment until all tasks are completed.
This reduces the situation where test tasks are allocated to unrelated devices, improves the utilization rate of test equipment, and reduces invalid execution and improves the processing efficiency of test tasks by adjusting the status of tasks to be executed.
Smart Images

Figure CN119415390A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a task processing method, device, electronic device, storage medium and program product. Background Art
[0002] Gitlab pipeline is an important part of Gitlab continuous integration (CI) / continuous delivery (CD), which is used to automatically execute a series of jobs when changes occur in the code repository, thereby improving development efficiency and ensuring code quality. Jenkins is a testing tool for continuous integration / continuous deployment, which is used to automate various code tasks, such as building, testing, and deployment.
[0003] Although automated testing can be achieved through the Gitlab pipeline and Jenkins testing tools, the testing requirements of the deep learning compiler cannot be fully considered when executing large-scale testing tasks, which is not conducive to improving the processing efficiency of large-scale testing tasks. Summary of the invention
[0004] In order to overcome the problems in the related art, the present disclosure provides a task processing method, device, electronic device, storage medium and program product, thereby reducing the situation of allocating the first test task to irrelevant test equipment, which is beneficial to improving the utilization rate of the test equipment. At the same time, it reduces the invalid execution of tasks to be executed, which is beneficial to improving the processing efficiency of the first test task.
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a task processing method, including:
[0006] In response to triggering at least two first test tasks at a first moment, determining a priority of each of the first test tasks based on a test-related parameter of each of the first test tasks;
[0007] Based on the priority of each of the first test tasks, each of the first test tasks is allocated to a target test device among at least two candidate test devices; wherein the target test device is used to execute the first test task;
[0008] Determine, based on the execution result returned by the target test device, an executed task among the at least two first test tasks, and a to-be-executed task associated with the executed task;
[0009] Based on the execution result of the executed task, adjusting the task status of the task to be executed;
[0010] The tasks to be executed in an executable state are allocated to the target test device until the execution results of each of the first test tasks returned by the target test device are obtained.
[0011] In some embodiments, the method further comprises:
[0012] In response to triggering at least one second test task at a second moment, determining the priority of each of the second test tasks based on the execution results of each of the first test tasks and the test-related parameters of each of the second test tasks;
[0013] Based on the priority of each second test task, each second test task is allocated to the target test device, and the execution result of each second test task returned by the target test device is obtained.
[0014] In some embodiments, the method further comprises:
[0015] When the execution results of each of the first test tasks and / or the execution results of each of the second test tasks are obtained, a target file is generated based on the test-related parameters and / or the execution time of the test tasks corresponding to the obtained execution results;
[0016] The execution time is used to indicate the time when the execution result is obtained.
[0017] In some embodiments, determining the priority of each of the first test tasks based on the test-related parameters of each of the first test tasks includes:
[0018] Determining an initial priority of each of the first test tasks based on a test type and a storage time of each of the first test tasks;
[0019] Determine the priority of the first test task based on the initial priority of the first test task and various associated parameters corresponding to the first test task;
[0020] The correlation parameter represents the correlation degree between the execution result of the currently processed first test task and the execution process of other first test tasks except the currently processed first test task.
[0021] In some embodiments, adjusting the task status of the to-be-executed task based on the execution result of the executed task includes:
[0022] When the execution result indicates that the executed task is successfully executed, adjusting the task state of the task to be executed to the executable state;
[0023] When the execution result indicates that the executed task fails to execute, the task status of the task to be executed is adjusted to a canceled execution status.
[0024] In some embodiments, allocating each of the first test tasks to a target test device among at least two candidate test devices based on the priority of each of the first test tasks includes:
[0025] Based on the execution strategy of each candidate test device, add each candidate test device to a corresponding device type set;
[0026] When the type indicated by the device type set matches the test type of the at least two first test tasks, each of the first test tasks is sequentially allocated to a target test device in the device type set based on the priority of the at least two first test tasks.
[0027] In some embodiments, the method further comprises:
[0028] In a case where the target test device is assigned to the first test task, receiving a first request sent by the target test device; the first request indicates that the working state of the target test device is switched from a first working state to a second working state;
[0029] In a case where the target test device returns the execution result, receiving a second request sent by the target test device; the second request indicates that the working state of the target test device is switched from the second working state to the first working state;
[0030] The power consumption of the target test device in the first working state is less than the power consumption of the target test device in the second working state.
[0031] According to a second aspect of an embodiment of the present disclosure, there is provided a task processing device, including:
[0032] A first determination module, configured to determine the priority of each of the first test tasks based on the test-related parameters of each of the first test tasks in response to triggering the at least two first test tasks at a first moment;
[0033] an allocating module, configured to allocate each of the first test tasks to a target test device among at least two candidate test devices based on the priority of each of the first test tasks; wherein the target test device is used to execute the first test task;
[0034] A second determination module, configured to determine, based on the execution result returned by the target test device, an executed task in the at least two first test tasks, and a to-be-executed task associated with the executed task;
[0035] An adjustment module, configured to adjust the task status of the to-be-executed task based on the execution result of the executed task;
[0036] The first execution module is configured to distribute the tasks to be executed in an executable state to the target test device until the execution results of each of the first test tasks returned by the target test device are obtained.
[0037] In some embodiments, the apparatus further comprises:
[0038] a third determination module, configured to, in response to triggering at least one second test task at a second moment, determine the priority of each of the second test tasks based on the execution results of each of the first test tasks and the test-related parameters of each of the second test tasks;
[0039] The second execution module is configured to allocate each of the second test tasks to the target test device based on the priority of each of the second test tasks, and obtain the execution results of each of the second test tasks returned by the target test device.
[0040] In some embodiments, the apparatus further comprises:
[0041] A generation module, configured to generate a target file based on the test-related parameters and / or execution time of the test task corresponding to the obtained execution result when the execution result of each of the first test tasks and / or the execution result of each of the second test tasks is obtained;
[0042] The execution time is used to indicate the time when the execution result is obtained.
[0043] In some embodiments, the first determining module is specifically configured as follows:
[0044] Determining an initial priority of each of the first test tasks based on a test type and a storage time of each of the first test tasks;
[0045] Determine the priority of the first test task based on the initial priority of the first test task and various associated parameters corresponding to the first test task;
[0046] The correlation parameter represents the correlation degree between the execution result of the currently processed first test task and the execution process of other first test tasks except the currently processed first test task.
[0047] In some embodiments, the adjustment module is specifically configured as follows:
[0048] When the execution result indicates that the executed task is successfully executed, adjusting the task state of the task to be executed to the executable state;
[0049] When the execution result indicates that the executed task fails to execute, the task status of the task to be executed is adjusted to a canceled execution status.
[0050] In some embodiments, the allocation module is specifically configured as follows:
[0051] Based on the execution strategy of each candidate test device, add each candidate test device to a corresponding device type set;
[0052] When the type indicated by the device type set matches the test type of the at least two first test tasks, each of the first test tasks is sequentially allocated to a target test device in the device type set based on the priority of the at least two first test tasks.
[0053] In some embodiments, the apparatus further comprises:
[0054] A first switching module is configured to receive a first request sent by the target test device when the target test device is assigned to the first test task; the first request indicates that the working state of the target test device is switched from the first working state to the second working state;
[0055] A second switching module is configured to receive a second request sent by the target test device when the target test device returns the execution result; the second request indicates that the working state of the target test device is switched from the second working state to the first working state;
[0056] The power consumption of the target test device in the first working state is less than the power consumption of the target test device in the second working state.
[0057] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0058] processor;
[0059] Memory for storing computer programs or instructions;
[0060] The processor executes the computer program or instruction to implement the steps in any one of the task processing methods in the first aspect above.
[0061] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, including:
[0062] When the computer program or instructions in the storage medium are executed by a processor, the steps in any one of the task processing methods in the first aspect are implemented.
[0063] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implements the steps of any one of the task processing methods in the first aspect.
[0064] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0065] In an embodiment of the present disclosure, in response to triggering at least two first test tasks at a first moment, the priority of each first test task is determined based on the test-related parameters of each first test task; based on the priority of each first test task, each first test task is allocated to a target test device among at least two candidate test devices; wherein the target test device is used to execute the first test task; based on the execution result returned by the target test device, the executed tasks among the at least two first test tasks and the tasks to be executed associated with the executed tasks are determined; based on the execution result of the executed task, the task status of the tasks to be executed is adjusted; and the tasks to be executed in an executable state are allocated to the target test device until the execution results of each first test task returned by the target test device are obtained.
[0066] On the one hand, the priority of the first test task is obtained by test-related parameters. Therefore, in the process of dynamically allocating each first test task through the priority of each first test task, the first test task can be allocated to the target test device in the candidate test devices based on the degree of matching between the first test task and the candidate test devices. This not only reduces the process of human participation, but also reduces the situation of allocating the first test task to irrelevant test devices, which is beneficial to improving the utilization rate of the test equipment.
[0067] On the other hand, by fully considering the dependencies between the first test tasks and adjusting the task status of the tasks to be executed associated with the executed tasks according to the execution results of the executed tasks, the invalid execution of the tasks to be executed is reduced, which is beneficial to improving the processing efficiency of the first test tasks.
[0068] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0070] Figure 1 A flowchart of a task processing method according to an exemplary embodiment is shown. Figure 1 .
[0071] Figure 2 A flowchart of a task processing method according to an exemplary embodiment is shown. Figure 2 .
[0072] Figure 3 The figure is a block diagram of a task processing device according to an exemplary embodiment.
[0073] Figure 4 is a structural block diagram of an electronic device 400 according to an exemplary embodiment.
[0074] Figure 5 is a block diagram of a device 500 for task processing according to an exemplary embodiment. DETAILED DESCRIPTION
[0075] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices consistent with some aspects of the present disclosure as detailed in the appended claims.
[0076] Figure 1 A flowchart of a task processing method according to an exemplary embodiment is shown. Figure 1 ,like Figure 1 As shown, the task processing method mainly includes the following steps:
[0077] In step 101, in response to triggering at least two first test tasks at a first moment, determining the priority of each first test task based on the test-related parameters of each first test task;
[0078] In step 102, based on the priority of each first test task, each first test task is allocated to a target test device among at least two candidate test devices; wherein the target test device is used to execute the first test task;
[0079] In step 103, based on the execution result returned by the target test device, the executed tasks in at least two first test tasks and the tasks to be executed associated with the executed tasks are determined;
[0080] In step 104, based on the execution result of the executed task, the task status of the task to be executed is adjusted;
[0081] In step 105, the tasks to be executed in the executable state are distributed to the target test device until the execution results of each first test task returned by the target test device are obtained.
[0082] It should be noted that the task processing method proposed in the present disclosure can be applied to electronic devices. Here, the electronic device may include: terminal devices, such as mobile terminals or fixed terminals. Among them, the mobile terminal may include: mobile phones, tablet computers, laptop computers, wearable electronic devices and other devices. Fixed terminals may include: desktop computers, smart TVs, vehicle-mounted devices, etc. In other embodiments, the task processing method can also be applied to applications installed on electronic devices.
[0083] In other embodiments, the task processing method in the embodiment of the present disclosure may be configured in a task processing device, and the task processing device may be set in an electronic device, which is not limited in the embodiment of the present disclosure. It should be noted that the execution subject of the embodiment of the present disclosure may be a central processing unit (CPU) in the electronic device in terms of hardware, and may be a related background service in the electronic device in terms of software, which is not limited.
[0084] In some embodiments, although the Gitlab pipeline and Jenkins testing tools can realize automated testing, they do not fully consider the testing requirements of the deep learning compiler, and cannot evenly and reasonably distribute large-scale testing tasks with inconsistent priorities, test types, and operating environments to various testing devices, which is not conducive to improving the processing efficiency of test tasks.
[0085] Therefore, in the embodiment of the present disclosure, in order to improve the processing efficiency of test tasks, in response to triggering at least two first test tasks at a first moment, each first test task can be allocated to a target test device among the candidate test devices through the test-related parameters of the first test task.
[0086] In some embodiments, the first moment is any moment. The triggering operation of at least two first test tasks may be that the user clicks on a control on the main server to execute the test task. Here, the main server is a server that manages each test device, and each test device may be a computer, a tablet computer, or a virtual machine, etc., which is not limited in the embodiments of the present disclosure.
[0087] Here, the test-related parameters include but are not limited to the test type, operating environment, and operating platform.
[0088] In some embodiments, in response to triggering at least two first test tasks at a first moment, when each first test task is stored in a code repository, a machine declaration for indicating the test type is carried; here, the machine declaration has multiple implementation methods, such as setting a field in a json configuration file to indicate the test type of the first test task; for example, adding a field in a database table and assigning a value to this field when the first test task is created.
[0089] It can be understood that in order to better allocate multiple first test tasks, the priority of each first test task can be obtained based on the test-related parameters of each first test task, and then each first test task can be allocated to the target test device in the candidate device according to each priority, which is beneficial to improving the processing efficiency of the first test task.
[0090] In some embodiments, based on the test type of each first test task, the urgency of executing each first test task is determined, and the urgency is scored to obtain a scoring result corresponding to each first test task; then, each scoring result is sorted to obtain a priority corresponding to each first test task.
[0091] In other embodiments, since the storage time of each first test task in the code repository can also reflect the execution order of each first test task, in order to determine a more accurate priority, the priority of each first test task can be obtained based on the test type and storage time of each first test task.
[0092] It should be noted that if the first test task is assigned to an irrelevant test device for processing, it is not conducive to improving the utilization rate of the test device. Since the priority corresponding to the first test task is obtained from the test-related parameters, in the process of dynamically assigning each first test task according to the priority of each first test task, the target test device can be screened from multiple candidate test devices based on the matching degree between the first test task and the candidate test device, so as to assign each first test task to the target test device related to the first test task.
[0093] The execution strategy of the target test device matches the test type of the first test task. Here, different first test tasks can be assigned to the same target test device or to different target test devices, which is not limited in the embodiment of the present disclosure.
[0094] In some embodiments, in order to improve the processing efficiency of the first test task, a first test device in an idle state may be selected from the candidate test devices according to the working state of each candidate test device, and then a target test device may be selected from the first test devices. Here, the working state includes but is not limited to: a busy state, an idle state, or an abnormal state (such as disconnection).
[0095] It can be understood that after the first test task is allocated to the target test device, the target test device can execute the first test task according to the execution strategy to obtain the execution result of the first test task.
[0096] Here, the execution strategy includes various stages such as test preparation, test execution, result analysis and iterative testing. The execution result can be the result of successful execution or the result of failed execution.
[0097] It should be explained that, since the number of first test tasks is large, in order to improve the processing efficiency of each first test task, the dependency relationship between each first test task can be fully considered, and the task status of the to-be-executed task associated with the executed task can be adjusted according to the execution result of the executed task, so as to avoid the invalid execution of the to-be-executed task. It can be understood that after obtaining the execution result returned by the target test device, the executed task can be determined from each first test task; by obtaining the dependency relationship between the executed task and each to-be-executed task, the to-be-executed task associated with the executed task can be determined.
[0098] Here, the first test task A is associated with the first test task B, which can be understood as the execution result of the first test task A affecting the execution process of the first test task B. For example, the first test task A is an upstream task, and the first test task B is a downstream task. When the first test task A is successfully executed, the first test task B can continue to be executed based on the execution result of the first test task A.
[0099] In some embodiments, for a model compiler, the upstream task refers to compiling a general model structure and weights into a target model file that can run on a specific chip through a tool; here, the compilation task must ensure that the target model file can pass the compilation and has the same accuracy as the initial model file.
[0100] The downstream task refers to running the target model file on a specific device; only when the upstream task is compiled successfully can the downstream task obtain the target model file and run the target model file. Here, the downstream task for running the target model file may include accuracy testing and performance testing, where the accuracy test is to test whether the accuracy of the target model is the same as the initial model on the real device; the performance test is to test the duration of executing the target model on the real device. The accuracy test must ensure that the accuracy of the target model is consistent with the accuracy of the initial model; the performance test must ensure that the performance of the target model meets a certain value set manually.
[0101] At the same time, the first test task A is associated with the first test task B, which can also be understood as the execution or completion of the first test task B depends on the first test task A reaching a certain condition or state. For example, in a software development project, the first test task A is to write and test the code of a certain module, while the first test task B is to integrate the module into the entire system. The integration task depends on the completion and passing of the code writing and test tasks.
[0102] It can be understood that by adjusting the task status of the tasks to be executed according to the execution results of the executed tasks, invalidly executed tasks to be executed can be screened out from multiple tasks to be executed, so that the target test equipment can execute the tasks to be executed in an executable state, which is beneficial to improving the utilization rate of the target test equipment and reducing the waste of execution resources.
[0103] In some embodiments, when there are multiple tasks to be executed in an executable state, each of the tasks to be executed in an executable state may be sequentially allocated to a target test device according to an execution order indicated by each priority.
[0104] In an embodiment of the present disclosure, in response to triggering at least two first test tasks at a first moment, the priority of each first test task is determined based on the test-related parameters of each first test task; based on the priority of each first test task, each first test task is allocated to a target test device among at least two candidate test devices; wherein the target test device is used to execute the first test task; based on the execution result returned by the target test device, the executed tasks among the at least two first test tasks and the tasks to be executed associated with the executed tasks are determined; based on the execution result of the executed task, the task status of the tasks to be executed is adjusted; and the tasks to be executed in an executable state are allocated to the target test device until the execution results of each first test task returned by the target test device are obtained.
[0105] On the one hand, the priority of the first test task is obtained by test-related parameters. Therefore, in the process of dynamically allocating each first test task through the priority of each first test task, the first test task can be allocated to the target test device in the candidate test devices based on the degree of matching between the first test task and the candidate test devices. This not only reduces the process of human participation, but also reduces the situation of allocating the first test task to irrelevant test devices, which is beneficial to improving the utilization rate of the test equipment.
[0106] On the other hand, by fully considering the dependencies between the first test tasks and adjusting the task status of the tasks to be executed associated with the executed tasks according to the execution results of the executed tasks, the invalid execution of the tasks to be executed is reduced, which is beneficial to improving the processing efficiency of the first test tasks.
[0107] In some embodiments, the method further comprises:
[0108] In response to triggering at least one second test task at a second moment, determining the priority of each second test task based on the execution results of each first test task and the test-related parameters of each second test task;
[0109] Based on the priority of each second test task, each second test task is allocated to a target test device, and the execution result of each second test task returned by the target test device is obtained.
[0110] Here, the second time is any time after the first time.
[0111] It is understandable that during the execution of the first test task, a new second test task may be triggered. When a triggering operation of at least one second test task is detected, each second test task can be allocated to a corresponding target test device according to the priority of each second test task.
[0112] Here, the second test task may be an updated first test task, or may be any test task other than the first test task, which is not limited in the embodiment of the present disclosure.
[0113] In some embodiments, the triggered second test task may be a test task generated by detecting a code submission to a git repository. Here, the git repository includes a local repository (Local Repository) and a remote repository (Remote Repository). Among them, the local repository refers to a git repository stored on a local computer, where code submission (commit), branch (branch) operations, etc. can be performed. The remote repository refers to a git repository stored on the network, where changes in the local repository can be pushed to the remote repository to share the code with others, and the latest code can be pulled (pull) or cloned (clone) from the remote repository to the local repository.
[0114] It should be noted that since the triggering time of the second test task is after the first test task, in order to improve the accuracy of determining the priority of the second test task, the priority of each second test task can be determined based on the execution results of each first test task and the test-related parameters of each second test task.
[0115] Here, the test-related parameters include but are not limited to the test type, operating environment, and operating platform.
[0116] Since the priority corresponding to the second test task is obtained by test-related parameters, in the process of dynamically allocating each second test task according to the priority of each second test task, the target test device can be screened from multiple candidate test devices based on the degree of matching between the second test task and the candidate test device, so as to allocate each second test task to the target test device related to the second test task.
[0117] In some embodiments, the second test task may be a test task generated by detecting a code submission in a git repository. Since there is one or more code submissions in the git repository within a preset time, a second test task matching the number of code submissions will be generated, and the second moment for triggering the second test task can be set arbitrarily. When the second test task is triggered at the second moment, the second test task A corresponding to the last code submission can be assigned to the target test device, and the execution result of the second test task A returned by the target test device is obtained. When the execution result indicates that the second test task A fails to execute, in order to locate the erroneous code, the second test task B corresponding to the first code submission can be first assigned to the target test device, and the execution result of the second test task B returned by the target test device is obtained. If the execution result indicates that the second test task B is successfully executed, it is determined that there is an erroneous code submission between the first code submission and the last code submission.
[0118] Exemplarily, code submission is understood as version update. Assume that the version that failed to execute is Y, and the previous version that successfully executed is X. There are N=YX versions between the two versions. In order to locate the wrong version, the second test tasks corresponding to versions Y-1, Y-2, and Y-3 are triggered in sequence until the second test task corresponding to any version is successfully executed. For example, if the second test task corresponding to version Y-1 fails to execute, and the second test task corresponding to version Y-2 succeeds, it can be determined that version Y-1 is the version that caused the failure of the second test task, and there is an erroneous code in version Y-1.
[0119] In an embodiment of the present disclosure, in response to triggering at least one second test task at a second moment, the priority of each second test task is determined based on the execution results of each first test task and the test-related parameters of each second test task; based on the priority of each second test task, each second test task is assigned to a target test device, and the execution results of each second test task returned by the target test device are obtained, thereby not only reducing the process of human participation, but also reducing the situation of assigning the second test tasks to irrelevant test devices, which is beneficial to improving the utilization rate of the test equipment.
[0120] In some embodiments, the method further comprises:
[0121] When the execution results of each first test task and / or the execution results of each second test task are obtained, a target file is generated based on the test-related parameters and / or the execution time of the test task corresponding to the obtained execution results;
[0122] The execution time is used to indicate the time when the execution result is obtained.
[0123] It is understandable that, in order to facilitate the acquisition of processing information in this test task, when the execution results of each first test task and / or the execution results of each second test task are obtained, a target file related to each execution result can be generated.
[0124] It should be noted that you can first determine the test task corresponding to the obtained execution result, and then generate a target file based on the test-related parameters and / or execution time of the test task. In this way, the user can locate each test task under the same test type by viewing the target file. At the same time, you can also locate the test tasks that failed to execute according to the various execution times, which is conducive to improving the user experience.
[0125] Here, the obtained execution results may be the execution results of each first test task or the execution results of each second test task, or may be the execution results of each first test task and the execution results of each second test task.
[0126] Taking the target file as a report as an example, first generate the report entries based on the task ID, execution result, test type and execution time; then fill in the parameters of the test task corresponding to the obtained execution result into the corresponding entries to generate the report. In some embodiments, the report can be generated at a specified location in the database, and the user can download the report at the specified location to view the processing information in the test task in a timely manner.
[0127] In some embodiments, a test task can be set to be triggered periodically based on code submissions modified in a specified git repository. There are one or more submissions for the test task triggered on two consecutive days. After the second test task (or the first test task) triggered under a certain submission fails, the second test task corresponding to the previous submission of the second test task will be added to the task queue until the corresponding second test task under any submission is successfully executed. After the target file is generated, the second test tasks that failed to execute can be displayed along the timeline of the submission, and each second test task indicates each code submission. Therefore, the developer can quickly locate the wrong submission code by viewing the execution results of the second test task.
[0128] In the disclosed embodiment, a target file can be generated based on the test-related parameters and / or execution time of the test task corresponding to the obtained execution result. In this way, the user can obtain the processing information in the test task by viewing the target file, so as to quickly locate the first test task that failed to execute.
[0129] In some embodiments, determining the priority of each first test task based on the test-related parameters of each first test task includes:
[0130] Determining an initial priority of each first test task based on a test type and a storage time of each first test task;
[0131] Determine the priority of the first test task based on the initial priority of the first test task and various associated parameters corresponding to the first test task;
[0132] The correlation parameter represents the correlation degree between the execution result of the first test task currently being processed and the execution process of other first test tasks except the first test task currently being processed.
[0133] It is understandable that in order to obtain accurate priorities, the urgency of executing each first test task can be determined by the test type and storage time of each first test task, and the initial priority corresponding to each first test task can be obtained. Then, the priority of the first test task can be obtained based on the initial priority of the first test task and the various associated parameters corresponding to the first test task.
[0134] Here, the storage time represents the storage time of the first test task in the code repository. The storage time is positively correlated with the urgency of executing the first test task. The longer the storage time, the higher the urgency of executing the first test task, and the shorter the storage time, the lower the urgency of executing the first test task.
[0135] In some embodiments, the test types include daily testing and release testing. Daily testing is a testing practice in continuous integration or continuous delivery, which is used to automatically execute a series of tests after the code is submitted to the version control system; the test content of daily testing includes at least unit testing, integration testing or performance testing, etc. Release testing is a comprehensive test performed before the software is ready for release to ensure that the software can run normally in the target environment; the test content of release testing includes at least functional testing, compatibility testing or security testing, etc.
[0136] Here, the correlation parameter is the correlation degree between the execution result of the first test task C and the execution process of other first test tasks except the first test task C. When the execution result of the first test task C affects the execution process of other first test tasks, the correlation degree between the first test task C and other first test tasks is higher; and when the execution result of the first test task C does not affect the execution process of other first test tasks, the correlation degree between the first test task C and other first test tasks is lower.
[0137] In some embodiments, when the degree of correlation between the first test task C and other first test tasks is higher, the correlation parameter corresponding to the first test task C is 1; when the degree of correlation between the first test task C and other first test tasks is lower, the correlation parameter corresponding to the first test task C is 0. In this way, a scoring mechanism is used to determine the priority corresponding to the first test task.
[0138] Here, the number of tasks associated with the first test task can be determined through the various associated parameters corresponding to the first test task. When the number of tasks associated with the first test task is greater, the urgency of executing the first test task is higher; and when the number of tasks associated with the first test task is smaller, the urgency of executing the first test task is lower.
[0139] Therefore, determining the priority of the first test task by using the initial priority of the first test task and various associated parameters corresponding to the first test task is conducive to improving the accuracy of determining the priority, thereby improving the processing efficiency of the first test task.
[0140] In the disclosed embodiment, the initial priority of each first test task is first determined based on the test type and storage time of each first test task; then the priority of the first test task is determined based on the initial priority of the first test task and various associated parameters corresponding to the first test task, thereby improving the accuracy of determining the priority of the first test task, which is beneficial to improving the processing efficiency of the first test task.
[0141] In some embodiments, based on the execution result of the executed task, the task status of the task to be executed is adjusted, including:
[0142] When the execution result indicates that the executed task has been successfully executed, the task status of the task to be executed is adjusted to an executable status;
[0143] When the execution result indicates that the executed task has failed, the task status of the task to be executed is adjusted to a canceled execution status.
[0144] It should be noted that in order to improve the determination of invalid execution of pending tasks, after obtaining the execution result returned by the target test device, it is possible to determine whether the executed task is successfully executed based on the execution result. Since the execution result of the executed task affects the execution process of the pending task, when the executed task fails, the pending task will inevitably fail. Therefore, when the execution result indicates that the executed task has failed, the task status of the pending task is adjusted to the canceled execution status, so that the task does not need to be allocated or executed, which is conducive to improving the processing efficiency of the first test task.
[0145] When the executed task is successfully executed, it will not affect the execution process of the task to be executed. Therefore, when the execution result indicates that the executed task is successfully executed, the task state of the task to be executed is adjusted to an executable state, so as to allocate the task to be executed to the target test device.
[0146] In some embodiments, the executed task is an upstream task, and the to-be-executed task associated with the executed task is a downstream task. When the execution result indicates that the executed task is executed successfully, the task status of the to-be-executed task is an executable status; when the execution result indicates that the executed task fails, the task status of the to-be-executed task is an upstream task failure and execution cancellation status.
[0147] In the disclosed embodiment, when the execution result indicates that the executed task has failed, the task status of the task to be executed can be adjusted to a canceled execution status, which can reduce the invalid execution of the task to be executed, thereby facilitating improving the processing efficiency of the first test task.
[0148] In some embodiments, allocating each first test task to a target test device among at least two candidate test devices based on the priority of each first test task includes:
[0149] Based on the execution strategy of each candidate test device, each candidate test device is added to a corresponding device type set;
[0150] When the type indicated by the device type set matches the test type of at least two first test tasks, the first test tasks are sequentially allocated to target test devices in the device type set based on the priority of the at least two first test tasks.
[0151] It should be noted that before allocating the first test task, a corresponding device type set can be configured for each candidate test task according to the execution strategy of each candidate test device, so as to directly match the type indicated by the device type set with the test type corresponding to the first test task, so that different target test devices can process a more suitable first test task, which is conducive to bringing into play the maximum characteristics of each target test device, thereby facilitating improving the processing efficiency of the first test task.
[0152] Here, the device type sets corresponding to different candidate test devices may be the same or different; the number of candidate test devices in each device type set may be the same or different, which is not limited in the embodiments of the present disclosure.
[0153] Here, the execution policy of the candidate test device is used to indicate the operating parameters (such as the operating platform and the operating environment) of the candidate test device and the types of test tasks that can be executed.
[0154] Exemplarily, the first candidate test device can process the first test task of test types T1 and T2, and the second candidate test device can process the first test task of test types T1, T2 and T3. In this case, the first candidate test device and the second candidate test device can be added to the device type set corresponding to T1 and the device type set corresponding to T2, and the second candidate test device can be added to the device type set corresponding to T3.
[0155] It is understandable that after adding each candidate test device to the corresponding device type set, the device type of each first candidate test device can be matched with the type indicated by each device type set to determine the device type set corresponding to each first candidate test device. When there are multiple first test tasks whose test types match the type indicated by the same device type set, the first test tasks can be assigned to the corresponding target test devices according to their priorities.
[0156] In some embodiments, when the type indicated by the device type set matches the test type of at least two first test tasks, if there are multiple candidate test devices in the device type, the candidate test device in an idle state is determined based on the working state of the candidate test device, and the candidate test device in an idle state is determined as the target test device, and finally each first test task is assigned to the corresponding target test device, so as to avoid the problem of task backlog caused by assigning too many first test tasks to the same target test device, thereby improving the processing efficiency of the first test tasks.
[0157] In the embodiment of the present disclosure, each candidate test device is added to the corresponding device type set through the execution strategy of each candidate test device; and when the type indicated by the device type set matches the test type of at least two first test tasks, each first test task is assigned to the target test device in the device type set according to the priority of each first test task.
[0158] On one hand, by allocating the first test task to the target test device in the corresponding device type set, the resource waste caused by allocating the first test task only according to the busyness of the test device can be improved, which is conducive to improving the processing efficiency of the target test device.
[0159] On the other hand, when there are multiple target test devices in the device type set, each first test task can be assigned to a different target test device according to the priority of each first test task, avoiding the problem of task accumulation and untimely processing caused by allocating too many first test tasks to the same target test device, which is conducive to improving the processing efficiency of the first test task.
[0160] In some embodiments, the method further comprises:
[0161] In the case where the target test device is assigned to the first test task, receiving a first request sent by the target test device; the first request indicates that the working state of the target test device is switched from the first working state to the second working state;
[0162] In the case where the target test device returns the execution result, receiving a second request sent by the target test device; the second request indicates that the working state of the target test device is switched from the second working state to the first working state;
[0163] The power consumption generated by the target test device in the first working state is less than the power consumption generated by the target test device in the second working state.
[0164] It can be understood that in order to improve the processing efficiency of each first test task, the working status of each target test device can be received so that the corresponding first test task can be dynamically allocated according to the working status of the target test device, avoiding allocating too many first test tasks to a certain target test device, causing the first test tasks to pile up, and resulting in the problem of untimely processing of the first test tasks.
[0165] Here, the working state of the target test device includes a first working state and a second working state. Since the power consumption generated by the target test device in the first working state is less than the power consumption generated by the target test device in the second working state, it can be understood that the target device in the first working state is not currently executing a test task, and the target device in the second working state is currently executing a test task.
[0166] In some embodiments, the first working state indicates an idle state, and the second working state indicates a busy state.
[0167] Specifically, when the target test device is assigned to the first test task, it can be determined that the target test device is about to execute the first test task, and therefore the target test device can send a first request to switch the working state of the target test device from the first working state to the second working state; and when the target test device returns the execution result of the first test task, it can be determined that the target test device has not executed the test task, and therefore the target test device can send a second request to switch the working state of the target test device from the second working state to the first working state.
[0168] Here, the data formats of the first request and the second request may be the same or different, and this embodiment of the present disclosure does not limit this.
[0169] In the disclosed embodiment, when the target test device is assigned to the first test task, the working state of the target test device is switched from the first working state to the second working state; and when the target test device returns the execution result, the working state of the target test device is switched from the second working state to the first working state. In this way, the working state of the target test device is updated in time according to the allocation of the first test task, which is conducive to the dynamic allocation of the first test task in the waiting state, so as to improve the utilization rate of each target test device.
[0170] Figure 2 A flowchart of a task processing method according to an exemplary embodiment is shown. Figure 2 ,like Figure 2 As shown, the task processing method mainly includes the following steps:
[0171] In step 201 , at least two first test tasks are triggered.
[0172] In step 202, the priority of each first test task is determined based on the test-related parameters of each first test task.
[0173] In some embodiments, the initial priority of each first test task is first determined based on the test type and storage time of each first test task; then the priority of the first test task is determined based on the initial priority of the first test task and each associated parameter corresponding to the first test task; wherein the associated parameter characterizes the degree of association between the execution result of the currently processed first test task and the execution process of other first test tasks except the currently processed first test task.
[0174] In step 203, the task state of the first test task without associated tasks is set to an executable state.
[0175] Here, the first test task without associated tasks refers to the first test task without dependent upstream tasks.
[0176] In step 204, an application is made to the main server for an executable first test task.
[0177] In some embodiments, before applying to the main server for the executable first test task, each candidate test device is added to the corresponding device type set based on the execution strategy of each candidate test device. Figure 2 The first device type set, the second device type set and the Nth device type set in .
[0178] In step 205, it is determined whether there is a first test task processed by a target test device in the first device type set.
[0179] In some embodiments, the types indicated by each device type set are matched with the test type corresponding to the first test task.
[0180] In some embodiments, it is determined that there is a first test task processed by a target test device in the first device type set, and the first test task may be allocated to the target test device, and the target test device executes the first test task, and the process proceeds to step 206 .
[0181] In some other embodiments, if it is determined that there is no first test task processed by the target test device in the first device type set, step 204 is executed.
[0182] Here, the execution process of the target test devices in the second device type set and the Nth device type set is similar to the execution process of the target test devices in the first device type set, and the execution process of the target test devices in the second device type set and the Nth device type set is executed synchronously with the execution process of the target test devices in the first device type set, which will not be repeated here.
[0183] In step 206, the execution result returned by the target test device is received.
[0184] In step 207, it is determined whether the executed task is executed successfully.
[0185] In some embodiments, if the executed task is successfully executed, step 208 is performed.
[0186] In other embodiments, when the executed task fails, step 209 is executed.
[0187] In step 208, the task status of the to-be-executed task associated with the execution task is adjusted to an executable status.
[0188] In some embodiments, when the execution result indicates that the executed task is successfully executed, the task state of the task to be executed is adjusted to an executable state.
[0189] In step 209, the task status of the to-be-executed task associated with the execution task is adjusted to a canceled execution status.
[0190] In some embodiments, when the execution result indicates that the executed task has failed, the task status of the task to be executed is adjusted to a canceled execution status.
[0191] In step 210, it is determined whether all first test tasks of this test are completed.
[0192] In some embodiments, when it is determined that all first test tasks of this test are completed, step 211 is executed.
[0193] In some embodiments, when it is determined that all first test tasks of the current test have not been completed, the target test device is continued to be waited for to return the execution results of each first test task.
[0194] In step 211, a target file is generated.
[0195] In some embodiments, when the execution results of each first test task are obtained, a target file is generated based on the test-related parameters and / or execution time of the first test task; wherein the execution time is used to indicate the time when the execution result is obtained.
[0196] On the one hand, the priority of the first test task is obtained by test-related parameters. Therefore, in the process of dynamically allocating each first test task through the priority of each first test task, the first test task can be allocated to the target test device in the candidate test devices based on the degree of matching between the first test task and the candidate test devices. This not only reduces the process of human participation, but also reduces the situation of allocating the first test task to irrelevant test devices, which is beneficial to improving the utilization rate of the test equipment.
[0197] On the other hand, by fully considering the dependencies between the first test tasks and adjusting the task status of the tasks to be executed associated with the executed tasks according to the execution results of the executed tasks, the invalid execution of the tasks to be executed is reduced, which is beneficial to improving the processing efficiency of the first test tasks.
[0198] Figure 3 is a block diagram of a task processing device according to an exemplary embodiment. Figure 3As shown, the task processing device 300 includes:
[0199] A first determining module 301 is configured to determine the priority of each of the first test tasks based on the test-related parameters of each of the first test tasks in response to triggering the at least two first test tasks at a first moment;
[0200] An allocating module 302 is configured to allocate each of the first test tasks to a target test device among at least two candidate test devices based on the priority of each of the first test tasks; wherein the target test device is used to execute the first test task;
[0201] A second determining module 303 is configured to determine, based on the execution result returned by the target test device, an executed task in the at least two first test tasks and a to-be-executed task associated with the executed task;
[0202] An adjustment module 304 is configured to adjust the task status of the task to be executed based on the execution result of the executed task;
[0203] The first execution module 305 is configured to distribute the tasks to be executed in an executable state to the target test device until the execution results of each of the first test tasks returned by the target test device are obtained.
[0204] In some embodiments, the apparatus 300 further includes:
[0205] a third determination module, configured to, in response to triggering at least one second test task at a second moment, determine the priority of each of the second test tasks based on the execution results of each of the first test tasks and the test-related parameters of each of the second test tasks;
[0206] The second execution module is configured to allocate each of the second test tasks to the target test device based on the priority of each of the second test tasks, and obtain the execution results of each of the second test tasks returned by the target test device.
[0207] In some embodiments, the apparatus 300 further includes:
[0208] A generation module, configured to generate a target file based on the test-related parameters and / or execution time of the test task corresponding to the obtained execution result when the execution result of each of the first test tasks and / or the execution result of each of the second test tasks is obtained;
[0209] The execution time is used to indicate the time when the execution result is obtained.
[0210] In some embodiments, the first determining module 301 is specifically configured as follows:
[0211] Determining an initial priority of each of the first test tasks based on a test type and a storage time of each of the first test tasks;
[0212] Determine the priority of the first test task based on the initial priority of the first test task and various associated parameters corresponding to the first test task;
[0213] The correlation parameter represents the correlation degree between the execution result of the currently processed first test task and the execution process of other first test tasks except the currently processed first test task.
[0214] In some embodiments, the adjustment module 304 is specifically configured as follows:
[0215] When the execution result indicates that the executed task is successfully executed, adjusting the task state of the task to be executed to the executable state;
[0216] When the execution result indicates that the executed task fails to execute, the task status of the task to be executed is adjusted to a canceled execution status.
[0217] In some embodiments, the allocation module 302 is specifically configured as follows:
[0218] Based on the execution strategy of each candidate test device, add each candidate test device to a corresponding device type set;
[0219] When the type indicated by the device type set matches the test type of the at least two first test tasks, each of the first test tasks is sequentially allocated to a target test device in the device type set based on the priority of the at least two first test tasks.
[0220] In some embodiments, the apparatus 300 further includes:
[0221] A first switching module is configured to receive a first request sent by the target test device when the target test device is assigned to the first test task; the first request indicates that the working state of the target test device is switched from the first working state to the second working state;
[0222] A second switching module is configured to receive a second request sent by the target test device when the target test device returns the execution result; the second request indicates that the working state of the target test device is switched from the second working state to the first working state;
[0223] The power consumption of the target test device in the first working state is less than the power consumption of the target test device in the second working state.
[0224] Figure 4 4 is a block diagram of an electronic device 400 according to an exemplary embodiment. For example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0225] Reference Figure 4 , the electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0226] The processing component 402 generally controls the overall operation of the electronic device 400, such as operations associated with at least one of display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0227] The memory 404 is configured to store various types of data to support operations on the electronic device 400. Examples of such data include at least one of the following: instructions for any application or method operating on the electronic device 400, contact data, phone book data, messages, pictures, and videos. The memory 404 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk, or an optical disk.
[0228] The power supply component 406 provides power to various components of the electronic device 400. The power supply component 406 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 400.
[0229] The multimedia component 408 includes a screen that provides an output interface between the electronic device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the electronic device 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0230] The audio component 410 is configured to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the electronic device 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.
[0231] The input / output interface 412 provides an interface between the processing component 402 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0232] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 can detect the open / closed state of the electronic device 400, the relative positioning of the components, such as the display and keypad of the electronic device 400, and the sensor assembly 414 can also detect the position change of the electronic device 400 or a component in the electronic device 400, the presence or absence of contact between the user and the electronic device 400, the orientation or acceleration / deceleration of the electronic device 400, and the temperature change of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include a light sensor, such as a complementary metal oxide semiconductor (CMOS) or a charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include, but is not limited to, at least one of the following: an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, and a temperature sensor.
[0233] The communication component 416 is configured to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 can access a wireless network based on a communication standard, such as Wi-Fi, 4G, 5G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (Ultra Wide Band, UWB) technology, Bluetooth (BT) technology and other technologies.
[0234] In an exemplary embodiment, the electronic device 400 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components.
[0235] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including executable instructions or a computer program, which can be executed by a processor 420 of an electronic device 400 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0236] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform any of the above-mentioned task processing methods of the embodiments of the present disclosure. For example, the method includes:
[0237] In response to triggering at least two first test tasks at a first moment, determining a priority of each first test task based on a test-related parameter of each first test task;
[0238] Based on the priority of each first test task, each first test task is allocated to a target test device among at least two candidate test devices; wherein the target test device is used to execute the first test task;
[0239] Determine, based on the execution result returned by the target test device, an executed task in at least two first test tasks, and a to-be-executed task associated with the executed task;
[0240] Based on the execution results of the executed tasks, the task status of the tasks to be executed is adjusted;
[0241] The tasks to be executed in an executable state are distributed to the target test device until the execution results of each first test task returned by the target test device are obtained.
[0242] The embodiment of the present disclosure provides a computer program product, which includes: a computer program or executable instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer program or executable instructions from the computer-readable storage medium, and the processor executes the computer program or executable instructions, so that the computer device executes any one of the above-mentioned task processing methods of the embodiment of the present disclosure.
[0243] The embodiment of the present disclosure provides a computer program product, which includes: a computer program or executable instructions, which are stored in a computer-readable storage medium. The processor of the computer device reads the computer program or executable instructions from the computer-readable storage medium, and the processor executes the computer program or executable instructions, so that the computer device executes any one of the above-mentioned task processing methods of the embodiment of the present disclosure.
[0244] Figure 5 is a block diagram of a device 500 for task processing according to an exemplary embodiment. For example, the device 500 may be provided as a server. Figure 5 , the apparatus 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532 for storing instructions executable by the processing component 522, such as an application. The application stored in the memory 532 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform the above-mentioned task processing method:
[0245] In response to triggering at least two first test tasks at a first moment, determining a priority of each first test task based on a test-related parameter of each first test task;
[0246] Based on the priority of each first test task, each first test task is allocated to a target test device among at least two candidate test devices; wherein the target test device is used to execute the first test task;
[0247] Determine, based on the execution result returned by the target test device, an executed task in at least two first test tasks, and a to-be-executed task associated with the executed task;
[0248] Based on the execution results of the executed tasks, the task status of the tasks to be executed is adjusted;
[0249] The tasks to be executed in an executable state are distributed to the target test device until the execution results of each first test task returned by the target test device are obtained.
[0250] The device 500 may also include a power supply component 526 configured to perform power management of the device 500, a wired or wireless network interface 550 configured to connect the device 500 to a network, and an input / output (I / O) interface 558. The device 500 may operate an operating system stored in the memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.
[0251] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0252] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A task processing method, characterized in that: include: In response to triggering at least two first test tasks at a first moment, determining a priority of each of the first test tasks based on a test-related parameter of each of the first test tasks; Based on the priority of each of the first test tasks, each of the first test tasks is allocated to a target test device among at least two candidate test devices; wherein the target test device is used to execute the first test task; Determine, based on the execution result returned by the target test device, an executed task among the at least two first test tasks, and a to-be-executed task associated with the executed task; Based on the execution result of the executed task, adjusting the task status of the task to be executed; The tasks to be executed in an executable state are allocated to the target test device until the execution results of each of the first test tasks returned by the target test device are obtained.
2. The method according to claim 1, characterized in that The method further comprises: In response to triggering at least one second test task at a second moment, determining the priority of each of the second test tasks based on the execution results of each of the first test tasks and the test-related parameters of each of the second test tasks; Based on the priority of each second test task, each second test task is allocated to the target test device, and the execution result of each second test task returned by the target test device is obtained.
3. The method according to claim 2, characterized in that The method further comprises: When the execution results of each of the first test tasks and / or the execution results of each of the second test tasks are obtained, a target file is generated based on the test-related parameters and / or the execution time of the test tasks corresponding to the obtained execution results; The execution time is used to indicate the time when the execution result is obtained.
4. The method according to claim 1, characterized in that: The determining the priority of each of the first test tasks based on the test-related parameters of each of the first test tasks includes: Determining an initial priority of each of the first test tasks based on a test type and a storage time of each of the first test tasks; Determine the priority of the first test task based on the initial priority of the first test task and various associated parameters corresponding to the first test task; The correlation parameter represents the correlation degree between the execution result of the currently processed first test task and the execution process of other first test tasks except the currently processed first test task.
5. The method according to any one of claims 1 to 4, characterized in that: The step of adjusting the task status of the task to be executed based on the execution result of the executed task includes: When the execution result indicates that the executed task is successfully executed, adjusting the task state of the task to be executed to the executable state; When the execution result indicates that the executed task fails, the task status of the task to be executed is adjusted to a canceled execution status.
6. The method according to any one of claims 1 to 4, characterized in that: The allocating each of the first test tasks to a target test device among at least two candidate test devices based on the priority of each of the first test tasks comprises: Based on the execution strategy of each candidate test device, add each candidate test device to a corresponding device type set; When the type indicated by the device type set matches the test type of the at least two first test tasks, each of the first test tasks is sequentially allocated to a target test device in the device type set based on the priority of the at least two first test tasks.
7. The method according to claim 6, characterized in that The method further comprises: In a case where the target test device is assigned to the first test task, receiving a first request sent by the target test device; the first request indicates that the working state of the target test device is switched from a first working state to a second working state; In a case where the target test device returns the execution result, receiving a second request sent by the target test device; the second request indicates that the working state of the target test device is switched from the second working state to the first working state; The power consumption of the target test device in the first working state is less than the power consumption of the target test device in the second working state.
8. A task processing device, characterized in that: include: A first determination module, configured to determine the priority of each of the first test tasks based on the test-related parameters of each of the first test tasks in response to triggering the at least two first test tasks at a first moment; an allocating module, configured to allocate each of the first test tasks to a target test device among at least two candidate test devices based on the priority of each of the first test tasks; wherein the target test device is used to execute the first test task; A second determination module, configured to determine, based on the execution result returned by the target test device, an executed task in the at least two first test tasks, and a to-be-executed task associated with the executed task; An adjustment module, configured to adjust the task status of the task to be executed based on the execution result of the executed task; The first execution module is configured to distribute the tasks to be executed in an executable state to the target test device until the execution results of each of the first test tasks returned by the target test device are obtained.
9. An electronic device, characterized in that: include: processor; Memory for storing computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing a computer program or instruction, characterized in that: When the computer program or instructions in the storage medium are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program or instructions, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.