Resource allocation system, method, apparatus, computer device and storage medium
By establishing a correlation between target resource identifiers and container identifiers in the resource allocation system, the problem of computing resource chaos caused by chip resource replacement is solved, ensuring the orderly processing of business processes and the efficient utilization of computing resources.
Patent Information
- Application Number
- CN202110387784.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-12
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2041-04-12
AI Technical Summary
In traditional resource allocation systems, when allocated chip resources are replaced due to faults or other reasons, it is easy to cause problems with the use of computing resources, resulting in the disruption of business processing.
The resource allocation system uses allocators and resource plugins to establish resource associations between target resource identifiers and container identifiers, ensuring that resource containers can call the latest business processors for business processing based on their installation locations, thus achieving orderly resource allocation.
Even if the business processor in the target installation location is replaced, the resource container can still call the new target business processor to ensure the orderliness of the business processing and improve the efficiency of computing resource utilization.
Smart Images

Figure CN115202856B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource allocation system, method, apparatus, computer device, and storage medium. Background Art
[0002] With the development of network technology, the demand for fast data processing is increasing. In many cases, a large amount of computing resources are needed to centrally process data. For example, when training artificial intelligence models, a large amount of computing resources are required to complete the model training process.
[0003] Currently, one or more chip resources can be allocated for business processing. With traditional resource allocation technology, when an allocated chip resource is replaced due to a fault, for example, the use of computing resources during business processing is prone to confusion. Summary of the Invention
[0004] Based on this, it is necessary to provide a resource allocation system, method, apparatus, computer device and storage medium to address the above technical issues.
[0005] A resource allocation system, the system comprising: an allocator for receiving a resource allocation request, determining a resource container corresponding to the resource allocation request, and determining a target resource identifier corresponding to the resource container from a set of candidate resource identifiers; the resource identifiers in the set of candidate resource identifiers have a position correspondence with the installation location of a business processor; a resource plug-in for receiving an allocation indication message sent by the allocator, the allocation indication message carrying the target resource identifier and the container identifier of the resource container, and in response to the allocation indication message, triggering the establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier; the resource container for obtaining the target resource identifier according to the resource association relationship when performing business processing, determining the target installation location corresponding to the target resource identifier according to the position correspondence, and calling the target business processor installed in the target installation location to process business data.
[0006] A resource allocation method, the method comprising: receiving a resource allocation request, the resource allocation request being used to request allocation of business processing resources for a resource container; in response to the resource allocation request, determining a target resource identifier corresponding to the resource container from a set of candidate resource identifiers; the resource identifiers in the set of candidate resource identifiers having a position correspondence with the installation location of a business processor; triggering establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier; wherein the resource association relationship is used to trigger the resource container to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the position correspondence, and call the target business processor installed in the target installation location to process business data.
[0007] A resource allocation device, the device comprising: an allocation request receiving module for receiving a resource allocation request, the resource allocation request being used to request allocation of business processing resources for a resource container; a resource identifier determining module for determining, in response to the resource allocation request, a target resource identifier corresponding to the resource container from a set of candidate resource identifiers; the resource identifiers in the set of candidate resource identifiers having a position correspondence with the installation location of the business processor; an association relationship establishing module for triggering establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier; wherein the resource association relationship is used to trigger the resource container to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the position correspondence, and call the target business processor installed in the target installation location to process business data.
[0008] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program: receiving a resource allocation request, wherein the resource allocation request is used to request allocation of business processing resources for a resource container; in response to the resource allocation request, determining a target resource identifier corresponding to the resource container from a set of candidate resource identifiers; the resource identifiers in the set of candidate resource identifiers have a position correspondence with the installation location of the business processor; triggering establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier; wherein the resource association relationship is used to trigger the resource container to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the position correspondence, and call the target business processor installed in the target installation location to process business data.
[0009] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps: receiving a resource allocation request, the resource allocation request being used to request allocation of business processing resources for a resource container; determining, in response to the resource allocation request, a target resource identifier corresponding to the resource container from a set of candidate resource identifiers; the resource identifiers in the set of candidate resource identifiers having a position correspondence with the installation location of the business processor; triggering establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier; wherein the resource association relationship is used to trigger the resource container to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the position correspondence, and call the target business processor installed in the target installation location to process business data.
[0010] The above-mentioned resource allocation system, method, apparatus, computer device and storage medium, in response to a resource allocation request for allocating business processing resources to a resource container, determines a target resource identifier corresponding to the resource container from a set of candidate resource identifiers; wherein the resource identifiers in the candidate resource identifier set have a positional correspondence with the installation location of the business processor; can establish a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier based on the installation location of the business processor; so as to trigger the resource container to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the positional correspondence between the resource identifier and the installation location of the business processor, and call the target business processor based on the target installation location to process business data. Since the resource identifier has a positional correspondence with the installation location of the business processor, and the resource container calls the business processor at the target installation location corresponding to the target resource identifier based on the positional correspondence when calling the business processor for business processing, even if the business processor in the target installation location is replaced with a new target business processor, the resource container can still call the new target business processor for business processing, thereby ensuring the orderly use of resources during business processing and improving the efficiency of computing resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A structural block diagram of a resource allocation system in one embodiment;
[0012] Figure 2 A diagram showing the connection relationship between a graphics processor and a central processing unit in one embodiment;
[0013] Figure 3 A schematic diagram of a model training process in one embodiment;
[0014] Figure 4It is a structural block diagram of a resource allocation system in another embodiment;
[0015] Figure 5 A diagram of an application environment of a resource allocation method in one embodiment;
[0016] Figure 6 Schematic diagram of a flow chart of a resource allocation method in one embodiment;
[0017] Figure 7 is a flowchart of a resource allocation method in another embodiment;
[0018] Figure 8 is a structural block diagram of a resource allocation device in one embodiment;
[0019] Figure 9 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0020] 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.
[0021] The various embodiments provided in this application can be implemented based on cloud technology. Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0022] Cloud computing is a computing model that distributes computing tasks across a resource pool consisting of a large number of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network that provides these resources is called the "cloud." To users, these resources appear infinitely scalable and can be accessed at any time, used on demand, expanded at any time, and paid for on a per-use basis.
[0023] As a provider of cloud computing infrastructure, a cloud computing resource pool (referred to as a cloud platform, often referred to as an IaaS (Infrastructure as a Service) platform) is established. Various virtual resources are deployed within the resource pool for external clients to select and use. The cloud computing resource pool primarily includes computing devices (virtualized machines, including operating systems), storage devices, and network devices. In one embodiment, resources within the cloud computing resource pool can be partitioned and allocated to containers, enabling the containers to complete corresponding business processing based on the allocated resources.
[0024] Based on logical functional divisions, the PaaS (Platform as a Service) layer can be deployed on top of the IaaS layer, and the SaaS (Software as a Service) layer can be deployed on top of the PaaS layer. SaaS can also be deployed directly on top of IaaS. PaaS is a platform for software execution, such as databases and web (World Wide Web) containers. SaaS is a variety of business software, such as web portals and text message senders. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0025] The various embodiments provided in this application can also be applied to artificial intelligence technology. Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making. AI technology is an interdisciplinary discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Basic AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0026] Computer vision (CV) is the science of making machines "see." Specifically, it refers to using cameras and computers to replace the human eye in identifying, tracking, and measuring objects. It also performs image processing, transforming the images into images more suitable for human observation or transmission to instrumentation. As a scientific discipline, computer vision studies related theories and technologies, aiming to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / action recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping, and other technologies. It also includes common biometric recognition technologies such as facial recognition and fingerprint recognition.
[0027] In one embodiment, Figure 1 As shown, a resource allocation system 100 is provided, comprising the following components: an allocator 102, a resource plug-in 104, and a resource container 106. The resource allocation system can be a system configured on a computer device, which can be referred to as a host computer. Furthermore, allocator 102, resource plug-in 104, and resource container 106 can each communicate with each other via a network on the host computer.
[0028] Among them, the allocator 102 can be a device that performs resource allocation control in the resource allocation system. The allocator can be implemented by a processor on a computer device or by an independent computer device. The allocator can also be called an allocation center (master). The allocator can be connected to the resource plug-in and the resource container through a network. The allocator can determine the target resource identifier corresponding to the resource container, and then directly establish a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier, or establish a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier through the resource plug-in.
[0029] A resource plug-in can be a device that plays an auxiliary role in resource allocation, or a plug-in loaded into an application, which is installed on the mother machine. In certain embodiments, the resource plug-in can also be implemented by an independent processor on the mother machine, or by a computer device independent of the mother machine. The resource plug-in can be independently deployed on each business processor, and each resource plug-in interacts with the corresponding business processor in a single line. When there are multiple business processors, there will be multiple resource plug-ins. In this case, the combination of all resource plug-ins can be used as a plug-in layer. Of course, the resource plug-in can also be deployed on each business processor at the same time, that is, a resource plug-in simultaneously connects to each business processor and interacts with each business processor. In certain embodiments, the resource plug-in can also be called a device plug-in. In the process of assisting resource allocation, the resource plug-in can establish a resource association relationship between a resource identifier and a resource container, and can also record and update the allocation status of the business processors in each installation location.
[0030] A resource container (docker) can be the resource container targeted by the current resource allocation process and is referred to as the current resource container. A resource container can be a separately allocated resource used to complete a specific service, such as a separately allocated chip used to complete a specific service. Specifically, a container is a set of resources isolated on the host machine, with independent file and process spaces within the container. After the container is started, the container in the running state is referred to as the running container. A resource container can complete services based on corresponding resources, for example, using resources corresponding to a graphics processor to complete a graphics data analysis service. The number of resource containers can be at least one. When there are at least two resource containers, these resource containers can be configured in a physically isolated state, preventing data exchange between resource containers and preventing computational results between resource containers from affecting each other. By configuring resource containers, the service processing processes of different resource containers can be isolated from each other, ensuring the independence and reliability of different service processing results. Furthermore, an association can be established between a target resource identifier and a resource container, allowing the resource container to complete service processing based on the service processor corresponding to the target resource identifier.
[0031] It should be noted that the resource allocation system may include a distributor, a resource plug-in, and a resource container. Furthermore, the resource allocation system may also include other resource containers besides the resource container (which may be referred to as the current resource container). The distributor may allocate resources to other resource containers.
[0032] The steps to be performed for each component are described below:
[0033] The allocator 102 is configured to receive a resource allocation request, determine the resource container corresponding to the resource allocation request, and determine a target resource identifier corresponding to the current resource container from a set of candidate resource identifiers; the resource identifiers in the set of candidate resource identifiers have a positional correspondence with the installation location of the service processor.
[0034] Resources are the business processing resources required by computer devices to perform operations. Business processing resources are provided by business processors. Business processing resources represent the computing power of computer devices. Computing power, also known as computing power, reflects the business processing capabilities of business processors. Therefore, computing power allocation can be achieved by assigning business processors. Resource allocation is also called computing power allocation, and the corresponding resource container is called a computing power container.
[0035] In one embodiment, a service processor can be a processor capable of completing corresponding service processing using resources. Furthermore, the service processor can be implemented using a chip. A service processor can be a processor other than a central processing unit (CPU), in which case it can be referred to as a heterogeneous processor. The service processing performed by the service processor can be at least one of the following: graphics analysis, voice information analysis, or model training. Furthermore, the service processor can be a GPU (Graphics Processing Unit) or other type of processor. The service processing performance of service processors installed in different installation locations can be the same or different. Service processing performance can be characterized by the amount of memory space corresponding to the processor. When service processing performance is the same, resources can be allocated based on the number of service processors. For example, a set of candidate resource identifiers can be constructed based on the resource identifiers of the installation locations of each service processor. The set of candidate resource identifiers can contain multiple candidate resource identifiers, each of which represents a service processor in a specific installation location. When a service processor is required, a resource identifier is selected from the set of candidate resource identifiers as the target resource identifier. When multiple service processors are required, a corresponding number of target resource identifiers are selected from the set of candidate resource identifiers, where the number of target resource identifiers can be two or more. When the business processing performance is different, resource allocation can be completed according to the business processing performance requirements of the business processor. For example, the business processor that can meet the performance requirements corresponding to the resource allocation request is determined, and the corresponding target resource identifier is selected from the candidate resource identifier set accordingly. Specifically, assume that the total memory bandwidth of the unallocated business processing is 500GB / s (gigabytes per second), which includes: business processor A with a memory bandwidth of 50GB / s, business processor B with a memory bandwidth of 200GB / s, and business processor C with a memory bandwidth of 250GB / s. When the performance requirement corresponding to the resource allocation request is a memory bandwidth of 450GB / s, the resource identifiers corresponding to business processors B and C are selected from the candidate resource identifier set as the target resource identifier.
[0036] A resource allocation request is a request to allocate business processing resources to a resource container. Therefore, the resource allocation request may include the container identifier of the resource container. This container identifier uniquely identifies the resource container and can be represented by a specific number. The resource allocation request may also include the number of resource containers. The allocator allocates resources in equal shares based on the number of resource containers, allocating the corresponding resources to each resource container.
[0037] Among them, the resource identifier is information for uniquely distinguishing a resource, and can be represented by a specific number. A resource is a resource at a specific installation location, so the resource identifier can also be understood as an identifier corresponding to the installation location. The candidate resource identifier set is a set consisting of at least one resource identifier. In an embodiment of the present application, the resource identifier and the installation location of the service processor have a position correspondence, and the position correspondence can be a one-to-one relationship or a many-to-one relationship. Through the position correspondence between the resource identifier and the installation location of the service processor, the allocator or resource container can locate the corresponding installation location based on the resource identifier and trigger the service processor at the installation location to perform service processing. In one embodiment, when the service processor is a GPU, the resource identifier can be called a GPU serial number or a GPU card serial number. Furthermore, the GPU card serial number can remain fixed after being assembled at the installation location on the computer device, and will not change with hardware card replacement or card replacement.
[0038] The number of installation locations may be one or more. One installation location may correspond to one service processor. Furthermore, the service processor may be installed in the corresponding installation location via a specific interface. The interface may be a PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) slot. Furthermore, a set number of slots may be configured on the computer device, and a corresponding service processor may be inserted into each slot. The number of slots may be determined based on actual conditions, for example, 6, 8, etc.
[0039] The target business processor may be the most recently installed business processor in the target installation location. Therefore, the resource container may call the most recently installed business processor in the target installation location to process the business data.
[0040] In one embodiment, the allocator may receive a resource allocation request from a terminal device, determine the corresponding resource container based on the container identifier carried in the resource allocation request, and determine the target resource identifier corresponding to the resource container from a set of candidate resource identifiers, that is, determine the target resource identifier that matches the resource allocation request. This target resource identifier is sent to the resource container, and the resource corresponding to the target resource identifier is then mounted on the resource container.
[0041] The resource plug-in 104 is used to receive an allocation indication message sent by the allocator, which carries the target resource identifier and the container identifier of the resource container. In response to the allocation indication message, it triggers the establishment of a resource association relationship between the resource container corresponding to the target resource identifier and the container identifier.
[0042] The allocation indication message is used to trigger the establishment of a resource association. Furthermore, after the resource plug-in triggers the establishment of a resource association, the resource allocation process is considered complete. The resource container can then determine the target installation location based on the target resource identifier and invoke the target service processor in the target installation location to process the service data.
[0043] The establishment of a resource association relationship can be implemented by a resource plug-in, an allocator, or other components in the resource allocation system. In one embodiment, the resource plug-in, in response to an allocation indication message, establishes a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier. In another embodiment, the resource plug-in, in response to an allocation indication message, triggers the allocator to establish a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier.
[0044] In some embodiments, the allocation indication message may also be a message used to trigger allocation status modification. After determining the target resource identifier, the allocator directly establishes a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier, and sends an allocation indication message to the resource plug-in, causing the resource plug-in to update the allocation status corresponding to the target resource identifier, for example, to the allocated state.
[0045] In one embodiment, triggering the establishment of a resource association relationship between a target resource identifier and a resource container corresponding to a container identifier includes triggering the establishment of a binding relationship between the target resource identifier and the resource container to mount a target service processor in a target installation location corresponding to the target resource identifier into the resource container. After the mounting process, the resource container can access the target service processor in the target installation location after startup and process service data based on the target service processor.
[0046] Furthermore, the allocator may generate an allocation instruction message and send the allocation instruction message to the corresponding resource container to mount the target service processor in the target installation location into the service processing file of the resource container. The allocation instruction message may be generated in the form of [parameter][device name][mount point], using the target resource identifier as a mount parameter, the container identifier of the resource container as a device name, and the file name of the specific service processing file in the resource container as a mount point.
[0047] The resource container 106 is used to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the location correspondence relationship, and call the target business processor installed in the target installation location to process business data.
[0048] The business data may be data related to the business process, and the specific data format and content may be determined based on the content of the business process. When the business process is graphic analysis, the business data may be the image to be analyzed. When the business process is model training, the business data may be sample data to be trained.
[0049] In one embodiment, after establishing a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier, a direct resource association relationship is established between the target resource identifier and the corresponding resource container, and the target resource identifier has a position correspondence relationship with the installation location, so it can be considered that a direct resource association relationship is established between the target installation location and the corresponding resource container. A direct resource association relationship can be a fixed and stable association relationship that does not change with changes in the business processor installed in the installation location. In addition, since a business processor is installed in the installation location and the business processor may be replaced, it can be considered that an indirect resource association relationship is established between the target business processor installed in the target installation location (i.e., the most recently installed business processor) and the resource container. The resource container can be located to the target installation location based on the direct resource association relationship established with the target installation location, and access the most recently installed business processor based on the indirect resource association relationship established with the target business processor, i.e., access the target business processor, and then process the business data based on the target business processor.
[0050] In one embodiment, the process of calling the target business processor may be: locating the target installation location, determining the current business processor installed in the target installation location as the target business processor, and calling the target business processor to process the business data. In some cases, the business processor may be damaged, and the damaged abnormal business processor may not be able to process the business data normally. Therefore, at this time, it is necessary to replace the abnormal business processor installed in the target installation location and install a new business processor in the target installation location. Through the processing method of the above embodiment, the resource container uses the target installation location as the positioning information. If the business processor installed in the target installation location is replaced, the resource container can also call the latest target business processor without trying to call the business processor that has been replaced. Furthermore, when the target business processor is implemented by a chip, the process of the resource container calling the target business processor can be to access the corresponding target chip to perform business processing based on the computing power of the target chip.
[0051] In one embodiment, the resource container may be in a closed state by default, and may be started upon receiving a service processing request sent by a terminal device, and process service data after being started.
[0052] In one embodiment, when a resource container receives a business processing request sent by a terminal device, it can determine the business data corresponding to the business processing request, obtain the target resource identifier based on the resource association relationship, determine the target installation location corresponding to the target resource identifier based on the position correspondence between the resource identifier and the installation location of the business processor, and call the target business processor installed in the target installation location to process the business data.
[0053] In the above embodiment, the allocator, in response to a resource allocation request for allocating business processing resources to a resource container, determines a target resource identifier corresponding to the resource container from a set of candidate resource identifiers; wherein the resource identifiers in the set of candidate resource identifiers have a positional correspondence with the installation location of the business processor; the resource plug-in can establish a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier based on the installation location of the business processor; so as to trigger the resource container to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the positional correspondence between the resource identifier and the installation location of the business processor, and call the target business processor based on the target installation location to process business data. Since the resource identifier has a positional correspondence with the installation location of the business processor, and the resource container calls the business processor at the target installation location corresponding to the target resource identifier based on the positional correspondence when calling the business processor for business processing, even if the business processor in the target installation location is replaced with a new target business processor, the resource container can still call the new target business processor for business processing, thereby ensuring the orderly use of resources during business processing and improving the efficiency of computing resource utilization. In addition, the allocator will not allocate the new target business processor to other resource containers, which can prevent the target business processor from being reused by multiple resource containers, thereby ensuring the orderly use of resources during business processing.
[0054] In one embodiment, a resource container may be a resource space allocated from a computer device. This may be a resource space allocated in advance for the resource allocation system, or a resource space allocated by the resource allocation system during the resource allocation process. Furthermore, a resource container may be a resource space allocated by an allocator in the resource allocation system upon receiving a resource allocation request.
[0055] In one embodiment, the allocator is used to: create a resource container corresponding to the resource allocation request in response to a resource allocation request; the resource plug-in is used to: trigger the establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier during the process of creating the resource container in response to an allocation indication message.
[0056] In one embodiment, the resource container creation process may include: a dispatcher divides an independent operating space within a computer device and uses the independent operating space as a resource container. After creating the resource container, the dispatcher may trigger the resource container to start, thereby triggering the resource container to invoke a target service processor installed in a target installation location to process service data. The dispatcher may create at least one resource container, and these resource containers are physically isolated from each other.
[0057] In one embodiment, when creating the resource container corresponding to the resource allocation request, the allocator may send a container creation completion message to the resource plug-in. The container creation completion message carries the container identifier of the resource container. Upon receiving the container creation completion message from the allocator, the resource plug-in may determine the container identifier carried in the container creation completion message and trigger the establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier.
[0058] In the above embodiment, the allocator creates a resource container after receiving a resource allocation request. During the process of the allocator creating the resource container, the resource plug-in triggers the establishment of a resource association relationship between the resource container corresponding to the target resource identifier and the container identifier, so that the resource container creation process and the resource association relationship establishment process are carried out synchronously, thereby improving the efficiency of the resource allocation process.
[0059] In one embodiment, the resource plug-in is used to: obtain the current allocation status of the resource identifier corresponding to each installation location; send processor status information to the allocator, the processor status information including the current allocation status and the candidate resource identifier corresponding to the installation location; the allocator is used to: obtain the candidate resource identifier with the current allocation status of unallocated from the candidate resource identifier set according to the current allocation status corresponding to the candidate resource identifier, as the target resource identifier corresponding to the resource container.
[0060] Among them, the resource identifier and the installation location of the business processor have a position correspondence, so the current allocation state of the resource identifier can be the allocation state of the corresponding installation location, or the allocation state corresponding to the business processor installed in the installation location. The current allocation state may include at least one of unallocated, allocated or intermediate states. In one embodiment, when the current allocation state is the allocation state of the installation location, if the current allocation state corresponding to a certain installation location is allocated, then when the business processor installed in the installation location is replaced, the current allocation state remains allocated. When the current allocation state is the allocation state corresponding to the business processor, if the current allocation state corresponding to the business processor installed in a certain installation location is allocated, then when the business processor installed in the installation location is replaced, the current allocation state is modified from allocated to unallocated or to be allocated, and only when the new business processor is reallocated to the resource container will its corresponding current allocation state be modified to allocated again.
[0061] The processor status information may be status information indicating whether a service processor has been assigned, and may include at least one of the following: the assignment status of each service processor, the number of assigned service processors, and the number of unassigned service processors. An assigned service processor is an assigned service processor, and an unassigned service processor is a service processor that has not yet been assigned and is available for assignment. In the processor status information, a correspondence may exist between the candidate resource identifier and the current assignment status.
[0062] In one embodiment, the resource plug-in is used to record candidate resource identifiers corresponding to each installation location and the current allocation status of each candidate resource identifier, and generate processor state information based on the recorded information, and then send the processor state information to the allocator.
[0063] In one embodiment, the resource plug-in can generate a mapping table between installation locations and current allocation states. The resource plug-in periodically traverses each installation location to obtain the latest current allocation state of the candidate resource identifier corresponding to each installation location and updates the mapping table based on the latest current allocation state. When processor status information needs to be reported to the allocator, the resource plug-in queries the mapping table to obtain the current allocation state corresponding to each installation location and generates processor status information accordingly.
[0064] In one embodiment, the allocator determines the current allocation status corresponding to each candidate resource identifier, and then determines the unallocated business processor, and obtains the candidate resource identifier with the current allocation status of unallocated from the candidate resource identifier set based on the unallocated business processor as the target resource identifier corresponding to the resource container.
[0065] In the above embodiment, the allocator allocates target resource identifiers based on processor status information sent by the resource plug-in. This prevents already allocated resource identifiers from being assigned to resource containers, ensuring orderly resource allocation. Furthermore, the resource plug-in centrally updates the service processors in each installation location, and the allocator centrally completes the allocation of target resource identifiers. This ensures orderly resource allocation through the collaboration of various components.
[0066] In one embodiment, the resource plug-in may also send the current allocation status and candidate resource identifiers to the allocator directly, rather than in the form of processor state information. Furthermore, the resource plug-in is configured to obtain the current allocation status of the resource identifiers corresponding to each installation location; send the candidate resource identifiers corresponding to each installation location and the current allocation status corresponding to the candidate resource identifiers to the allocator; and the allocator is configured to: based on the current allocation status corresponding to the candidate resource identifiers, obtain a candidate resource identifier with a current allocation status of unallocated from the set of candidate resource identifiers as the target resource identifier corresponding to the resource container.
[0067] In one embodiment, after triggering the establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier, the resource plug-in is used to: modify the current allocation state of the target business processor to an allocated state; when it is determined that the target business processor in the target installation location is replaced by a new business processor, the current allocation state of the new business processor is determined to be an allocated state, and the resource container is triggered to call the new business processor to process the corresponding business data.
[0068] In one embodiment, the resource plug-in is also used to: modify the allocation state of the target business processor to an unallocated state when it is determined that the business processing of the business data is completed, generate new processor state information, and send the new processor state information to the allocator to trigger the allocator to select a resource identifier based on the new processor state information and allocate corresponding resources to the resource container.
[0069] In one embodiment, the processor status information also includes the number of first processors to be allocated; the allocator is used to: determine the number of second processors corresponding to the resource allocation request; when the number of second processors is less than or equal to the number of first processors, based on the current allocation status corresponding to the candidate resource identifier, obtain the candidate resource identifier with the current allocation status of unallocated from the candidate resource identifier set as the target resource identifier corresponding to the resource container.
[0070] The first number of processors to be allocated is the number of service processors to be allocated. Specifically, the first number of processors may be the number of service processors to be allocated. The second number of processors is the number of service processors requested in the resource allocation request.
[0071] In one embodiment, the first number of processors can be the resource capacity of the service processors to be allocated, and the second number of processors can be the resource capacity of the requested service processors. Furthermore, the allocator determines the resource capacity of each unallocated service processor and integrates the remaining resource capacity to obtain the total remaining resource capacity as the first number of processors. The resource allocation request can also include resource capacity requirement information, and the allocator determines the corresponding required resource capacity based on the resource capacity requirement information as the second number of processors.
[0072] In one embodiment, when the second number of processors is less than or equal to the first number of processors, the allocator determines that unallocated service processors can meet the processor quantity requirement of the resource allocation request, and therefore selects a target resource identifier from the candidate resource identifier set.
[0073] In one embodiment, when the second number of processors is greater than the first number of processors, the allocator determines that the unallocated service processors cannot meet the processor quantity requirement of the resource allocation request. In this case, resource allocation can be terminated and a resource allocation termination prompt message can be output. Alternatively, the allocator can wait. As the service processors complete their service processing, they are recycled, and the corresponding first number of processors increases. When the allocator determines that the second number of processors is less than or equal to the first number of processors, it then determines the target resource identifier corresponding to the resource container.
[0074] In the above embodiment, whether to obtain the target resource identifier is determined based on the comparison result of the number of processors. The target resource identifier is determined only when the business processor can meet the processor quantity requirement of the resource allocation request, thereby preventing the problem of resources being unusable after allocation and ensuring the orderly progress of the business processing process.
[0075] In one embodiment, when the number of second processors corresponding to the resource allocation request is one, a candidate resource identifier with a current allocation status of unallocated can be randomly selected from the candidate resource identifier set as the target resource identifier corresponding to the resource container, or the target resource identifier can be selected in a specific manner. When the number of second processors corresponding to the resource allocation request is two or more, a corresponding number of candidate resource identifiers with a current allocation status of unallocated can be randomly selected from the candidate resource identifier set as the target resource identifier corresponding to the resource container, or the target resource identifier can be selected in a specific manner to enable the corresponding business processors to communicate more conveniently. Among them, selecting the target resource identifier in a specific manner can be selecting the target resource identifier in sequence.
[0076] In one embodiment, the allocator is used to: obtain candidate resource identifiers whose current allocation status is unallocated from the candidate resource identifier set to form an intermediate resource identifier set; obtain the affinity between the business processors corresponding to each candidate resource identifier in the intermediate resource identifier set; select the candidate resource identifier that meets the affinity condition from the intermediate resource identifier set according to the affinity between the business processors as the target resource identifier corresponding to the resource container; the affinity condition includes at least one of the affinity being greater than the affinity threshold or the affinity ranking being before the ranking threshold.
[0077] In one embodiment, the affinity between each pair of service processors can be determined, and then at least two candidate resource identifiers can be selected based on the affinity as target resource identifiers corresponding to the resource container. Furthermore, when a certain affinity satisfies the affinity condition, the candidate resource identifiers of the two service processors corresponding to that affinity are both selected as target resource identifiers corresponding to the resource container.
[0078] Among them, the affinity between business processors is the correlation between each business processor. Affinity can be characterized by the convenience of communication between business processors. The more convenient the communication, the higher the corresponding affinity. In one embodiment, the affinity between business processors can be determined based on the hardware attribute information of the business processor. Among them, the hardware attribute information can be at least one of storage space, memory bandwidth, etc. When the storage space and memory bandwidth of business processor A are large enough, the affinity between business processor A and other business processors are set to a larger value, because in this case, business processor A can accommodate the deficiencies in the hardware attributes of other business processors as much as possible, so the communication convenience between them is higher, and the corresponding affinity can be a higher value.
[0079] In one embodiment, affinity can be determined based on the connection relationship between service processors. The fewer intermediary devices connected, the higher the affinity. Therefore, the reciprocal of the number of connection lines between service processors can be used as affinity. When two service processors are connected by one connection line, their affinity is 1; when two service processors are connected by two connection lines, their affinity is 1 / 2; when two service processors are connected by three connection lines, their affinity is 1 / 3, and so on. This will not be further described.
[0080] In many scenarios, the business processor needs to be connected to the central processor, and the business processors need to communicate with each other based on the central processor. In one embodiment, for business processor A and business processor B: Case 1) When they are both connected to a central processor, there are two connecting lines between business processor A and business processor B, and the affinity is 1 / 2; Case 2) When they are respectively connected to a central processor, and the two central processors are connected by a connecting line, there are three connecting lines between business processor A and business processor B, and the affinity is 1 / 3. It can be seen that the affinity of case 1) is greater than the affinity of case 2). The connecting line can be a wired connection, such as a physical wire; or it can be a wireless connection, such as a network connection line between devices.
[0081] In one embodiment, the connectivity between service processors can also be determined, and the affinity between the service processors can be derived based on the connectivity. The connectivity between service processors can be determined as follows: When two service processors are connected, for example, directly via a single connection line, the connectivity between the two service processors is 1. If they are connected via more than one connection line, the connectivity between the two service processors is a value between 0 and 1, which is positively correlated with the number of connection lines. When two service processors are not connected, the connectivity between the two service processors is 0. The connectivity is then statistically analyzed to determine the affinity between each pair of service processors.
[0082] In one embodiment, the affinity threshold can have a numerical range of [0, 1]. Specifically, the affinity threshold can be a fixed value such as 0.5 or 0.6, or it can dynamically change based on the number of service processors. For example, the affinity threshold is positively correlated with the number of service processors, and as the number of service processors increases, the affinity threshold also increases. The ranking threshold can be a fixed value such as 4 or 6, or it can dynamically change based on the number of service processors. For example, the ranking threshold is positively correlated with the number of service processors, and as the number of service processors increases, the ranking threshold also increases.
[0083] In one embodiment, each affinity is compared to an affinity threshold. When the affinity is greater than the affinity threshold, the candidate resource identifier between the two corresponding service processors is selected from the set of intermediate resource identifiers as the target resource identifier corresponding to the resource container. For example, when the affinity threshold is 0.8, if the affinity between service processor 1 and service processor 2 is determined to be 0.9, which is greater than 0.8, the candidate resource identifier between service processor 1 and service processor 2 is selected from the set of intermediate resource identifiers as the target resource identifier corresponding to the resource container.
[0084] In one embodiment, each affinity is sorted in descending order, that is, sorted in order from large to small, and the greater the affinity, the higher the ranking. When the affinity between two business processors is ranked before the sorting threshold, the candidate resource identifiers of the corresponding two business processors are selected from the intermediate resource identifier set as the target resource identifier corresponding to the resource container. For example, when the sorting threshold is 4, when it is determined that the affinity between business processor 1 and business processor 2 ranks second, the candidate resource identifier between business processor 1 and business processor 2 is selected from the intermediate resource identifier set as the target resource identifier corresponding to the resource container; when it is determined that the affinity between business processor 1 and business processor 3 ranks third, the candidate resource identifier between business processor 1 and business processor 3 is selected from the intermediate resource identifier set as the target resource identifier corresponding to the resource container.
[0085] In one embodiment, when it is determined according to the resource allocation request that the required number of business processors is at least two, at least two candidate resource identifiers that meet the affinity conditions are selected from the intermediate resource identifier set according to the affinity between the business processors as the target resource identifiers corresponding to the resource container.
[0086] In the above embodiment, the allocator determines the target resource identifier that matches the resource allocation request based on the affinity between the business processors. The higher the affinity, the more convenient the communication between the business processors. This enables the business processors assigned to the resource container to communicate as conveniently as possible, thereby ensuring the efficiency of business processing.
[0087] In one embodiment, the graphics processor and the central processing unit can be connected via a PCIE switch. When the number of graphics processors connected to the central processing unit increases, the PCIE switch can still ensure the rapid conversion of interactive information between the graphics processors, thereby ensuring the efficient interaction between the central processing unit and the graphics processor.
[0088] In one embodiment, the allocator is configured to: determine a first number of service processors that meet affinity conditions; and when a second number of processors is less than or equal to the first number of processors, determine a candidate resource identifier from a set of intermediate resource identifiers that matches the second number of processors as a target resource identifier corresponding to the resource container. The allocation of the target resource identifier is determined only when both the number of service processors and the affinity between the service processors meet the requirements. In other words, resource allocation is performed only when both the number of service processors and the affinity between the service processors meet the requirements, thereby ensuring the validity of the allocated resources.
[0089] In one embodiment, the allocator is used to: obtain topological connection information between the business processor and the central processor; the central processor is used to connect to multiple business processors and control the business processors; and determine the affinity between the business processors based on the topological connection information, wherein the affinity between business processors connected to the same central processor is greater than the affinity between business processors connected to different central processors.
[0090] The topological connection information is the connection relationship between the service processors, and may include at least one of the following: the connection status, the number of connection lines, etc. In one embodiment, the processors may be connected together through a specific connection method. For example, the service processor and the central processing unit may be connected based on PCIE, the service processors may be connected based on NVLink (a bus and its communication protocol), and the central processing units may be connected based on QPI (also known as CSI, Common System Interface).
[0091] If business processors are mounted on the same CPU, they can communicate directly. If they are not, communication between the business processors requires a relay, which increases the number of communication calls and reduces communication convenience. Therefore, the affinity between business processors can be determined based on the topological connection status between the business processors and the CPU.
[0092] In one embodiment, Figure 2 As shown, the service processors include graphics processors 1 to 8, and the central processors include central processors 1 and 2. Among them, graphics processors 1 to 4 are connected to central processor 1 through a connection line, and graphics processors 5 to 8 are connected to central processor 2 through a connection line. Therefore, the affinity between graphics processors 1 to 4 is 1 / 2, the affinity between graphics processors 5 to 8 is also 1 / 2, and the affinity between graphics processor 1 and graphics processor 5 is 1 / 3. It should be noted that there can be a connection relationship between graphics processors, for example, they can be connected in pairs. Figure 2 The connections between the graphics processors are not shown.
[0093] In one embodiment, there can be multiple central processing units (CPUs), and multiple CPUs can constitute a CPU core. In this case, the resource allocation process can be as follows: Assume there are two CPU cores, CPU core A and CPU core B, each connected to four GPUs: CPU core A is connected to GPUs 1-4, and CPU core B is connected to GPUs 5-8. If GPUs 1-3 connected to CPU core A have already been allocated. When receiving a resource allocation request, if the allocator determines that two GPUs need to be allocated, it randomly selects two GPUs from GPUs 5-8 connected to CPU core B, rather than sequentially selecting GPU 4 and GPU 5, because GPUs 4 and 5 are not connected to the same CPU core and the affinity between them is lower than the affinity between GPUs 5-8. Assuming the allocator selects GPU 5 and GPU 6, the allocator sends the GPU card serial numbers corresponding to GPUs 5 and 6 to the resource plug-in, triggering the resource plug-in to mount the GPU card serial numbers to the corresponding resource containers.
[0094] The above embodiment determines the affinity between service processors based on the topological connection information between them and the central processor. This allows resources from service processors connected to the same central processor to be allocated to resource containers as much as possible during resource allocation. During service processing in the resource container, the allocated service processors can communicate with minimal latency, thereby improving service processing efficiency.
[0095] In one embodiment, the allocator is used to: switch the allocation state corresponding to the target resource identifier from an unallocated state to an intermediate state, wherein the resource identifier in the intermediate state stops being allocated; the resource plug-in is used to: after establishing a resource association relationship, send an allocation completion message corresponding to the target resource identifier to the allocator; the allocator is used to: when receiving the allocation completion message, determine the current allocation state corresponding to the target resource identifier, and when the current allocation state corresponding to the target resource identifier is an intermediate state, switch the allocation state corresponding to the target resource identifier from the intermediate state to the allocated state.
[0096] The resource identifier in the intermediate state will not be allocated to other resource containers. The allocation completion message is used to indicate that the service processor in the resource identifier has been mounted. The allocation completion message can carry the target resource identifier and an indication of the mounting completion.
[0097] When the allocator receives a resource allocation request, it determines the target resource identifier and switches the allocation state corresponding to the target resource identifier from the unallocated state to the intermediate state. At this time, if the resource identifier needs to be allocated, the resource identifiers in the candidate resource identifier set that are in the intermediate state are first filtered out before the resource identifier is allocated. At this time, the resource identifiers in the intermediate state will not be used as the target resource identifier. In addition, when the allocation completion message sent by the resource plug-in after the resource association relationship is established is received, the allocation state of the resource identifier in the intermediate state of the allocator is switched from the intermediate state to the allocated state. At this time, the corresponding resource identifier can be used as the target resource identifier.
[0098] In one embodiment, if the allocator does not receive an allocation completion message corresponding to the target resource identifier within a preset time period, the allocator may directly switch the allocation state of the target resource identifier from the intermediate state to the unallocated state. Alternatively, the allocator may send an allocation state query message to the resource plug-in and switch the allocation state based on the status returned by the resource plug-in, thereby ensuring the accuracy of the state switching. The preset time period may be determined based on actual conditions.
[0099] In one embodiment, after determining the allocated GPU card, the allocation center sets the current allocation status of the corresponding GPU card serial number to an intermediate state. Only after the mounting operation is completed at the plug-in layer is the current allocation status of the GPU card serial number adjusted to allocated, so as to prevent the GPU card from being allocated to other containers when the mounting process is not completed.
[0100] In some cases, a resource identifier recorded in a resource plug-in may have already been allocated, but the allocator fails to promptly update the allocation status before assigning the corresponding resource identifier to a resource container, resulting in the resource being reused by multiple resource containers. The above embodiment, by switching the allocation status of resource identifiers, filters out intermediate resource identifiers from the set of candidate resource identifiers. This controls the resource identifier allocation process, prevents resources from being reused by multiple resource containers, and ensures the reliability of the resource allocation process.
[0101] In one embodiment, the resource plug-in is used to: when it is determined that a business processor replacement operation has occurred at the target installation location, generate new processor state information, the new processor state information carries the hardware attribute information of the new business processor, and send the new processor state information to the allocator. Since the target installation location has not changed, the current allocation state in the new processor state information remains unchanged. The allocator is used to: receive the new processor state information, and when a new resource allocation request is received, filter out the aforementioned target resource identifier from the candidate resource identifier set, the target resource identifier can be recorded as the first target resource identifier, and determine the target resource identifier corresponding to the new resource allocation request, the target resource identifier can be recorded as the second target resource identifier, and then complete the subsequent resource allocation process based on the second target resource identifier.
[0102] In one embodiment, when the target resource identifier is one, it can be determined that a business processor needs to be mounted to the resource container; the resource container is used to: receive a model training request, obtain a training sample set corresponding to the model training request, and the training sample set includes multiple training image samples; determine the target installation location corresponding to the target resource identifier according to the position correspondence, and send the training sample set to the target business processor installed in the target installation location, and the target business processor inputs the training image samples in the training sample set into the image processing model to be trained for processing to obtain a processing result; obtain a model loss value, and the model loss value is obtained in combination with the processing result obtained by the target business processor; adjust the parameters of the image processing model to be trained based on the model loss value to obtain a trained image processing model.
[0103] The training image samples may be images of various types, formats, and sizes. In some embodiments, the training image samples may also be replaced by sound samples or text samples.
[0104] The image processing model may be a network model based on artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and teaching learning. Adjusting the parameters of the image processing model may be adjusting the image feature extraction weights in the image processing model.
[0105] The resource container may also send the model data of the image processing model to be trained to the target service processor. The target service processor constructs the corresponding image processing model to be trained based on the model data and inputs the training image samples in the training sample set into the image processing model to be trained for processing.
[0106] In the above embodiment, the resource container completes training of the corresponding image processing model based on the assigned target service processor, resulting in a trained image processing model capable of accurately classifying image categories. Furthermore, because the resource container is an independent resource on the host machine, the training process is not affected by other running processes on the host machine, ensuring stable training of the image processing model and improving training efficiency.
[0107] In one embodiment, there are multiple target resource identifiers; the resource container is used to: receive a model training request, obtain a training sample set corresponding to the model training request, the training sample set including multiple training image samples; divide the training sample set into multiple sub-training sample sets, the number of sub-training sample sets is consistent with the number of target resource identifiers; determine the target installation location corresponding to the target resource identifier according to the position correspondence, send the sub-training sample set to the target business processor installed in the target installation location, the target business processor inputs the training image samples in the sub-training sample set into the image processing model to be trained for processing to obtain a processing result; obtain a model loss value, the model loss value is obtained by combining the processing results obtained by each target business processor; adjust the parameters of the image processing model to be trained based on the model loss value to obtain a trained image processing model.
[0108] In one embodiment, each target service processor trains the image processing model to be trained based on the assigned training image samples, and a corresponding loss value is obtained upon completion of the training. The resource container can integrate the loss values corresponding to each target service processor, for example by performing a weighted summation operation, and use the integrated loss value as the model loss value. The resource container can then adjust the parameters of the image processing model to be trained based on the model loss value to obtain a trained image processing model.
[0109] In one embodiment, Figure 3As shown, assume that two GPU cards are assigned to the resource container: GPU 1 and GPU 2. Upon receiving a model training request from a terminal device, the resource container divides the training sample set, consisting of training samples and model data, into two groups: training sample subset 1 and training sample subset 2. These two groups are sent to GPU 1 and GPU 2, respectively, for computation. GPU 1 and GPU 2 construct models based on the model data and train the models based on the training samples. They obtain computation results, such as loss values from a loss function: loss value 1 and loss value 2, and return these results to the container. The container integrates the computation results from the two GPUs, for example, integrating loss values 1 and 2 to obtain a total loss value. If the integration result determines that the training termination condition has been met, for example, if the total loss value is sufficiently small, the training process ends and the trained image processing model is output to the terminal device. In certain embodiments, the resource container may also receive an image to be predicted from the terminal device, input the image to be predicted into the trained image processing model, and determine the image category corresponding to the image to be predicted based on the output of the trained image processing model.
[0110] In the above embodiment, the resource container adjusts the parameters of the image processing model to be trained based on the assigned business processor, resulting in a trained image processing model. This allows each business processor to fully utilize the data analysis and computation, allowing each business processor to complete business processing in parallel, ensuring efficient training of the image processing model.
[0111] This application also provides an application scenario, which applies the above-mentioned resource allocation system. Specifically, the application of the resource allocation system in this application scenario is as follows:
[0112] like Figure 4 As shown in the figure, the architecture of the resource allocation system is divided into a control layer and an execution layer. The control layer is implemented through the allocation center, and the execution layer is implemented through plug-ins and containers. Plug-ins are also called device-plugins, and containers are also called docker. The allocation center, plug-ins, and containers can be devices configured on the host machine. The plug-in layer is configured on N GPUs, and the size of N can be determined based on actual conditions. The resource allocation system can include three workflows during operation: allocation process, reporting process, and mounting process. The following is a detailed description of each architectural component and the three workflows:
[0113] Allocation Center: The allocation center is the core of the architecture. Hardware information for each GPU card and the topology between cards are reported to the center for management. The allocation center's primary responsibilities include making GPU allocation decisions, maintaining GPU card status as allocated or unallocated, and maintaining information such as the affinity between GPU cards and the CPU. It also determines the GPU card serial number based on the installation location on the host machine and transmits the GPU card serial number to the plugin layer, enabling the plugin layer to mount GPU computing power within the container. When a GPU card in a specific installation location is replaced, the GPU card serial number for that location remains unchanged, ensuring that the new GPU card in that location is not allocated to another container. Resource allocation by the allocation center is implemented through the following allocation process (Allocate process): The allocation center sends an allocation instruction to the plugin layer, which carries the GPU card serial number. The plugin layer then allocates the GPU card based on the GPU card serial number specified by the allocation center.
[0114] Plug-in layer: Plug-ins in the plug-in layer are deployed on each GPU card, enabling communication between the allocation center and the GPU cards. The plug-in layer reports the status of each GPU card to the allocation center, which manages each GPU card through the plug-in layer to perform specific allocation operations. The plug-in layer receives the GPU card serial number from the allocation center and performs GPU card binding within the container, so that the GPU card at the corresponding installation location is mounted into the corresponding container. The plug-in layer reports GPU card status through the following reporting process (List and Watch process): The plug-in layer generates reporting information based on the hardware properties of the GPU card. This reporting information includes: the number of GPU cards, the number of used GPU cards, the number of available GPU cards, and the status of each GPU card. The plug-in layer then sends this generated reporting information to the allocation center. The plug-in layer performs GPU card binding through the following mounting process (Mount process): The allocation center issues an allocation creation request, the plug-in layer receives the allocation creation request, and performs the bind and mount operations within the container. After this process is completed, the container is delivered to the terminal device for service use.
[0115] Containers: Containers are located at the delivery layer of computing containers. Once a GPU card is mounted, the container sees the assigned GPU card upon startup and can complete business processing based on it. If the GPU card in the corresponding location is replaced, the container can access the new GPU card in the corresponding installation location and complete business processing based on the new GPU card.
[0116] For business containers, allocation and delivery can be achieved using the GPU card's Universally Unique Identifier (UUID) or PCIE (Peripheral Component Interconnect Express) bus. The UUID is the factory identifier for the GPU card, and each GPU card has a unique UUID. With this UUID allocation method, if a GPU card is replaced due to a hardware problem, the UUID of the failed card becomes corrupted, but running containers are unaware of the UUID change. The allocation center will consider the UUID of a new GPU card in the same installation location to be unassigned. Therefore, after receiving a creation request, the allocation center may assign the new GPU card to a different container, while the previous container can still access the new GPU card through hardware bus information. In this case, the same card may be shared by two running containers, causing them to compete for the computing power of the new GPU card, slowing down the system.
[0117] In the embodiment of the present application, even if the GPU card is replaced, the device information in the container must be guaranteed to be accurate and available during delivery, so it has at least the following beneficial effects: 1) The allocation and delivery of the GPU computing power container is realized based on the GPU card serial number, which can avoid the situation where dirty data appears in the mounted computing power in the container when the UUID or PCIE changes after the GPU card is replaced, and there will be no situation where the same card is shared by two containers. 2) The container's use of the GPU card and the GPU card's UUID and other attributes are decoupled, and the replacement of the GPU card will not affect the currently running container. 3) After the faulty GPU card is repaired, it can continue to be put into the resource pool for use, ensuring the continuity of the resource pool. 4) The distribution center manages the card allocation through the GPU serial number, which is conducive to the resource flow and use of the hardware card and improves the usability of the resource pool.
[0118] Based on the same concept as the resource allocation system in the above embodiment, the present application also provides a resource allocation method, which can be implemented based on the above resource allocation system.
[0119] The resource allocation method provided in this application can be applied to Figure 5The application environment shown in FIG. This application environment includes a server 502, a terminal device 504, and a resource container 506. The server 502, terminal device 504, and resource container 506 can each communicate via a network. The server includes a target installation location, in which a service processor capable of performing service processing is installed. The terminal device sends a resource allocation request to the server. The server determines the resource container corresponding to the resource allocation request and the target resource identifier corresponding to the resource container, triggering the establishment of a resource association relationship between the target resource identifier and the resource container. When performing service processing, the resource container obtains the target resource identifier based on the resource association relationship, determines the target installation location corresponding to the target resource identifier, and invokes the target service processor installed in the target installation location to process the service data. The server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal may be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. The terminal and the server may be connected directly or indirectly via wired or wireless communication, and this application does not impose any restrictions thereon.
[0120] In one embodiment, Figure 6 As shown, a resource allocation method is provided. This embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. The method includes the following steps:
[0121] S602: Receive a resource allocation request, where the resource allocation request is used to request allocation of business processing resources for a resource container.
[0122] S604 , in response to the resource allocation request, determining a target resource identifier corresponding to the resource container from a candidate resource identifier set; the resource identifiers in the candidate resource identifier set have a position correspondence with the installation location of the service processor.
[0123] S606 triggers the establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier. The resource association relationship is used to trigger the resource container, when performing business processing, to obtain the target resource identifier based on the resource association relationship, determine the target installation location corresponding to the target resource identifier based on the location correspondence relationship, and invoke the target business processor installed in the target installation location to process the business data.
[0124] In the above resource allocation method, since the resource identifier and the installation location of the business processor have a position correspondence, and the resource container calls the business processor at the target installation location corresponding to the target resource identifier based on the position correspondence when calling the business processor for business processing, even if the business processor in the target installation location is replaced with a new target business processor, the resource container can still call the new target business processor for business processing, thereby ensuring the orderly use of resources during business processing and improving the efficiency of computing resource utilization. In addition, the allocator will not allocate the new target business processor to other resource containers, which can prevent the target business processor from being reused by multiple resource containers, thereby ensuring the orderly use of resources during business processing.
[0125] In one embodiment, receiving a resource allocation request includes: receiving the resource allocation request, and creating a resource container corresponding to the resource allocation request in response to the resource allocation request; triggering establishment of a resource association relationship between a target resource identifier and a resource container corresponding to a container identifier, including: sending an allocation indication message to a resource plug-in to trigger the resource plug-in to respond to the allocation indication message and establish a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier during the process of creating the resource container.
[0126] In the above embodiment, a resource container is created after receiving a resource allocation request. During the process of creating the resource container, the resource plug-in is triggered to establish a resource association relationship between the resource container corresponding to the target resource identifier and the container identifier, so that the resource container creation and resource association relationship establishment processes can be carried out simultaneously, thereby improving the efficiency of the resource allocation process.
[0127] In one embodiment, in response to a resource allocation request, a target resource identifier corresponding to a resource container is determined from a set of candidate resource identifiers, including: receiving processor status information sent by a resource plug-in; the processor status information is sent by the resource plug-in based on the current allocation status of the business processor corresponding to each installation location, and the processor status information includes the current allocation status and the candidate resource identifier corresponding to the installation location; according to the current allocation status corresponding to the candidate resource identifier, a candidate resource identifier with a current allocation status of unallocated is obtained from the set of candidate resource identifiers as the target resource identifier corresponding to the resource container.
[0128] In the above embodiment, the target resource identifier is allocated according to the processor status information sent by the resource plug-in, which can prevent the allocated resource identifier from being allocated to the resource container, thereby ensuring the orderliness of resource allocation.
[0129] In one embodiment, in response to a resource allocation request, a target resource identifier corresponding to a resource container is determined from a candidate resource identifier set, including: obtaining candidate resource identifiers whose current allocation status is unallocated from the candidate resource identifier set to form an intermediate resource identifier set; obtaining the affinity between the business processors corresponding to each candidate resource identifier in the intermediate resource identifier set; selecting a candidate resource identifier that meets the affinity condition from the intermediate resource identifier set based on the affinity between the business processors as the target resource identifier corresponding to the resource container; the affinity condition includes at least one of the affinity being greater than an affinity threshold or the affinity ranking being before a ranking threshold.
[0130] In the above embodiment, the target resource identifier that matches the resource allocation request is determined based on the affinity between the business processors. The higher the affinity, the more convenient the communication between the business processors. This enables the business processors assigned to the resource container to communicate as conveniently as possible, thereby ensuring the efficiency of business processing.
[0131] In one embodiment, the processor status information also includes the number of first processors to be allocated; in response to a resource allocation request, determining a target resource identifier corresponding to a resource container from a set of candidate resource identifiers, including: determining the number of second processors corresponding to the resource allocation request; when the number of second processors is less than or equal to the number of first processors, according to the current allocation state corresponding to the candidate resource identifier, obtaining a candidate resource identifier with a current allocation state of unallocated from the set of candidate resource identifiers as the target resource identifier corresponding to the resource container.
[0132] In the above embodiment, whether to obtain the target resource identifier is determined based on the comparison result of the number of processors. The target resource identifier is determined only when the business processor can meet the processor quantity requirement of the resource allocation request, thereby preventing the problem of resources being unusable after allocation and ensuring the orderly progress of the business processing process.
[0133] In one embodiment, in response to a resource allocation request, a target resource identifier corresponding to a resource container is determined from a candidate resource identifier set, including: obtaining candidate resource identifiers whose current allocation status is unallocated from the candidate resource identifier set to form an intermediate resource identifier set; obtaining the affinity between the business processors corresponding to each candidate resource identifier in the intermediate resource identifier set; selecting a candidate resource identifier that meets the affinity condition from the intermediate resource identifier set based on the affinity between the business processors as the target resource identifier corresponding to the resource container; the affinity condition includes at least one of the affinity being greater than an affinity threshold or the affinity ranking being before a ranking threshold.
[0134] In the above embodiment, the server determines the target resource identifier that matches the resource allocation request based on the affinity between the service processors, which enables the service processors assigned to the resource container to communicate as conveniently as possible, thereby ensuring the efficiency of service processing.
[0135] In one embodiment, the affinity between the business processors corresponding to each candidate resource identifier in the intermediate resource identifier set is obtained, including: obtaining topological connection information between the business processor and the central processor; the central processor is used to connect with multiple business processors and control the business processors; and determining the affinity between the business processors based on the topological connection information, wherein the affinity between the business processors connected to the same central processor is greater than the affinity between the business processors connected to different central processors.
[0136] In the above embodiment, the server determines the affinity between the business processors based on the topological connection information between the business processors and the central processor, and can allocate the resources of the business processors connected to the same central processor to the resource container as much as possible during the resource allocation process. Furthermore, during the business processing process of the resource container, the allocated business processors can complete communication with the smallest possible delay, thereby improving the efficiency of business processing.
[0137] In one embodiment, the method also includes: switching the allocation state corresponding to the target resource identifier from an unallocated state to an intermediate state, wherein the resource identifier in the intermediate state stops being allocated; when receiving an allocation completion message corresponding to the target resource identifier sent by the resource plug-in after establishing a resource association relationship, determining the current allocation state corresponding to the target resource identifier, and when the current allocation state corresponding to the target resource identifier is an intermediate state, switching the allocation state corresponding to the target resource identifier from the intermediate state to the allocated state.
[0138] In the above embodiment, by switching the allocation state of resource identifiers, resource identifiers in the intermediate state are filtered out from the candidate resource identifier set, which can control the allocation process of resource identifiers, prevent the problem of resources being reused by multiple resource containers, and ensure the reliability of the resource allocation process.
[0139] In one embodiment, there are multiple target resource identifiers; a resource container is triggered: a model training request is received, and a training sample set corresponding to the model training request is obtained, where the training sample set includes multiple training image samples; the training sample set is divided into multiple sub-training sample sets, where the number of sub-training sample sets is consistent with the number of target resource identifiers; a target installation location corresponding to the target resource identifier is determined based on a position correspondence, and the sub-training sample set is sent to a target business processor installed in the target installation location, where the target business processor inputs the training image samples in the sub-training sample set into an image processing model to be trained for processing to obtain a processing result; a model loss value is obtained, where the model loss value is obtained by combining the processing results obtained by each target business processor; and parameters of the image processing model to be trained are adjusted based on the model loss value to obtain a trained image processing model.
[0140] In the above embodiment, the server triggers the resource container to adjust the parameters of the image processing model to be trained based on the assigned business processor, thereby obtaining a trained image processing model. This allows each business processor to fully utilize the big data analysis and computation, allowing each business processor to complete business processing in parallel, thus ensuring efficient training of the image processing model.
[0141] This application also provides an application scenario, which applies the above resource allocation method. Specifically, Figure 7 As shown, the application of this resource allocation method in this application scenario is as follows:
[0142] S702: The terminal device creates a resource allocation task based on the resource allocation creation operation submitted by the user. Once the resource allocation task is created, it triggers the process of allocating GPU cards to the container. The resource allocation task creation operation includes the required number of GPU cards.
[0143] S704: The allocation center determines whether the remaining GPU card resources reported by the plug-in layer meet the demand based on the GPU card demand.
[0144] S706: If the requirements cannot be met, the distribution center returns a prompt message indicating insufficient user resources to the terminal device.
[0145] S708: If the requirements are met, the allocation center executes the GPU card allocation process based on the managed device resource information. Specifically, taking a single node with 8 cards and 4 already in use as an example, the plugin layer will report that the total number of nodes is 8 cards (0-7), 4 cards are in use (0-3), and 4 cards are available (4-7). If a request to allocate 2 cards is received, the allocation center will select 2 cards from GPUs 4-7 in order. Assuming that these 2 cards are: GPU4 and GPU5, the GPU card serial number is generated based on the installation location of GPU4 and GPU5. Among them, a GPU card can be considered a node in the resource allocation system.
[0146] S710: The distribution center sends the allocated GPU card serial numbers to the plug-in layer of the corresponding node. Specifically, the distribution center sends the GPU card serial numbers corresponding to GPU4 and GPU5 to the plug-in layer.
[0147] S712: During the container startup process, the plug-in layer binds the GPU card serial number to the container to mount the GPU card in the container. Specifically, when the container starts, the plug-in layer mounts GPU4 and GPU5 into the container.
[0148] At S714, the container is delivered and completes business processing based on the assigned GPU card. Specifically, when the container receives a model training request from the terminal device, it accesses the mounted GPU4 and GPU5 to complete the corresponding model training process based on GPU4 and GPU5, obtaining a trained model.
[0149] When the training task is completed, the GPU card in the container will be recycled by the allocation center. The recycling process is triggered by the List AndWatch process. The released GPU card will be reported to the allocation center as an idle resource to serve the next resource allocation demand.
[0150] The above embodiment decouples GPU card hardware information from the distribution center. The distribution center manages computing resources based on the GPU card serial number. By using the GPU card serial number in the allocation process to allocate computing resources, even if the GPU hardware card is replaced, the distribution center does not need to worry about the dirty UUID data of the old card. This facilitates the flow of GPU card resources in the computing resource pool and improves the usability and operability of the resource pool.
[0151] It should be understood that, although the various steps in the above flow chart are shown in sequence as indicated by the arrows, these steps are not necessarily performed 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 performed in other orders. Moreover, at least a portion of the steps in the above flow chart may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0152] For the specific definition of the resource allocation method, please refer to the definition of the resource allocation system above, which will not be repeated here.
[0153] Based on the same concept as the resource allocation method in the above embodiment, the present application also provides a resource allocation device, which can be used to execute the above resource allocation method. For ease of explanation, the structural diagram of the resource allocation device embodiment only shows the parts related to the embodiment of the present application. Those skilled in the art will understand that the illustrated structure does not constitute a limitation of the device, and it may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0154] In one embodiment, Figure 8 As shown, a resource allocation device 800 is provided. The device can be implemented as a software module or a hardware module, or a combination of both to form a part of a computer device. The device specifically includes: an allocation request receiving module 802, a resource identifier determining module 804, and an association relationship establishing module 806, wherein:
[0155] The allocation request receiving module 802 is configured to receive a resource allocation request, where the resource allocation request is used to request allocation of service processing resources for a resource container.
[0156] The resource identifier determination module 804 is configured to determine, in response to the resource allocation request, a target resource identifier corresponding to the resource container from a candidate resource identifier set; the resource identifiers in the candidate resource identifier set have a position correspondence with the installation location of the service processor.
[0157] The association relationship establishment module 806 is used to trigger the establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier; wherein the resource association relationship is used to trigger the resource container to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the position correspondence, and call the target business processor installed in the target installation location to process the business data.
[0158] In the above-mentioned resource allocation device, when the business processor in the target installation location is replaced by the target business processor, the target business processor cannot be allocated to other resource containers, and the resource container can call the target business processor based on the position correspondence with the target installation location, thereby ensuring the orderliness of resource usage during the business processing process.
[0159] In one embodiment, the allocation request receiving module is further used to receive a resource allocation request, and in response to the resource allocation request, create a resource container corresponding to the resource allocation request; the association relationship establishing module is further used to send an allocation indication message to the resource plug-in to trigger the resource plug-in to respond to the allocation indication message, and in the process of creating the resource container, establish a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier.
[0160] In one embodiment, a resource identifier determination module includes: a status information receiving submodule, used to receive processor status information sent by a resource plug-in; the processor status information is sent by the resource plug-in based on the current allocation status of the business processor corresponding to each installation location, and the processor status information includes the current allocation status and the candidate resource identifier corresponding to the installation location; a resource identifier determination submodule, used to obtain a candidate resource identifier with a current allocation status of unallocated from a candidate resource identifier set according to the current allocation status corresponding to the candidate resource identifier, as the target resource identifier corresponding to the resource container.
[0161] In one embodiment, a resource identifier determination module includes: an identifier set determination submodule, used to obtain candidate resource identifiers whose current allocation status is unallocated from the candidate resource identifier set to form an intermediate resource identifier set; an affinity acquisition submodule, used to obtain the affinity between the business processors corresponding to each candidate resource identifier in the intermediate resource identifier set; a resource identifier selection submodule, used to select candidate resource identifiers that meet the affinity conditions from the intermediate resource identifier set according to the affinity between the business processors as the target resource identifier corresponding to the resource container; the affinity conditions include at least one of the affinity being greater than the affinity threshold or the affinity ranking being before the ranking threshold.
[0162] In one embodiment, the affinity acquisition submodule includes: a topology information acquisition unit, used to obtain topological connection information between the business processor and the central processor; the central processor is used to connect to multiple business processors and control the business processors; an affinity determination unit, used to determine the affinity between the business processors based on the topological connection information, wherein the affinity between business processors connected to the same central processor is greater than the affinity between business processors connected to different central processors.
[0163] In one embodiment, the device also includes: a first state switching module, used to switch the allocation state corresponding to the target resource identifier from an unallocated state to an intermediate state, wherein the resource identifier in the intermediate state stops being allocated; a second state switching module, used to determine the current allocation state corresponding to the target resource identifier when receiving the allocation completion message corresponding to the target resource identifier sent by the resource plug-in after establishing the resource association relationship, and when the current allocation state corresponding to the target resource identifier is an intermediate state, switch the allocation state corresponding to the target resource identifier from the intermediate state to the allocated state.
[0164] In one embodiment, there are multiple target resource identifiers; the device also includes a module that triggers the resource container to perform the following steps: receiving a model training request, obtaining a training sample set corresponding to the model training request, the training sample set including multiple training image samples; dividing the training sample set into multiple sub-training sample sets, the number of the sub-training sample sets being consistent with the number of the target resource identifiers; determining the target installation location corresponding to the target resource identifier based on the position correspondence, sending the sub-training sample set to the target business processor installed in the target installation location, the target business processor inputting the training image samples in the sub-training sample set into the image processing model to be trained for processing to obtain a processing result; obtaining a model loss value, the model loss value being obtained by combining the processing results obtained by each of the target business processors; adjusting the parameters of the image processing model to be trained based on the model loss value to obtain a trained image processing model.
[0165] The specific definition of the resource allocation apparatus can be found in the definition of the resource allocation method above and will not be repeated here. Each module in the resource allocation apparatus described above may be implemented in whole or in part via software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in hardware form, or may be stored in a memory in a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0166] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 9 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. 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, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data such as resource association relationships. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a resource allocation method is implemented.
[0167] Those skilled in the art will understand that Figure 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0168] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0169] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor.
[0170] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps of each of the above-described method embodiments.
[0171] 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, storage, 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 or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0172] 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.
[0173] 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 invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A resource allocation system, characterized in that: The system comprises: an allocator configured to receive a resource allocation request, determine a resource container corresponding to the resource allocation request, and obtain, from a set of candidate resource identifiers, a candidate resource identifier with a current allocation state of unallocated, based on a current allocation state corresponding to the candidate resource identifier, as a target resource identifier corresponding to the resource container; the resource identifiers in the set of candidate resource identifiers having a positional correspondence with an installation location of a service processor; A resource plug-in is configured to obtain the current allocation status of the resource identifier corresponding to each installation location; send processor status information to the allocator, the processor status information including the current allocation status and the candidate resource identifier corresponding to the installation location; receive an allocation indication message sent by the allocator, the allocation indication message carrying the target resource identifier and the container identifier of the resource container, and in response to the allocation indication message, trigger the establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier; The resource container is used to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the position correspondence relationship, and call the target business processor installed in the target installation location to process business data.
2. The system according to claim 1, wherein: The allocator is configured to: create a resource container corresponding to the resource allocation request in response to the resource allocation request; The resource plug-in is configured to, in response to the allocation indication message, trigger establishment of a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier during the process of creating the resource container.
3. The system according to claim 1, wherein: The processor status information further includes the number of first processors to be allocated; the allocator is configured to: determining the number of second processors corresponding to the resource allocation request; When the number of the second processors is less than or equal to the number of the first processors, according to the current allocation status corresponding to the candidate resource identifier, a candidate resource identifier with a current allocation status of unallocated is obtained from the candidate resource identifier set as the target resource identifier corresponding to the resource container.
4. The system according to claim 1, wherein: The distributor is used to: Obtaining candidate resource identifiers whose current allocation state is unallocated from the candidate resource identifier set to form an intermediate resource identifier set; Obtaining the affinity between the service processors corresponding to the candidate resource identifiers in the intermediate resource identifier set; Selecting, according to the affinity between the service processors, a candidate resource identifier that meets the affinity condition from the intermediate resource identifier set as the target resource identifier corresponding to the resource container; The affinity condition includes at least one of the affinity being greater than an affinity threshold or the affinity ranking being before a ranking threshold.
5. The system according to claim 4, characterized in that The distributor is used to: Acquiring topological connection information between the service processor and the central processor; the central processor is used to connect with multiple service processors and control the service processors; The affinity between the service processors is determined according to the topology connection information, wherein the affinity between service processors connected to the same central processor is greater than the affinity between service processors connected to different central processors.
6. The system according to claim 1, wherein: The allocator is used to: switch the allocation state corresponding to the target resource identifier from an unallocated state to an intermediate state, wherein the resource identifier in the intermediate state stops being allocated; The resource plug-in is used to: after establishing the resource association relationship, send an allocation completion message corresponding to the target resource identifier to the allocator; The allocator is used to: when receiving the allocation completion message, determine the current allocation state corresponding to the target resource identifier; when the current allocation state corresponding to the target resource identifier is an intermediate state, switch the allocation state corresponding to the target resource identifier from the intermediate state to the allocated state.
7. The system according to claim 1, wherein: There are multiple target resource identifiers; and the resource container is used to: Receive a model training request, and obtain a training sample set corresponding to the model training request, wherein the training sample set includes multiple training image samples; Dividing the training sample set into a plurality of sub-training sample sets, wherein the number of the sub-training sample sets is consistent with the number of the target resource identifiers; Determining a target installation location corresponding to the target resource identifier according to the location correspondence, sending the sub-training sample set to a target service processor installed in the target installation location, and inputting the training image samples in the sub-training sample set into the image processing model to be trained for processing to obtain a processing result; Obtaining a model loss value, where the model loss value is obtained by combining processing results obtained by each of the target service processors; Parameters of the image processing model to be trained are adjusted based on the model loss value to obtain a trained image processing model.
8. A resource allocation method, characterized in that: The method comprises: receiving a resource allocation request, wherein the resource allocation request is used to request allocation of service processing resources to a resource container; Receive processor status information sent by the resource plug-in; the processor status information is sent by the resource plug-in based on the current allocation status of the service processor corresponding to each installation location, and the processor status information includes the current allocation status and the candidate resource identifier corresponding to the installation location; In response to the resource allocation request, obtaining, from a set of candidate resource identifiers, a candidate resource identifier with a current allocation state of unallocated, based on a current allocation state corresponding to the candidate resource identifier, as a target resource identifier corresponding to the resource container; the resource identifiers in the set of candidate resource identifiers having a positional correspondence with the installation location of the service processor; triggering establishment of a resource association relationship between the target resource identifier and the resource container; Among them, the resource association relationship is used to trigger the resource container to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the position correspondence relationship, and call the target business processor installed in the target installation location to process the business data.
9. The method according to claim 8, characterized in that The method further comprises: In response to the resource allocation request, creating a resource container corresponding to the resource allocation request; The triggering of establishing a resource association relationship between the target resource identifier and the resource container includes: An allocation indication message carrying the target resource identifier and the container identifier of the resource container is sent to the resource plug-in to trigger the resource plug-in to respond to the allocation indication message and establish a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier during the process of creating the resource container.
10. The method according to claim 8, characterized in that The method further comprises: In response to the resource allocation request, obtaining candidate resource identifiers whose current allocation status is unallocated from the candidate resource identifier set to form an intermediate resource identifier set; Obtaining the affinity between the service processors corresponding to the candidate resource identifiers in the intermediate resource identifier set; Selecting, according to the affinity between the service processors, a candidate resource identifier that meets the affinity condition from the intermediate resource identifier set as the target resource identifier corresponding to the resource container; The affinity condition includes at least one of the affinity being greater than an affinity threshold or the affinity ranking being before a ranking threshold.
11. A resource allocation device, characterized in that: The device comprises: An allocation request receiving module, configured to receive a resource allocation request, wherein the resource allocation request is used to request allocation of service processing resources to a resource container; A status information receiving module, configured to receive processor status information sent by a resource plug-in; the processor status information is sent by the resource plug-in based on the current allocation status of the service processor corresponding to each installation location, the processor status information including the current allocation status and the candidate resource identifier corresponding to the installation location; a resource identifier determination module, configured to, in response to the resource allocation request, obtain, from a set of candidate resource identifiers, a candidate resource identifier with a current allocation state of unallocated, as a target resource identifier corresponding to the resource container, based on the current allocation state corresponding to the candidate resource identifier; the resource identifiers in the set of candidate resource identifiers having a positional correspondence with the installation location of the service processor; An association relationship establishing module, configured to trigger the establishment of a resource association relationship between the target resource identifier and the resource container; Among them, the resource association relationship is used to trigger the resource container to obtain the target resource identifier according to the resource association relationship when performing business processing, determine the target installation location corresponding to the target resource identifier according to the position correspondence relationship, and call the target business processor installed in the target installation location to process the business data.
12. The resource allocation device according to claim 11, characterized in that: The allocation request receiving module is also used to create a resource container corresponding to the resource allocation request in response to the resource allocation request; the association relationship establishment module is also used to send an allocation indication message carrying the target resource identifier and the container identifier of the resource container to the resource plug-in, so as to trigger the resource plug-in to respond to the allocation indication message and establish a resource association relationship between the target resource identifier and the resource container corresponding to the container identifier in the process of creating the resource container.
13. The resource allocation device according to claim 11, characterized in that: The resource identifier determination module is also used to respond to the resource allocation request, obtain candidate resource identifiers whose current allocation status is unallocated from the candidate resource identifier set to form an intermediate resource identifier set; obtain the affinity between the business processors corresponding to each candidate resource identifier in the intermediate resource identifier set; select the candidate resource identifier that meets the affinity condition from the intermediate resource identifier set according to the affinity between the business processors as the target resource identifier corresponding to the resource container; the affinity condition includes at least one of the affinity being greater than the affinity threshold or the affinity ranking being before the ranking threshold.
14. 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 method according to any one of claims 8 to 10 is implemented.
15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 8 to 10 is implemented.
16. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the method according to any one of claims 8 to 10 is implemented.
Citation Information
Patent Citations
Resource synchronizing method and device, electronic equipment and computer readable storage medium
CN108809686A
Container distribution method and device, electronic equipment and storage medium
CN112559130A