A method, system, task manager and storage medium for dynamically allocating tasks

By obtaining database tasks and controlling script execution, the problem that test scripts cannot be dynamically provisioned and automatically repeated execution is solved, which improves testing efficiency and flexibility and liberates human resources.

CN115098360BActive Publication Date: 2024-12-03SHENZHEN KONKA ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210616252.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-01
Publication Date
2024-12-03
Estimated Expiration
2042-06-01

AI Technical Summary

Technical Problem

In the prior art, the problem that test scripts cannot be dynamically provisioned and cannot be automatically repeated is especially the problem that test scripts for IOT product projects cannot be automatically started, resulting in inefficient testing.

Method used

By obtaining tasks in the database, starting tasks, obtaining test case data and sending them to the script execution center control, the control script is executed at the designated test terminal, receiving the execution results and device status change information, comparing and outputting task reports, realizing dynamic provisioning and repeat automatically.

Benefits of technology

It improves the flexibility and practicality of test scripts, reduces repetitive testing work, liberates human resources, and realizes automatic repeated execution of automated tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098360B_ABST
    Figure CN115098360B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, task manager and storage medium for dynamically allocating tasks, the method comprising: obtaining tasks in a database and starting the tasks; obtaining test case data, sending the test case data to a script execution central control, and controlling the script execution central control to execute a test script on a designated test terminal; after completing the execution of the test script, receiving the execution result sent by the script execution central control, and using the execution result as a test reference standard; receiving the state change information of the test device, comparing the state change information of the test device with the test reference standard, outputting the comparison result, and outputting a task report according to the comparison result. The present invention improves the flexibility and practicality of the test script by issuing script execution instructions and obtaining the state data of each script-specified device, comparing the expected results of the device and finally outputting a test task report.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart product testing technology, and in particular to a method, system, task manager and storage medium for dynamically allocating tasks. Background Art

[0002] Automated testing is a process that converts human-driven testing behavior into machine execution. Usually, after the test case is designed and reviewed, the tester executes the test step by step according to the procedures described in the test case to compare the actual results with the expected results. In this process, in order to save manpower, time or hardware resources and improve testing efficiency, the concept of automated testing was introduced. Automated testing generally refers to the automation of software testing. Software testing is to run the system or application under preset conditions and evaluate the running results. The preset conditions should include normal conditions and abnormal conditions. Each smart product project needs to undergo final stage testing and acceptance, and product testing includes product functional testing and stability testing. When conducting stability testing, such as a switch product, the tester may need to perform up to hundreds of switch control operations (on the smart terminal APP) and record error tests. This type of repetitive testing work is necessary but labor-intensive, so automated testing has emerged.

[0003] Automated testing requires writing automated test scripts. In the prior art, the operation of automated test scripts mainly relies on manual operation by testers. To complete the coordination between scripts, script developers need to write test logic, and it can only be applied in specific occasions. In particular, test scripts used for IOT (Internet of Things) product projects cannot be started automatically, and the coordination between scripts requires developers to complete related logic, which leads to the problem of being unable to achieve dynamic deployment and automatic repeated execution.

[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention

[0005] The main purpose of the present invention is to provide a method, system, task manager and storage medium for dynamically allocating tasks, aiming to solve the problem in the prior art that test scripts cannot be dynamically allocated and cannot be automatically repeated.

[0006] To achieve the above object, the present invention provides a method for dynamically allocating tasks, the method for dynamically allocating tasks comprising the following steps:

[0007] Get the task in the database and start the task;

[0008] Acquire test case data, send the test case data to the script execution central control, and control the script execution central control to execute the test script on the specified test terminal;

[0009] After the test script is executed, the execution result sent by the script execution control is received, and the execution result is used as a test reference standard;

[0010] Receive status change information of the test device, compare the status change information of the test device with the test reference standard, output a comparison result, and output a task report according to the comparison result.

[0011] Optionally, the method for dynamically allocating tasks, wherein the step of obtaining the tasks in the database and starting the tasks further comprises:

[0012] Define original data and task arrangement data according to the test script, wherein the original data includes the script file path and the test case corresponding to the script;

[0013] Building a database based on the original data and the task scheduling data;

[0014] The front-end UI is controlled to generate a control editing page, and the execution status of the tasks in the database is displayed based on the control editing page, wherein the front-end UI supports importing scripts from Excel configuration files.

[0015] Optionally, in the method for dynamically allocating tasks, the database is used to store tasks generated by arranging script instructions, and the tasks include information about the specified device to be tested, test script call path information, test case information, and execution orchestration strategy information.

[0016] Optionally, the method for dynamically allocating tasks, wherein the acquiring of test case data, sending the test case data to a script execution central control, and controlling the script execution central control to execute the test script on a designated test terminal, specifically includes:

[0017] When the task is started, determining whether the task pipeline has completed startup;

[0018] If the task pipeline has been started and is in an idle state, the waiting state of the task is converted to in progress, and the device data sent by the device cloud is received;

[0019] The device data is sent as a sending instruction to the script execution central control, and the script execution central control is controlled to execute on a designated test terminal.

[0020] Optionally, in the method for dynamically allocating tasks, when the task is started, determining whether the task pipeline has been started, and then further comprising:

[0021] If the task pipeline has not been started, a task pipeline start instruction is sent to the script execution center control to start the task pipeline.

[0022] Optionally, the method for dynamically allocating tasks, wherein the receiving of the state change information of the test device, comparing the state change information of the test device with the test reference standard, outputting the comparison result, and outputting the task report according to the comparison result, specifically includes:

[0023] Establishing a connection with the device cloud according to a connection protocol between the test device and the device cloud;

[0024] After the connection is completed, the state change information of the test device sent by the device cloud is received, and the current state of the test device is compared with the state of the test reference standard to see whether they are consistent;

[0025] If the status is consistent, the test success data is recorded and the next task is started until the task is completed and the test report of the entire task is output;

[0026] If the status is inconsistent, the data of the test failure is recorded and the next task is started until the task is completed and the test report of the entire task is output.

[0027] Optionally, the method for dynamically allocating tasks, wherein the step of comparing the received state change information of the test equipment based on the test reference standard, recording the comparison result, and outputting a task report, further comprises:

[0028] Add a timeout queue mechanism, which is used to dynamically maintain the timeout period of test cases;

[0029] If the task pipeline does not receive the correct message within the timeout period, the test case fails and the next test case is executed.

[0030] Optionally, in the method for dynamically allocating tasks, the system for dynamically allocating tasks includes:

[0031] A task starting module, used to obtain tasks in the database and start the tasks;

[0032] The task execution module is used to obtain test case data, send the test case data to the script execution central control, and control the script execution central control to execute the test script on the specified test terminal;

[0033] An execution result module is used to receive the execution result sent by the script execution central control after completing the execution of the test script, and use the execution result as a test reference standard;

[0034] The report output module is used to receive the state change information of the test device, compare the received state change information of the test device with the test reference standard, output the comparison result, and output the task report according to the comparison result.

[0035] In addition, to achieve the above-mentioned purpose, the present invention also provides a task manager, wherein the task manager includes: a memory, a processor, and a dynamic task allocation program stored in the memory and executable on the processor, and when the dynamic task allocation program is executed by the processor, the steps of the dynamic task allocation method as described above are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a dynamic task allocation program, and when the dynamic task allocation program is executed by a processor, the steps of the dynamic task allocation method as described above are implemented.

[0037] The present invention starts the task by acquiring the task in the database; acquires the test case data, sends the test case data to the script execution central control, and controls the script execution central control to execute the test script on the designated test terminal; after completing the execution of the test script, receives the execution result sent by the script execution central control, and uses the execution result as the test reference standard; receives the state change information of the test device, compares the state change information of the test device with the test reference standard, outputs the comparison result, and outputs the task report according to the comparison result. The present invention improves the flexibility and practicality of the test script by issuing the script execution instruction and acquiring the state data of the device specified by each script, comparing the expected results of the device and finally outputting the test task report, replacing part of the repetitive test work and freeing up manpower. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is a flow chart of a preferred embodiment of the method for dynamically allocating tasks in the present invention;

[0039] Figure 2 It is a schematic diagram of the tool framework for dynamically allocating tasks in the present invention;

[0040] Figure 3 is a flowchart of step S20 in a preferred embodiment of the method for dynamically allocating tasks in the present invention;

[0041] Figure 4 is a flowchart of step S40 in a preferred embodiment of the method for dynamically allocating tasks in the present invention;

[0042] Figure 5 It is a schematic diagram of the entire process of a preferred embodiment of the method for dynamically allocating tasks in the present invention;

[0043] Figure 6 It is a schematic diagram of the principle of a preferred embodiment of the dynamic allocation task system of the present invention;

[0044] Figure 7 Schematic diagram of the operating environment of a preferred embodiment of the task manager of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0046] The method for dynamically allocating tasks described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the method for dynamically allocating tasks includes the following steps:

[0047] Step S10: Obtain tasks from the database and start the tasks.

[0048] Specifically, original data and task scheduling data are defined according to the test script, and the original data includes the script file path and the test case corresponding to the script; a database is constructed based on the original data and the task scheduling data; the front-end UI uses WEB technology to generate a control editing page, and the control editing page is used to display the executable script instructions stored in the database. After the script instructions are scheduled and saved by the user, a task with information such as the specified device to be tested, the test script and the script scheduling strategy is generated. After the task is generated, the task data configured by the user is stored in the database through the front-end and back-end interaction, and is re-called and assembled for use when the task is executed; the user can control the start and interruption of the task, and can also view the task execution status on the control editing page; wherein, the front-end UI provides a script entry function, supports Excel configuration files to import scripts, and saves the original data of scripts and test cases by maintaining configuration files, which is convenient for test developers to manage; the task in the database is obtained, and the task is started.

[0049] Further, Figure 2This is a tool architecture diagram for dynamically allocating tasks in the present invention, which includes four structures, namely a task management center, a device cloud, a front-end UI and a script execution tool; wherein the task management center is the center of the entire tool architecture; the device cloud sends the acquired information and status changes of the tested device to the task management center; the front-end UI sends the tasks of user operations and scheduling changes to the task management center, and the task management center reads the data in the database through the front-end UI to display the task status and script information; the script execution tool receives the current execution instruction information issued by the task management center for processing, and returns the result of the script execution to the task management center after the processing is completed.

[0050] Specifically, in an embodiment of the present invention, when a tester tests a smart air conditioner, he needs to first select the actual device to be tested. The task management center will provide optional test cases for users to arrange test tasks (for example, turning on / off the air conditioner, setting the air conditioner wind speed, mode, temperature and timing, etc.) according to the type of device. In order to meet the stress testing needs in the test tasks, the tool for dynamically allocating tasks provides multiple rounds of repeated execution of test tasks for testers to choose from. After the tester arranges the task, he selects an available test terminal (for example, a mobile phone, computer, and TV, etc.) as the script execution platform, thereby completing the creation of a task. On the task management page, the test task can execute tasks that have just been created or have not yet started.

[0051] Step S20: Acquire test case data, send the test case data to the script execution central control, and control the script execution central control to execute the test script on the designated test terminal.

[0052] For detailed process, please refer to Figure 3 , which is a flowchart of step S20 in the method for dynamically allocating tasks provided by the present invention.

[0053] like Figure 3 As shown, the step S20 includes:

[0054] Step S21: when the task is started, determine whether the task pipeline has completed the startup;

[0055] Step S22: If the task pipeline has been started and is in an idle state, the waiting state of the task is converted to in progress, and the device data sent by the device cloud is received;

[0056] Step S22: sending the device data as a sending instruction to the script execution central control, and controlling the script execution central control to execute on the designated test terminal.

[0057] Specifically, when the task starts to start, it is determined whether the same task pipeline (the test script is ultimately run on a terminal (such as a mobile phone, a TV terminal device, etc.). If multiple tasks specify the same running terminal, the situation where multiple tasks specify the same running terminal is defined as these tasks being in the same task pipeline) has completed the startup. If the task pipeline has not completed the startup, a task pipeline startup instruction is sent to the script execution central control to start the task pipeline; if the task pipeline has completed the startup, it is determined whether there is a task being executed in the task pipeline. If there is a task being executed in the task pipeline, the task is added to the waiting queue; if there is no task being executed in the task pipeline, the waiting state of the task is converted to in progress, and the device data sent by the device cloud is received; the device data is sent as a sending instruction (for example, turning on the air conditioner, setting the air conditioner wind speed to gear 3, etc.) to the script execution central control, and the script execution central control runs the specified test script on the test terminal according to the information of the sending instruction.

[0058] Furthermore, when multiple tasks start to execute, since the terminals they run on are the same, tasks cannot be interspersed. Therefore, the task management center will maintain a task queue for each test terminal. After a task outputs a task report, the task queue will be retrieved and the next task will be automatically started to ensure that tasks can be executed in sequence when unattended.

[0059] Step S30: After the test script is executed, the execution result sent by the script execution central control is received, and the execution result is used as a test reference standard.

[0060] Specifically, after the execution of the test script is completed, the execution result sent by the script execution central control is received, and the execution result is used as a test reference standard.

[0061] Step S40: receiving the state change information of the test device, comparing the state change information of the test device with the test reference standard, outputting the comparison result, and outputting a task report according to the comparison result.

[0062] For detailed process, please refer to Figure 4 , which is a flowchart of step S40 in the method for dynamically allocating tasks provided by the present invention.

[0063] like Figure 4 As shown, the step S40 includes:

[0064] Step S41: Establishing a connection with the device cloud according to a connection protocol between the test device and the device cloud;

[0065] Step S42: after the connection is completed, receiving the state change information of the test device sent by the device cloud, and comparing the current state of the test device with the state of the test reference standard to see whether they are consistent;

[0066] Step S43: If the status is consistent, record the test success data and start the next task until the task is completed and output the test report of the entire task;

[0067] Step S44: If the status is inconsistent, record the data of the test failure and start the next task until the task is completed and the test report of the entire task is output.

[0068] Specifically, according to the connection protocol between the test device and the device cloud, a connection is established with the device cloud. After the connection is completed, the state change information of the test device sent by the device cloud is received (for example, the switch state of a switch device is "on"), and the current state of the test device is compared with the state of the test reference standard (for example, the result of starting the script binding "switch state on") to see whether the expected state of the device is achieved; if the state is consistent with the expected state, the data of the successful test is recorded and the next task is started, and the test report of the entire task is output after the task is completed; if the state is inconsistent with the expected state, the data of the failed test is recorded and the next task is started, and the test report of the entire task is output after the task is completed; if the state is inconsistent with the expected state, the data of the failed test is recorded and the next task is started, and the test report of the entire task is output after the task is completed.

[0069] It also supports interrupting tasks in progress. When a task is interrupted, the task management center will output the execution result report of the interrupted task and process the data into a test form that the tester needs to clearly analyze according to a specific format. After the task outputs the test report, it will check whether there are any waiting tasks in the task queue corresponding to the test terminal. If so, the task at the head of the queue will be taken to start execution until all tasks are completed.

[0070] Furthermore, in order to avoid the task scheduling module from continuously waiting due to the lack of information in the device cloud or the script central control, a timeout queue mechanism is added. The timeout queue mechanism is used to dynamically maintain the timeout period of each test case. If the correct script central control information and the device status information of the IOT cloud are not received during the timeout period, the test script is set to fail when the delayed task starts. Otherwise, when the test case result is normal, the timeout task is canceled. After the task executes a round of test cases, it will execute the next round of test cases based on whether multiple rounds of testing are set.

[0071] Furthermore, if Figure 5 As shown, the whole process of the preferred embodiment of the method for dynamically allocating tasks of the present invention is as follows:

[0072] Step S1, obtaining the task arranged by the user;

[0073] Step S2, starting the task;

[0074] Step S3, determining whether the same task pipeline has been started. If the task pipeline has not been started, proceeding to step S4; if the task pipeline has been started, proceeding to step S5;

[0075] Step S4, sending a task pipeline start instruction to the script execution central control to start the task pipeline;

[0076] Step S5, determining whether there is a task being executed in the task pipeline, if there is a task being executed in the task pipeline, adding the task to the waiting queue; if there is no task being executed in the task pipeline, proceeding to step S6;

[0077] Step S6, converting the waiting state of the task to in progress, and receiving device data sent by the device cloud;

[0078] Step S7, sending the device data as a sending instruction to the script execution central control, and controlling the script execution central control to execute on the designated test terminal;

[0079] Step S8, receiving the state change information of the test device sent by the device cloud, comparing the current state of the test device with the state of the test reference standard to see whether it reaches the expected state of the device; if the state is consistent with the expected state, proceed to step S9, if the state is inconsistent with the expected state, proceed to step S10;

[0080] Step S9, record the test success data and start the next task, and determine whether the task is completed. If the task is not completed, go to step S7, if the task is completed, go to step S12;

[0081] Step S10, record the data of test failure and start the next task, and determine whether the task is completed. If the task is not completed, go to step S7, if the task is completed, go to step S12;

[0082] Step S11, if the task is interrupted, determine whether the task is finished, if the task is not finished, go to step S7, if the task is finished, go to step S12;

[0083] Step S12, outputting a test report of the entire task.

[0084] Furthermore, if Figure 6 As shown, based on the above-mentioned method for dynamically allocating tasks, the present invention also provides a dynamic task allocation system accordingly, and the dynamic task allocation system includes:

[0085] A task starting module 51 is used to obtain a task in a database and start the task;

[0086] The task execution module 52 is used to obtain test case data, send the test case data to the script execution central control, and control the script execution central control to execute the test script on the specified test terminal;

[0087] An execution result module 53 is used to receive the execution result sent by the script execution central control after completing the execution of the test script, and use the execution result as a test reference standard;

[0088] The report output module 54 is used to receive the state change information of the test device, compare the received state change information of the test device with the test reference standard, output the comparison result, and output a task report according to the comparison result.

[0089] Furthermore, if Figure 7 As shown, based on the above-mentioned method for dynamically allocating tasks, the present invention also provides a task manager accordingly, and the task manager includes a processor 10, a memory 20 and a display 30; Figure 7 Only some of the components of the task manager are shown, but it should be understood that implementation of all of the shown components is not required, and more or fewer components may be implemented instead.

[0090] The memory 20 may be an internal storage unit of the task manager in some embodiments, such as a hard disk or memory of the task manager. The memory 20 may also be an external storage device of the task manager in other embodiments, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the task manager. Further, the memory 20 may also include both an internal storage unit of the task manager and an external storage device. The memory 20 is used to store application software and various types of data installed in the task manager, such as the program code of the installation task manager, etc. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a dynamic allocation task program 40 is stored on the memory 20, and the dynamic allocation task program 40 can be executed by the processor 10, thereby realizing the method of dynamically allocating tasks in the present application.

[0091] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the method of dynamically allocating tasks.

[0092] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the task manager and to display a visual user interface. The components 10-30 of the task manager communicate with each other via a system bus.

[0093] In one embodiment, when the processor 10 executes the interface display program 40 of the split-screen window in the memory 20, the following steps are implemented:

[0094] Get the task in the database and start the task;

[0095] Acquire test case data, send the test case data to the script execution central control, and control the script execution central control to execute the test script on the specified test terminal;

[0096] After the test script is executed, the execution result sent by the script execution control is received, and the execution result is used as a test reference standard;

[0097] Receive status change information of the test device, compare the status change information of the test device with the test reference standard, output a comparison result, and output a task report according to the comparison result.

[0098] The step of obtaining the task in the database and starting the task may also include:

[0099] Define original data and task arrangement data according to the test script, wherein the original data includes the script file path and the test case corresponding to the script;

[0100] Building a database based on the original data and the task scheduling data;

[0101] The front-end UI is controlled to generate a control editing page, and the execution status of the tasks in the database is displayed based on the control editing page, wherein the front-end UI supports importing scripts from Excel configuration files.

[0102] The database is used to store tasks generated by arranging script instructions, wherein the tasks include information about a designated device to be tested, information about a test script calling path, information about test cases, and information about an execution arrangement strategy.

[0103] The acquiring of the test case data, sending the test case data to the script execution central control, and controlling the script execution central control to execute the test script on the designated test terminal specifically includes:

[0104] When the task is started, determining whether the task pipeline has completed startup;

[0105] If the task pipeline has been started and is in an idle state, the waiting state of the task is converted to in progress, and the device data sent by the device cloud is received;

[0106] The device data is sent as a sending instruction to the script execution central control, and the script execution central control is controlled to execute on a designated test terminal.

[0107] Wherein, when the task is started, it is determined whether the task pipeline has been started, and then it also includes:

[0108] If the task pipeline has not been started, a task pipeline start instruction is sent to the script execution center control to start the task pipeline.

[0109] The receiving of the state change information of the test device, comparing the state change information of the test device with the test reference standard, outputting the comparison result, and outputting the task report according to the comparison result specifically includes:

[0110] Establishing a connection with the device cloud according to a connection protocol between the test device and the device cloud;

[0111] After the connection is completed, the state change information of the test device sent by the device cloud is received, and the current state of the test device is compared with the state of the test reference standard to see whether they are consistent;

[0112] If the status is consistent, the test success data is recorded and the next task is started until the task is completed and the test report of the entire task is output;

[0113] If the status is inconsistent, the data of the test failure is recorded and the next task is started until the task is completed and the test report of the entire task is output.

[0114] Wherein, based on the test reference standard, the received state change information of the test equipment is compared, the comparison result is recorded, and a task report is output, and then it also includes:

[0115] Add a timeout queue mechanism, which is used to dynamically maintain the timeout period of test cases;

[0116] If the task pipeline does not receive the correct message within the timeout period, the test case fails and the next test case is executed.

[0117] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a dynamic task allocation program, and when the dynamic task allocation program is executed by a processor, the steps of the method for dynamically allocating tasks as described above are implemented.

[0118] In summary, the present invention provides a method, system, task manager and storage medium for dynamically allocating tasks, the method comprising: obtaining tasks in a database and starting the tasks; obtaining test case data, sending the test case data to a script execution control, and controlling the script execution control to execute the test script on a specified test terminal; after completing the execution of the test script, receiving the execution result sent by the script execution control, and using the execution result as a test reference standard; receiving the state change information of the test device, comparing the state change information of the test device with the test reference standard, outputting the comparison result, and outputting a task report according to the comparison result. The present invention improves the flexibility and practicality of the test script by issuing script execution instructions and obtaining the state data of the device specified by each script, comparing the expected results of the device and finally outputting the test task report, replacing part of the repetitive testing work and liberating manpower.

[0119] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0120] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.

[0121] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for dynamically allocating tasks, characterized in that: The method for dynamically allocating tasks includes: Get the task in the database and start the task; Acquire test case data, send the test case data to the script execution central control, and control the script execution central control to execute the test script on the specified test terminal; When a plurality of the tasks start to be executed, a task queue corresponding to each test terminal is maintained, and after a task outputs a task report, the task queue is retrieved and the next task is automatically started; After the test script is executed, the execution result sent by the script execution control is received, and the execution result is used as a test reference standard; Receiving state change information of a test device, comparing the state change information of the test device with the test reference standard, outputting a comparison result, and outputting a task report according to the comparison result; The receiving the state change information of the test device, comparing the state change information of the test device with the test reference standard, outputting the comparison result, and outputting the task report according to the comparison result specifically includes: Establishing a connection with the device cloud according to a connection protocol between the test device and the device cloud; After the connection is completed, the state change information of the test device sent by the device cloud is received, and the current state of the test device is compared with the state of the test reference standard to see whether they are consistent; If the status is consistent, the test success data is recorded and the next task is started until the task is completed and the test report of the entire task is output; If the status is inconsistent, the data of the test failure is recorded and the next task is started until the task is completed and the test report of the entire task is output; The method further comprises: comparing the received state change information of the test equipment based on the test reference standard, recording the comparison result, and outputting a task report, and then: Add a timeout queue mechanism, which is used to dynamically maintain the timeout period of test cases; If the task pipeline does not receive the correct message within the timeout period, the test case fails and the next test case is executed.

2. The method for dynamically allocating tasks according to claim 1, characterized in that: The step of obtaining the task in the database and starting the task also includes: Define original data and task arrangement data according to the test script, wherein the original data includes the script file path and the test case corresponding to the script; Building a database based on the original data and the task scheduling data; The front-end UI is controlled to generate a control editing page, and the execution status of the tasks in the database is displayed based on the control editing page, wherein the front-end UI supports importing scripts from Excel configuration files.

3. The method for dynamically allocating tasks according to claim 1, characterized in that: The database is used to store tasks generated by arranging script instructions, wherein the tasks include information about a designated device to be tested, information about a test script calling path, information about a test case, and information about an execution arrangement strategy.

4. The method for dynamically allocating tasks according to claim 1, characterized in that: The acquiring of test case data, sending the test case data to a script execution central control, and controlling the script execution central control to execute the test script on a designated test terminal specifically includes: When the task is started, determining whether the task pipeline has completed startup; If the task pipeline has been started and is in an idle state, the waiting state of the task is converted to in progress, and the device data sent by the device cloud is received; The device data is sent as a sending instruction to the script execution central control, and the script execution central control is controlled to execute on a designated test terminal.

5. The method for dynamically allocating tasks according to claim 4, characterized in that: When the task is started, it is determined whether the task pipeline has been started, and then the following steps are further included: If the task pipeline has not been started, a task pipeline start instruction is sent to the script execution center control to start the task pipeline.

6. A system for dynamically allocating tasks, characterized in that: The system for dynamically allocating tasks includes: A task starting module, used to obtain tasks in the database and start the tasks; The task execution module is used to obtain test case data, send the test case data to the script execution central control, and control the script execution central control to execute the test script on the specified test terminal; When a plurality of the tasks start to be executed, a task queue corresponding to each test terminal is maintained, and after a task outputs a task report, the task queue is retrieved and the next task is automatically started; An execution result module is used to receive the execution result sent by the script execution control after completing the execution of the test script, and use the execution result as a test reference standard; A report output module, used for receiving the state change information of the test device, comparing the received state change information of the test device with the test reference standard, outputting the comparison result, and outputting a task report according to the comparison result; The receiving the state change information of the test device, comparing the state change information of the test device with the test reference standard, outputting the comparison result, and outputting the task report according to the comparison result specifically includes: Establishing a connection with the device cloud according to a connection protocol between the test device and the device cloud; After the connection is completed, the state change information of the test device sent by the device cloud is received, and the current state of the test device is compared with the state of the test reference standard to see whether they are consistent; If the status is consistent, the test success data is recorded and the next task is started until the task is completed and the test report of the entire task is output; If the status is inconsistent, the data of the test failure is recorded and the next task is started until the task is completed and the test report of the entire task is output; The method further comprises: comparing the received state change information of the test equipment based on the test reference standard, recording the comparison result, and outputting a task report, and then: Add a timeout queue mechanism, which is used to dynamically maintain the timeout period of test cases; If the task pipeline does not receive the correct message within the timeout period, the test case fails and the next test case is executed.

7. A task manager, characterized in that: The task manager includes: a memory, a processor, and a dynamic task allocation program stored in the memory and executable on the processor. When the dynamic task allocation program is executed by the processor, the steps of the method for dynamically allocating tasks as described in any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a dynamic task allocation program, and when the dynamic task allocation program is executed by a processor, the steps of the method for dynamically allocating tasks according to any one of claims 1 to 5 are implemented.