Method and apparatus for performing test tasks, electronic device

By coordinating management through cloud and edge devices, the system automates the execution of in-vehicle Ethernet testing tasks, solving the problems of low efficiency and poor traceability caused by manual operation, and achieving an efficient and reliable testing process.

CN122457526APending Publication Date: 2026-07-24CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA FAW CO LTD
Filing Date
2026-04-27
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In vehicle Ethernet testing, test tasks rely on manual operation, resulting in low efficiency and poor process traceability.

Method used

By collaborating between cloud and edge devices, test tasks are automatically matched and managed. Test records stored in the cloud are used to identify task types, and edge devices are dynamically allocated in the local area network to execute test tasks. Task migration and status detection are supported to achieve automated execution.

Benefits of technology

It improves the efficiency of test task execution, ensures the traceability of the test process and the efficient utilization of edge devices, and reduces resource consumption and execution time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122457526A_ABST
    Figure CN122457526A_ABST
Patent Text Reader

Abstract

The application discloses a method and device for executing a test task, and an electronic device. The method comprises: receiving a test task to be executed; determining the type of the test task to be executed according to a test record stored in the cloud; in the case of a new task, matching a first target edge device for each new task among a plurality of edge devices deployed in a test network; in the case of an incremental task, matching a second target edge device for the incremental task according to the test record; detecting a first execution state of each first target edge device executing the new task, determining whether to migrate the new task according to the first execution state, and detecting a second execution state of each second target edge device executing the incremental task, determining whether to migrate the incremental task according to the second execution state, until the test task to be executed is completed. The application solves the technical problem of executing a test task by relying on manual operation in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automated testing technology, and more specifically, to a method, apparatus, and electronic device for performing testing tasks. Background Technology

[0002] In related technologies, automotive Ethernet testing generally adopts a local stand-alone mode, where test engineers manually write test cases, execute test tasks in a local test cabinet, and then manually upload test reports. The entire test task execution relies on manual operation, which results in low test task execution efficiency and poor traceability of the test process.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides a method, apparatus, and electronic device for performing test tasks, so as to at least solve the technical problem of relying on manual operation to perform test tasks in related technologies.

[0005] According to one aspect of the embodiments of this application, a method for executing a test task is provided, comprising: receiving test tasks to be executed, wherein each test task to be executed contains at least one test case; determining the type of the test task to be executed based on test records stored in the cloud, wherein the type of the test task to be executed includes: a new task not recorded in the test records, and an incremental task containing target test cases, wherein the target test cases include: test cases marked as execution failure in the test records; in the case of a new task, matching a first target edge device for each new task among multiple edge devices deployed in a test network, wherein the test network is a local area network to which the cloud belongs; in the case of an incremental task, matching a second target edge device for the incremental task based on the test records; detecting a first execution state of each first target edge device executing a new task, determining whether to migrate the new task based on the first execution state, and detecting a second execution state of each second target edge device executing an incremental task, determining whether to migrate the incremental task based on the second execution state, until the test task to be executed is completed.

[0006] Optionally, the type of test task to be executed is determined based on the test records stored in the cloud, including: comparing the first version information of each test task to be executed with the second version information stored in the cloud to obtain a comparison result, wherein the first version information is determined based on the test cases, and the second version information is determined based on the historical test cases contained in the test records; if the comparison result indicates that there is no first type of information in the first version information that is the same as the second version information, the type of test task to be executed is determined as a new task; if the comparison result indicates that the first version information stores both first type of information and second type of information that is different from the second version information, the type of test task to be executed is determined as an incremental task; if the comparison result indicates that there is only first type of information in the first version information, the execution result of each historical test case recorded in the test records is extracted, and if the execution result includes execution failure, the type of test task to be executed is determined as an incremental task.

[0007] Optionally, matching a first target edge device for each new task among multiple edge devices deployed in the test network includes: determining the load information of each edge device, wherein the edge device is a device deployed at the network edge of the test network and used to provide computing resources, and the load information includes: computing resource utilization rate and the proportion of tasks to be executed; determining the idle computing resource ratio of each edge device based on the load information of each edge device, and determining a first matching order for multiple edge devices in descending order of idle computing resource ratio; determining a second matching order for multiple new tasks in descending order of priority, wherein the priority is used to indicate the order in which the first target edge devices are matched for multiple new tasks; determining a target first matching order and a target second matching order that indicate the same matching order, and determining the edge device corresponding to the target first matching order as the first target edge device for the new task corresponding to the target first matching order.

[0008] Optionally, matching a second target edge device for an incremental task based on test records includes: for each incremental task, identifying the historical edge device that last executed the incremental task in the test records; and identifying the historical edge device as the second target edge device.

[0009] Optionally, before detecting the second execution state of each second target edge device executing the incremental task, the method further includes: identifying test cases marked as execution failures and new test cases from the multiple test cases included in the incremental task as incremental test cases, wherein the new test cases are test cases not included in the historical execution record of the incremental task; and distributing the incremental test cases to the second target edge devices, wherein the state of the second target edge devices executing each incremental test case is the second execution state.

[0010] Optionally, determining whether to migrate a new task based on the first execution state includes: if the first execution state is interrupted, determining to migrate a new task; wherein, if it is determined to migrate a new task, a first new edge device is matched for each new task, and the execution record of the new task is migrated to the first new edge device. After the first new edge device restores the execution progress of the new task according to the execution record, it continues to execute the new task.

[0011] Optionally, determining whether to migrate incremental tasks based on the second execution state further includes: determining whether to migrate incremental tasks based on the second execution state, including: determining to migrate incremental tasks when the second execution state is interrupted; wherein, when it is determined to migrate incremental tasks, a second new edge device is matched for each incremental task, the execution record of the incremental task is migrated to the second new edge device, and the second new edge device resumes the execution progress of the incremental task based on the execution record and continues to execute the incremental task.

[0012] According to another aspect of the embodiments of this application, an apparatus for executing test tasks is also provided, comprising: a receiving module for receiving test tasks to be executed, wherein each test task to be executed contains at least one test case; a determining module for determining the type of test task to be executed based on test records stored in the cloud, wherein the type of test task to be executed includes: a new task not recorded in the test records, and an incremental task containing target test cases, wherein the target test cases include: test cases marked as execution failure in the test records; a first matching module for matching a first target edge device among multiple edge devices deployed in a test network for each new task, wherein the test network is a local area network to which the cloud belongs; a second matching module for matching a second target edge device for the incremental task based on the test records; and a detection module for detecting a first execution state of each first target edge device executing a new task, determining whether to migrate the new task based on the first execution state, and detecting a second execution state of each second target edge device executing an incremental task, determining whether to migrate the incremental task based on the second execution state, until the test task to be executed is completed.

[0013] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described method for performing test tasks through the computer program.

[0014] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions, which, when executed by a processor, implement the steps of the method for performing the test task described above.

[0015] In this embodiment, a method is adopted to receive test tasks to be executed, wherein each test task to be executed contains at least one test case; the type of test task to be executed is determined according to the test records stored in the cloud, wherein the type of test task to be executed includes: new tasks not recorded in the test records, and incremental tasks containing target test cases, wherein the target test cases include: test cases marked as execution failure in the test records; in the case of a new task, a first target edge device is matched for each new task among multiple edge devices deployed in the test network, wherein the test network is the local area network to which the cloud belongs; in the case of an incremental task, a second target edge device is matched for the incremental task according to the test records; the first execution state of each first target edge device executing the new task is detected, and whether to migrate the new task is determined according to the first execution state; and the second execution state of each second target edge device executing the incremental task is detected, and whether to migrate the incremental task is determined according to the second execution state, until the test task to be executed is completed. Through the collaboration of the cloud and edge devices, the purpose of automatically matching the edge device to execute the test task is achieved, realizing the technical effect of automating the execution of test tasks and improving the execution efficiency of test tasks, thereby solving the technical problem of relying on manual operation to execute test tasks in related technologies. Attached Figure Description

[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0017] Figure 1 This is a hardware structure block diagram of a computer terminal for implementing a method for performing a test task according to an embodiment of this application;

[0018] Figure 2 This is a flowchart illustrating the steps of a method for performing a test task according to an embodiment of this application;

[0019] Figure 3 This is a structural diagram of an apparatus for performing a test task according to an embodiment of this application;

[0020] Figure 4 This is a flowchart of an apparatus for performing a test task according to an embodiment of this application;

[0021] Figure 5 This is an architecture diagram of a system for automatically executing test tasks according to an embodiment of this application. Detailed Implementation

[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0024] To better understand the embodiments of this application, the technical terms involved in the embodiments of this application are explained below:

[0025] In-vehicle Ethernet testing: Testing of the communication network built on Ethernet technology inside a vehicle and its associated electronic control unit (ECU) functions, communication protocols, real-time performance, reliability, and safety.

[0026] Test case: A complete description of a specific set of operational steps, input conditions, expected results, and execution environment designed to verify whether a particular function or behavior meets expectations.

[0027] In related technologies, automotive Ethernet test tasks are manually written and executed by engineers using local automotive electronic system development and testing tools, and the test results are manually uploaded to the system. That is, in related technologies, the scheduling, execution, and report feedback of test tasks operate in isolation, without system-level collaboration. Therefore, problems such as fragmented test processes, low collaboration efficiency, and difficulty in traceability of results exist. To solve the above problems, this application provides relevant solutions, which are described in detail below.

[0028] According to an embodiment of this application, a method embodiment for performing a test task is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0029] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal for implementing a method for performing test tasks is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0030] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as processor control (e.g., selection of a variable resistor termination path connected to an interface).

[0031] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method of executing test tasks in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned method of executing test tasks. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0032] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0033] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.

[0034] This application provides a method for executing test tasks that can run in the above-described operating environment. Figure 2 This is a flowchart of the steps of the method for performing a test task provided in an embodiment of this application, as follows: Figure 2 As shown, the method includes the following steps:

[0035] Step S202: Receive test tasks to be executed, wherein each test task to be executed contains at least one test case.

[0036] This application provides a method for automatically executing test tasks collaboratively by cloud and edge devices. The cloud refers to a software platform system with capabilities for task orchestration, intelligent scheduling, status monitoring, and data closure. The cloud receives and parses test tasks, allocates corresponding edge devices to the test tasks to complete the scheduling of test tasks, and the edge devices execute the received test tasks. In step S202, the cloud receives the test tasks uploaded by the user terminal through an interaction interface with the user terminal. The interaction interface between the cloud and the user terminal can be a RESTful network interface following the Representational State Transfer (REST) ​​architectural style. The test tasks to be executed can be test tasks for automotive Ethernet testing. Each test task to be executed includes at least one test case, and each test case is the smallest test unit.

[0037] Step S204: Determine the type of test task to be executed based on the test records stored in the cloud. The types of test tasks to be executed include: new tasks not recorded in the test records and incremental tasks containing target test cases. Target test cases include: test cases marked as execution failure in the test records.

[0038] In step S204, the cloud determines the type of the test task to be executed received in step S202 based on the stored test records. The test records are used to record multiple historical test tasks and the execution results of multiple historical test cases. Historical test tasks are those received before the test task to be executed is received, and historical test cases are those included in the historical test tasks. If the test task to be executed is not recorded in the test records, it indicates that the test task to be executed is a new task that has not been executed before. If the test task to be executed contains a test case marked as failed in the test records (i.e., the target test case), then the test task to be executed is determined to be an incremental task.

[0039] Optionally, the type of test task to be executed is determined based on the test records stored in the cloud, including: comparing the first version information of each test task to be executed with the second version information stored in the cloud to obtain a comparison result, wherein the first version information is determined based on the test cases, and the second version information is determined based on the historical test cases contained in the test records; if the comparison result indicates that there is no first type of information in the first version information that is the same as the second version information, the type of test task to be executed is determined as a new task; if the comparison result indicates that the first version information stores both first type of information and second type of information that is different from the second version information, the type of test task to be executed is determined as an incremental task; if the comparison result indicates that there is only first type of information in the first version information, the execution result of each historical test case recorded in the test records is extracted, and if the execution result includes execution failure, the type of test task to be executed is determined as an incremental task.

[0040] As mentioned in step S204, after receiving the test task, the cloud determines the type of the test task to be executed based on the test records stored in the cloud. Specifically, in this embodiment, it first determines whether the test task to be executed contains the executed test task by comparing the version information of the test task to be executed (i.e., the first version information) and the version information of the executed test task (i.e., the second version information). Then, it further determines the type of the test task to be executed based on the comparison result. The version information of the test task to be executed (i.e., the first version information) and the version information of the executed test task (i.e., the second version information) can be in the form of hash value sequences. The first hash value sequence corresponding to the first version information is generated based on all test cases recorded in the test task to be executed, with each test case generating one hash value in the first hash value sequence. The second hash value sequence corresponding to the second version information is generated based on all historical test cases recorded in the executed test task, with each historical test case generating one hash value in the second hash value sequence. The executed test task is the test task recorded in the test records.

[0041] In this embodiment, when determining the type of the test task to be executed based on the comparison results, the following situations apply: First, if the comparison results indicate that the first version information and the second version information are completely different, then the type of the test task to be executed is determined to be a new task. Second, if the comparison results indicate that the first version information contains both information identical to the second version information (i.e., first-type information) and information different from the second version information (i.e., second-type information), this means that the test task to be executed contains both previously executed test cases (corresponding to first-type information) and newly added or modified test cases (corresponding to second-type information). In this case, the type of the test task to be executed is determined to be an incremental task. Another scenario is that all the information recorded in the first version of the information can be found in the second version of the information (i.e., the first type of information). This indicates that the test cases in the test task to be executed are all test cases that have been executed before (i.e., historical test cases). In this case, the execution results of each historical test case contained in the test task to be executed are further obtained from the test records. If the historical test cases contained in the test task to be executed include test cases that failed to execute previously, the test task to be executed is also determined to be an incremental task. Otherwise, if all the test cases contained in the test task to be executed are historical test cases and the execution results are all successful, it is determined to be a duplicate submission test task, and the cloud will not allocate edge devices for such duplicate submission test tasks.

[0042] The method provided in this embodiment intelligently identifies new tasks, newly added test cases, and failed retry test cases by combining the version information of the test task and the execution results of the test cases. Through the method provided in this embodiment, an accurate basis can be provided for the subsequent allocation of edge devices, and the technical effect of precise scheduling of computing resources can be achieved.

[0043] Step S206: In the case of a new task, a first target edge device is matched for each new task among multiple edge devices deployed in the test network, wherein the test network is the local area network to which the cloud belongs.

[0044] After determining the type of test task to be executed in step S204, different device matching methods are used for different types of test tasks to be executed. The device matching method is used to match edge devices for the test tasks to be executed. In this embodiment, the edge device is a device deployed at the edge of the test network and used to provide computing resources. The computing resources are used to execute the test tasks to be executed. For example, the edge device may be a test cabinet deployed at the edge of the test network, and the test network may be a local area network or a dedicated Ethernet interconnected with the cloud.

[0045] For example, in step S206, the first type of device matching method is used to match the edge device (i.e. the first target edge device) for executing the test task that is determined to be a new task. The first type of device matching method matches the edge device (i.e. the first target edge device) for executing the test cases contained therein for each new task based on the real-time load information of multiple edge devices deployed in the test network.

[0046] Optionally, matching a first target edge device for each new task among multiple edge devices deployed in the test network includes: determining the load information of each edge device, wherein the edge device is a device deployed at the network edge of the test network and used to provide computing resources, and the load information includes: computing resource utilization rate and the proportion of tasks to be executed; determining the idle computing resource ratio of each edge device based on the load information of each edge device, and determining a first matching order for multiple edge devices in descending order of idle computing resource ratio; determining a second matching order for multiple new tasks in descending order of priority, wherein the priority is used to indicate the order in which the first target edge devices are matched for multiple new tasks; determining a target first matching order and a target second matching order that indicate the same matching order, and determining the edge device corresponding to the target first matching order as the first target edge device for the new task corresponding to the target first matching order.

[0047] In step S206, when allocating the edge device (i.e. the first target edge device) to execute the test cases contained in each new task according to the edge devices included in the test network, it is necessary to consider the priority of each new task and the load information of each edge device deployed in the test network at the same time. The priority is used to determine the order of matching the first target edge device for multiple new tasks, and the load information is used to determine the available computing resources of the edge device.

[0048] In this embodiment, when matching edge devices for new tasks, the cloud acquires the load information of each edge device in real time and determines the proportion of idle computing resources of the edge devices based on the load information. The acquired load information includes: the current utilization rate of the central processing unit (CPU) (i.e., computing resource utilization rate), the utilization rate of the Ethernet channels used to send test tasks to the edge devices, and the proportion (or number) of test tasks already allocated to edge devices but not yet executed (i.e., test tasks to be executed). Subsequently, all edge devices are sorted from high to low according to their idle computing resource proportions to obtain a device priority queue. The order of the edge devices in the device priority queue is determined as the matching order of the edge devices (i.e., the first matching order). Simultaneously, multiple new tasks are sorted according to their priority to obtain a task priority queue. The order of new tasks in the task priority queue is the matching order (i.e., the second matching order). The priority of the new task is information carried by the new task and can be set when submitting the test task. In this embodiment, new tasks with higher priority will be matched with the target edge devices earlier. For example, if the priority of new task 1 is P1, the priority of new task 2 is P2, and the priority of new task 3 is P3, and P1>P2>P3, then the first edge device matched is new task 1, the second is new task 2, and the third is new task 3. Since the device priority queue is arranged in descending order of available computing resources, in this embodiment, the two queues are matched one-to-one. The edge devices and new tasks indicated by the device matching order and task matching order (i.e., the target first matching order and the target second matching order) are matched to ensure that the highest priority task is assigned to the rack with the most available resources, the second highest priority task is assigned to the second highest priority rack, and so on, ensuring that high-priority tasks get the best resources first.

[0049] The method in this embodiment achieves efficient scheduling and load balancing of test resources through a load-aware and priority-driven dynamic matching mechanism, which improves the utilization of edge devices and ensures that higher-priority critical test tasks are executed in a timely manner.

[0050] Step S208: In the case of an incremental task, match the second target edge device for the incremental task based on the test records.

[0051] In step S208, the second type of device matching method is used to match the edge device (i.e. the second target edge device) for executing the incremental task to the test task to be determined as an incremental task. The second type of device matching method matches the edge device (i.e. the second target edge device) for executing the test cases contained therein for each incremental task based on the test records stored in the cloud.

[0052] According to some optional embodiments of this application, matching a second target edge device for an incremental task based on test records includes: for each incremental task, determining the historical edge device that last executed the incremental task in the test records; and determining the historical edge device as the second target edge device.

[0053] When an incremental task includes both historical test cases marked as failed (i.e., target test cases) and newly added test cases, the cloud can query the test records for the historical edge device that last executed the target test case and determine it as the edge device for executing the incremental task this time (i.e., the second target edge device). Alternatively, it can query the test records for the historical edge device that last executed the incremental task and determine it as the edge device for executing the incremental task this time (i.e., the second target edge device). In this embodiment, multiple test cases in a test task are executed by one edge device; therefore, the second target edge device determined by the two methods described above is the same.

[0054] Even if the incremental task does not include the target test case, but only includes historical test cases marked as successfully executed and newly added test cases, it is still possible to query the historical edge device that last executed the incremental task in the test record based on the identification information of the incremental task and the identification information of the historical test cases that were successfully executed, and identify it as the edge device for executing the incremental task this time (i.e., the second target edge device).

[0055] The method provided in this embodiment assigns incremental test tasks containing executed test cases to edge devices that have already executed the test cases they contain. This allows for the reuse of loaded test projects, cached data, and runtime contexts, avoiding repeated sample writing, environment re-initialization, and complete test case re-downloading. This improves the speed of test task execution and saves the computing resources consumed in executing test tasks.

[0056] Step S210: Detect the first execution state of each first target edge device executing a new task, and determine whether to migrate the new task based on the first execution state; and detect the second execution state of each second target edge device executing an incremental task, and determine whether to migrate the incremental task based on the second execution state, until the test task to be executed is completed.

[0057] After matching the corresponding edge device for the test task to be executed using the method provided in the above embodiments, during the execution of the test task assigned to it by the edge device, it is determined whether there is a test task to be executed that needs to be migrated based on the task execution status reported by each edge device. Specifically, when any edge device is detected to be interrupted, the test task to be executed by the interrupted edge device is migrated to the edge device that is not currently executing any test task. In this embodiment, the status of multiple edge devices executing test tasks can be detected at the same time.

[0058] For example, in step S210, if the test tasks to be executed received in step S202 include both new tasks and incremental tasks, the execution status of the edge device executing the new task (i.e., the first target edge device) and the edge device executing the incremental task (i.e., the second target edge device) are simultaneously detected. The aforementioned execution interruption may be caused by a network interruption or a hardware failure. In the method provided in this application embodiment, when all test tasks to be executed received in step S202 have been completed, the detection of edge device task execution is stopped. After the edge device completes the test task execution, it automatically generates a standardized test report and sends the standardized test report back to the user terminal through the interaction interface mentioned in step S202. The user terminal is the terminal used to receive the test tasks to be executed in step S202.

[0059] According to some optional embodiments of this application, before detecting the second execution state of each second target edge device executing the incremental task, the method further includes: identifying test cases marked as execution failure and new test cases from the multiple test cases included in the incremental task as incremental test cases, wherein the new test cases are test cases not included in the historical execution record of the incremental task; and distributing the incremental test cases to the second target edge devices, wherein the state of the second target edge devices executing each incremental test case is the second execution state.

[0060] In the solution provided in this application embodiment, for a new task, all test cases it contains are distributed to the matching edge device (i.e., the first target edge device); while for an incremental task, only the incremental test cases are distributed to the matching edge device (i.e., the second target edge device). New test cases and historical test cases marked as failed are both considered incremental test cases. Therefore, in this embodiment, before distributing the incremental task to the matching edge device (i.e., the second target edge device), the cloud first filters two types of key test cases from all the test cases contained in the incremental task: one type is test cases explicitly marked as having failed execution results in historical execution records, and the other type is new test cases not recorded in the test records; subsequently, only these two types of incremental test cases and their dependent modified code snippets are distributed to the designated second target edge device. Therefore, when the second target edge device executes the incremental test task, it only loads and executes these incremental items, skipping test cases that have been successfully run and have not been changed, and its execution status (such as successful execution, failed execution, timeout) is transmitted back in real time as the second execution status.

[0061] The method provided in this embodiment only issues incremental test cases, which reduces the resource consumption at the edge and shortens the execution time of test tasks, thereby improving the efficiency of test task execution.

[0062] According to some optional embodiments of this application, determining whether to migrate a new task based on a first execution state includes: determining to migrate a new task when the first execution state is interrupted; wherein, when it is determined to migrate a new task, a first new edge device is matched for each new task, and the execution record of the new task is migrated to the first new edge device, and the first new edge device resumes the execution progress of the new task based on the execution record and continues to execute the new task.

[0063] The method provided in this application supports context retention and migration after task interruption. Specifically, as mentioned in step S210, after the test task to be executed is sent to the corresponding edge device, when the test task is executed on the edge device, the method provided in this application will detect the status of the test task to be executed to determine whether to migrate the test task sent to the edge device. The above-mentioned task migration method is applicable to both new tasks and incremental tasks. If there are multiple test tasks to be executed received in step S202, and they include both new tasks and incremental tasks, then the status of the edge device executing the new task (i.e., the first target edge device) executing the new task (i.e., the first execution status) and the status of the edge device executing the incremental task (i.e., the second target edge device) executing the incremental task (i.e., the second execution status) are detected simultaneously.

[0064] In this embodiment, when it is detected that the execution of a new task issued by the cloud to the first target edge device is interrupted due to network disconnection, device crash, or abnormal execution process, the cloud will automatically execute a task migration process. Specifically, the cloud will select a currently idle edge device from among the multiple edge devices deployed in the test network as the migration target (i.e., the first new edge device), and migrate the interrupted new task and the test tasks to be executed on that edge device to the determined migration target (i.e., the first new edge device). During the migration process, for the interrupted new task, the context of the task (i.e., the execution record) is completely migrated and injected into the migration target (i.e., the first new edge device). Therefore, when the migration target (i.e., the first new edge device) executes the previously interrupted new task, it can resume execution from the point of interruption without starting from the beginning. The context (i.e., the execution record) of the task that is migrated simultaneously with the new task records the number of the completed test case, the execution progress of the test case being executed at the time of interruption, the message logs collected during the execution of the task, the status snapshot of the vehicle electronic control unit (ECU), and parameter configurations, etc.

[0065] The method provided in this embodiment migrates the test task and its execution record together when migrating the test task, realizing seamless fault-tolerant migration of the test task when the edge node fails, and improving the stability of the automated test system.

[0066] According to some optional embodiments of this application, determining whether to migrate incremental tasks based on the second execution state further includes: determining whether to migrate incremental tasks based on the second execution state, including: determining to migrate incremental tasks when the second execution state is interrupted; wherein, when it is determined to migrate incremental tasks, a second new edge device is matched for each incremental task, the execution record of the incremental task is migrated to the second new edge device, and after the second new edge device restores the execution progress of the incremental task according to the execution record, it continues to execute the incremental task.

[0067] As mentioned in the above embodiments, if there are multiple test tasks to be executed received in step S202, and both new tasks and incremental tasks are included, then the state of the edge device executing the new task (i.e., the first target edge device) (i.e., the first execution state) and the state of the edge device executing the incremental task (i.e., the second target edge device) (i.e., the second execution state) are detected simultaneously.

[0068] In this embodiment, for incremental tasks, when an execution interruption is detected in the edge device (i.e., the second target edge device) executing the incremental task, the cloud, based on the uploaded execution records (including the identifiers of the test cases already executed in this incremental task, the execution progress of the test cases being executed at the time of the test interruption, the remaining test cases to be executed, and the key message sequence), matches the incremental task with a new edge device (i.e., the second new edge device) that is currently idle and whose hardware and software environment is compatible with the original edge device executing the incremental task. The cloud then completely migrates the incremental task and its execution record (which records its complete execution context) to the new edge device (i.e., the second new edge device). In this way, after the new edge device matched for the incremental task starts, it can restore the execution progress of the incremental task to the test node before the interruption based on the migrated execution record, skipping the successfully executed test cases and directly continuing to execute the remaining test cases from the breakpoint without needing to re-download or re-initialize.

[0069] The method in this embodiment ensures high availability and continuity of the test task execution process when the edge device fails, avoids repeated testing due to local anomalies, and improves the execution efficiency of the test task.

[0070] Through the above steps, the technical effect of automatically executing test tasks can be achieved. Specifically, through the cloud-edge device collaborative architecture, the cloud distributes test tasks to the edge devices, and the edge devices automatically execute the test tasks. In addition, the automatic migration of tasks when test tasks are abnormal also improves the technical effect of executing test tasks. Furthermore, after the edge devices complete the execution of test tasks, they send the test report back to the cloud, which improves the traceability of test data.

[0071] Figure 3 This is a structural diagram of an apparatus for performing test tasks according to an embodiment of this application, such as... Figure 3As shown, the apparatus for executing test tasks includes: a receiving module 30 for receiving test tasks to be executed, wherein each test task to be executed contains at least one test case; a determining module 32 for determining the type of test task to be executed based on test records stored in the cloud, wherein the type of test task to be executed includes: a new task not recorded in the test records, and an incremental task containing target test cases, wherein the target test cases include: test cases marked as execution failure in the test records; a first matching module 34 for matching a first target edge device among multiple edge devices deployed in the test network for each new task, wherein the test network is the local area network to which the cloud belongs; a second matching module 36 for matching a second target edge device for the incremental task based on the test records; and a detection module 38 for detecting the first execution state of each first target edge device executing a new task, determining whether to migrate the new task based on the first execution state, and detecting the second execution state of each second target edge device executing an incremental task, determining whether to migrate the incremental task based on the second execution state, until the test task to be executed is completed.

[0072] Figure 4 This is a flowchart of the device that performs the test task, such as... Figure 4As shown, when the apparatus for executing test tasks performs the method for executing test tasks provided in this application embodiment, it receives test tasks submitted by users (such as designers) through the receiving module 30. These test tasks may be submitted by the user terminal and then transmitted to the cloud by the user terminal. Next, the determining module 32 determines the type of test task by comparing the version information (such as the task number) of the test task with the test records in the cloud, and only identifies test cases that have not been executed before (new tasks) and test cases that have failed to be executed before (incremental tasks) as input files required for testing, and saves them in the cloud storage location (such as a cloud disk). If module 32 determines that the submitted test task contains both new tasks and incremental tasks, then the first matching module 34 matches the corresponding edge device (i.e., the first target edge device) for the new task, and the second matching module 36 matches the corresponding edge device (i.e., the second target edge device) for the incremental task. Specifically, in this embodiment, the first matching module 34 matches edge devices for each new task in order of priority among all edge devices included in the local area network interconnected with the cloud, while the second matching module 36 queries the test records in the cloud for edge devices that have already executed test cases included in the previously executed incremental tasks, and determines the edge device as the device for executing the incremental task this time (i.e., the second target edge device). The cloud can send the edge device matching results output by the first matching module 34 and the second matching module 36 to the user terminal for confirmation before sending new tasks and test tasks to the corresponding edge devices. Alternatively, it can send new tasks and test tasks directly to the corresponding edge devices without user terminal confirmation. When the edge devices execute the test tasks sent by the cloud, the detection module 38 monitors the execution status of each edge device in real time. In the event of an execution interruption, the interrupted test task and its execution record are uploaded to the cloud. The cloud then reallocates the interrupted test cases and subsequent unexecuted test cases to the edge devices based on the execution records. The cloud sends the interrupted test cases, subsequent unexecuted test cases, and their corresponding execution records to the reallocated edge devices so that the edge devices can resume execution at the interrupted point without having to execute previously completed test cases. Figure 4 As shown in this embodiment, after the edge device (such as a test cabinet) completes the test task, it automatically generates a standardized test report (including test data, link status, and abnormal information), which is automatically sent back to the vehicle R&D management system through the interactive interface, triggering subsequent R&D review, problem rectification and other processes. The multi-source logs generated during the execution process (such as test cabinet status logs, Ethernet message logs, alarm logs, etc.) are stored in the cloud database with timestamp association, supporting retrieval by test task, test time, test part model and other dimensions, which facilitates the tracing and root cause analysis of test problems.

[0073] It should be noted that, Figure 3 Preferred embodiments of the shown examples can be found in [reference needed]. Figure 2 The relevant descriptions of the embodiments shown will not be repeated here.

[0074] The method provided in this application embodiment can be executed using a three-tier architecture system consisting of cloud, server, and edge device (test rack). Figure 5 This is an architecture diagram of a system that automatically executes test tasks, such as... Figure 5 As shown, in the cloud task orchestration layer, the cloud receives and stores test tasks forwarded by the server through an interaction interface. Test tasks are submitted by users through the front end (user end). Test tasks can be automotive Ethernet test tasks, and each test task contains parameters such as test type, channel to be tested, and test case selection. In addition, the cloud also maintains real-time load data of all test racks (a type of edge device) through the server, such as CPU utilization, channel occupancy, and task execution progress. If none of the test cases in the received test task have been executed, test racks are allocated to the test task according to the task priority to ensure efficient task execution. Test cases are stored on the cloud server, which supports the selection, editing, and distribution of test cases. An incremental distribution mechanism is adopted. Before distributing test cases, the cloud identifies incremental test cases by comparing the test case information stored in the cloud with the test case information mentioned by the user end, and only distributes incremental test case fragments to reduce bandwidth consumption and improve distribution efficiency.

[0075] At the edge execution layer, each test rack acts as a client to the cloud, establishing a long-term connection with the cloud task orchestration layer via an Ethernet communication unit to receive test instructions and incremental test cases from the cloud in real time. The central control unit within the test rack parses the instructions, receives the necessary test projects, sample writing packages, and other inputs, and executes the test tasks. During testing, rack status (load, operating status) is reported in real time via WebSocket protocol at a reporting interval of 100 milliseconds (ms), ensuring real-time monitoring by the cloud. Edge devices support context retention and migration after task interruption. When a test rack malfunctions (such as power failure or network interruption), the central control unit immediately reports the current task's execution progress and context data (completed test steps and test data) to the cloud. The cloud scheduling module automatically switches the task to another idle rack, resuming task execution and avoiding resource waste caused by test interruption.

[0076] At the data closed-loop layer, after the test cabinet completes its test task, the test host within the cabinet automatically generates a standardized test report (including test data, link status, and anomaly information), which is automatically sent back to the vehicle manufacturer's R&D management system through an interactive interface, triggering subsequent R&D reviews, problem rectification, and other processes. Multi-source logs generated during the test, such as cabinet status logs, Ethernet message logs, and alarm logs, are stored in the cloud database with timestamp association. The aforementioned standardized test report supports retrieval by test task, test time, and test component model, facilitating the tracing and root cause analysis of test issues.

[0077] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described method for performing test tasks through the computer program.

[0078] The aforementioned non-volatile storage medium is used to store a program that performs the following functions: receiving test tasks to be executed, wherein each test task to be executed contains at least one test case; determining the type of test task to be executed based on test records stored in the cloud, wherein the type of test task to be executed includes: new tasks not recorded in the test records, and incremental tasks containing target test cases, wherein the target test cases include: test cases marked as execution failure in the test records; in the case of a new task, matching a first target edge device for each new task among multiple edge devices deployed in the test network, wherein the test network is the local area network to which the cloud belongs; in the case of an incremental task, matching a second target edge device for the incremental task based on the test records; detecting the first execution state of each first target edge device executing a new task, determining whether to migrate the new task based on the first execution state, and detecting the second execution state of each second target edge device executing an incremental task, determining whether to migrate the incremental task based on the second execution state, until the test task to be executed is completed.

[0079] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions, which, when executed by a processor, implement the steps of the method for performing the test task described above.

[0080] The processor in the aforementioned electronic device is used to run a program that performs the following functions: receiving test tasks to be executed, wherein each test task to be executed contains at least one test case; determining the type of test task to be executed based on test records stored in the cloud, wherein the type of test task to be executed includes: new tasks not recorded in the test records, and incremental tasks containing target test cases, wherein the target test cases include: test cases marked as execution failure in the test records; in the case of a new task, matching a first target edge device for each new task among multiple edge devices deployed in the test network, wherein the test network is the local area network to which the cloud belongs; in the case of an incremental task, matching a second target edge device for the incremental task based on the test records; detecting a first execution state of each first target edge device executing a new task, determining whether to migrate the new task based on the first execution state, and detecting a second execution state of each second target edge device executing an incremental task, determining whether to migrate the incremental task based on the second execution state, until the test task to be executed is completed.

[0081] It should be noted that each module in the device for performing the test task can be a program module (e.g., a set of program instructions to implement a specific function) or a hardware module. For the latter, it can take the following forms, but is not limited to them: each of the above modules is represented by a processor, or the functions of each of the above modules are implemented by a processor.

[0082] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0083] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0084] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0085] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0086] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0087] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0088] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for performing a test task, characterized in that, include: Receive test tasks to be executed, wherein each test task to be executed contains at least one test case; The type of the test task to be executed is determined based on the test records stored in the cloud. The types of the test tasks to be executed include: new tasks not recorded in the test records and incremental tasks containing target test cases. The target test cases include: test cases marked as failed in the test records. In the case of the new task, a first target edge device is matched for each new task among multiple edge devices deployed in the test network, wherein the test network is the local area network to which the cloud belongs; In the case where the type is the incremental task, a second target edge device is matched for the incremental task based on the test records; The first execution state of each first target edge device executing the new task is detected, and a decision is made on whether to migrate the new task based on the first execution state. The second execution state of each second target edge device executing the incremental task is detected, and a decision is made on whether to migrate the incremental task based on the second execution state, until the test task to be executed is completed.

2. The method according to claim 1, characterized in that, The type of the test task to be executed is determined based on the test records stored in the cloud, including: The first version information of each test task to be executed is compared with the second version information stored in the cloud to obtain a comparison result, wherein the first version information is determined according to the test case, and the second version information is determined according to the historical test cases contained in the test record; If the comparison result indicates that there is no first type of information in the first version information that is the same as the second version information, the type of the test task to be executed is determined to be the new task; If the comparison result indicates that the first version information stores both the first type of information and the second type of information that is different from the second version information, the type of the test task to be executed is determined to be the incremental task; If the comparison result indicates that only the first type of information exists in the first version information, the execution result of each of the historical test cases recorded in the test record is extracted. If the execution result includes the execution failure, the type of the test task to be executed is determined as the incremental task.

3. The method according to claim 1, characterized in that, For each new task, a first target edge device is matched among multiple edge devices deployed in the test network, including: Determine the load information for each edge device, wherein the edge device is a device deployed at the network edge of the test network and used to provide computing resources, and the load information includes: computing resource utilization rate and the proportion of tasks to be executed; The idle computing resource ratio of each edge device is determined based on the load information of each edge device, and a first matching order is determined for multiple edge devices in descending order of the idle computing resource ratio; A second matching order is determined for the multiple new tasks in descending order of priority, wherein the priority is used to indicate the order in which the multiple new tasks are matched with the first target edge device; Determine a first target matching order and a second target matching order that indicate the same matching order, and determine the edge device corresponding to the first target matching order as the first target edge device of the new task corresponding to the first target matching order.

4. The method according to claim 1, characterized in that, Matching a second target edge device for the incremental task based on the test records includes: For each incremental task, the historical edge device that last executed the incremental task is identified in the test record; The historical edge device is identified as the second target edge device.

5. The method according to claim 1, characterized in that, Before detecting the second execution state of each of the second target edge devices executing the incremental task, the method further includes: The test cases marked as execution failure and the new test cases in the multiple test cases included in the incremental task are identified as incremental test cases, wherein the new test cases are test cases that are not included in the historical execution record of the incremental task; The incremental test cases are distributed to the second target edge device, wherein the state in which the second target edge device executes each incremental test case is the second execution state.

6. The method according to claim 1, characterized in that, Determining whether to migrate the new task based on the first execution state includes: If the first execution state is interrupted, the new task is determined to be migrated; wherein, If it is determined that the new task will be migrated, a first new edge device is matched for each new task, and the execution record of the new task is migrated to the first new edge device. After the first new edge device restores the execution progress of the new task according to the execution record, it continues to execute the new task.

7. The method according to claim 1, characterized in that, Determining whether to migrate the incremental task based on the second execution state further includes: Determining whether to migrate the incremental task based on the second execution state includes: determining to migrate the incremental task if the second execution state is interrupted; wherein, If it is determined that the incremental task is to be migrated, a second new edge device is matched for each incremental task, the execution record of the incremental task is migrated to the second new edge device, and the second new edge device resumes the execution progress of the incremental task according to the execution record and continues to execute the incremental task.

8. An apparatus for performing a test task, characterized in that, include: A receiving module is used to receive test tasks to be executed, wherein each test task to be executed contains at least one test case; The determination module is used to determine the type of the test task to be executed based on the test records stored in the cloud. The type of the test task to be executed includes: new tasks not recorded in the test records and incremental tasks containing target test cases. The target test cases include: test cases marked as execution failure in the test records. The first matching module is used to match a first target edge device for each new task among multiple edge devices deployed in the test network, wherein the test network is the local area network to which the cloud belongs; The second matching module is used to match a second target edge device for the incremental task based on the test records; The detection module is used to detect the first execution state of each first target edge device executing the new task, determine whether to migrate the new task based on the first execution state, and detect the second execution state of each second target edge device executing the incremental task, determine whether to migrate the incremental task based on the second execution state, until the test task to be executed is completed.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method for performing a test task as described in any one of claims 1 to 7 through the computer program.

10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method for performing a test task as described in any one of claims 1 to 7.