Hardware resource scheduling method, system, computer device and storage medium
By implementing file sharing and container mounting between the development machine and the target physical machine, the problem of low utilization of special hardware resources is solved, and the utilization efficiency of hardware resources and task execution efficiency are improved.
Patent Information
- Application Number
- CN202211410278.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2042-11-11
AI Technical Summary
In the existing technology, the utilization rate of special hardware resources such as GPUs and FPGAs is low, mainly due to debugging problems that cause them to be idle most of the time.
The target physical machine is determined through the server, and the agent program is started to realize file sharing and container mounting between the development machine and the target physical machine. The target container is used to execute tasks to ensure the consistency of the development environment and the operating environment.
It improves the utilization of special hardware resources, reduces idle time, and reduces the environment configuration costs and debugging time of developers.
Smart Images

Figure CN115756840B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a hardware resource scheduling method, system, computer device, and storage medium. Background Art
[0002] With the development of computer technology, artificial intelligence (AI) has emerged. When developers research AI-related issues, they need specialized hardware resources such as GPUs (graphics processing units) and / or FPGAs (field programmable gate arrays) to run their code. Because these specialized hardware resources are expensive, most companies currently provide developers with development machines without these specialized hardware resources. These resources are then allocated to developers when they need them to run their code.
[0003] However, when special hardware resources are combined with the developer's development machine, there are many debugging problems, which makes the special hardware resources idle most of the time they are allocated, resulting in low utilization of the special hardware resources. Summary of the Invention
[0004] Based on this, it is necessary to provide a hardware resource scheduling method, system, computer device, computer-readable storage medium and computer program product that can improve hardware resource utilization in response to the above technical problems.
[0005] In a first aspect, the present application provides a hardware resource scheduling method. The method includes:
[0006] In response to an execution command for a target task sent by a development machine, a target physical machine is determined; the target physical machine is used to provide special hardware resources required to execute the target task;
[0007] Start the first agent program on the target physical machine, and mount the root directory of the development machine where the file sharing service is enabled to the target mount point of the target physical machine through the first agent program;
[0008] Start the target container through the first agent program and replace the root directory of the target container with the target mount point of the target physical machine;
[0009] Execute the target task through the target container and obtain the target task execution result.
[0010] In some embodiments, the method further comprises:
[0011] A file sharing service is enabled for a disk on the development machine through a second agent program on the development machine; the file sharing service is used to enable file sharing between the development machine and the target physical machine. In some embodiments, the disk includes a system disk and a data disk.
[0012] In some embodiments, the method further comprises:
[0013] After the target task is executed, the target container is destroyed by the first agent program to recycle the target physical machine;
[0014] Disable the file sharing service through the second agent.
[0015] In some embodiments, in response to an execution command for a target task sent by a development machine, determining a target physical machine includes:
[0016] In response to an execution command for a target task sent by a development machine, the execution command is parsed to obtain special hardware resource requirement information;
[0017] Based on the special hardware resource requirement information, determine the target physical machine from the physical machine cluster.
[0018] In some embodiments, after executing the target task through the target container and obtaining the target task execution result, the method further includes:
[0019] Forward the target task execution result to the second agent program on the development machine through the first agent program;
[0020] The terminal receiving service opened by the second agent program receives the target task execution result, so as to output and display the target task execution result in the development machine.
[0021] In some embodiments, the method further comprises:
[0022] Display the command line interface on the development machine;
[0023] According to the execution command code entered in the command line interface, the execution command for the target task is sent to the server;
[0024] In response to an execution command for a target task sent by a development machine, determining a target physical machine includes:
[0025] The server extracts the development machine identifier from the execution command and allocates a corresponding target physical machine to the development machine uniquely represented by the development machine identifier.
[0026] In a second aspect, the present application also provides a hardware resource scheduling system. The system includes: a server and a target physical machine;
[0027] The server is used to respond to the execution command for the target task sent by the development machine and determine the target physical machine; the target physical machine is used to provide the special hardware resources required to execute the target task;
[0028] The target physical machine is used to start the first agent program on the target physical machine, and mount the root directory of the development machine that starts the file sharing service to the target mount point of the target physical machine through the first agent program; start the target container through the first agent program, and replace the root directory of the target container with the target mount point of the target physical machine; execute the target task through the target container to obtain the target task execution result.
[0029] In some embodiments, the system further comprises:
[0030] The development machine is used to enable a file sharing service for a disk on the development machine through a second agent program on the development machine; wherein the file sharing service is used to implement file sharing between the development machine and the target physical machine.
[0031] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above method embodiment when executing the computer program.
[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method embodiments when executed by a processor.
[0033] In a fifth aspect, the present application further provides a computer program product, which includes a computer program that implements the steps in the above method embodiments when executed by a processor.
[0034] The above-mentioned hardware resource scheduling method, system, computer device, computer-readable storage medium and computer program product, when executing a target task that requires special hardware resources, determines the target physical machine with special hardware resources through the execution command for the target task sent by the development machine, and mounts the root directory of the development machine that enables the file sharing service to the target mount point of the target physical machine and starts the target container through the first agent program, then replaces the root directory of the target container with the target mount point of the target physical machine, and finally executes the target task through the target container to obtain the target task execution result. Through the first agent program and the file sharing service, the root directory of the development machine is automatically mounted to the root directory of the target container, and the target task is executed through the target container, ensuring the consistency of the development environment and the operating environment of the target task, reducing the cost of developers to configure the environment additionally, saving the debugging time of combining the development machine with the special hardware resources, reducing the idle time of the special hardware resources after being allocated to the developers, and further improving the utilization rate of the special hardware resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A diagram illustrating an application environment of a hardware resource scheduling method according to an embodiment;
[0036] Figure 2 1 is a flow chart of a hardware resource scheduling method according to an embodiment;
[0037] Figure 3 is a flowchart of a hardware resource scheduling method according to another embodiment;
[0038] Figure 4 is a structural block diagram of a hardware resource scheduling system in one embodiment;
[0039] Figure 5 is a structural block diagram of a hardware resource scheduling system in another embodiment;
[0040] Figure 6 is a diagram of the internal structure of a computer device in one embodiment;
[0041] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0043] The hardware resource scheduling method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. When executing a target task that requires special hardware resources, the development machine 101 requests special hardware resources from the server 102, and the server 102 determines the target physical machine 1031 for executing the target task from the physical machine cluster 103. Among them, the server refers to the cluster manager that manages the physical machine cluster. The server is the main coordinator and manager of the entire physical machine cluster, responsible for formulating the allocation strategy of the target physical machine and scheduling the special hardware resources of the physical machine cluster. It should be noted that the server can exist independently of the physical machine cluster, or it can be deployed inside a physical machine in the physical machine cluster. It can be understood that the server and the physical machine cluster used to provide special hardware resources are background devices, that is, the server and the physical machine cluster are regarded as a background device to execute the steps of the embodiment of this method.
[0044] Exemplarily, the server 102 determines the target physical machine 1031 in response to the execution command for the target task sent by the development machine 101; the target physical machine 1031 is used to provide the special hardware resources required to execute the target task. The first agent program on the target physical machine 1031 is started, and the target physical machine 1031 mounts the root directory of the development machine 101 that enables the file sharing service to the target mount point of the target physical machine 1031 through the first agent program. The target physical machine 1031 starts the target container through the first agent program and replaces the root directory of the target container with the target mount point of the target physical machine 1031. The target physical machine 1031 executes the target task through the target container and obtains the target task execution result.
[0045] In some embodiments, as Figure 2 As shown, a hardware resource scheduling method is provided, which can be Figure 1 The method can be implemented by interaction between the server 102 and the target physical machine 1031, or by interaction between the server 102, the development machine 101, and the target physical machine 1031. The method includes the following steps:
[0046] Step 201: In response to an execution command for a target task sent by a development machine, a target physical machine is determined; the target physical machine is used to provide special hardware resources required for executing the target task.
[0047] A development machine is a hardware environment used for development and configuration. Developers configure the required code environment on the development machine. It's understandable that a virtual machine can be used as a development machine.
[0048] A target task is the code designed by developers to achieve a specific goal or solve a problem. Entering the code execution command corresponding to the target task, i.e., the target task execution command, will complete the code execution.
[0049] A physical machine is a physical computer that provides specialized hardware resources. These resources are difficult to obtain or more expensive than standard hardware resources (such as memory). For example, specialized hardware resources include at least one of a graphics processing unit (GPU) and an FPGA (field programmable gate array).
[0050] For example, when executing a target task that requires special hardware resources, the server responds to an execution command for the target task sent by the development machine, parses the execution command of the target task, and determines a target physical machine based on the parsing result.
[0051] Step 202: Start the first agent program on the target physical machine, and mount the root directory of the development machine with the file sharing service enabled to the target mount point of the target physical machine through the first agent program.
[0052] The first agent program refers to the agent program running on the target physical machine. It is understood that the first agent program is an agent program with a completely new function proposed in this application. That is, the first agent program is an agent program used to automatically mount directories between the development machine and the target physical machine and start containers. It should be noted that the functions of the first agent program include but are not limited to these. It is understood that the agent program is an agent.
[0053] File sharing services refer to NFS (Network File System) services. By using file sharing services, users can access files on remote systems just like accessing local files, allowing each computer node to use online resources as easily as using local resources.
[0054] The target mount point is a directory on the physical machine used to mount the disk of the development machine. It is understandable that any directory on the physical machine can be used as the target mount point, and this embodiment does not limit this.
[0055] For example, after the target physical machine is assigned by the server to execute the target task, the first agent program on the target physical machine is started, and a file directory on the target physical machine is set as the target mount point through the first agent program. After the development machine starts the file sharing service, the root directory of the development machine that starts the file sharing service is mounted to the target mount point of the target physical machine through the first agent program.
[0056] It can be understood that after the root directory of the development machine is mounted to the target mount point of the target physical machine, the files on the development machine can be accessed by accessing the target mount point of the target physical machine.
[0057] In some embodiments, a specified file directory on the target physical machine may be used as the target mount point, or any file directory on the target physical machine may be used as the target mount point, without limitation.
[0058] In some embodiments, while ensuring the absolute security of the development machine, the file sharing service on the development machine can be enabled at all times, without having to wait until the target physical machine is assigned by the server to execute the target task. In other embodiments, the file sharing service may not be enabled by default at all times, but may be triggered to enable under certain conditions.
[0059] Step 203: Start the target container through the first agent program, and replace the root directory of the target container with the target mount point of the target physical machine.
[0060] The target container is a container created on the target physical machine. It is understood that containers created on the target physical machine can utilize the target physical machine's unique hardware resources. By using target containers, the various resources required for task execution are isolated, allowing multiple tasks to run on the same target physical machine and utilize its unique hardware resources, thereby maximizing resource utilization.
[0061] Exemplarily, after the root directory of the development machine is successfully mounted to the target mount point of the target physical machine, the target physical machine starts the target container through the first agent program and replaces the root directory of the target container with the target mount point of the target physical machine.
[0062] Step 204: Execute the target task through the target container to obtain the target task execution result.
[0063] The target task execution result is the result output during the execution of the target task, that is, the result of running the code.
[0064] Exemplarily, after the target container is started, the execution command of the target task is run, and the target physical machine executes the target task through the target container to obtain the target task execution result.
[0065] In some embodiments, the target physical machine may send the target task execution result to the development machine, so that the development machine outputs and displays the target task execution result.
[0066] In some embodiments, after the target task is executed, the target physical machine may destroy the created target container to reclaim the special hardware resources occupied by the target container.
[0067] In some embodiments, after the target task is completed, the development machine can shut down the file sharing service, thereby improving security. In other embodiments, after the target task is completed, the development machine can also keep the file sharing service in an open state under safe conditions, so that when special hardware resources are needed later, the required special hardware resources can be used directly based on the file sharing service that has been in an open state through the method of the present application to perform the task, thereby improving the efficiency of task execution.
[0068] In the above-mentioned hardware resource scheduling method, the root directory of the development machine is automatically mounted to the root directory of the target container through the first agent program and the file sharing service, and the target task is executed through the target container, thereby ensuring the consistency of the development environment and the operating environment of the target task, reducing the cost of additional environment configuration for developers, saving the debugging time of combining the development machine with special hardware resources, reducing the idle time of special hardware resources after being allocated to developers, and further improving the utilization rate of special hardware resources.
[0069] In some embodiments, the method further comprises:
[0070] Through the second agent program on the development machine, the file sharing service is enabled for the disk on the development machine; the file sharing service is used to realize file sharing between the development machine and the target physical machine.
[0071] The second agent program refers to an agent program running on the development machine. When the execution command of the target task is detected, the second agent program is awakened and started. It will be understood that in this embodiment, the second agent program has the function of controlling the activation of the file sharing service, that is, the second agent program can autonomously control the activation of the file sharing service.
[0072] For example, a second agent program is pre-running on the development machine. When the development machine sends an execution command for the target task to the server, the second agent program on the development machine is awakened and started. The development machine uses the second agent program on the development machine to start the file sharing service for the disk on the development machine.
[0073] In some embodiments, the disk includes a system disk and a data disk; the second agent program on the development machine can enable file sharing services for both the system disk and the data disk on the development machine. It is understood that the first agent program on the target physical machine can mount the system disk and the data disk on the development machine with the file sharing service enabled, thereby mounting the root directory of the development machine to the target mount point of the target physical machine. It is understood that the method of the present application can achieve sharing of data disks and system disks.
[0074] It should be noted that the startup sequence of the first agent program and the second agent program can be changed and can be determined according to needs, and this embodiment does not limit this.
[0075] In the above embodiment, when the execution command of the target task is monitored, the file sharing service on the development machine is enabled through the second agent program, so that the local root directory of the development machine can be accessed by the target physical machine, which can save the local storage space of the target physical machine.
[0076] In some embodiments, the method further includes: after the target task is executed, destroying the target container by the first agent program to reclaim the target physical machine; and closing the file sharing service by the second agent program.
[0077] For example, after a target physical machine is assigned by a server to execute a target task, a first agent program on the target physical machine is started. The first agent program mounts the root directory of a development machine that has enabled a file sharing service to a target mount point on the target physical machine. A target container is started, and the root directory of the target container is replaced with the target mount point on the target physical machine. The target task is then executed via the target container. After the target task is completed, the first agent program destroys the target container to reclaim the target physical machine. The file sharing service is then shut down via a second agent program.
[0078] In the above embodiment, after the target task is executed, the target container is destroyed by the first agent program to recycle the target physical machine, which can avoid wasting the special hardware resources of the target physical machine; at the same time, the file sharing service is closed after the target task is executed to ensure the security of the data resources on the development machine and the data resources on the target physical machine.
[0079] In some embodiments, in response to an execution command for a target task sent by a development machine, determining a target physical machine includes: in response to an execution command for a target task sent by a development machine, parsing the execution command to obtain special hardware resource requirement information; and determining the target physical machine from a physical machine cluster based on the special hardware resource requirement information.
[0080] The special hardware resource requirement information refers to the information about the special hardware resources required to execute the target task, including the type, size, and quantity of the special hardware resources.
[0081] A physical machine cluster refers to a group of physical computers with special hardware resources. The physical machine cluster as a whole provides special hardware resources to developers.
[0082] For example, when executing a target task that requires special hardware resources, the server responds to the execution command for the target task sent by the development machine, parses the execution command, and obtains special hardware resource requirement information; based on the special hardware resource requirement information, determines the target physical machine from the physical machine cluster.
[0083] It is understandable that the server can select a physical machine that meets the special hardware resource conditions required by the special hardware resource requirement information from the physical machine cluster as the target physical machine.
[0084] In some embodiments, the server configures the size and quantity of special hardware resources required to execute the target task based on the special hardware resource requirement information, and selects a physical machine that can meet the size and quantity of special hardware resources from the physical machine cluster as the target physical machine according to the sorting algorithm.
[0085] In the above embodiment, special hardware resource requirement information is determined according to the execution command of the target task, and a target physical machine that meets the special hardware resource requirement information is allocated, using an on-demand allocation method to avoid wasting special hardware resources.
[0086] In some embodiments, after executing the target task through the target container and obtaining the target task execution result, it also includes: forwarding the target task execution result to the second agent program on the development machine through the first agent program; receiving the target task execution result through the terminal receiving service opened by the second agent program, so as to output and display the target task execution result in the development machine.
[0087] The Terminal Receiving Service is a system service component that transmits client input to the backend and transmits backend output back to the client. As you can see, enabling the Terminal Receiving Service allows backend output to be forwarded to the client. This means that backend output logs can be forwarded to the client, allowing the client to see the backend output.
[0088] Exemplarily, after the development machine sends an execution command for the target task, the development machine opens a terminal receiving service through the second agent program. After the target physical machine executes the target task through the target container and obtains the target task execution result, the target physical machine forwards the target task execution result to the second agent program on the development machine through the first agent program. The development machine receives the target task execution result through the terminal receiving service opened by the second agent program to output and display the target task execution result on the development machine.
[0089] In the above embodiment, the second agent program is also used for the agent docking function of communication forwarding between the development machine and the physical machine. By turning on the terminal receiving service, communication is established between the first agent program and the second agent program. Developers can see the target task execution results on the development machine without performing additional operations. For example, there is no need to perform additional operations such as opening a web page or entering commands, and the target task execution results can be seen on the development machine, so that developers can achieve what they see is what they get.
[0090] In some embodiments, the method also includes: displaying a command line interface on the development machine; sending an execution command for the target task to the server based on the execution command code entered in the command line interface; determining the target physical machine in response to the execution command for the target task sent by the development machine, including: the server extracting the development machine identifier in the execution command, and allocating a corresponding target physical machine to the development machine uniquely represented by the development machine identifier.
[0091] Among them, the command-line interface (CLI) was the most widely used user interface before the graphical user interface became popular. It usually does not support a mouse. Users enter commands through the keyboard, and the computer executes them after receiving the commands.
[0092] The development machine ID is a UUID (Universally Unique Identifier) pre-stored on the development machine. It is used to uniquely identify the development machine.
[0093] For example, a developer invokes the command line interface (CLI) of the development machine, causing the CLI to be displayed on the development machine. The development machine then sends an execution command for the target task to the server based on the execution command code entered by the developer in the CLI. It will be appreciated that the execution command code includes the development machine identifier, so the generated execution command for the target task also includes the development machine identifier. In response to the execution command for the target task sent by the development machine, the server extracts the development machine identifier from the execution command and assigns a corresponding target physical machine to the development machine uniquely represented by the development machine identifier.
[0094] In the above embodiment, the target physical machine is allocated to the development machine uniquely represented by the development machine identifier by extracting the development machine identifier from the execution command, so that the target physical machine is accurately allocated to the development machine.
[0095] In some embodiments, as Figure 3 As shown, a flowchart of a hardware resource scheduling method is provided. The method is implemented through interaction between a server, a target physical machine, and a development machine, and includes the following steps:
[0096] Step 301: The development machine displays a command line interface; the development machine sends an execution command for a target task to the server according to the execution command code entered in the command line interface.
[0097] Step 302: The server responds to the execution command for the target task sent by the development machine, parses the execution command, and obtains special hardware resource requirement information; and determines the target physical machine from the physical machine cluster based on the special hardware resource requirement information.
[0098] The target physical machine is used to provide the special hardware resources required to execute the target task.
[0099] Step 303: The server extracts the development machine identifier from the execution command of the target task, and allocates a corresponding target physical machine to the development machine uniquely represented by the development machine identifier.
[0100] Step 304: The second agent program on the development machine is awakened and started, and the file sharing service is enabled for the system disk and data disk on the development machine through the second agent program on the development machine.
[0101] The file sharing service is used to implement file sharing between the development machine and the target physical machine.
[0102] Step 305: Start the first agent program on the target physical machine, and mount the root directory of the development machine with the file sharing service enabled to the target mount point of the target physical machine through the first agent program.
[0103] It should be noted that the startup sequence of the first agent program and the second agent program can be changed and can be determined according to needs, and this embodiment does not limit this.
[0104] Step 306: The development machine starts the target container through the first agent program, and replaces the root directory of the target container with the target mount point of the target physical machine.
[0105] Step 307: The target physical machine executes the target task through the target container to obtain the target task execution result.
[0106] Step 308: The target physical machine forwards the target task execution result to the second agent program on the development machine through the first agent program; the development machine receives the target task execution result through the terminal receiving service opened by the second agent program, so as to output and display the target task execution result on the development machine.
[0107] Step 309: After the target task is executed, the target physical machine destroys the target container through the first agent program to recycle the target physical machine; the development machine closes the file sharing service through the second agent program.
[0108] In this embodiment, the root directory of the development machine is automatically mounted to the root directory of the target container through the first agent program and the file sharing service, and the target task is executed through the target container, thereby ensuring the consistency of the development environment and the operating environment of the target task, reducing the cost of additional environment configuration for developers, saving the debugging time of combining the development machine with special hardware resources, reducing the idle time of special hardware resources after being allocated to developers, and further improving the utilization rate of special hardware resources.
[0109] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the above-mentioned embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0110] Based on the same inventive concept, the present application also provides a hardware resource scheduling system for implementing the hardware resource scheduling method described above. The implementation solution provided by this system is similar to the implementation solution described in the above method. Therefore, the specific limitations in the hardware resource scheduling system embodiment provided below can be found in the above limitations on the hardware resource scheduling method and will not be repeated here.
[0111] In some embodiments, as Figure 4 As shown, a structural block diagram of a hardware resource scheduling system is provided, and the system includes: a server 401 and a target physical machine 402.
[0112] The server 401 is used to determine a target physical machine in response to an execution command for a target task sent by a development machine; the target physical machine is used to provide special hardware resources required to execute the target task.
[0113] The target physical machine 402 is used to start the first agent program on the target physical machine, and mount the root directory of the development machine that starts the file sharing service to the target mount point of the target physical machine through the first agent program; start the target container through the first agent program, and replace the root directory of the target container with the target mount point of the target physical machine; execute the target task through the target container to obtain the target task execution result.
[0114] In the above-mentioned hardware resource scheduling system, the root directory of the development machine is automatically mounted to the root directory of the target container through the first agent program in the target physical machine and the file sharing service enabled on the development machine, and the target task is executed through the target container, thereby ensuring the consistency of the development environment and the operating environment of the target task, saving the debugging time of combining the development machine with special hardware resources, reducing the idle time of special hardware resources after being allocated to developers, and further improving the utilization rate of special hardware resources.
[0115] In some embodiments, as Figure 5 As shown, the system further includes a development machine 403.
[0116] The development machine 403 is used to enable a file sharing service for a disk on the development machine 403 through a second agent program on the development machine 403 ; the file sharing service is used to implement file sharing between the development machine 403 and the target physical machine 402 .
[0117] In some embodiments, the target physical machine 402 is used to destroy the target container through the first agent program after the target task is executed to recycle the target physical machine 402; the development machine 403 is used to close the file sharing service through the second agent program.
[0118] In some embodiments, the server 401 is further configured to respond to an execution command for a target task sent by the development machine 403, parse the execution command, and obtain special hardware resource requirement information; and determine a target physical machine from the physical machine cluster based on the special hardware resource requirement information.
[0119] In some embodiments, after executing the target task through the target container and obtaining the target task execution result, the target physical machine 402 is also used to forward the target task execution result to the second agent program on the development machine through the first agent program; the development machine 403 is also used to receive the target task execution result through the terminal receiving service opened by the second agent program, so as to output and display the target task execution result.
[0120] In some embodiments, the development machine 403 is further configured to display a command line interface (CLI); based on an execution command code entered in the CLI, the development machine 403 sends an execution command for a target task to the server 401. The server 401 is further configured to extract the development machine identifier from the execution command and assign a corresponding target physical machine 402 to the development machine 403 uniquely identified by the development machine identifier.
[0121] In some embodiments, a computer device is provided. The computer device may be a server or a target physical machine, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements at least part of the steps in a hardware resource scheduling method.
[0122] In some embodiments, a computer device is provided. The computer device may be a development machine, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, it implements at least part of the steps in a hardware resource scheduling method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse.
[0123] Those skilled in the art will understand that Figure 7The structure shown in the figure is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the above-mentioned method embodiments are implemented.
[0124] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0125] In some embodiments, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0126] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.
[0127] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0128] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0129] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A hardware resource scheduling method, characterized in that: The method comprises: In response to an execution command for a target task sent by a development machine, determining a target physical machine; the target physical machine is used to provide special hardware resources required to execute the target task; Starting a first agent program on the target physical machine, and mounting the root directory of the development machine on which the file sharing service is enabled to a target mount point of the target physical machine through the first agent program; Starting a target container through the first agent program, and replacing the root directory of the target container with the target mount point of the target physical machine; The target task is executed through the target container to obtain a target task execution result.
2. The method according to claim 1, characterized in that The method further comprises: A file sharing service is enabled for the disk on the development machine through the second agent program on the development machine; the file sharing service is used to realize file sharing between the development machine and the target physical machine.
3. The method according to claim 2, characterized in that The disk includes a system disk and a data disk.
4. The method according to claim 2, characterized in that The method further comprises: After the target task is executed, destroying the target container through the first agent program to recycle the target physical machine; The file sharing service is closed by the second agent program.
5. The method according to claim 1, wherein The step of determining the target physical machine in response to the execution command for the target task sent by the development machine includes: In response to an execution command for a target task sent by a development machine, the execution command is parsed to obtain special hardware resource requirement information; The target physical machine is determined from a physical machine cluster according to the special hardware resource requirement information.
6. The method according to claim 1, characterized in that After executing the target task through the target container and obtaining the target task execution result, the method further includes: forwarding the target task execution result to the second agent program on the development machine through the first agent program; The target task execution result is received through the terminal receiving service opened by the second agent program, so as to output and display the target task execution result in the development machine.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Display the command line interface on the development machine; Sending an execution command for the target task to the server according to the execution command code entered in the command line interface; The step of determining the target physical machine in response to the execution command for the target task sent by the development machine includes: The server extracts the development machine identifier in the execution command and allocates a corresponding target physical machine to the development machine uniquely represented by the development machine identifier.
8. A hardware resource scheduling system, characterized in that: The system includes: a server and a target physical machine; The server is configured to determine the target physical machine in response to an execution command for a target task sent by the development machine; the target physical machine is configured to provide special hardware resources required to execute the target task; The target physical machine is used to start the first agent program on the target physical machine, and mount the root directory of the development machine that starts the file sharing service to the target mount point of the target physical machine through the first agent program; start the target container through the first agent program, and replace the root directory of the target container with the target mount point of the target physical machine; execute the target task through the target container to obtain the target task execution result.
9. The system according to claim 8, characterized in that The system further comprises: The development machine is used to enable a file sharing service for a disk on the development machine through a second agent program on the development machine; wherein the file sharing service is used to realize file sharing between the development machine and the target physical machine.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Processing method, device and equipment for operation task of development machine and storage medium
CN112035220A
Code running method and device, electronic equipment, storage medium and program product
CN113742716A