Test task execution method and device, electronic equipment and storage medium

By calculating task priority weights and path optimization value in server tests, preemptive scheduling and path optimization of high-priority tasks are achieved, and the problem of high path redundancy when smart mobile devices move between multiple servers is solved, and the response timeliness and resource utilization of emergency tasks is improved.

CN120492338APending Publication Date: 2025-08-15INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510578093.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In server tests, the path redundancy of intelligent mobile devices when moving between multiple servers is high, and emergency tasks need to wait for the current task to be executed, resulting in low response delay and resource utilization.

Method used

By reading the emergency identification parameters as the target value in the task queue, the task priority weight is calculated and the path optimization value is determined, preemptive scheduling of high-priority tasks is realized, low-priority tasks are interrupted to perform emergency tasks, and path planning is optimized using the improved DP-RRT algorithm.

Benefits of technology

It improves the response timeliness of emergency tasks, reduces path redundancy, improves resource utilization and path planning efficiency, and reduces invalid paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492338A_ABST
    Figure CN120492338A_ABST
Patent Text Reader

Abstract

The invention discloses a test task execution method and device, electronic equipment and a storage medium, and relates to the technical field of server tests.The test task execution method comprises the steps that when an emergency identification parameter of a first task read from a task queue is a target value, task priority weight calculation is conducted firstly; determining a priority weight according to the position of a test object corresponding to the task, and determining path optimization cost values respectively corresponding to the first task and the currently executed second task based on the priority weight and the path cost of the intelligent mobile device from the current position to the test object corresponding to the task; when the first path optimization cost value corresponding to the first task is smaller than the second path optimization cost value of the second task, the second task is interrupted, and the first task is executed, so that the emergency task can be executed preferentially when the path optimization cost value of the emergency task is smaller without waiting for the completion of the execution of the currently executed task. The response timeliness of the emergency task is improved, and the technical problem that the path redundancy is large when the intelligent mobile device moves is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of server testing technology, and in particular to a method, device, electronic device, and storage medium for executing a testing task. Background Art

[0002] In server testing scenarios, smart mobile devices (such as robotic arms) serve as the core execution units of automated testing, usually simultaneously supervising multiple servers to complete operations such as lighting tests, hard drive replacements, and module insertions.

[0003] Currently, in related technologies, when using smart mobile devices to test servers, test tasks are executed in a fixed order, and urgent tasks must wait until the current tasks are completed before they can be executed, resulting in urgent tasks not being responded to in a timely manner; moreover, smart mobile devices move between multiple servers, and the movement path is usually calculated point by point based on Cartesian space. This path planning method easily generates a large number of invalid round-trip paths, resulting in a large amount of path redundancy. Summary of the Invention

[0004] The present application provides a method, device, electronic device and storage medium for executing a test task, so as to at least solve the problem of large path redundancy when a smart mobile device moves between multiple servers in the related art.

[0005] This application provides a method for executing a test task, including:

[0006] Obtaining a first task from a task queue, where the first task carries an urgent identification parameter;

[0007] When the emergency identification parameter is a target value, determining a first priority weight corresponding to the first task based on a first position of a first test object corresponding to the first task, and determining a second priority weight corresponding to a second task currently being executed based on a second position of a second test object corresponding to the second task;

[0008] determining a first path optimization cost value corresponding to the first task based on the first priority weight and a path cost of the smart mobile device moving from the current location to the first location, and determining a second path optimization cost value corresponding to the second task based on the second priority weight and a path cost of the smart mobile device moving from the current location to the second location, wherein the path optimization cost value is positively correlated with the priority weight;

[0009] When the first path optimization cost value is less than the second path optimization cost value, the second task is interrupted, and the smart mobile device is called to perform a test operation on the first test object based on the first task.

[0010] This application also provides a device for executing a test task, including:

[0011] A task acquisition module, configured to acquire a first task from a task queue, wherein the first task carries an emergency identification parameter;

[0012] a weight calculation module, configured to determine, when the emergency identification parameter is a target value, a first priority weight corresponding to the first task based on a first position of a first test object corresponding to the first task, and to determine a second priority weight corresponding to a second task currently being executed based on a second position of a second test object corresponding to the second task;

[0013] a cost calculation module, configured to determine a first path optimization cost value corresponding to the first task based on the first priority weight and a path cost of the smart mobile device moving from the current location to the first location, and to determine a second path optimization cost value corresponding to the second task based on the second priority weight and the path cost of the smart mobile device moving from the current location to the second location, wherein the path optimization cost value is positively correlated with the priority weight;

[0014] The task execution module is configured to interrupt the second task when the first path optimization cost is less than the second path optimization cost, and call the smart mobile device to perform a test operation on the first test object based on the first task.

[0015] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the execution method of any of the above-mentioned test tasks when executing the computer program.

[0016] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the execution method of any of the above-mentioned test tasks are implemented.

[0017] The present application also provides a computer program product, including a computer program, which implements the steps of the execution method of any of the above-mentioned test tasks when the computer program is executed by a processor.

[0018] Through the present application, since the task priority weight is first calculated when the emergency identification parameter of the first task read from the task queue is the target value, the priority weight is determined according to the location of the test object corresponding to the task, and then the path optimization cost values corresponding to the first task and the currently executed second task are determined based on the priority weight and the path cost of the smart mobile device from the current location to the test object corresponding to the task. The path optimization cost value is positively correlated with the priority weight. When the first path optimization cost value corresponding to the first task is less than the second path optimization cost value of the second task, the second task is interrupted and the first task is executed, so that when the path optimization cost value of the emergency task is smaller, the emergency task can be executed first without waiting for the currently executed task to be completed, thereby improving the response timeliness of the emergency task. Moreover, since the task with the smaller path optimization cost value is executed first, the path optimization of the smart mobile device is guaranteed, thereby reducing invalid paths and reducing path redundancy. Therefore, the technical problem of large path redundancy when the smart mobile device moves between multiple servers can be solved, and the technical effect of reducing path redundancy can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0020] Figure 1 A schematic diagram of a system architecture for implementing a method for executing a test task provided by an exemplary embodiment of the present application;

[0021] Figure 2 A flowchart of a method for executing a test task provided in an embodiment of the present application;

[0022] Figure 3 A flowchart of another method for executing a test task provided in an embodiment of the present application;

[0023] Figure 4 A flowchart of another method for executing a test task provided in an embodiment of the present application;

[0024] Figure 5 A schematic diagram of the overall flow of a method for executing a test task provided by an exemplary embodiment of the present application;

[0025] Figure 6 A schematic diagram of the structure of a test task execution device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0027] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0028] In server testing scenarios, related technologies usually adopt a static task allocation mechanism, that is, a fixed task queue scheduling strategy based on time slices (static process state transition model (ready → running → blocked)). Preemptive interrupts cannot be triggered during the execution of low-priority tasks, making it impossible to dynamically adjust the execution order according to the urgency of the tasks. When a sudden high-priority task (such as server fault repair) occurs, the high-priority task must wait until the current task is completed before it can be started, causing critical operations to lag, resulting in an average response delay of up to 2.5 seconds for emergency tasks, and resource utilization of less than 60%. In addition, it is impossible to dynamically adjust the priority according to the real-time load. For example, when a server times out due to a hardware anomaly, the smart mobile device will still wait for the preset cycle to end, causing the entire process to be blocked.

[0029] In addition, when smart mobile devices move between multiple servers, they usually calculate the movement path point by point based on Cartesian space, without considering the topological relationship of multi-server collaborative operations. For example, when performing disk swap operations on three servers at the same time, the path generated by the traditional algorithm does not integrate the task priority and the kinematic constraints of the robot arm (such as the joint acceleration limit ≤3m / s 2 ), resulting in over 32% redundancy in cross-server movement paths and a 25% idle rate for smart mobile devices. Actual measurements show that a single cross-device movement takes an average of 8 seconds, with 60% of that time spent on ineffective path adjustments.

[0030] In response to the above problems, the present application provides a test task execution scheme. When the test task in the task queue is an urgent task (the urgent identification parameter is the target value), based on the task priority weight algorithm, the priority weight of the test task and the currently executing task is determined, and the corresponding path optimization cost value is determined based on the respective priority weights. Tasks with smaller path optimization cost values are executed first, thereby providing a high-priority task preemption mechanism. Through the preemptive scheduling strategy, urgent tasks (such as equipment abnormality alarms) are allowed to immediately interrupt low-priority operations, so that the response delay of urgent tasks is reduced to the millisecond level, ensuring the real-time performance of urgent tasks. In addition, the priority weight is related to the current path state and can reflect changes such as obstacles on the current path. Therefore, the priority weight is introduced when calculating the path optimization cost value, which can support real-time path updates in complex scenarios. For example, when a new obstacle appears, an obstacle avoidance trajectory is quickly generated, which shortens the path adjustment time by more than 30%. By integrating the heuristic path search with priority weights in this scheme, the expansion of invalid nodes is reduced, and the memory usage of path planning is reduced by 50%, which is more suitable for large-scale server cluster scenarios. In the server test scenario, this solution can achieve global optimization of multi-device operation paths, reducing the path redundancy rate from 37% to 12%.

[0031] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0032] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the test task execution method depends, the specific application environment architecture or specific hardware architecture is described here.

[0033] Figure 1 A schematic diagram of a system architecture for implementing a test task execution method provided by an exemplary embodiment of the present application is shown in FIG. Figure 1 As shown, taking the server test scenario as an example, that is, the test object is a server, the system includes an electronic device, a smart mobile device and multiple servers, wherein the electronic device and the smart mobile device can be connected via wireless communication. The electronic device executes the execution method of the test task of this application, calls the smart mobile device to move to the server along the planned path to perform server test operations, such as lighting, replacing the hard disk, etc. It should be noted that Figure 1 The dotted line in the figure is only an example of the path that the smart mobile device moves to the server. Figure 1 The shown architecture is only used as an example to explain the present application and is not intended to limit the present application.

[0034] The embodiments of the present application provide a method for executing a test task, and the method is described in detail in conjunction with the execution flow of the method for executing a test task.

[0035] Figure 2 This is a flow chart of a method for executing a test task provided in an embodiment of the present application. The method can be executed by the device for executing a test task provided in an embodiment of the present application and can be integrated into an electronic device.

[0036] like Figure 2 As shown, the execution method of the test task includes the following steps:

[0037] Step 101: Obtain a first task from a task queue, where the first task carries an emergency identification parameter.

[0038] Each task in the task queue carries an urgency flag parameter, which is used to indicate whether the corresponding test task is an urgent task. It should be noted that the urgency flag parameter can be calibrated using a pre-set identification method. For example, the urgency flag parameter can be set to 1 to indicate that the test task is an urgent task, while the urgency flag parameter can be set to 0 to indicate that the test task is not an urgent task.

[0039] In this embodiment, the first task may be obtained from the task queue according to a preset acquisition strategy.

[0040] As an example, the task with the earliest execution time in the task queue may be obtained as the first task.

[0041] As an example, the priority weight of each test task in the task queue may be determined, and the test task with the highest priority weight may be selected as the first task.

[0042] Step 102, when the emergency identification parameter is the target value, determine the first priority weight corresponding to the first task based on the first position of the first test object corresponding to the first task, and determine the second priority weight corresponding to the second task based on the second position of the second test object corresponding to the currently executed second task.

[0043] The target value is a preset value, and the target value is used to indicate that the test task is an urgent task.

[0044] In this embodiment, after obtaining the first task, it is possible to first detect whether the emergency identification parameter carried by the first task is the target value. If the emergency identification parameter of the first task is the target value, the first task is determined to be an emergency task. At this time, the preemptive interrupt mechanism is triggered, and the priority weights of the first task and the currently executing second task are calculated to determine the path optimization cost. Based on the path optimization costs of the two, it is decided whether it is necessary to interrupt the currently executing second task and give priority to executing the first task.

[0045] As an example, when determining the priority weight, it can be determined based on the distance between the current location of the smart mobile device and the location of the test object corresponding to the task. The larger the distance, the larger the corresponding priority weight value. For example, the first actual distance from the smart mobile device to the first location of the first test object corresponding to the first task along the current planned path can be obtained, and the second actual distance from the smart mobile device to the second location of the second test object corresponding to the second task along the current planned path can be obtained. The first priority weight = first actual distance / (first actual distance + second actual distance).

[0046] As an example, the priority weight of a task can be comprehensively determined by combining parameters such as the location of the test subject, the remaining acceptable delay time of the task, and whether the task is urgent. The remaining acceptable delay time of the task is positively correlated with the priority weight. The relationship between each parameter and the priority weight can be characterized by a preset task priority weight calculation model. Based on each parameter, by calling the task priority weight calculation model, a first priority weight corresponding to the first task and a second priority weight corresponding to the currently executing second task can be determined.

[0047] Among them, the task priority weight calculation model is a pre-designed calculation formula and can be changed according to actual needs. This application does not impose any restrictions on this. The task priority weight calculation model can be stored in the storage space of the electronic device to facilitate retrieval and use when needed. By designing a task priority weight calculation model and integrating parameters such as task urgency and allowed delay time to determine the priority weight of the task, it is helpful to achieve high-priority tasks immediately preempting low-priority tasks.

[0048] Step 103: Determine a first path optimization cost value corresponding to the first task based on the first priority weight and the path cost of the smart mobile device moving from the current position to the first position, and determine a second path optimization cost value corresponding to the second task based on the second priority weight and the path cost of the smart mobile device moving from the current position to the second position, wherein the path optimization cost value is positively correlated with the priority weight.

[0049] Understandably, in dynamic environments, path planning needs to quickly respond to changes in the environment or task priorities. However, while commonly used path planning algorithms, such as the Rapidly Exploring Random Tree (RRT), can generate feasible paths, they fail to integrate task priorities with the kinematic constraints of the robotic arm, resulting in significant path redundancy when moving across objects.

[0050] To address this issue, this application proposes a path optimization cost function that defines calculation rules for determining a path optimization cost based on priority weights and path costs. For example, the path optimization cost function can define the product of the priority weights and the path cost as the path optimization cost. Using this path optimization cost function, a first path optimization cost corresponding to a first task can be determined based on a first priority weight and the path cost of moving a smart mobile device from its current location to the first location. Similarly, a second path optimization cost corresponding to a second task can be determined based on a second priority weight and the path cost of moving the smart mobile device from its current location to the second location. The path optimization cost is positively correlated with the priority weights, and the path optimization cost is then used to select the task to be executed first from the first and second tasks. The larger the task's path optimization cost, the lower its corresponding execution priority and the later it is executed in the order of execution. This path optimization cost function incorporates the task's priority weights when calculating the path optimization cost, allowing task priority weights to be considered during path optimization, enabling high-priority tasks to immediately preempt low-priority tasks.

[0051] It should be noted that path cost refers to the cumulative cost or consumption of a specific path from the starting point to the end point. Path cost is an important basis for evaluating and selecting the optimal path. Different application scenarios may have different cost criteria, with common ones including distance, time, and energy consumption. In the embodiment of the present application, the parameters of the path optimization cost function include the path cost of moving the smart mobile device from its current location to the location of the test object corresponding to the task.

[0052] Step 104 : When the first path optimization cost is less than the second path optimization cost, the second task is interrupted, and the smart mobile device is called to perform a test operation on the first test object based on the first task.

[0053] In this embodiment, after determining the first path optimization cost value of the first task and the second path optimization cost value of the second task, the two can be compared. If the first path optimization cost value is less than the second path optimization cost value, the currently executing second task is interrupted, the first task is executed first, and the smart mobile device is called to perform a test operation on the first test object; otherwise, the second task is continued.

[0054] The execution method of the test task of the embodiment of the present application first calculates the task priority weight when the emergency identification parameter of the first task read from the task queue is the target value, determines the priority weight according to the location of the test object corresponding to the task, and then determines the path optimization cost values corresponding to the first task and the currently executed second task based on the priority weight and the path cost of the smart mobile device from the current location to the test object corresponding to the task. When the first path optimization cost value corresponding to the first task is less than the second path optimization cost value of the second task, the second task is interrupted and the first task is executed, so that when the path optimization cost value of the urgent task is smaller, the urgent task can be executed first without waiting for the currently executed task to be completed, thereby improving the response timeliness of the urgent task. Moreover, since the task with the smaller path optimization cost value is executed first, the path optimization of the smart mobile device is guaranteed, thereby reducing invalid paths and reducing path redundancy. Therefore, the technical problem of large path redundancy when the smart mobile device moves between multiple servers can be solved, and the technical effect of reducing path redundancy can be achieved.

[0055] In an optional embodiment of the present application, when the first path optimization cost value is not less than the second path optimization cost value, the second task continues to be executed and the first task is added to the task queue. It can be understood that if the task to be executed is obtained from the task queue according to the task priority weight, then after the first task is added to the task queue, it re-participates in the calculation of the priority weight, and the task that is out of the queue is selected as the new first task according to the newly calculated priority weight. Thus, it can be ensured that the currently executed task is the task with the smallest path optimization cost value, which ensures the path optimization of the smart mobile device, thereby reducing invalid paths and reducing path redundancy.

[0056] In an optional embodiment of the present application, Figure 3 As shown, based on the above embodiment, step 101 may include the following sub-steps:

[0057] Step 201: Determine the execution priority of at least one test task in the task queue.

[0058] In this embodiment, for at least one test task in the task queue, an execution priority corresponding to each test task may be determined.

[0059] As an example, the execution priority can be determined based on the emergency identification parameter and execution time of the test task. The execution priority of the test task whose emergency identification parameter is the target value is higher than that of the test task whose emergency identification parameter is not the target value. The smaller the interval between the execution time and the current time, the higher its execution priority. Based on this, the execution priority of each test task can be determined. The test task whose emergency identification parameter is the target value and whose execution time is earlier has a higher execution priority.

[0060] As an example, parameter weights can be set for parameters such as the task's emergency identification parameter, execution time, and the distance between the test object corresponding to the test task and the smart mobile device. Then, a weighted sum is performed based on each parameter and its corresponding weight to determine the execution priority score of each test task, and the execution priority of each test task is determined based on the execution priority score.

[0061] For example, the execution priority score can be determined based on three parameters: the emergency identification parameter, the execution time, and the distance between the test object corresponding to the test task and the smart mobile device. The parameter weights corresponding to these three parameters are a, b, and c, respectively. The calculation formula of the execution priority score (denoted as P) can be expressed as:

[0062] P = a×emergency identification parameter+b×(1 / execution time)+c×(1 / distance).

[0063] It can be understood that, the larger the execution priority score calculated by the above formula, the higher the execution priority of the task and the greater the possibility of being executed first.

[0064] As an example, the priority weight of each test task in the task queue may be determined based on the aforementioned task priority weight algorithm, thereby determining the execution priority of each test task.

[0065] Step 202: Based on the execution priority, obtain the test task with the highest execution priority from the task queue as the first task.

[0066] In this embodiment, after determining the execution priority of each test task in the task queue, the test tasks can be sorted in descending order of execution priority, and the test task with the highest execution priority is selected as the first task.

[0067] The method for executing test tasks in an embodiment of the present application first determines the execution priority of at least one test task in the task queue, and then obtains the test task with the highest execution priority from the task queue as the first task based on the execution priority. Thus, the first task obtained from the task queue is the test task with the highest execution priority, which can ensure that high-priority tasks can be responded to and processed quickly, and the speed at which urgent tasks are responded to can be increased as much as possible.

[0068] It can be understood that in the embodiment of the present application, the method of determining the first priority weight and the second priority weight is the same. The embodiment of the present application is described in detail using the determination of the first priority weight as an example.

[0069] In an optional embodiment of the present application, when determining the first priority weight corresponding to the first task, the reference distance between the current location of the smart mobile device and the first location can be determined first. The reference distance is the straight-line distance from the current location of the smart mobile device to the first location, which can be obtained by coordinate calculation; and based on the current planned path, the planned path distance from the current location of the smart mobile device to the first location is determined. The planned path distance is the actual distance that the smart mobile device moves from the current location to the first location according to the current planned path, which can help evaluate the smoothness and complexity of the path, thereby guiding path planning and optimization decisions. It can be understood that for the smart mobile device, the planned path distance from its current location to the first location is known.

[0070] Then, based on the reference distance and the planned path distance, the path curvature coefficient corresponding to the first task can be determined (for ease of description and distinction, referred to as the target path curvature coefficient). It should be noted that the path curvature coefficient can be defined and calculated in a variety of ways, depending on the application scenario or actual design needs, and this application does not limit this. For example, the path curvature coefficient can be calculated by dividing the planned path distance by the reference distance, that is, the path curvature coefficient = planned path distance / reference distance. Finally, the first priority weight corresponding to the first task is determined based on the target path curvature coefficient. For example, the obtained target path curvature coefficient can be determined as the first priority weight.

[0071] In an embodiment of the present application, by determining the baseline distance and planned path distance from the current location of the smart mobile device to the first location of the first test corresponding to the first task, the target path curvature coefficient is determined based on the baseline distance and the planned path distance, and then the priority weight is determined based on the target path curvature coefficient, so that the determination of the priority weight is integrated with the path curvature coefficient, and when new obstacles or environmental changes are detected, an obstacle avoidance path can be quickly generated through dynamic random sampling, supporting real-time path updates in complex scenarios and improving path effectiveness.

[0072] Furthermore, in an optional embodiment of the present disclosure, the first priority weight and the second priority weight may be determined based on the remaining delay time, path curvature coefficient and emergency identification parameter corresponding to the first task and the second task respectively. Figure 4 As shown, based on the above embodiment, determining the first priority weight corresponding to the first task may include the following sub-steps:

[0073] Step 301: Obtain a first weighting coefficient corresponding to the remaining delay time, a second weighting coefficient corresponding to the path curvature coefficient, and a third weighting coefficient corresponding to the emergency identification parameter.

[0074] It should be noted that, in this embodiment, the first weighting coefficient is a time-sensitive factor, which is used to give priority to time-sensitive tasks.

[0075] The second weighting coefficient is used to balance the stability and efficiency of the current state. If the load rate is too high, the weight needs to be reduced to prevent overload.

[0076] The third weighting coefficient is used to enforce the priority of emergency tasks and dominate the emergency response priority, which can be dynamically improved according to real-time risks (such as collision probability and island operation reliability).

[0077] In the embodiment of the present application, the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient can be obtained in a variety of ways, and the present application does not limit this. Generally, the third weighting coefficient> the first weighting coefficient> the second weighting coefficient> 0 to ensure that urgent tasks have a higher priority.

[0078] As an example, the first weighting coefficient, the second weighting coefficient and the third weighting coefficient may be manually set in advance based on operational experience, and may be adjusted according to actual needs.

[0079] As an example, the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient can be obtained through simulation experiment tuning and can be dynamically adjusted.

[0080] Step 302 : Determine a target remaining delay time corresponding to the first task based on the current time, the execution time of the first task, and the allowed delay time.

[0081] As an example, to calculate the target remaining delay time, the execution time of the first task and the allowed delay time can be summed, and then the sum can be subtracted from the current time. The formula for calculating the target remaining delay time is as follows:

[0082] T=t1+t2-t3

[0083] Among them, t1 is the execution time, t2 is the allowed delay time, and t3 is the current time.

[0084] Step 303 : Based on the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient, a weighted calculation is performed on the target remaining delay time, the target path bending coefficient, and the emergency identification parameter of the first task to obtain a first priority weight corresponding to the first task.

[0085] In this embodiment, based on the target remaining delay time, target path curvature coefficient, and emergency identification parameter corresponding to the first task, weighted calculation is performed using corresponding weighting coefficients to obtain the first priority weight of the first task.

[0086] In an optional implementation of the present application, the formula for the first priority weight is as follows:

[0087] Pk=α×Tremaining+β×(D current / D base )-γ×Semergency

[0088] Where Pk is the first priority weight, α, β, and γ are the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient, respectively. Tremaining is the target remaining delay time. (D current / D base ) is the target path curvature coefficient, D current is the planned path distance, D base is the benchmark distance, and Semergency is the emergency identification parameter of the first task. By setting the emergency identification parameter to be negatively correlated with the priority weight, it helps to meet the requirement of giving priority to the execution of emergency tasks.

[0089] The execution method of the test task of the embodiment of the present application obtains the first priority weight of the first task by performing weighted calculation based on the three dimensions of remaining delay time, path bending coefficient, and emergency identification parameter, which helps to improve the accuracy and rationality of the priority weight results. The integration of the path bending coefficient can quickly generate an obstacle avoidance path through dynamic random sampling when new obstacles or environmental changes are detected, support real-time path updates in complex scenarios, and improve path effectiveness.

[0090] In an optional implementation of the present application, the parameters of the path optimization cost function further include a collision cost and a time factor, wherein the time factor represents the time interval between the time when the task enters the task queue and the current time.

[0091] As an example, the collision cost can be determined by a collision weight factor and a collision cost. The collision weight factor is used to balance the contribution between the path cost and the collision cost. The collision cost is used to penalize collision behavior in the sequence to ensure safety in path planning or motion control. The values of the collision cost and the collision weight factor can be determined through simulation experiments or set through experience.

[0092] The interval is the length of time a task waits in the task queue, usually expressed as a time difference. The interval can be used to measure the waiting time of a task and is an important reference metric in task scheduling and priority calculation.

[0093] Thus, in an embodiment of the present application, when determining a first path optimization cost corresponding to a first task based on a first priority weight and a path cost for a smart mobile device to move from a current location to a first location, a collision cost and a time factor corresponding to the first task can be obtained. The time factor represents the time interval between the time when the first task enters the task queue and the current time. The path cost for the smart mobile device to move from the current location to the first location is also obtained. Furthermore, based on the first priority weight, the path cost, the collision cost, and the time factor, the first path optimization cost corresponding to the first task is determined. The priority weight, the path cost, and the collision cost are positively correlated with the path optimization cost, while the time factor is negatively correlated with the path optimization cost. The calculation rules for determining the path optimization cost based on these parameters can be predefined using a path optimization cost function. Substituting these parameters into the path optimization cost function yields the corresponding path optimization cost. Thus, substituting the relevant parameters of the first task into the path optimization cost function yields the first path optimization cost corresponding to the first task, and substituting the relevant parameters of the second task into the path optimization cost function yields the second path optimization cost corresponding to the second task.

[0094] In the embodiment of the present application, by introducing collision cost and time factor, the path optimization cost is determined in combination with the path cost and priority weight, so that the factors of multiple dimensions such as path cost, collision cost and time are comprehensively considered during path optimization, ensuring the rationality and accuracy of path optimization and helping to reduce path redundancy.

[0095] As an example, the mathematical formula of the path optimization cost function is as follows:

[0096]

[0097] in, It means accumulating the path cost at each moment in the sequence (k=1~n).

[0098] represents the path cost at time k, where P k and τ k is a parameter related to time k, P k represents the priority weight calculated at time k, τ k is the time scale, which indicates the time taken to move between nodes.

[0099] / / q k+1 -q k / / indicates the position q k To position q k+1 The distance or difference measure represents the length or change of the path.

[0100] q k : Path node coordinates.

[0101] λ·CollisionCost represents the collision cost, where λ is a collision weight factor used to balance the contribution between path cost and collision cost.

[0102] CollisionCost is a term representing the collision cost, which is used to penalize collision behaviors in a sequence to ensure safety in path planning or motion control.

[0103] T k : Time factor, which represents the time parameter value from the time the task enters the task queue to the current time.

[0104] It can be understood that in the process of calculating the path optimization cost, the corresponding priority weight will be calculated for each movement of the smart mobile device at each moment, and the path cost at that moment will be determined based on the priority weight at that moment, and then the path costs at each moment will be accumulated, and the path optimization cost will be determined by combining the collision cost and time factor.

[0105] Through the above-mentioned path optimization cost function, the priority weight and path cost are calculated at each moment, and then the path optimization cost value is determined. It can continuously iterate and optimize the path length, reduce the expansion of invalid nodes, and finally converge to the approximate optimal solution. It enhances the dynamic replanning capability of the algorithm and realizes incremental optimization. It is suitable for large-scale server cluster scenarios and can realize the optimization of multi-device operation paths in server testing scenarios.

[0106] This application integrates the task priority weight calculation model and the path optimization cost function to implement an improved rapid exploration random tree (Dynamic Priority RRT, DP-RRT) algorithm to calculate the path optimization cost value. The task priority weight Pk is embedded in the local path tree expansion stage. The path optimization cost function is called according to Pk to obtain the path optimization cost value, the global optimal path is screened, and the urgent task to be executed immediately is determined. Experimental verification results show that, by using the improved DP-RRT algorithm in the embodiment of this application, the planning time is shortened from 15 seconds to 4.2 seconds compared with the RRT algorithm in the related art, the path cost is reduced by 20%-40%, the path planning memory usage is reduced by 50%, the path redundancy rate is reduced from 37% to 12%, and, when the target point changes dynamically (such as mobile target tracking), the global path can be updated quickly to reduce redundant calculations. In addition, since the premise of the execution of the above algorithm is that the emergency identification parameter is the target value, that is, only the paths around the urgent task are dynamically adjusted, avoiding the waste of resources caused by global replanning.

[0107] In an optional embodiment of the present application, after the second task is interrupted, the second task is added to the task queue, and the memory state information of the second task when it was interrupted is saved, so that the memory can be restored based on the memory state information when the second task is executed. The memory state information when the second task was interrupted can be saved using memory snapshot technology. The memory state information stored in this storage method occupies a smaller storage space (usually no more than 50KB), so the recovery speed is faster.

[0108] It should be noted that the memory status information when the second task is interrupted may include a variety of data, such as the status of the process (such as register values, stack information), loaded modules or library files, data segments in memory (such as variable values, dynamically allocated data structures), system calls and network connection information, etc. This application does not impose any restrictions on this.

[0109] By saving the memory status information when the second task is interrupted, it is possible to quickly restore to the state when the second task is interrupted when it resumes execution, without having to start execution from the beginning of the second task. The recovery time is compressed to 0.2 seconds, ensuring seamless connection of the interrupted task, saving the cost of task execution, and increasing the system's mean time between failures (MTBF) from 2000 hours to 5000 hours, improving the system's continuous operation stability.

[0110] Taking the server as the test object, this solution is applied to the server test scenario as an example. Figure 5 The overall flow chart of the method for executing a test task provided by an exemplary embodiment of the present application is as follows: Figure 5As shown, step A: After the server test task is issued, it enters the task queue. Step B: For the task read from the task queue, the task monitoring device scans the emergency identification parameter (denoted as S) of the test task in real time. When S=1 is detected, the preemptive interrupt mechanism is triggered, and the task priority weight algorithm and path optimization cost function described in the above embodiment are called to calculate the path optimization cost value (steps C→E→F); otherwise, step D is executed: executing the current task. Steps C, E, and F: Using the improved DP-RRT algorithm, the task priority weight Pk is embedded in the local path tree expansion phase. The path optimization cost function is called according to Pk to obtain the path optimization cost value J, and the global optimal path is selected (determining the urgent task to be executed immediately). Step G: When the J value of the test task read from the task queue is less than the J value of the currently executed task, the currently executed task is interrupted, the read test task is executed, and the smart mobile device is called to perform the server test operation steps (lighting, plugging and unplugging, etc.), which improves the task execution efficiency by 68%. Step H: When the currently executed task is interrupted, the state of the original task (the interrupted task) is saved through lightweight memory snapshot technology. Step I: Continue to obtain test tasks to be executed from the task queue until there are no tasks in the task queue.

[0111] Through the solution of this application, a dynamic priority weight model is used to achieve instant preemption of low-priority tasks by high-priority tasks, and the scheduling response delay is compressed to the millisecond level. Combined with the asymptotically optimal path generation characteristics of the improved DP-RRT algorithm, a new path is quickly generated after the task is preempted, ensuring that the path length converges to more than 95% of the optimal solution. Preemptive scheduling dynamically allocates CPU computing power through a dynamic priority weight model to avoid inefficient tasks occupying resources, improves CPU core utilization by 25%, and the average number of operations per day reaches 2,100 times. The coupling mechanism of dynamic priority scheduling and path planning (DP-RRT algorithm) provided by this solution can adaptively perform random sampling and step size adjustment, dynamically adjust the random sampling step size of the algorithm according to the obstacle density, reduce the number of iterations and improve path generation efficiency.

[0112] It should be noted that the idea of DP-RRT algorithm fusion in this solution is not limited to the testing field, but can also be used in other fields. A simple example is as follows:

[0113] In the field of smart cities, the dynamic scheduling algorithm in this application scheme and the multi-field collaborative approach can be used to achieve smart city traffic signal optimization, combine the dynamic priority preemptive scheduling mechanism with the traffic flow prediction model, realize dynamic timing of traffic lights, and alleviate congestion.

[0114] In the medical field, the dynamic scheduling algorithm in this application can be used to achieve intelligent allocation of medical resources. Based on the deep learning dynamic priority task scheduling algorithm, combined with the real-time needs of the hospital (such as emergency surgery and equipment occupancy rate), the dynamic allocation of operating room and bed resources is optimized, and the response time is compressed to seconds.

[0115] In the field of modern agriculture, the idea of optimizing paths by using the path optimization cost in this application scheme can be used to realize drone logistics and agricultural automation. By integrating the efficient path generation capability of the RRT algorithm with the dynamic obstacle avoidance characteristics of the D algorithm, a drone / robot path planning system suitable for intensive orchard spraying or warehouse cargo handling can be developed to reduce path redundancy.

[0116] In the field of disaster relief, the idea of optimizing the path by using the path optimization cost in this application scheme can be used to achieve collaborative path planning for disaster rescue. By combining the multi-machine collaborative routing framework with the improved artificial potential field method, the collaborative search and material delivery paths of multiple rescue robots can be designed, supporting real-time replanning in scenarios with dynamic obstacles (such as collapsed buildings).

[0117] However, it is understandable that the parameters required for algorithms in different fields are different, and the specific parameters can be selected according to actual needs. This application does not provide detailed explanations.

[0118] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0119] An embodiment of the present application further provides a device for executing a test task, which can be implemented in software and / or hardware and can be integrated into an electronic device.

[0120] Figure 6 A schematic diagram of a test task execution device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the test task execution device 60 includes: a task acquisition module 610 , a weight calculation module 620 , a cost calculation module 630 and a task execution module 640 .

[0121] The task acquisition module 610 is configured to acquire a first task from a task queue, where the first task carries an emergency identification parameter.

[0122] a weight calculation module 620 for determining, when the emergency identification parameter is a target value, a first priority weight corresponding to the first task based on a first position of a first test object corresponding to the first task, and a second priority weight corresponding to the second task based on a second position of a second test object corresponding to the currently executed second task;

[0123] a cost calculation module 630 configured to determine a first path optimization cost corresponding to the first task based on the first priority weight and the path cost of the smart mobile device moving from the current location to the first location, and to determine a second path optimization cost corresponding to the second task based on the second priority weight and the path cost of the smart mobile device moving from the current location to the second location, wherein the path optimization cost is positively correlated with the priority weight;

[0124] The task execution module 640 is configured to interrupt the second task if the first path optimization cost is less than the second path optimization cost, and call the smart mobile device to perform a test operation on the first test object based on the first task.

[0125] Optionally, the task acquisition module 610 is further configured to: determine an execution priority of at least one test task in the task queue; and based on the execution priority, acquire the test task with the highest execution priority from the task queue as the first task.

[0126] Optionally, the weight calculation module 620 is also used to: determine a reference distance between the current location of the smart mobile device and the first location; determine the planned path distance from the current location of the smart mobile device to the first location based on the current planned path; determine the target path bending coefficient corresponding to the first task based on the reference distance and the planned path distance; and determine the first priority weight corresponding to the first task based on the target path bending coefficient.

[0127] Optionally, the weight calculation module 620 is also used to: obtain a first weighting coefficient corresponding to the remaining delay time, a second weighting coefficient corresponding to the path bending coefficient, and a third weighting coefficient corresponding to the emergency identification parameter; determine the target remaining delay time corresponding to the first task based on the current time, the execution time of the first task, and the allowed delay time; and perform weighted calculation on the target remaining delay time, the target path bending coefficient, and the emergency identification parameter of the first task based on the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient to obtain a first priority weight corresponding to the first task.

[0128] Optionally, the cost calculation module 630 is also used to: obtain the collision cost and the time factor corresponding to the first task, the time factor representing the time interval between the moment when the first task enters the task queue and the current moment; obtain the path cost of the smart mobile device moving from the current position to the first position; and determine the first path optimization cost value corresponding to the first task based on the first priority weight, path cost, collision cost and time factor.

[0129] Optionally, the task execution module 640 is further configured to: when the first path optimization cost is not less than the second path optimization cost, continue to execute the second task and add the first task to the task queue.

[0130] Optionally, the test task execution device 60 further includes:

[0131] The interruption storage module is used to add the second task to the task queue after interrupting the second task, and save the memory state information when the second task is interrupted, so as to perform memory recovery based on the memory state information when the second task is executed.

[0132] For the description of the features in the embodiment corresponding to the test task execution device, please refer to the relevant description of the embodiment corresponding to the test task execution method, which will not be repeated here.

[0133] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in the embodiment of the execution method of any of the above-mentioned test tasks.

[0134] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned execution method embodiments of the test task when running.

[0135] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0136] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the embodiment of the execution method of any of the above-mentioned test tasks are implemented.

[0137] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in the execution method embodiment of any of the above-mentioned test tasks.

[0138] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0139] The above is a detailed introduction to the execution method, device, electronic device and storage medium of a test task provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A method for executing a test task, characterized in that: include: Obtaining a first task from a task queue, where the first task carries an urgent identification parameter; When the emergency identification parameter is a target value, determining a first priority weight corresponding to the first task based on a first position of a first test object corresponding to the first task, and determining a second priority weight corresponding to a second task currently being executed based on a second position of a second test object corresponding to the second task; determining a first path optimization cost value corresponding to the first task based on the first priority weight and a path cost of the smart mobile device moving from the current location to the first location, and determining a second path optimization cost value corresponding to the second task based on the second priority weight and a path cost of the smart mobile device moving from the current location to the second location, wherein the path optimization cost value is positively correlated with the priority weight; When the first path optimization cost value is less than the second path optimization cost value, the second task is interrupted, and the smart mobile device is called to perform a test operation on the first test object based on the first task.

2. The method for executing a test task according to claim 1, wherein: The obtaining of the first task from the task queue includes: Determining an execution priority of at least one test task in the task queue; Based on the execution priority, a test task with the highest execution priority is obtained from the task queue as the first task.

3. The method for executing a test task according to claim 1, wherein: The determining a first priority weight corresponding to the first task based on a first position of a first test object corresponding to the first task includes: Determine a reference distance between the current location of the smart mobile device and the first location; Determining a planned path distance from the current location of the smart mobile device to the first location based on the current planned path; determining a target path curvature coefficient corresponding to the first task based on the reference distance and the planned path distance; A first priority weight corresponding to the first task is determined based on the target path curvature coefficient.

4. The method for executing a test task according to claim 3, wherein: The determining a first priority weight corresponding to the first task based on the path curvature coefficient includes: Obtaining a first weighting coefficient corresponding to the remaining delay time, a second weighting coefficient corresponding to the path curvature coefficient, and a third weighting coefficient corresponding to the emergency identification parameter; Determining a target remaining delay time corresponding to the first task based on the current time, the execution time of the first task, and the allowed delay time; Based on the first weighting coefficient, the second weighting coefficient, and the third weighting coefficient, a weighted calculation is performed on the target remaining delay time, the target path bending coefficient, and the emergency identification parameter of the first task to obtain a first priority weight corresponding to the first task.

5. The method for executing a test task according to claim 1, wherein: The determining a first path optimization cost corresponding to the first task based on the first priority weight and a path cost of the smart mobile device moving from a current location to the first location includes: Obtaining a collision cost and a time factor corresponding to the first task, where the time factor represents a time interval between a moment when the first task enters the task queue and a current moment; Obtaining a path cost for the smart mobile device to move from a current location to the first location; A first path optimization cost value corresponding to the first task is determined based on the first priority weight, the path cost, the collision cost, and the time factor.

6. The method for executing a test task according to claim 1, wherein: The method further comprises: When the first path optimization cost value is not less than the second path optimization cost value, the second task continues to be executed, and the first task is added to the task queue.

7. The method for executing a test task according to claim 1, wherein: The method further comprises: After the second task is interrupted, the second task is added to the task queue, and memory status information of the second task when it is interrupted is saved, so as to perform memory recovery based on the memory status information when the second task is executed.

8. A device for executing a test task, characterized in that: include: A task acquisition module, configured to acquire a first task from a task queue, wherein the first task carries an emergency identification parameter; a weight calculation module, configured to determine, when the emergency identification parameter is a target value, a first priority weight corresponding to the first task based on a first position of a first test object corresponding to the first task, and to determine a second priority weight corresponding to a second task currently being executed based on a second position of a second test object corresponding to the second task; a cost calculation module, configured to determine a first path optimization cost value corresponding to the first task based on the first priority weight and a path cost of the smart mobile device moving from the current location to the first location, and to determine a second path optimization cost value corresponding to the second task based on the second priority weight and the path cost of the smart mobile device moving from the current location to the second location, wherein the path optimization cost value is positively correlated with the priority weight; The task execution module is configured to interrupt the second task when the first path optimization cost is less than the second path optimization cost, and call the smart mobile device to perform a test operation on the first test object based on the first task.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for executing a test task as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method for executing the test task according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Task interruption processing method of patrol robot and related equipment

    CN122018562A