CN-115495239-B - Test resource multiplexing method and device, storage medium and computer equipment
Abstract
The application provides a test resource multiplexing method, a device, a storage medium and computer equipment, wherein the method comprises the steps of obtaining a reserved state of each test machine in a test cluster and a machine running state of each test machine, wherein the machine running state is used for reflecting whether the test machine is currently executing a task or not; determining the occupation state of each test machine according to the reserved state and the machine running state of the test machine, judging whether the test cluster is in an idle state according to the occupation state of each test machine, if the test cluster is in the idle state, pushing a resource availability notice to each power calculation demand platform so that each power calculation demand platform sends an occupation request to a resource management platform when needed, and distributing the test machine to the power calculation demand platform sending the occupation request when receiving the occupation request. The scheme of the application can reduce the number of resource deployment and further reduce the cost.
Inventors
- HUANG XINGYAO
Assignees
- 广州文远知行科技有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20220919
Claims (11)
- 1. A method for testing resource reuse, applied to a resource management platform, the method comprising: acquiring a reserved state of each test machine in a test cluster and a machine running state of each test machine, wherein the machine running state is used for reflecting whether the test machine is currently executing a task; determining an occupancy state of each test machine according to the reserved state and the machine running state of the test machine; Judging whether the test cluster is in an idle state or not according to the occupied state of each test machine, if the test cluster is in the idle state, pushing a resource availability notification to each power demand platform so that each power demand platform sends an occupied request to the resource management platform when needed; when the occupation request is received, distributing the test machine for the calculation force demand platform which sends the occupation request; The step of judging whether the test cluster is in an idle state according to the occupied state of each test machine comprises the following steps: Determining the number of unoccupied machines according to the occupied state of each test machine; Obtaining the total number of test machines of the test cluster, and calculating the ratio between the number of unoccupied machines and the total number of test machines; And if the ratio is larger than a preset threshold, determining that the test cluster is in an idle state, otherwise, determining that the test cluster is not in the idle state.
- 2. The method of claim 1, wherein the step of determining an occupancy state of the test machine based on the reservation state and the machine operational state of the test machine comprises: Judging whether the test machine is reserved or not based on the reserved state of the test machine; judging whether the test machine is currently executing a task or not based on the machine running state of the test machine; If the test machine is reserved or the test machine is currently executing a task, determining that the occupied state of the test machine is occupied, otherwise, determining that the occupied state of the test machine is unoccupied.
- 3. The method of claim 1, wherein the step of assigning the test machine to the computing power demand platform that sent the occupancy request comprises: when the occupation request is received, acquiring the reserved state of each test machine and the machine running state of each test machine in the test cluster again; For each testing machine, re-determining the occupation state of the testing machine according to the reserved state of the testing machine which is acquired latest and the machine running state of the testing machine which is acquired latest; If the test cluster is determined to be in an idle state according to the latest determined occupied state of each test machine, distributing the test machines for the calculation force demand platform for sending the occupation request based on the latest determined occupied state of each test machine.
- 4. A method according to claim 3, wherein the occupied state is occupied or unoccupied; The step of allocating the test machine to the computing power demand platform sending the occupation request based on the latest determined occupation state of each test machine comprises the following steps: Determining an unoccupied test machine according to the latest determined occupied state of each test machine, wherein the unoccupied test machine is a test machine with an unoccupied occupied state; The unoccupied test machine is assigned to the computing power demand platform that sent the occupancy request.
- 5. The method according to any one of claims 1 to 4, further comprising: and if the test cluster is not in the idle state, pushing a resource recovery notice to each power demand platform so as to instruct each power demand platform to release each target test machine, wherein the target test machine is a test machine occupied by the power demand platform.
- 6. The method of claim 5, wherein the method further comprises: and resetting the released target test machine according to the acquired reset mode every time any target test machine is detected to be released.
- 7. The method of claim 6, wherein the step of resetting the released target test machine according to the acquired reset pattern comprises: And if the reset mode is a light reset mode, controlling the released target test machine to restart, and after restarting, controlling the released target test machine to download a target dependent packet, wherein the target dependent packet is a dependent packet required for executing a simulation test task.
- 8. The method of claim 6, wherein the step of resetting the released target test machine according to the acquired reset pattern comprises: and if the reset mode is a deep reset mode, controlling the released target test machine to reinstall an operating system.
- 9. A test resource multiplexing device, for use in a resource management platform, the device comprising: The machine state acquisition module is used for acquiring a reserved state of each test machine in the test cluster and a machine running state of each test machine, wherein the machine running state is used for reflecting whether the test machine is currently executing a task; the occupation state determining module is used for determining the occupation state of each testing machine according to the reserved state of the testing machine and the machine running state; The first notification sending module is used for judging whether the test cluster is in an idle state according to the occupation state of each test machine, and if the test cluster is in the idle state, pushing a resource availability notification to each power demand platform so as to enable each power demand platform to send occupation requests to the resource management platform when needed; a machine allocation module for allocating the test machine to the computing power demand platform that sent the occupancy request when the occupancy request is received; Wherein, the first notification sending module includes: the quantity determining unit is used for determining the quantity of unoccupied machines according to the occupied state of each test machine; The ratio calculating unit is used for obtaining the total number of the test machines of the test cluster and calculating the ratio between the number of the unoccupied machines and the total number of the test machines; And the second state determining unit is used for determining that the test cluster is in an idle state if the ratio is larger than a preset threshold value, and otherwise, determining that the test cluster is not in the idle state.
- 10. A storage medium having stored therein 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 multiplexing method of any of claims 1 to 8.
- 11. A computer device includes one or more processors and a memory; Stored in the memory are computer readable instructions which, when executed by the one or more processors, perform the steps of the test resource multiplexing method according to any of claims 1 to 8.
Description
Test resource multiplexing method and device, storage medium and computer equipment Technical Field The present application relates to the field of autopilot technology, and in particular, to a test resource multiplexing method, apparatus, storage medium, and computer device. Background In the development, testing and application process of autopilot, an autopilot offline system has considerable computing resource requirements to perform tasks such as compiling, simulation and model training. Currently, engineers set up computing resources dedicated to performing the same type of task separately for different types of tasks. Before executing a task, the computer device may allocate resources among computing resources corresponding to a type of task to be executed according to the type of task, thereby determining computing resources for executing the task. For example, to select to allocate resources in the cloud or in a self-built cluster. However, considering the various task types, in the existing resource allocation method, a large amount of cost is required to be consumed to complete resource deployment, and there is a problem of high cost. Disclosure of Invention The object of the present application is to solve at least one of the above-mentioned technical drawbacks, in particular the technical drawbacks of the prior art which are too costly. In a first aspect, an embodiment of the present application provides a method for testing resource reuse, which is applied to a resource management platform, where the method includes: acquiring a reserved state of each test machine in a test cluster and a machine running state of each test machine, wherein the machine running state is used for reflecting whether the test machine is currently executing a task; determining an occupancy state of each test machine according to the reserved state and the machine running state of the test machine; Judging whether the test cluster is in an idle state or not according to the occupied state of each test machine, if the test cluster is in the idle state, pushing a resource availability notification to each power demand platform so that each power demand platform sends an occupied request to the resource management platform when needed; and when the occupation request is received, distributing the test machine to the computing power demand platform which sends the occupation request. In one embodiment, the step of determining the occupancy state of the test machine based on the reservation state and the machine operation state of the test machine comprises: Judging whether the test machine is reserved or not based on the reserved state of the test machine; judging whether the test machine is currently executing a task or not based on the machine running state of the test machine; If the test machine is reserved or the test machine is currently executing a task, determining that the occupied state of the test machine is occupied, otherwise, determining that the occupied state of the test machine is unoccupied. In one embodiment, the step of determining whether the test cluster is in an idle state according to the occupancy state of each test machine includes: Determining the number of unoccupied machines according to the occupied state of each test machine; Obtaining the total number of test machines of the test cluster, and calculating the ratio between the number of unoccupied machines and the total number of test machines; And if the ratio is larger than a preset threshold, determining that the test cluster is in an idle state, otherwise, determining that the test cluster is not in the idle state. In one embodiment, the step of assigning the test machine to the computing power demand platform that sent the occupancy request comprises: when the occupation request is received, acquiring the reserved state of each test machine and the machine running state of each test machine in the test cluster again; For each testing machine, re-determining the occupation state of the testing machine according to the reserved state of the testing machine which is acquired latest and the machine running state of the testing machine which is acquired latest; If the test cluster is determined to be in an idle state according to the latest determined occupied state of each test machine, distributing the test machines for the calculation force demand platform for sending the occupation request based on the latest determined occupied state of each test machine. In one embodiment, the occupied state is occupied or unoccupied; The step of allocating the test machine to the computing power demand platform sending the occupation request based on the latest determined occupation state of each test machine comprises the following steps: Determining an unoccupied test machine according to the latest determined occupied state of each test machine, wherein the unoccupied test machine is a test machine with an unoccupied occupied state; The unoccupied