CN113938392A - Resource allocation method, device, electronic equipment and computer readable storage medium - Google Patents

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

Info

Publication number
CN113938392A
CN113938392A CN202010659125.0A CN202010659125A CN113938392A CN 113938392 A CN113938392 A CN 113938392A CN 202010659125 A CN202010659125 A CN 202010659125A CN 113938392 A CN113938392 A CN 113938392A
Authority
CN
China
Prior art keywords
resource
client
resources
capacity expansion
amount
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
CN202010659125.0A
Other languages
Chinese (zh)
Other versions
CN113938392B (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.)
Asiainfo Technology Nanjing Co ltd
Original Assignee
Asiainfo Technology Nanjing 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 Asiainfo Technology Nanjing Co ltd filed Critical Asiainfo Technology Nanjing Co ltd
Priority to CN202010659125.0A priority Critical patent/CN113938392B/en
Publication of CN113938392A publication Critical patent/CN113938392A/en
Application granted granted Critical
Publication of CN113938392B publication Critical patent/CN113938392B/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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application provides a resource allocation method, a resource allocation device, electronic equipment and a computer-readable storage medium, and relates to the field of resource allocation. The method comprises the following steps: receiving a resource capacity expansion instruction sent by a client, wherein the resource capacity expansion instruction comprises capacity expansion resource amount; when the capacity expansion resource amount is larger than the sum of the fixed resource surplus corresponding to the client and the flowing resource surplus corresponding to the client, sending a capacity expansion failure instruction to the client; and when the capacity expansion resource amount is larger than the fixed resource residual amount corresponding to the client and is smaller than the sum of the fixed resource residual amount corresponding to the client and the mobile resource residual amount corresponding to the client, allocating the mobile resource of the first resource library to the client. The embodiment of the application realizes reasonable allocation of resources, and the resources are fully utilized.

Description

Resource allocation method, device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of resource allocation technologies, and in particular, to a resource allocation method, a resource allocation apparatus, an electronic device, and a computer-readable storage medium.
Background
With the progress and development of information technology, people's daily life is more closely related to data and calculation. For example, there are increasing demands for cloud platforms of living resources such as travel routes, shopping, diet, and the like, and for cloud platforms of scientific resources such as computing resources, meeting schedules, and major progress reports. According to different ways of providing services for clients of users, the service terminals of the current cloud technology are divided into Infrastructure As A Service (IAAS), Platform As A Service (PAAS), Software As A Service (SAAS), and the like. Typically, the service is paid for, so the user is also called a "tenant".
When the client of the tenant rents the service, the client needs to rent the resource of the service. When the existing resources are used and allocated, the client leases the resources, the server allocates the resources to the client, and when the client is used, the utilization rate of the resources is low, the lease cost is wasted, and the resources of the server are vacant.
Disclosure of Invention
The purpose of the present application is to solve at least one of the above technical drawbacks, and to provide the following solutions: .
In a first aspect, a method for resource allocation is provided, where the method includes:
receiving a resource capacity expansion instruction sent by a client, wherein the resource capacity expansion instruction comprises capacity expansion resource amount;
when the capacity expansion resource amount is larger than the sum of the fixed resource surplus corresponding to the client and the flow resource surplus corresponding to the client, sending a capacity expansion failure instruction to the client;
and when the capacity expansion resource amount is larger than the fixed resource residual amount corresponding to the client and is smaller than the sum of the fixed resource residual amount corresponding to the client and the mobile resource residual amount corresponding to the client, allocating the mobile resource of the first resource library to the client.
In a second aspect, an apparatus for resource allocation is provided, the apparatus comprising:
the instruction receiving module is used for receiving a resource capacity expansion instruction sent by the client, and the resource capacity expansion instruction comprises capacity expansion resource quantity;
the instruction sending module is used for sending a capacity expansion failure instruction to the client when the capacity expansion resource amount is larger than the sum of the fixed resource surplus amount corresponding to the client and the flowing resource surplus amount corresponding to the client;
and the capacity expansion allocation module is used for allocating the mobile resources of the first resource library to the client when the capacity expansion resource amount is greater than the fixed resource residual amount corresponding to the client and is less than the sum of the fixed resource residual amount corresponding to the client and the mobile resource residual amount corresponding to the client.
In a third aspect, an electronic device is provided, which includes:
one or more processors;
a memory;
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: the resource allocation method according to the first aspect of the present application is performed.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor, implements the resource allocation method shown in the first aspect of the present application. .
The beneficial effect that technical scheme that this application provided brought is: the resource library is divided into fixed resources and flowing resources, when a client expands capacity, a resource capacity expansion instruction sent by the client is received, when the capacity expansion resource amount is larger than the fixed resource surplus corresponding to the client and is smaller than the sum of the fixed resource surplus corresponding to the client and the flowing resource surplus corresponding to the client, the flowing resources of the first resource library are distributed to the client, when the client does not need the flowing resources, the flowing resources of the first resource library are not distributed to the client, the resource distribution has real-time performance, the resources are saved, when one client does not need the flowing resources, the flowing resources can be distributed to other clients for use, the resource distribution is more reasonable, and the resources are fully utilized.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic application environment diagram of a resource allocation method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a resource allocation method according to an embodiment of the present application;
FIG. 3 is a detailed flowchart of step S203 in FIG. 2;
fig. 4 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device for resource allocation according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The present application provides a resource allocation method, apparatus, electronic device and computer-readable storage medium, which are intended to solve the above technical problems in the prior art.
The following describes the technical solution of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The resource allocation method provided by the application can be applied to the application environment shown in fig. 1. Specifically, the number of the clients may be multiple, and the embodiment of the present application is illustrated by 2 examples, and includes a client 101a and a client 101b, where the client 101a and the client 101b lease resources of a server. The server 102 includes a first resource pool, where the first resource pool includes fixed resources and mobile resources, and the fixed resources and the mobile resources are allocated according to a preset proportion. When the client applies for the resource of the leased server 102, the client can apply for a fixed resource and a mobile resource at the same time, the fixed resource is fixed for the corresponding client to use, and when the fixed resource corresponding to the client is not enough for the client to use, the mobile resource is allocated to the client to use. Specifically, for example, when the client 101a needs to expand the capacity of the resource during the peak period of the service of the client 101a, the client 101a sends a resource capacity expansion instruction to the server 102, and the server 102 receives the resource capacity expansion instruction sent by the client 101a, where the resource capacity expansion instruction includes the capacity expansion resource amount; when the capacity expansion resource amount is larger than the sum of the fixed resource remaining amount corresponding to the client 101a and the flow resource remaining amount corresponding to the client 101a, sending a capacity expansion failure instruction to the client; and when the capacity expansion resource amount is larger than the fixed resource residual amount corresponding to the client 101a and is smaller than the sum of the fixed resource residual amount corresponding to the client 101a and the mobile resource residual amount corresponding to the client 101a, allocating the mobile resource of the first resource pool to the client 101 a.
Those skilled in the art will appreciate that the client 101a, the client 101b and the server 102 may be terminals to execute corresponding programs. In other embodiments, the client 101a, the client 101b and the server 102 may be replaced by servers.
Those skilled in the art will understand that the "terminal" used herein may be a Mobile phone, a tablet computer, a PDA (Personal Digital Assistant), an MID (Mobile Internet Device), etc.; a "server" may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
Referring to fig. 2, an embodiment of the present application provides a resource allocation method, which can be applied to the server side, where the server side includes a first resource pool, and the first resource pool includes fixed resources and mobile resources, and the method includes:
s201: and receiving a resource capacity expansion instruction sent by the client, wherein the resource capacity expansion instruction comprises capacity expansion resource quantity.
The client side is in communication connection with the server side. The client leases the resources in the first resource library of the server to meet the business needs of the client. The first resource pool may be a resource of a Platform As A Service (PAAS).
The fixed resources are fixedly allocated to the client and cannot increase or decrease along with the change of time; the mobile resource is the resource which is allocated to the client to use when the client needs. In the first resource library, the fixed resources and the mobile resources are allocated according to a preset proportion, the preset proportion is not limited, for example, the proportion of the fixed resources to the mobile resources is 8:2 or 7:3, and the preset proportion can be set or changed according to requirements. The client applies for renting the resources in the first resource library of the server in advance, and the client can apply for the fixed resources or apply for the fixed resources and the mobile resources simultaneously. For example, if the resources required by the client at ordinary times are 7G or less, and the client at a peak of service period requires 9G, the client may apply for the fixed resources 7G and the mobile resources 2G, or the client applies for the fixed resources 8G and the mobile resources 2G.
During the service peak period of the client, the service demand is increased, and when the resource expansion is needed, the client sends a resource expansion instruction to the server, wherein the resource expansion instruction includes an expansion resource amount, and the expansion resource amount is the resource amount needed to be increased when the client expands the capacity. The server can receive a resource capacity expansion instruction sent by the client.
S202: and when the capacity expansion resource amount is larger than the sum of the fixed resource surplus corresponding to the client and the flowing resource surplus corresponding to the client, sending a capacity expansion failure instruction to the client.
When the client has expanded capacity, the client may have used some of the resources. For example, the fixed resource applied by the client includes 8G, the mobile resource includes 2G, and when the client sends a resource expansion instruction to the server, the client has already used the fixed resource 6G.
The remaining amount of the fixed resource corresponding to the client is the difference between the amount of the fixed resource applied by the client and the amount of the fixed resource already used. If the fixed resource requested by the client includes 8G and the client has used 6G, the remaining amount of the fixed resource corresponding to the client is 2G. It is understood that the fixed resource remaining amount may be 0.
The remaining amount of the streaming resource corresponding to the client is a difference between the amount of the streaming resource requested by the client and the streaming resource already used, and if the streaming resource requested by the client includes 2G and the client already uses 0G of the streaming resource, the remaining amount of the streaming resource corresponding to the client is 2G, and the sum of the remaining amount of the fixed resource corresponding to the client and the remaining amount of the streaming resource corresponding to the client is 2G + 2G-4G.
When the capacity expansion resource amount is greater than the sum of the remaining amount of the fixed resource corresponding to the client and the remaining amount of the mobile resource corresponding to the client, for example, the capacity expansion resource amount is 5G and is greater than the sum of the remaining amount of the fixed resource corresponding to the client and the remaining amount of the mobile resource corresponding to the client, it is indicated that the capacity expansion resource amount applied by the client exceeds the remaining amount of the resource applied by the client, capacity expansion cannot be successful, and the client needs to apply for more resources if the client wants to apply for more resources. At this time, the server side sends a capacity expansion failure instruction to the client side. And the capacity expansion failure instruction is used for notifying the client of capacity expansion failure.
S203: and when the capacity expansion resource amount is larger than the fixed resource residual amount corresponding to the client and is smaller than the sum of the fixed resource residual amount corresponding to the client and the mobile resource residual amount corresponding to the client, allocating the mobile resource of the first resource library to the client.
If the remaining quantity of the fixed resources corresponding to the client is 2G, the remaining quantity of the mobile resources corresponding to the client is 2G, and when the capacity expansion resource quantity is 3G, the capacity expansion resource quantity 3G is larger than the remaining quantity of the fixed resources corresponding to the client 2G, and the capacity expansion resource quantity 3G is smaller than the sum of the remaining quantity of the fixed resources corresponding to the client 2G and the remaining quantity of the mobile resources corresponding to the client 4G, it is stated that the remaining quantity of the resources applied by the client is enough for the client to use, the mobile resources of the first resource pool are allocated to the client.
It can be understood that when the capacity expansion resource amount is smaller than the fixed resource remaining amount corresponding to the client, it indicates that the fixed resource is sufficient for the client to use in an expansion mode, and no mobile resource needs to be allocated to the client.
The resource allocation method provided by the embodiment of the application divides the resource library into fixed resources and flow resources, receives a resource capacity expansion instruction sent by the client during capacity expansion of the client, allocates the flow resources of the first resource library to the client when the capacity expansion resource amount is larger than the remaining amount of the fixed resources corresponding to the client and is smaller than the sum of the remaining amount of the fixed resources corresponding to the client and the remaining amount of the flow resources corresponding to the client, and does not allocate the flow resources of the first resource library to the client when the client does not need the flow resources, so that the resource allocation has real-time performance, resources are saved, and when one client does not need the flow resources, the flow resources can be allocated to other clients for use, the resource allocation is more reasonable, and the resources are fully utilized.
The embodiment of the present application further provides a possible implementation manner, where allocating a streaming resource of a first resource pool to a client includes:
and when the flow resources in the first resource library comprise the flow resources reserved for the client, allocating the flow resources reserved for the client to the client.
If the client has a requirement and the mobile resource is preset to meet the capacity expansion requirement, the mobile resource in the first resource library comprises the mobile resource reserved for the client, and when the capacity expansion resource amount is larger than the fixed resource residual amount corresponding to the client and is smaller than the sum of the fixed resource residual amount corresponding to the client and the mobile resource residual amount corresponding to the client, the mobile resource reserved for the client is distributed to the client.
The embodiment of the present application further provides a possible implementation manner, where before allocating the mobile resource reserved by the client to the client, the resource allocation further includes:
receiving a resource reservation instruction sent by a client, wherein the resource reservation instruction comprises preset time;
and according to the resource reservation instruction, taking part of the flowing resources in the first resource library as the flowing resources reserved for the client within a preset time.
When the client has a service demand and the client estimates a service peak period, the client can send a resource reservation instruction to the server, and the server can receive the resource reservation instruction sent by the client when the resource reservation instruction comprises a preset time. Wherein the predetermined time is the time when the client end reserves the streaming resource. For example, if the client estimates that the time between 18 hours and 23 hours is a traffic peak time, the predetermined time may be 18 hours to 23 hours, so as to reserve the flow resources from 18 hours to 23 hours to meet the traffic demand.
The size of the part of the streaming resources, the size of the streaming resources required by the client, or the size of the streaming resources applied by the client. And in the preset time, no matter whether the client expands the capacity or not, the server side prepares the mobile resource preset by the client for the client to expand the capacity for use.
Referring to fig. 3, a possible implementation manner is further provided in the embodiment of the present application, where allocating a streaming resource of a first resource pool to a client includes:
s301: and when the flow resources in the first resource library comprise the flow resources reserved for the client, allocating the flow resources reserved for the client to the client.
S302: and when the flow resources in the first resource library do not comprise the flow resources reserved for the client and the capacity expansion resource amount is less than the sum of the flow resource residual amount of the first resource library and the fixed resource residual amount corresponding to the client, preempting the flow resources of the first resource library to allocate to the client.
If the mobile resources in the first resource pool do not include the mobile resources reserved for the client, it indicates that the client does not reserve the mobile resources.
Although the mobile resources of the first resource pool may be large, the server may correspond to a plurality of clients, and when the plurality of clients all expand the mobile resources, the remaining amount of the mobile resources of the first resource pool may slowly decrease, the expanded resource amount may be smaller than the sum of the remaining amount of the mobile resources of the first resource pool and the remaining amount of the fixed resources corresponding to the clients, and the expanded resource amount may also be larger than the sum of the remaining amount of the mobile resources of the first resource pool and the remaining amount of the fixed resources corresponding to the clients.
When the capacity expansion resource amount is less than the sum of the flowing resource surplus of the first resource library and the fixed resource surplus corresponding to the client, it is indicated that the resource surplus of the first resource library can also meet the capacity expansion use of the client, but at the same time, other clients may also request capacity expansion, and the flowing resource is limited, and the flowing resource of the first resource library is preempted to be allocated to the client. The probability that the client sending the resource expansion instruction is early can obtain the flowing resources of the first resource library is high.
S303: and when the mobile resources in the first resource library do not comprise the mobile resources reserved for the client and the capacity expansion resource amount is larger than the sum of the mobile resource residual amount of the first resource library and the fixed resource residual amount corresponding to the client, acquiring the mobile resources of the second resource library and allocating the mobile resources to the client.
When the capacity expansion resource amount is larger than the sum of the mobile resource surplus of the first resource library and the fixed resource surplus corresponding to the client, the resource surplus of the first resource library cannot meet the capacity expansion use of the client, and then the mobile resource of the second resource library is obtained to be allocated to the client for use.
The second resource pool may be a resource of an IAAS (Infrastructure as a Service). It can be understood that the first resource library and the second resource library may be located in the same server, or the first resource library and the second resource library may be located in different servers; if the first resource library is located in the first service end and the second resource library is located in the second service end, the first service end is the service end of the client, the second service end is the service end of the first service end, and the second resource library of the second service end expands the capacity of the first resource library of the first service end.
And only when the mobile resources of the first resource library cannot meet the mobile resources of all the clients, the normal operation of all the clients can be guaranteed.
The embodiment of the present application further provides a possible implementation manner, and the resource allocation method further includes:
and when the flowing resource of the first resource library is unsuccessfully occupied, the flowing resource of the second resource library is obtained and distributed to the client.
When the flow resources in the first resource library do not include the flow resources reserved for the client and the capacity expansion resource amount is smaller than the sum of the flow resource residual amount of the first resource library and the fixed resource residual amount corresponding to the client, and when the flow resources in the first resource library are preempted to be allocated to the client, the flow resources in the first resource library fail to be preempted, which indicates that the flow resources in the first resource library are too few to meet the use of the client, the flow resources in the second resource library are obtained and allocated to the client.
The embodiment of the present application further provides a possible implementation manner, and the resource allocation method further includes:
when the usage amount of the mobile resources in the first resource library reaches a first preset proportion, the mobile resources in the second resource library are obtained as standby mobile resources;
and when the usage amount of the flowing resources of the first resource library is smaller than a second preset proportion, releasing part of or all of the flowing resources of the second resource library.
The magnitude of the first predetermined ratio is not limited, for example, the first predetermined ratio may be 85%, 90%, etc. The standby mobile resource, namely the standby resource of the first resource library, can be used by the client in time when the mobile resource of the first resource library is not enough to satisfy the use of a plurality of clients.
The second predetermined ratio is not limited, for example, the second predetermined ratio may be 80%, 85%, etc. The magnitude of the second predetermined proportion may be equal to the magnitude of the first predetermined proportion. Optionally, the size of the second preset proportion is smaller than or equal to the size of the first preset proportion. And releasing part of or all of the mobile resources of the second resource library can reduce the use of the mobile resources of the second resource library, and the resource allocation is more reasonable.
The embodiment of the present application further provides a possible implementation manner, and the resource allocation method further includes:
acquiring the resource amount used by a client;
and when the resource amount used by the client is smaller than the preset release proportion of the fixed resource corresponding to the client, releasing part or all of the flowing resource corresponding to the client.
When the resource amount used by the client is obtained, the resource amount can be obtained in real time.
The magnitude of the preset release ratio is not limited, and the preset release ratio may be 100%, 95%, 80%, and the like. If the amount of resources used by the client is less than 100% of the fixed resources corresponding to the client, 50% or 80% of the mobile resources corresponding to the client can be released, and if the amount of resources used by the client is less than 70% of the fixed resources corresponding to the client, all the mobile resources corresponding to the client can be released.
Referring to fig. 4, an embodiment of the present application provides a resource allocation apparatus 40, where the resource allocation apparatus 40 may include: an instruction receiving module 401, an instruction sending module 402 and a capacity allocation module 403, wherein,
the instruction receiving module 401 is configured to receive a resource expansion instruction sent by a client, where the resource expansion instruction includes an expansion resource amount;
an instruction sending module 402, configured to send a capacity expansion failure instruction to the client when the capacity expansion resource amount is greater than a sum of a fixed resource surplus amount corresponding to the client and a mobile resource surplus amount corresponding to the client;
and the capacity expansion allocation module 403 is configured to allocate the flow resource of the first resource pool to the client when the capacity expansion resource amount is greater than the remaining amount of the fixed resource corresponding to the client and is less than the sum of the remaining amount of the fixed resource corresponding to the client and the remaining amount of the flow resource corresponding to the client.
The resource allocation device provided by the embodiment of the application divides the resource library into fixed resources and flow resources, receives a resource expansion instruction sent by the client during the expansion of the client, allocates the flow resources of the first resource library to the client when the expansion resource amount is larger than the remaining amount of the fixed resources corresponding to the client and is smaller than the sum of the remaining amount of the fixed resources corresponding to the client and the remaining amount of the flow resources corresponding to the client, and does not allocate the flow resources of the first resource library to the client when the client does not need the flow resources, so that the resource allocation has real-time performance, resources are saved, and when one client does not need the flow resources, the flow resources can be allocated to other clients for use, the allocation of the resources is more reasonable, and the resources are fully utilized.
The capacity expansion and distribution module 403 may include:
and the reserved allocation unit is used for allocating the mobile resources reserved for the client to the client when the mobile resources in the first resource library comprise the mobile resources reserved for the client.
The resource allocation apparatus 40 may further include:
the system comprises a preset receiving module, a resource reservation module and a resource reservation module, wherein the preset receiving module is used for receiving a resource reservation instruction sent by a client, and the resource reservation instruction comprises preset time;
and the reservation module is used for taking part of the flowing resources in the first resource library as the flowing resources reserved for the client within the preset time according to the resource reservation instruction.
The capacity expansion and distribution module 403 may further include:
the preemption unit is used for preempting the flow resources of the first resource library to allocate to the client when the flow resources in the first resource library do not include the flow resources reserved for the client and the capacity expansion resource amount is less than the sum of the flow resource residual amount of the first resource library and the fixed resource residual amount corresponding to the client;
and the resource obtaining unit is used for obtaining the mobile resource of the second resource library and distributing the mobile resource to the client when the mobile resource in the first resource library does not comprise the mobile resource reserved for the client and the capacity expansion resource amount is larger than the sum of the mobile resource residual amount of the first resource library and the fixed resource residual amount corresponding to the client.
The resource obtaining unit is further configured to obtain the mobile resource of the second resource library and allocate the mobile resource to the client when the mobile resource of the first resource library is unsuccessfully occupied.
The resource allocation apparatus 40 may further include:
the standby resource acquisition module is used for acquiring the mobile resource of the second resource library as the standby mobile resource when the usage amount of the mobile resource of the first resource library reaches a first preset proportion;
and the first releasing module is used for releasing part of or all of the flowing resources of the second resource library when the usage amount of the flowing resources of the first resource library is smaller than a second preset proportion.
The resource allocation apparatus 40 may further include:
the usage amount obtaining module is used for obtaining the resource amount used by the client;
and the second release module is used for releasing part or all of the flowing resources corresponding to the client when the resource amount used by the client is smaller than the preset release proportion of the fixed resources corresponding to the client.
Referring to fig. 5, in an alternative embodiment, an electronic device is provided, and the electronic device 5000 includes: a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are coupled, such as via a bus 5002. Optionally, the electronic device 5000 may also include a transceiver 5004. It should be noted that the transceiver 5004 is not limited to one in practical application, and the structure of the electronic device 5000 is not limited to the embodiment of the present application.
The Processor 5001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein. The processor 5001 may also be a combination of processors implementing computing functionality, e.g., a combination comprising one or more microprocessors, a combination of DSPs and microprocessors, or the like.
Bus 5002 can include a path that conveys information between the aforementioned components. The bus 5002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 5002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The Memory 5003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 5003 is used for storing application program codes for executing the present solution, and the execution is controlled by the processor 5001. The processor 5001 is configured to execute application program code stored in the memory 5003 to implement the contents shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: a terminal and a server.
An embodiment of the present application provides an electronic device, including: a memory and a processor; at least one program, stored in the memory, for execution by the processor, which, in comparison with the prior art, implements: the resource library is divided into fixed resources and mobile resources, when a client expands capacity, a resource capacity expansion instruction sent by the client is received, when the capacity expansion resource amount is larger than the fixed resource surplus corresponding to the client and is smaller than the sum of the fixed resource surplus corresponding to the client and the mobile resource surplus corresponding to the client, the mobile resources of the first resource library are distributed to the client, when the client does not need the mobile resources, the mobile resources of the first resource library are not distributed to the client, the resource distribution has real-time performance, the resources are saved, when one client does not need the mobile resources, the mobile resources can be distributed to other clients for use, the resource distribution is more reasonable, and the resources are fully utilized.
The present application provides a computer-readable storage medium, which stores a computer program, and when the computer program runs on a computer, the computer can execute the corresponding content in the foregoing method embodiments. Compared with the prior art, the resource library is divided into fixed resources and mobile resources, when a client expands capacity, a resource capacity expansion instruction sent by the client is received, when the capacity expansion resource amount is larger than the remaining amount of the fixed resources corresponding to the client and is smaller than the sum of the remaining amount of the fixed resources corresponding to the client and the remaining amount of the mobile resources corresponding to the client, the mobile resources of the first resource library are distributed to the client, when the client does not need the mobile resources, the mobile resources of the first resource library are not distributed to the client, the resource distribution is real-time, the resources are saved, when one client does not need the mobile resources, the mobile resources can be distributed to other clients for use, the resource distribution is more reasonable, and the resources are fully utilized.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or in turns with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A resource allocation method is applied to a server, wherein the server includes a first resource pool, the first resource pool includes fixed resources and mobile resources, and the method includes:
receiving a resource capacity expansion instruction sent by a client, wherein the resource capacity expansion instruction comprises capacity expansion resource amount;
when the capacity expansion resource amount is larger than the sum of the fixed resource surplus corresponding to the client and the flowing resource surplus corresponding to the client, sending a capacity expansion failure instruction to the client;
and when the capacity expansion resource amount is larger than the fixed resource surplus corresponding to the client and is smaller than the sum of the fixed resource surplus corresponding to the client and the mobile resource surplus corresponding to the client, allocating the mobile resource of the first resource library to the client.
2. The method according to claim 1, wherein the allocating the streaming resources of the first resource pool to the client comprises:
and when the flow resources in the first resource library comprise the flow resources reserved for the client, allocating the flow resources reserved for the client to the client.
3. The method of claim 2, wherein before the allocating the reserved streaming resources to the client, the method further comprises:
receiving a resource reservation instruction sent by the client, wherein the resource reservation instruction comprises preset time;
and according to the resource reservation instruction, taking part of the flowing resources in the first resource library as the flowing resources reserved for the client within the preset time.
4. The method of claim 2, wherein the allocating the streaming resources of the first resource pool to the client further comprises:
when the flow resources in the first resource library do not include the flow resources reserved for the client and the capacity expansion resource amount is smaller than the sum of the flow resource residual amount of the first resource library and the fixed resource residual amount corresponding to the client, preempting the flow resources of the first resource library to allocate to the client;
and when the flow resources in the first resource library do not comprise the flow resources reserved for the client and the capacity expansion resource amount is larger than the sum of the flow resource residual amount of the first resource library and the fixed resource residual amount corresponding to the client, obtaining the flow resources of a second resource library and allocating the flow resources to the client.
5. The method of claim 4, further comprising:
and when the flowing resource of the first resource library is unsuccessfully preempted, the flowing resource of the second resource library is obtained and distributed to the client.
6. The method of claim 1, further comprising:
when the usage amount of the mobile resources in the first resource library reaches a first preset proportion, acquiring the mobile resources in a second resource library as standby mobile resources;
and when the usage amount of the mobile resources in the first resource library is smaller than a second preset proportion, releasing part of or all of the mobile resources in the second resource library.
7. The method according to any of claims 4-6, wherein the first resource pool is a resource of a Platform As A Service (PAAS); the second resource pool is a resource of an infrastructure as a service IAAS.
8. A resource allocation apparatus, comprising:
the instruction receiving module is used for receiving a resource capacity expansion instruction sent by a client, wherein the resource capacity expansion instruction comprises capacity expansion resource quantity;
the instruction sending module is used for sending a capacity expansion failure instruction to the client when the capacity expansion resource amount is larger than the sum of the fixed resource surplus amount corresponding to the client and the flowing resource surplus amount corresponding to the client;
and the capacity expansion allocation module is used for allocating the mobile resources of the first resource library to the client when the capacity expansion resource amount is greater than the remaining amount of the fixed resources corresponding to the client and is less than the sum of the remaining amount of the fixed resources corresponding to the client and the remaining amount of the mobile resources corresponding to the client.
9. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: performing the resource allocation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the resource allocation method of any one of claims 1 to 7.
CN202010659125.0A 2020-07-09 2020-07-09 Resource allocation method, device, electronic equipment and computer readable storage medium Active CN113938392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010659125.0A CN113938392B (en) 2020-07-09 2020-07-09 Resource allocation method, device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010659125.0A CN113938392B (en) 2020-07-09 2020-07-09 Resource allocation method, device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113938392A true CN113938392A (en) 2022-01-14
CN113938392B CN113938392B (en) 2023-11-14

Family

ID=79273319

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010659125.0A Active CN113938392B (en) 2020-07-09 2020-07-09 Resource allocation method, device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113938392B (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102137091A (en) * 2010-11-15 2011-07-27 华为技术有限公司 Overload control method, device and system as well as client-side
US20140244841A1 (en) * 2013-02-27 2014-08-28 Vmware, Inc. Resource allocation using capacity distribution
WO2017166584A1 (en) * 2016-03-30 2017-10-05 乐视控股(北京)有限公司 Resource allocation method and device, and electronic device
CN107291545A (en) * 2017-08-07 2017-10-24 星环信息科技(上海)有限公司 The method for scheduling task and equipment of multi-user in computing cluster
US9953351B1 (en) * 2013-03-13 2018-04-24 Amazon Technologies, Inc. Managing resource requests that exceed reserved resource capacity
CN108009017A (en) * 2016-11-01 2018-05-08 阿里巴巴集团控股有限公司 A kind of expansion method of application link, device and system
US10230664B1 (en) * 2015-09-21 2019-03-12 Amazon Technologies, Inc. Strategic resource allocation in a web-based computing system
CN109634747A (en) * 2018-12-12 2019-04-16 平安科技(深圳)有限公司 Resource capacity expansion method, apparatus, computer equipment and storage medium based on Saltstack
CN109657998A (en) * 2018-12-25 2019-04-19 国信优易数据有限公司 A kind of resource allocation methods, device, equipment and storage medium
CN109766182A (en) * 2018-12-18 2019-05-17 平安科技(深圳)有限公司 The scalable appearance method, apparatus of system resource dynamic, computer equipment and storage medium
CN109857518A (en) * 2019-01-08 2019-06-07 平安科技(深圳)有限公司 A kind of distribution method and equipment of Internet resources
CN109918194A (en) * 2019-01-16 2019-06-21 深圳壹账通智能科技有限公司 Intelligent dilatation capacity reduction method, device, computer equipment and storage medium
CN110032447A (en) * 2019-04-11 2019-07-19 北京百度网讯科技有限公司 Method and apparatus for distributing resource
CN110209342A (en) * 2018-03-26 2019-09-06 腾讯科技(深圳)有限公司 Expansion method, device, equipment and the system of cloud hard disk
CN110377415A (en) * 2018-04-12 2019-10-25 华为技术有限公司 A kind of request processing method and server
CN110858161A (en) * 2018-08-24 2020-03-03 阿里巴巴集团控股有限公司 Resource allocation method, device, system, equipment and medium
CN111192135A (en) * 2019-12-20 2020-05-22 上海淇玥信息技术有限公司 Method and device for processing reserved resource application and electronic equipment

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102137091A (en) * 2010-11-15 2011-07-27 华为技术有限公司 Overload control method, device and system as well as client-side
US20140244841A1 (en) * 2013-02-27 2014-08-28 Vmware, Inc. Resource allocation using capacity distribution
US9953351B1 (en) * 2013-03-13 2018-04-24 Amazon Technologies, Inc. Managing resource requests that exceed reserved resource capacity
US10230664B1 (en) * 2015-09-21 2019-03-12 Amazon Technologies, Inc. Strategic resource allocation in a web-based computing system
WO2017166584A1 (en) * 2016-03-30 2017-10-05 乐视控股(北京)有限公司 Resource allocation method and device, and electronic device
CN108009017A (en) * 2016-11-01 2018-05-08 阿里巴巴集团控股有限公司 A kind of expansion method of application link, device and system
CN107291545A (en) * 2017-08-07 2017-10-24 星环信息科技(上海)有限公司 The method for scheduling task and equipment of multi-user in computing cluster
CN110209342A (en) * 2018-03-26 2019-09-06 腾讯科技(深圳)有限公司 Expansion method, device, equipment and the system of cloud hard disk
CN110377415A (en) * 2018-04-12 2019-10-25 华为技术有限公司 A kind of request processing method and server
CN110858161A (en) * 2018-08-24 2020-03-03 阿里巴巴集团控股有限公司 Resource allocation method, device, system, equipment and medium
CN109634747A (en) * 2018-12-12 2019-04-16 平安科技(深圳)有限公司 Resource capacity expansion method, apparatus, computer equipment and storage medium based on Saltstack
CN109766182A (en) * 2018-12-18 2019-05-17 平安科技(深圳)有限公司 The scalable appearance method, apparatus of system resource dynamic, computer equipment and storage medium
CN109657998A (en) * 2018-12-25 2019-04-19 国信优易数据有限公司 A kind of resource allocation methods, device, equipment and storage medium
CN109857518A (en) * 2019-01-08 2019-06-07 平安科技(深圳)有限公司 A kind of distribution method and equipment of Internet resources
CN109918194A (en) * 2019-01-16 2019-06-21 深圳壹账通智能科技有限公司 Intelligent dilatation capacity reduction method, device, computer equipment and storage medium
CN110032447A (en) * 2019-04-11 2019-07-19 北京百度网讯科技有限公司 Method and apparatus for distributing resource
CN111192135A (en) * 2019-12-20 2020-05-22 上海淇玥信息技术有限公司 Method and device for processing reserved resource application and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CHIN-FENG LAI; REN-HUNG HWANG; HAN-CHIEH CHAO: "A QoS Aware Resource Allocation Strategy for Mobile Graphics Rendering With Cloud Support", IEEE *
董思岐;吴嘉慧;李海龙;屈毓锛;胡磊;: "面向优先级任务的移动边缘计算资源分配方法", 计算机工程, no. 03 *
高聪;双锴;苏森;: "支持客户预约的媒体服务器资源分配算法", 北京邮电大学学报, no. 05 *

Also Published As

Publication number Publication date
CN113938392B (en) 2023-11-14

Similar Documents

Publication Publication Date Title
CN110647394B (en) Resource allocation method, device and equipment
CN112905342B (en) Resource scheduling method, device, equipment and computer readable storage medium
CN112463375A (en) Data processing method and device
CN112925607A (en) System capacity expansion and contraction method and device and electronic equipment
CN112214313A (en) Memory allocation method and related equipment
CN111104219A (en) Binding method, device, equipment and storage medium of virtual core and physical core
CN112905334A (en) Resource management method, device, electronic equipment and storage medium
CN111427551A (en) User code operation method of programming platform, equipment and storage medium
CN114155026A (en) Resource allocation method, device, server and storage medium
CN115348264A (en) Multi-tenant cloud service management method, device, equipment and storage medium
CN113553178A (en) Task processing method and device and electronic equipment
CN108241535B (en) Resource management method and device and server equipment
CN111580974A (en) GPU instance distribution method and device, electronic equipment and computer readable medium
CN116069493A (en) Data processing method, device, equipment and readable storage medium
JP2023543744A (en) Resource scheduling method, system, electronic device and computer readable storage medium
CN113938392B (en) Resource allocation method, device, electronic equipment and computer readable storage medium
CN114217977B (en) Resource allocation method, device, equipment and storage medium
WO2017133421A1 (en) Method and device for sharing resources among multiple tenants
CN114253663A (en) Virtual machine resource scheduling method and device
US20220206844A1 (en) Scheduling resource reservations in a cloud-based communication system
CN111090520B (en) User allocation method and device for exclusive resources, electronic equipment and storage medium
CN114090249A (en) Resource allocation method, device, electronic equipment and storage medium
CN115794362A (en) Resource allocation method, cloud host and computer-readable storage medium
CN112398892B (en) Service distribution method, device and equipment
CN117785486B (en) Environment resource allocation method, device, equipment and medium

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
GR01 Patent grant
GR01 Patent grant