Test resource multiplexing method and apparatus, storage medium, and computer device
By determining the occupancy status based on the reservation and operating status of test machines in the autonomous driving test cluster, the reuse and allocation of computing resources are realized, solving the problem of high cost of autonomous driving computing resource allocation and achieving maximum utilization and cost reduction of computing resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU WERIDE TECH LTD CO
- Filing Date
- 2022-09-19
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies for autonomous driving suffer from high costs in allocating computing resources, resulting in excessively high resource deployment expenses.
By obtaining the reservation status and machine running status of each test machine in the test cluster, its occupancy status is determined, and a resource availability notification is pushed to the computing power demand platform when the test cluster is idle, thereby realizing the reuse and allocation of computing resources.
Make full use of the computing resources of the test cluster, avoid wasting resources during idle time, reduce the number of resources deployed, and reduce costs.
Smart Images

Figure CN115495239B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving technology, and in particular to a method, apparatus, storage medium and computer equipment for reusing test resources. Background Technology
[0002] In the research, testing, and application of autonomous driving, offline autonomous driving systems require substantial computing resources to perform tasks such as compilation, simulation, and model training. Currently, engineers allocate dedicated computing resources for different types of tasks. Before executing a task, the computer can allocate resources based on the type of task, determining the computing resources needed to perform that task. This can be done by choosing to allocate resources in the cloud or a self-built cluster. However, considering the wide variety of task types, the current resource allocation method incurs significant costs for resource deployment, resulting in high costs. Summary of the Invention
[0003] The purpose of this application is to address at least one of the aforementioned technical defects, particularly the technical defect of excessively high costs in the prior art.
[0004] In a first aspect, embodiments of this application provide a method for testing resource reuse, applied to a resource management platform, the method comprising:
[0005] Obtain the reservation status and machine running status of each test machine in the test cluster. The machine running status is used to reflect whether the test machine is currently executing a task.
[0006] For each of the test machines, the occupancy status of the test machine is determined based on the reserved status and the machine's operating status.
[0007] The test cluster is determined to be in an idle state based on the occupancy status of each test machine. If the test cluster is in an idle state, a resource availability notification is pushed to each computing power demand platform so that each computing power demand platform can send an occupancy request to the resource management platform when needed.
[0008] Upon receiving the occupancy request, the test machine is allocated to the computing power demand platform that sent the occupancy request.
[0009] In one embodiment, the step of determining the occupancy status of the test machine based on its reserved status and its operating status includes:
[0010] Based on the reserved status of the test machine, determine whether the test machine has been reserved;
[0011] Based on the machine's operating status, determine whether the test machine is currently executing a task;
[0012] If the test machine is reserved or is currently executing a task, the test machine is determined to be occupied; otherwise, the test machine is determined to be unoccupied.
[0013] In one embodiment, the step of determining whether the test cluster is in an idle state based on the occupancy status of each test machine includes:
[0014] Determine the number of unoccupied machines based on the occupancy status of each test machine;
[0015] Obtain the total number of test machines in the test cluster, and calculate the ratio between the number of unoccupied machines and the total number of test machines;
[0016] If the ratio is greater than a preset threshold, the test cluster is determined to be in an idle state; otherwise, the test cluster is determined to be in an idle state.
[0017] In one embodiment, the step of allocating the test machine to the computing power demand platform that sent the occupancy request includes:
[0018] Upon receiving the occupancy request, the reservation status and machine running status of each test machine in the test cluster are re-acquired.
[0019] For each test machine, the occupancy status of the test machine is re-determined based on the latest obtained reservation status and the latest obtained machine operation status of the test machine.
[0020] If the test cluster is determined to be in an idle state based on the latest determined occupancy status of each of the test machines, then the test machine is allocated to the computing power demand platform that sent the occupancy request, based on the latest determined occupancy status of each of the test machines.
[0021] In one embodiment, the occupancy status is either occupied or unoccupied;
[0022] The step of allocating the test machines to the computing power demand platform that sent the occupancy request based on the latest determined occupancy status of each test machine includes:
[0023] Based on the latest determined occupancy status of each of the aforementioned test machines, unoccupied test machines are identified, wherein the unoccupied test machines are those whose occupancy status is unoccupied.
[0024] The unoccupied test machine is allocated to the computing power demand platform that sends the occupation request.
[0025] In one embodiment, the method further includes: if the test cluster is not in an idle state, pushing a resource reclamation notification to each of the computing power demand platforms to instruct each of the computing power demand platforms to release each target test machine, wherein the target test machine is the test machine occupied by the computing power demand platform.
[0026] In one embodiment, the method further includes: whenever any of the target test machines is detected to be released, resetting the released target test machine according to the acquired reset mode.
[0027] In one embodiment, the step of resetting the released target test machine according to the acquired reset mode includes:
[0028] If the reset mode is a lightweight reset mode, then the released target test machine is controlled to restart, and after restarting, the released target test machine is controlled to download the target dependency package, which is the dependency package required to perform the simulation test task.
[0029] In one embodiment, the step of resetting the released target test machine according to the acquired reset mode includes:
[0030] If the reset mode is a deep reset mode, then the released target test machine is controlled to reinstall the operating system.
[0031] Secondly, embodiments of this application provide a test resource reuse device applied to a resource management platform, the device comprising:
[0032] The machine status acquisition module is used to acquire the reserved status of each test machine in the test cluster and the machine running status of each test machine. The machine running status is used to reflect whether the test machine is currently executing a task.
[0033] The occupancy status determination module is used to determine the occupancy status of each test machine based on its reserved status and its operating status.
[0034] The first notification sending module is used to determine whether the test cluster is in an idle state based on the occupancy status of each test machine. If the test cluster is in an idle state, it pushes a resource availability notification to each computing power demand platform so that each computing power demand platform can send an occupancy request to the resource management platform when needed.
[0035] The machine allocation module is used to allocate the test machine to the computing power demand platform that sent the request when the occupancy request is received.
[0036] Thirdly, embodiments of this application provide a storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the test resource reuse method described in any of the above embodiments.
[0037] Fourthly, embodiments of this application provide a computer device, including: one or more processors, and a memory;
[0038] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the test resource reuse method described in any of the above embodiments.
[0039] In the test resource reuse method, apparatus, storage medium, and computer equipment of this application, the resource management platform can determine the occupancy status of each test machine based on its reservation status and machine operating status within the test cluster. Furthermore, based on the occupancy status of each test machine in the test cluster, the platform can determine whether the entire test cluster is idle. If so, the resource management platform can push resource availability notifications to each computing power demanding platform, enabling these platforms to utilize the computing resources in the test cluster when needed. This allows other platforms with computing resource requirements to use the test cluster's computing resources to obtain corresponding results. In this way, the computing resources of the test cluster can be fully utilized, avoiding waste of idle resources and maximizing resource utilization. This reduces the number of resources deployed and lowers costs while ensuring resource availability. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a diagram illustrating the application environment for testing a resource reuse method in one embodiment.
[0042] Figure 2 This is one of the flowcharts illustrating a method for testing resource reuse in one embodiment;
[0043] Figure 3 This is a second flowchart illustrating a method for testing resource reuse in one embodiment;
[0044] Figure 4 This is the third flowchart illustrating the testing of a resource reuse method in one embodiment;
[0045] Figure 5 This is a schematic diagram of the structure of a test resource reuse device in one embodiment;
[0046] Figure 6 This is a schematic diagram of the structure of a computer device in one embodiment. Detailed Implementation
[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] The test resource reuse method in this application can be applied to Figure 1 The application environment shown. For example... Figure 1 As shown, the application environment includes a computing power demand platform 110, a resource management platform 120, and a test cluster 130. The test cluster 130 may include at least one test machine 132. It is understood that the specific hardware and software configuration of each test machine 132 can be determined based on the pre-determined type of task to be run by that test machine; this application does not impose specific limitations in this regard. In one embodiment, each test machine 132 can be a SIL (Software in the Loop) test machine. An SIL test machine refers to a machine used to run simulation-in-the-loop test tasks, and it can have the same computing resource configuration as the vehicle's infotainment system. Because SIL test machines have strong computing power, in addition to SIL test tasks, the computing power configuration of SIL test machines can be used to execute various types of tasks, such as test simulation tasks other than SIL testing, model training tasks, and compilation tasks.
[0049] The computing power demand platform 110 can be a platform with computing resource requirements, and can be, but is not limited to, a model training platform, various types of simulation platforms, or compilation platforms. It is understood that the application environment may include at least one computing power demand platform 110, and the specific number of computing power demand platforms 110 can be determined according to the actual situation. At the same time, the specific implementation of each computing power demand platform 110 can also be determined according to the function and role of the platform, and this application does not impose specific restrictions in this regard.
[0050] The resource management platform 120 can be a device used to store and manage the machine operating status and reservation status of each test machine 132, and to process received occupancy requests. It is understood that the resource management platform 120 can be implemented using computer equipment, and its specific configuration can be implemented according to actual conditions; this application does not impose specific limitations on this. In one embodiment, the resource management platform 120 can be implemented using a single server or a server cluster containing multiple servers.
[0051] In this application, the resource management platform 120 can be used to manage the resources of the test cluster 130. When the test cluster 130 is in an idle state, it sends a resource availability notification to the computing power demand platform 110, so that each computing power demand platform 110 can occupy the computing resources of the test cluster 130 as needed.
[0052] In one embodiment, this application provides a method for testing resource reuse, and the following embodiments apply this method to... Figure 1 The resource management platform shown is used as an example for illustration. Figure 2 As shown, the method specifically includes the following steps:
[0053] S202: Obtain the reserved status of each test machine in the test cluster and the machine running status of each test machine. The machine running status is used to reflect whether the test machine is currently executing a task.
[0054] The machine running status of the test machine can be used to indicate whether the test machine is currently executing any task, thereby reflecting whether the computing resources of the test machine to be reserved are currently available for use. The reservation status of the test machine can be used to reflect whether the test machine has been reserved. In one embodiment, the reservation described in the embodiments of this application may be that the test machine is not currently executing a task, and the computing resources of the test machine have been allocated to the corresponding reserved personnel or reserved platform.
[0055] It is understood that the resource management platform can obtain the reservation status and machine running status of each test machine in the test cluster in any way. For example, the resource management platform can communicate with each test machine to obtain its reservation status and machine running status. In one embodiment, if the resource management platform stores the machine running status and reservation status of each test machine, the reservation platform can obtain the reservation status and machine running status of each test machine from the stored information according to the machine identifier of each test machine.
[0056] S204: For each of the test machines, determine the occupancy status of the test machine based on the reserved status and the machine operating status.
[0057] The occupancy status of the test machine reflects whether it is currently occupied. In one embodiment, the occupancy status can be either occupied or unoccupied. If the test machine is occupied, it indicates that the test machine is currently unavailable; conversely, if the test machine is unoccupied, it indicates that the test machine is currently available.
[0058] For each test machine, the resource management platform can determine its occupancy status based on its reservation status and operating status, thus determining whether the test machine is currently available. It is understood that the specific determination rules in this step can be determined based on actual circumstances, and this application does not impose specific restrictions on this. In one example, the resource management platform can determine that the test machine is occupied if it has been reserved or is currently executing a task; otherwise, it determines that the test machine is unoccupied. In another example, the resource management platform can determine that the test machine is occupied if it has been reserved; if the test machine has not been reserved and is currently executing a task, the occupancy status is determined based on the task initiator identifier of the currently executing task.
[0059] S206: Determine whether the test cluster is in an idle state based on the occupancy status of each test machine. If the test cluster is in an idle state, push a resource availability notification to each computing power demand platform so that each computing power demand platform can send an occupancy request to the resource management platform when needed.
[0060] After determining the occupancy status of each test machine, the resource management platform can judge whether the test cluster as a whole is idle based on the occupancy status of each test machine, and then determine whether the test cluster has enough idle test machines for the computing power demand platform to call.
[0061] If the test cluster is idle, it indicates that there are sufficient free computing resources available to provide external computing resources. In this case, the resource management platform can push resource availability notifications to each computing power requesting platform to inform them of the availability of free computing resources in the test cluster. Upon receiving the resource availability notification, each computing power requesting platform that needs to utilize computing resources can send a request to the resource management platform to attempt to occupy the computing resources of the test cluster and execute relevant tasks using those resources.
[0062] In one embodiment, the resource management platform can periodically execute steps S202 to S206. In other words, the resource management platform can periodically obtain the reservation status and machine operation status of each test machine, determine the occupancy status of each test machine based on the latest obtained reservation status and machine operation status, and execute step S206 based on the latest determined occupancy status of each test machine.
[0063] S208: Upon receiving the occupancy request, allocate the test machine to the computing power demand platform that sent the occupancy request.
[0064] Upon receiving a request for resource allocation, the resource management platform can allocate test machines within the test cluster to the platform requesting the computing power. This allows the platform to call upon the test machines allocated by the resource management platform to execute relevant tasks, thereby enabling the reuse of the test cluster. In addition to executing test tasks, the test cluster can also execute more types of tasks.
[0065] In this application, the resource management platform can determine the occupancy status of each test machine in the test cluster based on its reserved status and machine operating status. Based on the occupancy status of each test machine, the platform can determine whether the entire test cluster is idle. If so, the resource management platform can push resource availability notifications to various computing power demand platforms, enabling these platforms to utilize the computing resources in the test cluster when needed. This allows other platforms with computing power needs to use the test cluster's computing resources to obtain corresponding results. In this way, the computing resources of the test cluster can be fully utilized, avoiding waste of idle resources and maximizing resource utilization. This reduces the number of resources deployed and lowers costs while ensuring resource availability.
[0066] In one embodiment, the step of determining the occupancy status of the test machine based on its reserved status and its operating status includes:
[0067] Based on the reserved status of the test machine, determine whether the test machine has been reserved;
[0068] Based on the machine's operating status, determine whether the test machine is currently executing a task;
[0069] If the test machine is reserved or is currently executing a task, the test machine is determined to be occupied; otherwise, the test machine is determined to be unoccupied.
[0070] Specifically, since the reservation status of a test machine can reflect whether the test machine is currently reserved, and the machine operation status of a test machine can reflect whether the test machine is currently executing a task, the resource management platform can determine whether the test machine is reserved based on its reservation status and whether the test machine is currently executing a task based on its machine operation status.
[0071] For each test machine, if it has already been reserved, it indicates that other engineers or platforms need to use its computing resources. In this case, to ensure that other engineers or platforms can use the reserved test machine normally and to avoid problems such as test machine contention or unavailability of reserved resources, the resource management platform can determine the test machine's occupancy status as occupied if it has already been reserved. If the test machine is currently executing a task, it indicates that its computing resources are currently in use, and its idle computing resources are insufficient to execute other tasks; in this case, the resource management platform can determine the test machine's occupancy status as occupied.
[0072] For each test machine, if the test machine is not reserved and is currently executing a task, it means that the test machine is available for use at any time. Therefore, the occupancy status of the test machine can be determined as unoccupied.
[0073] In this embodiment, test machines that have been reserved or are currently executing tasks are identified as occupied test machines, and test machines that have not been reserved and are not currently executing tasks are identified as unoccupied test machines. This allows for an accurate determination of whether each test machine is available for use, and further enables a more accurate determination of whether the test cluster is in an idle state, ensuring that computing resources can be fully utilized.
[0074] In one embodiment, the step of determining whether the test cluster is in an idle state based on the occupancy status of each test machine includes:
[0075] Determine the number of unoccupied machines based on the occupancy status of each test machine;
[0076] Obtain the total number of test machines in the test cluster, and calculate the ratio between the number of unoccupied machines and the total number of test machines;
[0077] If the ratio is greater than a preset threshold, the test cluster is determined to be in an idle state; otherwise, the test cluster is determined to be in an idle state.
[0078] The number of unused machines refers to the total number of unused test machines in the test cluster. The total number of test machines refers to the total number of all test machines included in the test cluster.
[0079] Specifically, after determining the occupancy status of each test machine, the resource management platform can determine the number of unoccupied machines in the test cluster and calculate the ratio between the number of unoccupied machines and the total number of test machines. If this ratio is greater than a preset threshold, the test cluster is determined to be in an idle state. In this case, the resource management platform can send a resource availability notification to the computing power demand platform. If the ratio is less than or equal to the preset threshold, the resource management platform can determine that the test cluster is not in an idle state, and the idle computing resources in the test cluster are insufficient, which may not be able to meet the computing resource requirements of other computing power demand platforms. It is understood that the specific value of the aforementioned preset threshold can be determined according to the actual situation, and this application does not impose specific restrictions on it.
[0080] In this embodiment, the resource management platform determines whether the test cluster is idle based on the ratio of the number of unoccupied machines in the test cluster to the total number of test machines. This allows for a more accurate assessment of whether the test cluster is idle, ensuring full utilization of computing resources.
[0081] In one embodiment, the step of allocating the test machine to the computing power demand platform that sent the occupancy request includes:
[0082] Upon receiving the occupancy request, the reservation status and machine running status of each test machine in the test cluster are re-acquired.
[0083] For each test machine, the occupancy status of the test machine is re-determined based on the latest obtained reservation status and the latest obtained machine operation status of the test machine.
[0084] If the test cluster is determined to be in an idle state based on the latest determined occupancy status of each of the test machines, then the test machine is allocated to the computing power demand platform that sent the occupancy request, based on the latest determined occupancy status of each of the test machines.
[0085] Specifically, upon receiving a request to allocate computing power, the resource management platform can allocate test machines to the platform that sent the request. Before allocating test machines, the resource management platform can re-obtain the reservation status and the machine running status of each test machine in the test cluster, and re-determine whether the test cluster is in an idle state based on the latest obtained reservation and machine running status. The specific process for re-determining whether the test cluster is in an idle state can be found in the above embodiments, and will not be repeated here.
[0086] If the test cluster is determined to be in an idle state based on the latest obtained reservation status and machine running status, then test machines can be allocated to the computing power demand platform that sends the occupancy request based on the re-determined occupancy status of each test machine.
[0087] In one embodiment, if it is determined that the test cluster is not in an idle state based on the re-acquired reservation status and machine operating status, then test machines may not be allocated to the computing power demand platform that sends the occupancy request.
[0088] This embodiment avoids situations where changes in the status of test machines lead to insufficient idle computing resources in the test cluster when allocating test machines to computing power demand platforms, ensuring that the test cluster has sufficient resources to run test tasks. Simultaneously, it allows for the allocation of test machines based on the redefined occupancy status, preventing the allocation of unavailable test machines to computing power demand platforms and improving the reliability of test resource reuse.
[0089] In one embodiment, the occupancy status is either occupied or unoccupied. The step of allocating the test machines to the computing power demand platform that sent the occupancy request based on the latest determined occupancy status of each test machine includes:
[0090] Based on the latest determined occupancy status of each of the aforementioned test machines, unoccupied test machines are identified, wherein the unoccupied test machines are those whose occupancy status is unoccupied.
[0091] The unoccupied test machine is allocated to the computing power demand platform that sends the occupation request.
[0092] Specifically, once the test cluster is confirmed to be idle, the resource management platform can allocate test machines based on the latest determined occupancy status of each test machine. Specifically, the resource management platform can identify unoccupied test machines in the test cluster based on the latest determined occupancy status; these unoccupied test machines are designated as such. The resource management platform can also allocate any number of unoccupied test machines to the computing power requesting platform that sends an allocation request, using any method possible. This avoids allocating unavailable test machines to computing power requesting platforms, improving the reliability of test resource reuse.
[0093] In one example, the test resource reuse method of this application can be as follows: Figure 3 As shown, whenever a testing cycle arrives, the test resource reuse method is executed according to the following steps:
[0094] S302: Obtain the reservation status and machine running status of each test machine in the test cluster.
[0095] S304: For each of the test machines, determine the occupancy status of the test machine based on the latest obtained reservation status and machine operation status of the test machine.
[0096] S306: Based on the latest determined occupancy status of each test machine, determine whether the test cluster is in an idle state. If yes, proceed to step S308; otherwise, wait for the next testing cycle to begin.
[0097] S308, the resource management platform sends resource availability notifications to each computing power demanding platform so that each computing power demanding platform can send a request to the resource management platform to occupy the resource when needed.
[0098] When S310 receives a request to occupy computing power from the computing power demand platform, it obtains the reservation status and machine operation status of each test machine in the test cluster.
[0099] S312, for each of the test machines, determine the occupancy status of the test machine based on the latest obtained reservation status and machine operation status of the test machine.
[0100] S314. Based on the latest determined occupancy status of each test machine, determine whether the test cluster is in an idle state. If yes, proceed to step S316; otherwise, proceed to step S318.
[0101] S316: Based on the latest determined occupancy status of each test machine, allocate idle test machines to the computing power requesting platform that sends the occupancy request.
[0102] S318, no test machine assigned, and waits for the next testing cycle.
[0103] In one embodiment, the test resource reuse method further includes: if the test cluster is not in an idle state, pushing a resource reclamation notification to each of the computing power demand platforms to instruct each of the computing power demand platforms to release each target test machine, wherein the target test machine is the test machine occupied by the computing power demand platform.
[0104] Specifically, if the test cluster is not idle, it indicates that the test cluster is currently experiencing resource shortages. To ensure that the test cluster's computing resources prioritize the execution of test tasks, the resource management platform needs to reclaim the computing resources provided to external users. This ensures that the test cluster has sufficient computing resources to execute test tasks. In this case, the resource management platform can push resource reclamation notifications to each computing power demanding platform. This allows the connected computing power demanding platforms to release the test machines they occupy, thereby reclaiming the computing resources of the test cluster occupied by each platform. The released test machines can then be used to receive and execute test tasks. This further optimizes resource reuse and maximizes the utilization of computing resources.
[0105] In one embodiment, the method further includes: whenever any of the target test machines is detected to be released, resetting the released target test machine according to the acquired reset mode.
[0106] Specifically, the previous use of a test machine may leave some residual effects, affecting its subsequent use. To avoid the impact of previous use on subsequent use and to ensure that the test machine can run tasks normally and smoothly and output reliable results, when the release of a target test machine is detected, the resource management platform can automatically reset the released target test machine according to the acquired reset mode before its reallocation. In one embodiment, the reset mode can be selected by the user or determined by the resource management platform based on the type of task executed by the released target test machine before its release.
[0107] In one embodiment, the step of resetting the released target test machine according to the obtained reset mode includes: if the reset mode is a lightweight reset mode, controlling the released target test machine to restart, and after restarting, controlling the released target test machine to download the target dependency package, the target dependency package being a dependency package required to perform the simulation test task.
[0108] Specifically, if the reset mode obtained is lightweight reset mode, the resource management platform can control the released target test machine to restart, thereby deleting the temporarily allowed programs. After restarting, it can control the released target test machine to re-download the dependency packages required to execute the simulation test task, ensuring that the dependency packages configured on the test machine are unchanged. This avoids problems such as users or the executed task accidentally modifying dependency packages, leading to test task malfunctions or inaccurate test results.
[0109] In one embodiment, after downloading the target dependency package, the resource management platform can also reset common system configurations in the released target test machine, such as time synchronization settings and system service settings on which various simulation tests depend.
[0110] In this embodiment, a lightweight reset is achieved by sequentially controlling the restart of the released target test machine and downloading the target dependency package, thereby completing the reset of the target test machine in a short time.
[0111] In one embodiment, the step of resetting the released target test machine according to the obtained reset mode includes: if the reset mode is a deep reset mode, then controlling the released target test machine to reinstall the operating system.
[0112] Specifically, in some cases, engineers may make underlying modifications to test machines for debugging purposes, such as modifying the underlying code or logic. In this case, simply restarting the released target test machine and re-downloading the target dependency packages cannot solve the problems caused by the underlying modifications. To minimize the residual effects of previous use and improve the reliability of test results, the resource management platform, when the reset mode is set to deep reset, can control the released target test machine to reinstall the operating system to achieve a deep reset.
[0113] In one example, the test resource reuse method of this application can be implemented according to... Figure 4 The resource recycling is implemented in the manner shown. Each time a detection cycle arrives, the resource management platform executes the following steps:
[0114] S402: Obtain the reservation status and machine running status of each test machine in the test cluster.
[0115] S404: For each of the test machines, determine the occupancy status of the test machine based on the latest obtained reservation status and machine operation status of the test machine.
[0116] S406: If, based on the latest determined occupancy status of each test machine, it is determined that the test cluster is not idle, a resource reclamation notification will be pushed to each computing power demanding platform to instruct them to release each target test machine. The target test machines are those currently occupied by the computing power demanding platforms.
[0117] S408: Whenever any target test machine is detected to be released, reset the released target test machine according to the obtained reset mode.
[0118] S410: The reset target test machine can run simulation test tasks.
[0119] The test resource reuse apparatus provided in the embodiments of this application is described below. The test resource reuse apparatus described below can be referred to in correspondence with the test resource reuse method described above.
[0120] In one embodiment, this application provides a test resource reuse apparatus 500. For example... Figure 5 As shown, the device 500 specifically includes a machine status acquisition module 510, an occupancy status determination module 520, a first notification sending module 530, and a machine allocation module 540. Wherein:
[0121] The machine status acquisition module 510 is used to acquire the reserved status of each test machine in the test cluster and the machine running status of each test machine. The machine running status is used to reflect whether the test machine is currently executing a task.
[0122] The occupancy status determination module 520 is used to determine the occupancy status of each test machine based on its reserved status and its operating status.
[0123] The first notification sending module 530 is used to determine whether the test cluster is in an idle state based on the occupancy status of each test machine. If the test cluster is in an idle state, it pushes a resource availability notification to each computing power demand platform so that each computing power demand platform can send an occupancy request to the resource management platform when needed.
[0124] The machine allocation module 540 is used to allocate the test machine to the computing power demand platform that sent the occupancy request when the occupancy request is received.
[0125] In one embodiment, the occupancy status determination module 520 includes a reservation determination unit, a running determination unit, and a first status determination unit. The reservation determination unit determines whether the test machine is reserved based on its reservation status. The running determination unit determines whether the test machine is currently executing a task based on its running status. The first status determination unit determines that the occupancy status of the test machine is occupied if the test machine is reserved or currently executing a task. The first status determination unit is also used to determine that the occupancy status of the test machine is unoccupied if the test machine is not reserved and is not currently executing a task.
[0126] In one embodiment, the first notification sending module 530 includes a quantity determination unit, a ratio calculation unit, and a second state determination unit. The quantity determination unit determines the number of unoccupied machines based on the occupancy status of each test machine. The ratio calculation unit obtains the total number of test machines in the test cluster and calculates the ratio between the number of unoccupied machines and the total number of test machines. The second state determination unit determines that the test cluster is in an idle state if the ratio is greater than a preset threshold; otherwise, it determines that the test cluster is not in an idle state.
[0127] In one embodiment, the machine allocation module 540 includes a status reacquisition unit, a status redetermination unit, and an allocation unit. The status reacquisition unit, upon receiving the occupancy request, reacquires the reservation status and the machine running status of each test machine in the test cluster. The status redetermination unit, for each test machine, redetermines its occupancy status based on the most recently acquired reservation status and the most recently acquired machine running status. The allocation unit, if determining that the test cluster is in an idle state based on the most recently determined occupancy status of each test machine, allocates the test machine to the computing power demand platform that sent the occupancy request based on the most recently determined occupancy status of each test machine.
[0128] In one embodiment, the occupancy status is either occupied or unoccupied. The allocation unit includes a machine determination unit and an unoccupied machine allocation unit. The machine determination unit is used to determine unoccupied test machines based on the latest determined occupancy status of each test machine; the unoccupied test machines are those whose occupancy status is unoccupied. The unoccupied machine allocation unit is used to allocate the unoccupied test machines to the computing power demand platform that sent the occupancy request.
[0129] In one embodiment, the apparatus 500 further includes a second notification sending module. This second notification sending module is used to push resource reclamation notifications to each of the computing power demand platforms when the test cluster is not in an idle state, instructing each of the computing power demand platforms to release each target test machine, wherein the target test machine is the test machine occupied by the computing power demand platform.
[0130] In one embodiment, the device 500 further includes a reset module. This reset module is used to reset the released target test machine according to an acquired reset mode whenever any of the target test machines is detected to be released.
[0131] In one embodiment, the reset module includes a lightweight reset unit. This lightweight reset unit is used to control the released target test machine to restart when the reset mode is lightweight reset mode, and after restarting, to control the released target test machine to download a target dependency package, which is a dependency package required to perform the simulation test task.
[0132] In one embodiment, the reset module includes a deep reset unit. This deep reset unit is used to control the released target test machine to reinstall the operating system when the reset mode is deep reset mode.
[0133] In one embodiment, this application also provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the test resource reuse method as described in any of the above embodiments.
[0134] In one embodiment, this application also provides a computer device. The computer device stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the test resource reuse method as described in any of the above embodiments.
[0135] Indicatively, Figure 6 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. In one example, the computer device can be a server. (Refer to...) Figure 6 The computer device 900 includes a processing component 902, which further includes one or more processors, and memory resources represented by memory 901 for storing instructions executable by the processing component 902, such as an application under test. The application under test stored in memory 901 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 902 is configured to execute instructions to perform the steps of the test resource reuse method described in any of the above embodiments.
[0136] The computer device 900 may also include a power supply component 903 configured to perform power management of the computer device 900, a wired or wireless network interface 904 configured to connect the computer device 900 to a network, and an input / output (I / O) interface 905. The computer device 900 may operate on an operating system stored in memory 901, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0137] Those skilled in the art will understand that the internal structure of the computer device shown in this application is merely a block diagram of a portion of the structure related to the solution of this application, and does not constitute a limitation on the computer device to be tested and applied thereto. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0138] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. In this document, "a," "an," "the," "the," and "its" may also include plural forms unless the context clearly indicates otherwise. "Multiple" refers to at least two, such as 2, 3, 5, or 8, etc. "And / or" includes any and all combinations of the related listed items.
[0139] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0140] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for reusing test resources, characterized in that, Applied to a resource management platform, the method includes: Obtain the reservation status and machine running status of each test machine in the test cluster. The machine running status is used to reflect whether the test machine is currently executing a task. For each of the test machines, the occupancy status of the test machine is determined based on the reserved status and the machine's operating status. The test cluster is determined to be in an idle state based on the occupancy status of each test machine. If the test cluster is in an idle state, a resource availability notification is pushed to each computing power demand platform so that each computing power demand platform can send an occupancy request to the resource management platform when needed. Upon receiving the occupancy request, the test machine is allocated to the computing power demand platform that sent the occupancy request; The step of determining whether the test cluster is in an idle state based on the occupancy status of each test machine includes: Determine the number of unoccupied machines based on the occupancy status of each test machine; Obtain the total number of test machines in the test cluster, and calculate the ratio between the number of unoccupied machines and the total number of test machines; If the ratio is greater than a preset threshold, the test cluster is determined to be in an idle state; otherwise, the test cluster is determined to be in an idle state.
2. The method according to claim 1, characterized in that, The step of determining the occupancy status of the test machine based on its reserved status and its operating status includes: Based on the reserved status of the test machine, determine whether the test machine has been reserved; Based on the machine's operating status, determine whether the test machine is currently executing a task; If the test machine is reserved or is currently executing a task, the test machine is determined to be occupied; otherwise, the test machine is determined to be unoccupied.
3. The method according to claim 1, characterized in that, The step of allocating the test machine to the computing power demand platform that sends the occupancy request includes: Upon receiving the occupancy request, the reservation status and machine running status of each test machine in the test cluster are re-acquired. For each test machine, the occupancy status of the test machine is re-determined based on the latest obtained reservation status and the latest obtained machine operation status of the test machine. If the test cluster is determined to be in an idle state based on the latest determined occupancy status of each of the test machines, then the test machine is allocated to the computing power demand platform that sent the occupancy request, based on the latest determined occupancy status of each of the test machines.
4. The method according to claim 3, characterized in that, The occupancy status is either occupied or unoccupied; The step of allocating the test machines to the computing power demand platform that sent the occupancy request based on the latest determined occupancy status of each test machine includes: Based on the latest determined occupancy status of each of the aforementioned test machines, unoccupied test machines are identified, wherein the unoccupied test machines are those whose occupancy status is unoccupied. The unoccupied test machine is allocated to the computing power demand platform that sends the occupation request.
5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: If the test cluster is not idle, a resource reclamation notification is pushed to each of the computing power demand platforms to instruct each of the computing power demand platforms to release each target test machine, wherein the target test machine is the test machine occupied by the computing power demand platform.
6. The method according to claim 5, characterized in that, The method further includes: Whenever any of the target test machines is detected to be released, the released target test machine is reset according to the obtained reset mode.
7. The method according to claim 6, characterized in that, The step of resetting the released target test machine according to the obtained reset mode includes: If the reset mode is a lightweight reset mode, then the released target test machine is controlled to restart, and after restarting, the released target test machine is controlled to download the target dependency package, which is the dependency package required to perform the simulation test task.
8. The method according to claim 6, characterized in that, The step of resetting the released target test machine according to the obtained reset mode includes: If the reset mode is a deep reset mode, then the released target test machine is controlled to reinstall the operating system.
9. A test resource reuse device, characterized in that, The device, applied to a resource management platform, includes: The machine status acquisition module is used to acquire the reserved status of each test machine in the test cluster and the machine running status of each test machine. The machine running status is used to reflect whether the test machine is currently executing a task. The occupancy status determination module is used to determine the occupancy status of each test machine based on its reserved status and its operating status. The first notification sending module is used to determine whether the test cluster is in an idle state based on the occupancy status of each test machine. If the test cluster is in an idle state, it pushes a resource availability notification to each computing power demand platform so that each computing power demand platform can send an occupancy request to the resource management platform when needed. The machine allocation module is used to allocate the test machine to the computing power demand platform that sent the occupancy request when the occupancy request is received; The first notification sending module includes: The quantity determination unit is used to determine the number of unoccupied machines based on the occupancy status of each of the test machines. The ratio calculation unit is used to obtain the total number of test machines in the test cluster and calculate the ratio between the number of unoccupied machines and the total number of test machines. The second state determination unit is used to determine that the test cluster is in an idle state if the ratio is greater than a preset threshold, and otherwise determine that the test cluster is not in an idle state.
10. A storage medium, characterized in that, The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the test resource reuse method as described in any one of claims 1 to 8.
11. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the test resource reuse method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Task allocation method and resource management platform
CN111580951A
Resource management method and device, electronic equipment and computer readable medium
CN112416593A