CN114629958A - Resource allocation method, device, electronic equipment and storage medium - Google Patents

Resource allocation method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114629958A
CN114629958A CN202210255411.XA CN202210255411A CN114629958A CN 114629958 A CN114629958 A CN 114629958A CN 202210255411 A CN202210255411 A CN 202210255411A CN 114629958 A CN114629958 A CN 114629958A
Authority
CN
China
Prior art keywords
target
unit
resource pool
function
identification value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210255411.XA
Other languages
Chinese (zh)
Other versions
CN114629958B (en
Inventor
丁治强
彭璟文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202210255411.XA priority Critical patent/CN114629958B/en
Publication of CN114629958A publication Critical patent/CN114629958A/en
Application granted granted Critical
Publication of CN114629958B publication Critical patent/CN114629958B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/02Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls

Abstract

The application provides a resource allocation method, a resource allocation device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring a resource pool establishing request of a tenant, wherein the request comprises the quantity of execution function requests and an identification value configured by the tenant; determining a traffic capacity according to the number; selecting a target working unit capable of executing a function instance corresponding to the function from the public resource pool according to the service capacity and the resource use state of the public resource pool; the public resource pool maintains the resource use state and the unit identification of the working unit, and when the working unit is not distributed, the unit identification is a default identification value; based on the target work unit, a private resource pool is established, an identification value is assigned to the private resource pool, the target work unit is assigned to the tenant, and a unit identification of the target work unit is set to the identification value, so that the work unit with the identification value can execute the function instance. According to the method and the system, the function instance running environment isolation and the resource isolation among the tenants can be realized, and the data security of the tenants is ensured.

Description

Resource allocation method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of network technologies, and in particular, to a resource allocation method and apparatus, an electronic device, and a storage medium.
Background
Function serving faas (functions as a service) is a new network architecture different from the traditional server-client architecture, and with the function serving, a tenant only needs to pay attention to service code logic and does not need to pay attention to configuration and maintenance of a server. Under the multi-tenant oriented scenario of function servization, the data security problem of each tenant needs to be solved.
Disclosure of Invention
In view of the above, an object of the present application is to provide a resource allocation method, an apparatus, an electronic device, and a storage medium.
In view of the above, the present application provides a resource allocation method, including:
acquiring a resource pool creation request of a tenant; wherein the request for creating the resource pool comprises the number of requests for executing the function and the configured identification value of the tenant; the execute function request includes a function of the tenant configuration;
determining service capacity according to the quantity of the execution function requests;
selecting a target working unit capable of executing a function instance corresponding to the function from the public resource pool according to the service capacity and the resource use state of the public resource pool; the public resource pool maintains the resource use state and the unit identification of a working unit, and when the working unit is not distributed, the unit identification of the working unit is set as a default identification value;
establishing a private resource pool based on the target work unit, assigning the identification value to the private resource pool, assigning the target work unit to the tenant, and setting the unit identification of the target work unit to the identification value, so that the work unit with the identification value can execute the function instance generated according to the function configured by the tenant.
Optionally, the resource usage state includes a function occupation state and a calculation resource state;
selecting a target work unit capable of executing a function instance corresponding to the function from the common resource pool, including:
selecting at least one working unit with the unit identifier as the default identifier value and the function occupation state as idle from the public resource pool;
and screening at least one working unit capable of executing the function instance corresponding to the function from the at least one selected working unit as a target working unit according to the computing resource state.
Optionally, the method further includes:
acquiring a resource pool modification request; wherein the resource pool modification request comprises the identification value and a target service capacity;
determining a target private resource pool and the current service capacity corresponding to the target private resource pool according to the identification value;
determining a capacity variation according to the target service capacity and the current service capacity;
and updating the unit identification and the resource use state of the target working unit in the target private resource pool according to the capacity variation.
Optionally, the resource usage state includes a function occupation state; the resource pool modification request is a resource pool expansion request;
according to the capacity variation, updating the unit identifier and the resource use state of the target work unit in the target private resource pool, including:
according to the capacity variation, at least one working unit with the unit identifier as the default identifier value and the function occupation state as idle is selected from the public resource pool;
and adding the unit identifier and the resource use state of the selected working unit in the target private resource pool, and setting the unit identifier of the added working unit as the identifier value.
Optionally, the resource usage state includes a function occupation state; the resource pool modification request is a resource pool capacity reduction request;
updating the unit identifier and the resource use state of the target work unit in the target private resource pool according to the capacity variation, wherein the updating comprises the following steps:
selecting a target working unit with the function occupation state being idle from the target private resource pool according to the capacity variation;
and deleting the unit identifier and the resource use state of the selected target working unit from the target private resource pool, and setting the deleted unit identifier of the target working unit as the default identifier value.
Optionally, the method further includes:
acquiring at least one execution function request; wherein the execute function request includes the identification value;
determining the actual service capacity according to the quantity of the execution function requests;
determining a target private resource pool and the current service capacity corresponding to the target private resource pool according to the identification value;
determining a capacity variation according to the actual service capacity and the current service capacity;
and updating the unit identification and the resource use state of the target working unit in the target private resource pool according to the capacity variable quantity.
Optionally, the method further includes:
acquiring a resource pool deletion request; wherein the resource pool deletion request includes the identification value;
determining a target private resource pool according to the identification value;
deleting the unit identification and the resource use state of the target working unit in the target private resource pool;
and deleting the target private resource pool.
Optionally, the method further includes:
acquiring a function operation request; wherein the function operation request comprises the identification value and an operation type;
determining a target private resource pool according to the identification value;
selecting a target occupation work unit from the target private resource pool according to the unit identification and the resource use state of the target work unit in the target private resource pool;
and operating the target occupation working unit according to the operation type to obtain an operation result.
Optionally, the operation type is to add at least one function, and the resource usage state includes a function occupation state;
selecting a target occupation work unit from the target private resource pool according to the unit identifier and the resource use state of the target work unit in the target private resource pool, wherein the method comprises the following steps:
according to the function occupation state, selecting at least one target working unit capable of running a function instance corresponding to the at least one function from the target private resource pool;
selecting a working unit with the minimum function occupation amount from at least one selected target working unit as the target occupation working unit;
according to the operation type, operating the target occupation work unit, including:
and sending a message for setting the identification value to the target occupation working unit so that the target occupation working unit sets the unit identification as the identification value, and when receiving an execution function request with the identification value, the target occupation working unit can run the function instance.
Optionally, the operation type is to modify at least one function, and the function operation request further includes a target identification value;
selecting a target occupation work unit from the target private resource pool according to the unit identifier and the resource use state of the target work unit in the target private resource pool, wherein the method comprises the following steps:
selecting the target occupation working unit with the unit identifier as the identifier value from the target private resource pool;
according to the operation type, operating the target occupation work unit, including:
setting the unit identifier of the target occupation working unit as the target identifier value;
and sending a message for setting the target identification value to the target occupation working unit so that the target occupation working unit sets the unit identification as the target identification value, and when receiving an execution function request with the target identification value, the target occupation working unit can run a function instance corresponding to the at least one function.
Optionally, the operation type is deleting at least one function;
selecting a target occupation work unit from the target private resource pool according to the target unit identification and the resource use state of the work unit in the target private resource pool, wherein the method comprises the following steps:
selecting the target occupation working unit with the unit identifier as the identifier value from the target private resource pool;
according to the operation type, operating the target occupation work unit, including:
and sending a message for deleting the identification value to the target occupation working unit so that the target occupation working unit sets the unit identification as the default identification value.
Optionally, the method further includes:
and sending the private resource pool allocated with the identification value, the unit identification of each working unit and the resource use state to other nodes.
Based on the same concept, the present application further provides a resource allocation apparatus, including:
the acquisition module is used for acquiring a resource pool creation request of a tenant; wherein the request for creating the resource pool comprises the number of requests for executing the function and the configured identification value of the tenant; the execute function request comprises a function configured by the tenant;
a capacity determining module, configured to determine a service capacity according to the number of the execution function requests;
a selecting module, configured to select, according to the service capacity and a resource usage state of a public resource pool, a target work unit capable of executing a function instance corresponding to the function from the public resource pool; the public resource pool maintains the resource use state and the unit identification of a working unit, and when the working unit is not distributed, the unit identification of the working unit is set as a default identification value;
the establishing module is used for establishing a private resource pool based on the target work unit, distributing the identification value to the private resource pool, distributing the target work unit to the tenant, and setting the unit identification of the target work unit to the identification value so as to enable the work unit with the identification value to execute the function instance generated according to the function configured by the tenant.
Based on the same concept, the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method as described in any one of the above is implemented.
Based on the same concept, the present application also provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method as any one of the above.
As can be seen from the foregoing, according to the resource allocation method, apparatus, electronic device, and storage medium provided in the present application, the service capacity is determined according to the number of execution function requests in a tenant resource pool creation request, a target work unit capable of executing a function instance corresponding to a function is selected from a public resource pool according to the service capacity and a resource usage state of the public resource pool, a private resource pool is established based on the target work unit, an identification value is allocated to the private resource pool, the target work unit is allocated to a tenant, and a unit identifier of the target work unit is set to the identification value, and a work unit having the identification value is capable of executing the function instance generated according to the function configured by the tenant. According to the method, the private resource pool and the working unit can be allocated to the tenant, the working unit is only used for executing the function instance of the corresponding tenant, and cross operation of the function instances of different tenants cannot occur, so that function instance operation environment isolation and resource isolation among the tenants are realized, and data security of the tenants is ensured.
Drawings
In order to more clearly illustrate the technical solutions in the present application or the related art, the drawings needed to be used in the description of the embodiments or the related art will be briefly introduced below, and it is obvious that the drawings in the following description are only embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a resource pool according to an embodiment of the present application;
FIG. 4 is a schematic data flow diagram illustrating operations related to resource pools according to an embodiment of the present disclosure;
FIG. 5 is a data flow diagram illustrating a function dependent operation according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of an apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the application.
Detailed Description
The principles and spirit of the present application will be described with reference to a number of exemplary embodiments. It should be understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the present application, and are not intended to limit the scope of the present application in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
According to an embodiment of the application, a resource allocation method, a resource allocation device, an electronic device and a storage medium are provided.
In this document, it is to be understood that any number of elements in the figures are provided by way of illustration and not limitation, and any nomenclature is used for differentiation only and not in any limiting sense.
The principles and spirit of the present application are explained in detail below with reference to several representative embodiments of the present application.
In the related technology, the function service can adopt a container or virtual machine technology to realize the function isolation among tenants, and the method has the advantages of longer cold start time, slower capacity expansion and contraction speed, high configuration requirement and high cost. The existing isolation technology is adopted to realize function isolation in the process, cold start time can be shortened, function deployment density is high, configuration requirements are not high, cost is controllable, however, since resource isolation depending on function execution is not realized, after a plurality of tenants carry out service deployment, resources depending on function execution of different services may intersect, and the mixed running of functions causes potential safety hazards of private data of the tenants.
In order to solve the above problems, the present application provides a resource allocation method, which can implement resource isolation that function execution of each tenant depends on, run function instances of the same tenant in the same process, ensure resource isolation among tenants, isolate function running environments, and ensure data security of the tenants.
Fig. 1 is a schematic view of an application scenario of a resource allocation method according to an embodiment of the present application. The application scenario includes a central computing node 10, an edge computing node 20, and a tenant 30.
The tenant 30 uses an electronic device with data transmission and processing capabilities, such as a computer, a tablet computer, a smart phone, and the like, and the electronic device may be installed with an application interface for deploying a specific service, and the tenant 30 may deploy the service through the application interface; in function servization, the tenant 30 only needs to develop a deployment function through an application interface so that the function can implement a specific business function. The edge computing node 20 is configured to provide resources and data processing support for implementing function service for the tenant 30, the relevant data of the tenant 30 may be stored on the edge computing node 20, and the edge computing node 20 provides function management of the tenant and a process isolation function between tenants, the edge computing node 20 only needs to interact with the central computing node 10 to process result data or obtain specific data from the central computing node 10, and the central computing node 10 does not need to process the relevant data of all tenants, so that the burden of the central computing node 10 can be reduced, the cost is reduced, and various services are more flexibly deployed.
The resource allocation method according to the exemplary embodiment of the present application is described below with reference to the application scenario of fig. 1. It should be noted that the above application scenarios are only presented to facilitate understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable.
First, as shown in fig. 2, an embodiment of the present application provides a resource allocation method, including:
s201: acquiring a resource pool creation request of a tenant; the resource pool creating request comprises the quantity of execution function requests and an identification value configured by a tenant; executing a function comprising a tenant configuration;
in this embodiment, when performing service deployment, a tenant may apply for creating an own private resource pool, configure the number of requests for executing a function, and set an identification value of the private resource pool. Sending a resource pool creating request to the edge computing node, creating a private resource pool capable of meeting the tenant service requirement by the edge computing node according to the quantity of the execution function requests, and taking the set identification value as the identification value of the private resource pool of the tenant.
S202: determining the service capacity according to the quantity of the execution function requests;
in this embodiment, the tenant resource pool creation request includes the number of execution function requests, where the number of execution function requests is the number of execution function requests in unit time, for example, QPS (query per second), and after the edge computing node obtains the resource pool creation request, the service capacity capable of meeting the number of execution function requests, that is, the number of work units capable of meeting the number of execution function requests, is determined according to the number of execution function requests. For example, the number of execution function requests configured by a tenant is 3000 function requests per second, and according to the number of function requests of the tenant, it is determined that the processing performance of 3000 function requests per second can be realized by allocating two work units, so that it is determined that the service capacity of the tenant is two work units.
S203: selecting a target working unit capable of executing a function instance corresponding to the function from the public resource pool according to the service capacity and the resource use state of the public resource pool; the public resource pool maintains the resource use state and the unit identification of the working unit, and when the working unit is not distributed, the unit identification of the working unit is set as a default identification value;
in this embodiment, after the service capacity is determined, that is, the number of the work units to be allocated is determined, and the target work units capable of executing the function instances corresponding to the functions in the required number are selected from the determined number of the work units in combination with the resource usage states of all the work units in the common resource pool.
The edge computing node needs to acquire the metadata of all the work units, so that the proper work units are distributed to the tenants according to the resource use states of all the work units. In the function service, a function submitted by a tenant generates an executable function instance, a working unit is used for executing the function instance to realize a specific service function, and the working unit can also be called a worker process.
In some approaches, the metadata of the unit of work includes unit identification, resource usage status, address information, and the like, and the resource usage status includes computing resource status, function occupation status, and the like. The unit identifier can identify the allocation state of the working unit, is a preset default identifier value when not allocated to the tenant, and is an identifier value of the tenant after being allocated to the tenant. The computing resource state may identify the computing power of the work unit, e.g., the computing resource state may be a CPU parameter, a memory parameter, etc.; and distributing proper work units for the tenants according to the computing resource states of the work units and the service requirements of the tenants, and realizing service functions for the tenants by using the distributed work units. The function occupation state can identify the current load capacity of the working unit, namely the number of the currently executed function instances, and the working unit can be selected according to the function occupation state to expand and contract the working unit. The address information may be a network address, for example, an IP address, a port number, and the like, and the address information is used to call the corresponding work unit through the address when the service function is implemented, and the work unit executes the function instance to implement the service function.
In some embodiments, the number of the work units may be configured at an initial stage of function servicing, unit identifiers of all initialized work units are default identifier values, and all work units are uniformly managed in a common resource pool. The edge computing node collects the metadata of all the working units at regular time so as to obtain the latest resource use states of all the working units and conveniently distribute proper working units for tenants subsequently.
S204: based on the target work unit, a private resource pool is established, an identification value is distributed to the private resource pool, the target work unit is distributed to the tenant, and the unit identification of the target work unit is set to the identification value, so that the work unit with the identification value can execute the function instance generated according to the function configured by the tenant.
Referring to fig. 3, in this embodiment, after the target work unit is picked out, a private resource pool is created for a tenant based on the picked target work unit, metadata of the target work unit assigned to the tenant is stored by using the private resource pool, an identification value set by the tenant is assigned to the private resource pool, a unit identification of the target work unit in the private resource pool is set to an identification value, and the private resource pool and the work unit owned by the tenant are identified by using the identification value. Therefore, each tenant has a private resource pool and a working unit, the private working unit is only used for operating the function instance of the corresponding tenant, and the function instances of other tenants are not operated, so that the resource isolation and the function operation environment isolation among the tenants are realized, the problem of function running mixing of different tenants is avoided, the data isolation among the tenants is realized, and the private data security of the tenants is ensured.
The embodiment provides a resource allocation method, which is applied to an edge computing node and comprises the steps of determining service capacity according to the number of execution function requests in tenant resource pool creation requests, selecting a target work unit capable of executing a function instance corresponding to a function from a public resource pool according to the service capacity and the resource use state of the public resource pool, establishing a private resource pool based on the target work unit, allocating an identification value to the private resource pool, allocating the target work unit to a tenant, setting a unit identification of the target work unit as an identification value, and enabling the work unit with the identification value to execute the function instance generated according to the function configured by the tenant. By using the method of the embodiment, the private resource pools and the working units can be allocated to the tenants, the working units of the tenants only execute the function instances of the corresponding tenants, the function instances of different tenants do not run in a cross way, the resource cross depended by the function running does not occur, and the private data security of the tenants can be ensured; moreover, edge function service is realized based on the edge computing node, the configuration requirement is not high, the cost is controllable, the cold start time can be shortened by process isolation, and flexible and various service deployment can be met.
In some embodiments, the resource usage state includes a function occupancy state and a compute resource state;
selecting a target work unit which can execute a function instance corresponding to a function from a public resource pool, wherein the target work unit comprises:
selecting at least one working unit with a unit identifier as a default identifier value and a function occupation state as idle from a public resource pool;
and screening at least one working unit capable of executing the function instance corresponding to the function from the at least one selected working unit as a target working unit according to the state of the computing resource.
In this embodiment, the method for selecting an appropriate target working unit according to the determined service capacity and the resource usage states of all working units in the public resource pool includes selecting one or more working units that are not allocated and do not execute the function instance according to the unit identifier and the function occupation state, then selecting one or more working units that can execute the function instance corresponding to the tenant-configured function according to the calculation resource state of each selected working unit, determining the target working units of the number required by the service capacity from the one or more working units, and creating a private resource pool based on the selected target working units, where the selected target working units can meet the calculation resource requirement for executing the function instance. And if the working unit meeting the condition is not selected, after the working unit executing the function instance finishes executing the stock function instance, reselecting the working unit meeting the condition without increasing the load for the working unit executing the function instance.
In some embodiments, the resource allocation method further comprises:
acquiring a resource pool modification request; wherein, the resource pool modification request comprises an identification value and a target service capacity;
determining a target private resource pool and the current service capacity corresponding to the target private resource pool according to the identification value;
determining a capacity variation according to the target service capacity and the current service capacity;
and updating the unit identification and the resource use state of the target work unit in the target private resource pool according to the capacity variation.
Considering that the number of service requests of a tenant changes, in order to adapt to the change of the number of service requests and ensure the normal implementation of service functions, the capacity expansion and reduction function needs to be supported. In this embodiment, a tenant actively performs capacity expansion and reduction, in this way, the tenant sends a resource pool modification request including an identification value and a target service capacity, an edge computing node receives the resource pool modification request, determines a target private resource pool to be subjected to capacity expansion and reduction according to the identification value, and a current service capacity in the target private resource pool, determines a capacity variation according to the target service capacity and the current service capacity, and then performs capacity expansion or capacity reduction on the target private resource pool according to the capacity variation, so that a target work unit in the expanded or reduced private resource pool can meet the number of execution function requests after variation, and normal implementation of service functions is ensured.
In some embodiments, the resource usage state comprises a function occupancy state; the resource pool modification request is a resource pool expansion request;
according to the capacity variation, updating the unit identifier and the resource use state of the target work unit in the target private resource pool, including:
according to the capacity variation, at least one working unit with a unit identifier as a default identifier value and a function occupation state as idle is selected from a public resource pool;
and adding the unit identification and the resource use state of the selected working unit in the target private resource pool, and setting the unit identification of the added working unit as an identification value.
In this embodiment, when a tenant actively performs capacity expansion, a resource pool capacity expansion request is sent to an edge computing node, where the resource pool capacity expansion request includes an identification value of a private resource pool and a target service capacity after capacity expansion, the edge computing node obtains the resource pool capacity expansion request, determines a target private resource pool and a current service capacity of the target private resource pool according to the identification value, and then determines a capacity change, that is, the number of work units to be added, according to the target service capacity and the current service capacity. And then, selecting the number of working units from the public resource pool, and adding the selected working units into the target private resource pool to realize the capacity expansion of the target private resource pool. When the working unit is selected from the public resource pool, the selection unit identifier is a default identifier value and the function occupation state is an idle working unit, that is, the working unit which is not allocated and has no execution function instance is selected as a target working unit for capacity expansion, the unit identifier of the selected target working unit is modified from the default identifier value to the identifier value of the target private resource pool, and the metadata of the selected target working unit is added into the target private resource pool to complete the capacity expansion of the target private resource pool.
In some embodiments, considering that different tenants have different requirements, some tenants have higher requirements on data security, and some tenants have lower requirements on data security, the method of this embodiment can meet different requirements of different tenants. Specifically, for tenants with data security requirements, the tenants may create a private resource pool in advance, allocate the private resource pool and the work unit with a specific identification value for such tenants, and run the function instances of the tenants by the private work unit, and the private work unit may not run the function instances of other tenants, thereby implementing function running environment isolation and resource isolation between the tenants. For tenants with low data security requirements, the work units in the public resource pool can be used, and the work unit with the unit identifier as the default identifier value is used for running the function instance to realize the service function of the tenants, in this case, the work units with the unit identifier as the default identifier value exist in the public resource pool, but the function occupation state is non-idle due to the running of the function instance, the work units cannot be used as optional objects for expansion of the private resource pool, and the condition of cross running of functions among the tenants is avoided. Therefore, the method of the embodiment can meet the requirements of different groups of users, allocate reasonable resources for different tenants, avoid the problems of robbery, mixed running and the like caused by unreasonable resource allocation, and improve the quality and satisfaction of the provided service.
In some embodiments, the resource usage state comprises a function occupancy state; the resource pool modification request is a resource pool capacity reduction request;
according to the capacity variation, updating the unit identifier and the resource use state of the target work unit in the target private resource pool, including:
selecting a target working unit with a function occupation state being idle from a target private resource pool according to the capacity variation;
and deleting the unit identifier and the resource use state of the selected target working unit from the target private resource pool, and setting the deleted unit identifier of the target working unit as a default identifier value.
In this embodiment, when a tenant actively performs capacity reduction, a resource pool capacity reduction request is sent to an edge computing node, where the resource pool capacity reduction request includes an identification value of a private resource pool and a target service capacity after capacity reduction, the edge computing node obtains the resource pool capacity reduction request, determines the target private resource pool and a current service capacity of the target private resource pool according to the identification value, and then determines a capacity variation, that is, the number of target work units that need to be reduced, according to the target service capacity and the current service capacity. And then, selecting the target working units of the quantity from the target private resource pool, deleting the metadata of the selected target working units from the target private resource pool, and modifying the unit identifiers of the deleted target working units into default identifier values to realize the capacity reduction of the target private resource pool. When the target working unit is selected from the target private resource pool, the working unit with the function occupation state being idle is selected, namely the target working unit without executing the function instance is selected as the target working unit for capacity reduction, the unit identification of the selected target working unit is changed from the identification value of the target private resource pool to the default identification value, and the unit identification is released back to the public resource pool to finish the capacity reduction of the target private resource pool.
In some embodiments, the resource allocation method further comprises:
acquiring at least one execution function request; wherein the request to execute the function includes an identification value;
determining the actual service capacity according to the quantity of the execution function requests;
determining a target private resource pool and the current service capacity corresponding to the target private resource pool according to the identification value;
determining the capacity variation according to the actual service capacity and the current service capacity;
and updating the unit identification and the resource use state of the target work unit in the target private resource pool according to the capacity variation.
In this embodiment, when the tenant does not actively perform the scaling, but the number of the execution function requests changes, the scaling may be performed according to the number of the changed execution function requests, so as to provide a normal service function for the tenant. Specifically, when the edge computing node obtains a plurality of execution function requests, the number of the execution function requests is determined, the actual service capacity is determined according to the number of the execution function requests, the target private resource pool and the current service capacity of the target private resource pool are determined according to the identification value, the capacity variation is determined according to the actual service capacity and the current service capacity, and the target working unit in the target private resource pool is subjected to capacity expansion and contraction according to the capacity variation, so that the target working unit after capacity expansion and contraction can normally realize the service function. Therefore, even if the tenant does not actively perform capacity expansion, the capacity expansion can be performed according to the number of actual execution function requests, the number of the working units is used as an index for performing capacity expansion of the private resource pool, the utilization rate of the private resource pool can be reflected, and the complexity of capacity expansion and reduction calculation is reduced.
For example, when a tenant creates a private resource pool, the number of configured execution function requests is 3000 function requests per second, and the number of work units allocated to the tenant is two. In a specific period, the number of the executed function requests of the tenant exceeds 3000, at this time, the edge computing node selects a working unit which is not allocated and has a free function occupation state from the public resource pool to expand the capacity of the tenant, and adds the selected working unit into the private resource pool of the tenant to execute the function instance corresponding to the function request, so as to ensure that the service function is normally performed. Within a certain time after a specific period, the number of execution function requests of the tenant is reduced to below 3000, at this time, the edge computing node selects a target work unit with a function occupation state being idle from the private resource pool of the tenant, and is used for capacity reduction of the tenant, and the selected target work unit is released back to the public resource pool again, so that the cost of the tenant is reduced. It should be noted that the number of the scaled working units should be the number of the target working units allocated in the stage of creating the private resource pool, and is not less than the number of the target working units initially allocated.
In some embodiments, the resource allocation method further comprises:
acquiring a resource pool deletion request; wherein the resource pool deletion request includes an identification value;
determining a target private resource pool according to the identification value;
deleting the unit identification and the resource use state of the working unit in the target private resource pool;
and deleting the target private resource pool.
In this embodiment, the tenant may delete the private resource pool, send a resource pool deletion request to the edge computing node, and request to delete the private resource pool having the identification value. After the edge computing node acquires the resource pool deletion request, the corresponding target private resource pool is determined according to the identification value, the metadata of the target working unit in the target private resource pool is deleted, then the target private resource pool is deleted, and the deletion of the private resource pool is completed. Therefore, the tenant can realize the creation, modification (expansion and contraction) and deletion operation of the private resource pool through the application interface, and the tenant can conveniently and flexibly deploy the service according to the service requirement.
In some embodiments, the resource allocation method further comprises:
acquiring a function operation request; the function operation request comprises an identification value and an operation type;
determining a target private resource pool according to the identification value;
selecting a target occupation work unit from the target private resource pool according to the unit identifier and the resource use state of the target work unit in the target private resource pool;
and operating the target occupation working unit according to the operation type to obtain an operation result.
In this embodiment, the tenant may perform operations of creating, modifying, and deleting on the owned private resource pool, and may perform related service operations including adding, modifying, and deleting functions based on the private resource pool. The tenant sends a function operation request comprising an identification value, the edge computing node determines a corresponding target private resource pool according to the identification value, selects a target occupation working unit according to metadata of the target working unit in the target private resource pool, and then performs corresponding operation on the target occupation working unit according to a specific operation type to obtain an operation result.
In some embodiments, the operation type is adding at least one function, and the resource usage state includes a function occupation state;
according to the unit identification and the resource use state of the target working unit in the target private resource pool, selecting the target occupation working unit from the target private resource pool, wherein the method comprises the following steps:
according to the function occupation state, selecting at least one target working unit capable of running a function instance corresponding to at least one function from a target private resource pool;
selecting a working unit with the minimum function occupation amount from the selected at least one target working unit as a target occupation working unit;
according to the operation type, operating the target occupation work unit, comprising:
and sending a message for setting the identification value to the target occupation working unit so that the target occupation working unit sets the unit identification to the identification value, and when receiving the execution function request with the identification value, the target occupation working unit can run the function instance.
In this embodiment, when a tenant adds a function, a function operation request with an operation type of the added function is sent, the edge computing node determines a target private resource pool and a function occupation state of each target working unit in the target private resource pool according to an identification value therein, selects a target working unit capable of running a function instance corresponding to the added function according to the function occupation state of each target working unit, and preferentially selects a target working unit with the smallest function occupation amount as the target occupation working unit if a plurality of selected target working units are selected, and executes the function instance corresponding to the added function by the target occupation working unit. After the target occupation working unit is determined, a message for setting an identification value is sent to the target occupation working unit, after the target occupation working unit receives the message, the unit identification of the target occupation working unit is set to the identification value, then, when an execution function request with the identification value is received, the target occupation working unit can be determined according to the identification value, and the target occupation working unit executes a function instance to realize a service function.
In some embodiments, the operation type is to modify at least one function, the function operation request further including a target identification value;
according to the unit identification and the resource use state of the target working unit in the target private resource pool, selecting the target occupation working unit from the target private resource pool, wherein the method comprises the following steps:
selecting a target occupation working unit with unit identification as an identification value from a target private resource pool;
according to the operation type, operating the target occupation work unit, comprising:
setting the unit identifier of the target occupied working unit as a target identifier value;
and sending a message for setting a target identification value to the target occupation working unit so that the target occupation working unit sets the unit identification as the target identification value, and when receiving an execution function request with the target identification value, the target occupation working unit can run at least one function instance corresponding to the function.
In the embodiment, for the case that the tenant has multiple private resource pools, when the tenant modifies the private resource pool to which the function belongs, sending a function operation request with an operation type of a modification function, determining a target private resource pool by the edge computing node according to the identification value, and the target working unit with the unit identifier of the target private resource pool as the identifier value is taken as a target occupation working unit, the unit identifier of the target occupation working unit is modified into the target identifier value, then sending a message for setting a target identification value to the target occupying working unit, after the target occupying working unit receives the message, modifies its unit identification to a target identification value, and thereafter, when an execute function request is received having the target identification value, the target occupation work unit can be determined according to the target identification value, and the function instance is executed by the target occupation work unit to realize the service function.
In some embodiments, the operation type is deleting at least one function;
selecting a target occupation work unit from the target private resource pool according to the target unit identification and the resource use state of the work unit in the target private resource pool, wherein the method comprises the following steps:
selecting a target occupation working unit with unit identification as an identification value from a target private resource pool;
according to the operation type, operating the target occupation work unit, comprising:
and sending a message for deleting the identification value to the target occupation working unit so that the target occupation working unit sets the unit identification as a default identification value.
In this embodiment, when a tenant deletes a function, a function operation request whose operation type is a deletion function is sent, the edge computing node determines a target private resource pool according to an identification value therein, and uses a target working unit whose unit in the target private resource pool is identified as the identification value as a target occupied working unit, and sends a message of deleting the identification value to the target occupied working unit, and the target occupied working unit receives the message, modifies its unit identification from the identification value to a default identification value, and thereafter, the target occupied working unit does not execute a function instance corresponding to the deleted function.
According to the resource allocation method provided by the embodiment, the tenant can realize the operations of creating, expanding, reducing and deleting the private resource pool on the edge computing node through the application interface, and realize the operations of function addition, modification, deletion and the like based on the owned private resource pool. Therefore, tenants can deploy, maintain and manage resources required by the services by themselves, the operation is convenient, the service deployment is flexible, and the resources and the function operating environment among the tenants are isolated, so that the private data safety of the tenants can be ensured, the data safety requirements of the tenants are met, and the service stability is improved.
In some embodiments, the resource allocation method further comprises:
and sending the private resource pool of the distributed identification value, the unit identification of each work unit and the resource use state to other nodes.
In the distributed system, a plurality of edge computing nodes are provided, a main node is selected from the edge computing nodes firstly before relevant operation is carried out, the main node executes relevant resource pool operation and/or function operation, and operation results are synchronized to other nodes, so that the relevant information of the resource pools of all the nodes is kept consistent with metadata of working units, and the resource pools and the working units are conveniently and uniformly maintained and managed. Optionally, each edge computing node may select a master node based on a Raft protocol, only the master node may perform write operation, and all the nodes may perform read operation.
The resource allocation method of the present embodiment is described below with reference to specific embodiments.
As shown in fig. 4 and 5, the edge computing node includes a gateway, a resource manager, a host agent, and a plurality of functional units for implementing function service, where the gateway is configured to obtain a relevant operation request submitted by a tenant from an application interface, receive metadata of all working units reported by the host agent, execute a relevant operation according to the relevant operation request and the metadata of all working units, and schedule resources in a unified manner. The resource manager is used to maintain and manage all the work units, including but not limited to: the method comprises the steps that a public resource pool and a preset number of working units are configured in an initialization stage, and unit identifications of all the working units are set to be default identification values; after receiving a message of an identification value of a target occupied working unit sent by a gateway, modifying a unit identification of the target occupied working unit into the identification value; when a function request having an identification value is received, the work unit that called the identification value executes a function instance, and so on. The host agent is used for receiving the metadata reported by all the working units at regular time so as to report the metadata of all the working units to the gateway uniformly.
In some approaches, the gateway, resource manager, and host agent may be configured independently based on physical or virtual machines. Or, the gateway, the resource manager, and the host agent may be configured on the same physical machine or virtual machine, and the specific manner is not limited.
As shown in fig. 4, in step 401, a tenant performs related operations such as resource pool creation, modification, deletion, and the like through an application interface; step 402, the application interface directly returns that the operation is successful. Step 403, the gateway periodically polls an application interface to obtain a resource pool related operation request submitted by a tenant; in step 404, the application interface requests data of relevant operation of the tenant to the gateway synchronization. Step 405, all the working units report respective metadata to the host agent at regular time through heartbeat information, and health status check can be performed on the working units through the heartbeat information to find abnormal working units in time; in step 406, the host agent sends heartbeat response information to the work unit that reported the heartbeat information. Step 407, the host agent reports the collected metadata of the working units to the gateway uniformly; and step 408, the gateway receives the reported metadata of the working unit and sends report success information to the host agent. Step 409, selecting a master node from the plurality of edge computing nodes, and executing the relevant operation of the resource pool by the master node.
Step 4101, for the request for creating the resource pool, the master node preselects from the public resource pool that the function occupation status is idle and the unit identifier is a default identifier value, and the computing resource can execute at least one working unit of the function instance, and preferably selects the target working unit that best meets the conditions from the preselected working units, then, based on the metadata of the preferred target working unit, creates a private resource pool, allocates an identifier value set by the tenant to the private resource pool, sets the unit identifier of the target working unit in the private resource pool as the identifier value, and completes the creation of the private resource pool. Step 4102, for the resource pool modification request, according to the target service capacity and the current service capacity of the private resource pool, selecting a work unit with capacity expansion from the public resource pool, adding the work unit into the private resource pool to realize capacity expansion, or selecting a target work unit with function occupation state being idle from the private resource pool, releasing the target work unit back into the public resource pool to realize capacity reduction. Step 4103, for the resource pool deletion request, the master node deletes the metadata of the target work unit in the private resource pool to be deleted, and deletes the private resource pool to complete the deletion of the private resource pool. In step 411, after the master node executes the relevant operations of the resource pool, the master node synchronously sends the operation results of the resource pool to other nodes, so as to ensure that the resource pool information of all the nodes is consistent.
The tenant can create, modify and delete the private resource pool, and can perform service operations such as function addition, modification and deletion based on the own private resource pool.
As shown in fig. 5, in step 501, a tenant performs function operations related to function addition, modification, deletion, and the like through an application interface; step 502, the application interface directly returns that the operation is successful. Step 503, the gateway periodically polls the application interface to obtain a function operation request submitted by the tenant; in step 504, the application interface requests data from the gateway synchronous tenant's function operation. Step 505, all the working units report respective metadata to the host agent at regular time through heartbeat information, and health status check can be performed on the working units through the heartbeat information to find abnormal working units in time; step 506, the host agent sends response information to the working unit reporting the heartbeat information. Step 507, the host agent reports the collected metadata of the working units to the gateway uniformly; and step 508, the gateway receives the reported metadata of the working unit and sends report success information to the host agent. In step 509, a master node is selected from the plurality of edge computing nodes, and the master node performs a relevant service operation.
In 5101, for a function operation request of a newly added function, the master node selects a target occupation work unit from the target private resource pool, sends an identification value to the target occupation work unit, the target occupation work unit receives the identification value, sets the unit identification as the identification value, determines the target occupation work unit according to the identification value when the function request is subsequently received, and executes a function instance by the target occupation work unit to realize a specific service function. In step 5102, for a function operation request for modifying a function, the master node selects a target occupied working unit from the target private resource pool, sends a modified target identification value to the target occupied working unit, the target occupied working unit receives the target identification value, sets the unit identification as the target identification value, determines the target occupied working unit according to the target identification value when the function request is subsequently received, and executes a function instance by the target occupied working unit to realize a specific service function. In step 5103, for the function operation request of the delete function, the master node selects the target occupied work unit from the target private resource pool, and sends a message of deleting the identification value to the target occupied work unit, and the target occupied work unit receives the message and sets the unit identification as the default identification value. And 511, the target occupation working unit receives the message sent by the main node and sends a successful setting message to the main node. And step 512, after the master node executes the relevant function operation, the master node synchronously sends the function operation result to other nodes, so that the meta information of the working units of all the nodes is kept consistent.
In the above-mentioned step 403-.
It should be noted that the method of the embodiment of the present application may be executed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene and completed by the mutual cooperation of a plurality of devices. In this distributed scenario, one device of the multiple devices may only perform one or more steps of the method of the embodiment of the present application, and the multiple devices interact with each other to complete the method.
It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
Based on the same inventive concept, corresponding to the method of any embodiment, the application also provides a resource allocation device.
Referring to fig. 6, the resource allocation apparatus includes:
an obtaining module 601, configured to obtain a resource pool creation request of a tenant; the resource pool creating request comprises the quantity of execution function requests and an identification value configured by a tenant; executing a function comprising a tenant configuration;
a capacity determining module 602, configured to determine a service capacity according to the number of requests for executing the function;
a selecting module 603, configured to select, according to the service capacity and the resource usage state of the public resource pool, a target working unit capable of executing a function instance corresponding to the function from the public resource pool; the public resource pool maintains the resource use state and the unit identification of the working unit, and when the working unit is not distributed, the unit identification of the working unit is set as a default identification value;
the establishing module 604 is configured to establish a private resource pool based on the target work unit, assign an identification value to the private resource pool, assign the target work unit to the tenant, and set a unit identification of the target work unit to the identification value, so that the work unit with the identification value can execute a function instance generated according to a function configured by the tenant.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, the functionality of the various modules may be implemented in the same one or more software and/or hardware implementations as the present application.
The apparatus of the foregoing embodiment is used to implement the method for presenting the corresponding pop-up window effect in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Based on the same inventive concept, corresponding to any of the above-mentioned embodiments, the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and when the processor executes the program, the resource allocation method according to any of the above-mentioned embodiments is implemented.
Fig. 7 is a schematic diagram illustrating a more specific hardware structure of an electronic device according to this embodiment, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.
The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 1050 includes a path that transfers information between various components of the device, such as processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.
It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only the components necessary to implement the embodiments of the present disclosure, and need not include all of the components shown in the figures.
The electronic device of the foregoing embodiment is configured to implement the corresponding resource allocation method in any one of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the resource allocation method according to any of the above-mentioned embodiments.
Computer-readable media of the present embodiments, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
The computer instructions stored in the storage medium of the foregoing embodiment are used to enable the computer to execute the resource allocation method according to any one of the foregoing embodiments, and have the beneficial effects of corresponding method embodiments, which are not described herein again.
It should be noted that technical terms or scientific terms used in the embodiments of the present application should have a general meaning as understood by those having ordinary skill in the art to which the present application belongs, unless otherwise defined. The use of "first," "second," and similar terms in the embodiments of the present application is not intended to indicate any order, quantity, or importance, but rather is used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The article "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.
While the spirit and principles of the application have been described with reference to several particular embodiments, it is to be understood that the application is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit from the description. The application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims (15)

1. A method for resource allocation, comprising:
acquiring a resource pool creation request of a tenant; wherein the request for creating the resource pool comprises the number of requests for executing the function and the configured identification value of the tenant; the execute function request includes a function of the tenant configuration;
determining service capacity according to the quantity of the execution function requests;
according to the service capacity and the resource using state of a public resource pool, selecting a target working unit which can execute a function instance corresponding to the function from the public resource pool; the public resource pool maintains the resource use state and the unit identification of a working unit, and when the working unit is not distributed, the unit identification of the working unit is set as a default identification value;
establishing a private resource pool based on the target work unit, assigning the identification value to the private resource pool, assigning the target work unit to the tenant, and setting the unit identification of the target work unit to the identification value, so that the work unit with the identification value can execute the function instance generated according to the function configured by the tenant.
2. The method of claim 1, wherein the resource usage state comprises a function occupancy state and a computational resource state;
selecting a target work unit capable of executing a function instance corresponding to the function from the common resource pool, including:
selecting at least one working unit with the unit identifier as the default identifier value and the function occupation state as idle from the public resource pool;
and screening at least one working unit capable of executing the function instance corresponding to the function from the at least one selected working unit as a target working unit according to the computing resource state.
3. The method of claim 1, further comprising:
acquiring a resource pool modification request; wherein the resource pool modification request comprises the identification value and a target service capacity;
determining a target private resource pool and the current service capacity corresponding to the target private resource pool according to the identification value;
determining a capacity variation according to the target service capacity and the current service capacity;
and updating the unit identification and the resource use state of the target working unit in the target private resource pool according to the capacity variation.
4. The method of claim 3, wherein the resource usage state comprises a function occupancy state; the resource pool modification request is a resource pool expansion request;
according to the capacity variation, updating the unit identifier and the resource use state of the target work unit in the target private resource pool, including:
according to the capacity variation, at least one working unit with the unit identifier as the default identifier value and the function occupation state as idle is selected from the public resource pool;
and adding the unit identifier and the resource use state of the selected working unit in the target private resource pool, and setting the unit identifier of the added working unit as the identifier value.
5. The method of claim 3, wherein the resource usage state comprises a function occupancy state; the resource pool modification request is a resource pool capacity reduction request;
according to the capacity variation, updating the unit identifier and the resource use state of the target work unit in the target private resource pool, including:
selecting a target working unit with the function occupation state being idle from the target private resource pool according to the capacity variation;
and deleting the unit identifier and the resource use state of the selected target working unit from the target private resource pool, and setting the deleted unit identifier of the target working unit as the default identifier value.
6. The method of claim 1, further comprising:
acquiring at least one execution function request; wherein the execute function request includes the identification value;
determining the actual service capacity according to the quantity of the execution function requests;
determining a target private resource pool and the current service capacity corresponding to the target private resource pool according to the identification value;
determining a capacity variation according to the actual service capacity and the current service capacity;
and updating the unit identification and the resource use state of the target working unit in the target private resource pool according to the capacity variation.
7. The method of claim 1, further comprising:
acquiring a resource pool deletion request; wherein the resource pool deletion request includes the identification value;
determining a target private resource pool according to the identification value;
deleting the unit identification and the resource use state of the target working unit in the target private resource pool;
and deleting the target private resource pool.
8. The method according to any one of claims 1-7, further comprising:
acquiring a function operation request; wherein the function operation request comprises the identification value and an operation type;
determining a target private resource pool according to the identification value;
selecting a target occupation work unit from the target private resource pool according to the unit identification and the resource use state of the target work unit in the target private resource pool;
and operating the target occupation working unit according to the operation type to obtain an operation result.
9. The method of claim 8, wherein the operation type is adding at least one function, and the resource usage status comprises a function occupation status;
selecting a target occupation work unit from the target private resource pool according to the unit identifier and the resource use state of the target work unit in the target private resource pool, wherein the method comprises the following steps:
according to the function occupation state, selecting at least one target working unit capable of running a function instance corresponding to the at least one function from the target private resource pool;
selecting a working unit with the minimum function occupation amount from at least one selected target working unit as the target occupation working unit;
according to the operation type, operating the target occupation work unit, including:
and sending a message for setting the identification value to the target occupation working unit so that the target occupation working unit sets the unit identification as the identification value, and when receiving an execution function request with the identification value, the target occupation working unit can run the function instance.
10. The method of claim 8, wherein the operation type is modifying at least one function, and wherein the function operation request further comprises a target identification value;
selecting a target occupation work unit from the target private resource pool according to the unit identifier and the resource use state of the target work unit in the target private resource pool, wherein the method comprises the following steps:
selecting the target occupation working unit with the unit identifier as the identifier value from the target private resource pool;
according to the operation type, operating the target occupation work unit, including:
setting the unit identifier of the target occupation working unit as the target identifier value;
and sending a message for setting the target identification value to the target occupation working unit so that the target occupation working unit sets the unit identification as the target identification value, and when receiving an execution function request with the target identification value, the target occupation working unit can run a function instance corresponding to the at least one function.
11. The method of claim 8, wherein the type of operation is deleting at least one function;
selecting a target occupation work unit from the target private resource pool according to the target unit identification and the resource use state of the work unit in the target private resource pool, wherein the method comprises the following steps:
selecting the target occupation working unit with the unit identifier as the identifier value from the target private resource pool;
according to the operation type, operating the target occupation work unit, including:
and sending a message of deleting the identification value to the target occupation working unit so that the target occupation working unit sets the unit identification as the default identification value.
12. The method of claim 1, further comprising:
and sending the private resource pool allocated with the identification value, the unit identification of each working unit and the resource use state to other nodes.
13. A resource allocation apparatus, comprising:
the acquisition module is used for acquiring a resource pool creation request of a tenant; wherein the request for creating the resource pool comprises the number of requests for executing the function and the configured identification value of the tenant; the execute function request includes a function of the tenant configuration;
a capacity determining module, configured to determine a service capacity according to the number of the execution function requests;
a selecting module, configured to select, according to the service capacity and a resource usage state of a public resource pool, a target work unit capable of executing a function instance corresponding to the function from the public resource pool; the public resource pool maintains the resource use state and the unit identification of a working unit, and when the working unit is not distributed, the unit identification of the working unit is set as a default identification value;
the establishing module is used for establishing a private resource pool based on the target work unit, distributing the identification value to the private resource pool, distributing the target work unit to the tenant, and setting the unit identification of the target work unit to the identification value so as to enable the work unit with the identification value to execute the function instance generated according to the function configured by the tenant.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 12 when executing the program.
15. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 12.
CN202210255411.XA 2022-03-15 2022-03-15 Resource allocation method, device, electronic equipment and storage medium Active CN114629958B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210255411.XA CN114629958B (en) 2022-03-15 2022-03-15 Resource allocation method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210255411.XA CN114629958B (en) 2022-03-15 2022-03-15 Resource allocation method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114629958A true CN114629958A (en) 2022-06-14
CN114629958B CN114629958B (en) 2024-01-30

Family

ID=81902417

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210255411.XA Active CN114629958B (en) 2022-03-15 2022-03-15 Resource allocation method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114629958B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115375111A (en) * 2022-08-02 2022-11-22 贝壳找房(北京)科技有限公司 Resource circulation method and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013181464A1 (en) * 2012-05-31 2013-12-05 Vmware, Inc. Distributed demand-based storage quality of service management using resource pooling
US20170180254A1 (en) * 2012-03-26 2017-06-22 Amazon Technologies, Inc. Adaptive throttling for shared resources
WO2017148249A1 (en) * 2016-03-03 2017-09-08 华为技术有限公司 Resource configuration method and network device thereof
CN110612705A (en) * 2017-11-08 2019-12-24 华为技术有限公司 Method for service deployment under server-free architecture and function management platform
US20200057676A1 (en) * 2018-08-17 2020-02-20 Vmware, Inc. Function as a service (faas) execution distributor
US20200174899A1 (en) * 2018-11-29 2020-06-04 International Business Machines Corporation Building a highly-resilient system with failure independence in a disaggregated compute environment
CN111835679A (en) * 2019-04-18 2020-10-27 华为技术有限公司 Tenant resource management method and device under multi-tenant scene
WO2020238751A1 (en) * 2019-05-28 2020-12-03 阿里巴巴集团控股有限公司 Resource access method under serverless architecture, device, system, and storage medium
US20210173719A1 (en) * 2019-09-12 2021-06-10 Pivotal Software, Inc. Dynamic autoscaler for cloud platform
CN113795826A (en) * 2019-06-27 2021-12-14 英特尔公司 Automated resource management for distributed computing

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170180254A1 (en) * 2012-03-26 2017-06-22 Amazon Technologies, Inc. Adaptive throttling for shared resources
WO2013181464A1 (en) * 2012-05-31 2013-12-05 Vmware, Inc. Distributed demand-based storage quality of service management using resource pooling
WO2017148249A1 (en) * 2016-03-03 2017-09-08 华为技术有限公司 Resource configuration method and network device thereof
CN110612705A (en) * 2017-11-08 2019-12-24 华为技术有限公司 Method for service deployment under server-free architecture and function management platform
CN112214293A (en) * 2017-11-08 2021-01-12 华为技术有限公司 Method for service deployment under server-free architecture and function management platform
US20200057676A1 (en) * 2018-08-17 2020-02-20 Vmware, Inc. Function as a service (faas) execution distributor
US20200174899A1 (en) * 2018-11-29 2020-06-04 International Business Machines Corporation Building a highly-resilient system with failure independence in a disaggregated compute environment
CN111835679A (en) * 2019-04-18 2020-10-27 华为技术有限公司 Tenant resource management method and device under multi-tenant scene
WO2020238751A1 (en) * 2019-05-28 2020-12-03 阿里巴巴集团控股有限公司 Resource access method under serverless architecture, device, system, and storage medium
CN113795826A (en) * 2019-06-27 2021-12-14 英特尔公司 Automated resource management for distributed computing
US20210173719A1 (en) * 2019-09-12 2021-06-10 Pivotal Software, Inc. Dynamic autoscaler for cloud platform

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115375111A (en) * 2022-08-02 2022-11-22 贝壳找房(北京)科技有限公司 Resource circulation method and electronic equipment

Also Published As

Publication number Publication date
CN114629958B (en) 2024-01-30

Similar Documents

Publication Publication Date Title
CN112019475B (en) Resource access method, device, system and storage medium under server-free architecture
CN110519361B (en) Container cloud platform multi-tenant construction method and device based on kubernets
CN108809722B (en) Method, device and storage medium for deploying Kubernetes cluster
US11553034B2 (en) Server computer management system for supporting highly available virtual desktops of multiple different tenants
CN113037794B (en) Method, device and system for computing resource allocation scheduling
EP3200393A1 (en) Method and device for virtual network function management
CN106201661A (en) Method and apparatus for elastic telescopic cluster virtual machine
CN110908774B (en) Resource scheduling method, equipment, system and storage medium
CN111309440B (en) Method and equipment for managing and scheduling multiple types of GPUs
CN112463375A (en) Data processing method and device
CN111858045A (en) Multitask GPU resource scheduling method, device, equipment and readable medium
KR20200119849A (en) Security protection methods and devices
CN113419846B (en) Resource allocation method and device, electronic equipment and computer readable storage medium
CN111835679B (en) Tenant resource management method and device under multi-tenant scene
CN114629958B (en) Resource allocation method, device, electronic equipment and storage medium
CN115617509A (en) Node deployment method and device of distributed cluster and electronic equipment
CN113986539A (en) Method, device, electronic equipment and readable storage medium for realizing pod fixed IP
CN110795202B (en) Resource allocation method and device of virtualized cluster resource management system
CN109840094B (en) Database deployment method and device and storage equipment
CN112468458B (en) Scheduling method based on neutron layering mechanism
CN108092790B (en) Management method and device
CN114237974A (en) Data backup method and device, equipment and storage medium
CN112866321A (en) Resource scheduling method, device and system
CN112015515A (en) Virtual network function instantiation method and device
CN112559164A (en) Resource sharing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant