CN111400032A - Resource allocation method and device - Google Patents

Resource allocation method and device Download PDF

Info

Publication number
CN111400032A
CN111400032A CN202010135892.1A CN202010135892A CN111400032A CN 111400032 A CN111400032 A CN 111400032A CN 202010135892 A CN202010135892 A CN 202010135892A CN 111400032 A CN111400032 A CN 111400032A
Authority
CN
China
Prior art keywords
service
interface
request
processing module
target
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
CN202010135892.1A
Other languages
Chinese (zh)
Other versions
CN111400032B (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.)
Hangzhou DPtech Information Technology Co Ltd
Original Assignee
Hangzhou DPtech Information 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 Hangzhou DPtech Information Technology Co Ltd filed Critical Hangzhou DPtech Information Technology Co Ltd
Priority to CN202010135892.1A priority Critical patent/CN111400032B/en
Publication of CN111400032A publication Critical patent/CN111400032A/en
Application granted granted Critical
Publication of CN111400032B publication Critical patent/CN111400032B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Hardware Redundancy (AREA)

Abstract

The present specification discloses a method and an apparatus for resource allocation, which configure a service interface resource list according to the number of service interfaces supported by each service processing module. And determining a service processing module required by the service request as a target service processing module according to the service request sent by the user. And judging whether a service interface is allocated to the service request or not according to the service interface resource list. If yes, the service interface is allocated to the service request to execute the service provided by the target service processing module, otherwise, the unallocated service interface corresponding to the target service processing module is determined to be allocated to the service request. Whether the main controller or the standby controller allocates the service interfaces to the service requests, the resource lists of the service interfaces are uniformly updated, so that the main controller and the standby controller can synchronize the information of the service interfaces. Therefore, the method can lead the main controller and the standby controller to unify the information of each service interface and reduce the resource waste.

Description

Resource allocation method and device
Technical Field
The present disclosure relates to the field of computers, and in particular, to a method and an apparatus for resource allocation.
Background
With the continuous development of information technology, distributed systems are widely used in network devices. The staff sets up the business interface for the distributed system. The service interface is a virtual interface aiming at the hardware interface on the service level. For example, a hardware interface in the distributed system is used to receive a service request of a user, and after receiving the service request, data for the service request may be returned through the service interface.
In the prior art, a distributed system has a plurality of service processing modules, each of which is responsible for processing a fixed service, and if a service interface needs to be extended for one service processing module, the service interface needs to be extended for all the service processing modules. Since some services are widely used and some services are less used, only a few service interfaces in some service processing modules are used, which results in resource waste.
And there are multiple controllers in a distributed system, with one controller being the primary controller and the remaining controllers being the backup controllers. When the distributed system operates, the main controller distributes service interfaces, and when the pressure of the main controller is overlarge, the standby controller distributes the service interfaces. However, when the standby controller controls the distributed system, the service interface resource configuration in the standby controller may be inconsistent with the service interface resource configuration in the main controller. For example, the primary controller assigns a service interface to one service request, and the standby controller assigns the service interface to another service request. This can cause problems in the distributed system when handling service requests.
Therefore, how to reduce the waste of the service interface resources and keep the service interface resource allocation in the main controller and the standby controller synchronous is an urgent problem to be solved.
Disclosure of Invention
The present disclosure provides a method and apparatus for resource allocation to partially solve the above problems in the prior art.
The technical scheme adopted by the specification is as follows:
the present specification provides a method of resource allocation, comprising:
determining each loaded service processing module;
configuring a service interface resource list according to the number of service interfaces supported by each service processing module;
receiving a service request sent by a user;
determining a service processing module required by the service request as a target service processing module according to the service request;
judging whether a service interface is allocated to the service request or not according to the service interface resource list;
if so, allocating the service interface allocated to the service request for executing the service provided by the target service processing module, otherwise, determining that the unallocated service interface corresponding to the target service processing module is allocated to the service request from the service interface resource list.
Optionally, configuring a service interface resource list according to the number of service interfaces supported by each service processing module, specifically including:
determining each service interface supported by each service processing module aiming at each service processing module;
determining an interface identifier, an allocation state and a request identifier corresponding to the service interface of each service interface supported by the service processing module, wherein the allocation state is used for indicating whether the service interface is allocated, and the request identifier is a request identifier of a service request using the service interface;
and correspondingly storing the interface identifier, the distribution state and the request identifier of each service interface in the service interface resource list.
Optionally, the method further comprises:
acquiring an application interface request sent by a standby controller;
and distributing a service interface to the standby controller according to the interface application request.
Optionally, allocating a service interface to the standby controller according to the application interface request specifically includes:
determining a service request corresponding to a request identifier carried in the application interface request as a target service request, wherein the target service request is sent to the standby controller by a user;
according to the request identification carried in the request for applying the interface, inquiring whether a service interface is already allocated to the target service request from the service interface resource list;
if so, allocating the service interface allocated to the target service request through the standby controller, otherwise, inquiring an unallocated service interface from the service interface resource list as a target interface, allocating the target interface to the target service request through the standby controller, and updating the corresponding allocation state of the target interface in the service interface resource list.
Optionally, allocating a service interface already allocated to the target service request through the standby controller, specifically including:
and sending the interface identifier of the service interface which is already allocated to the target service request to the standby controller, so that the standby controller allocates the service interface corresponding to the received interface identifier to the target service request according to the received interface identifier.
Optionally, allocating, by the standby controller, the target interface to the target service request specifically includes:
and sending the interface identifier of the target interface to the standby controller, so that the standby controller updates the allocation state of the target interface in a service interface resource list corresponding to the standby controller according to the interface identifier of the target interface.
The present specification provides an apparatus for resource allocation, comprising:
the first determining module is used for determining each loaded business processing module;
the configuration module configures a service interface resource list according to the number of service interfaces supported by each service processing module;
the receiving module is used for receiving a service request sent by a user;
the second determining module is used for determining a service processing module required by the service request as a target service processing module according to the service request;
the judging module judges whether a service interface is allocated to the service request according to the service interface resource list;
and the distribution module is used for distributing the service interface distributed to the service request for executing the service provided by the target service processing module if the service interface is distributed to the service request, otherwise, the undistributed service interface corresponding to the target service processing module is determined from the service interface resource list to be distributed to the service request.
Optionally, the configuration module is specifically configured to, for each service processing module, determine each service interface supported by the service processing module; determining an interface identifier, an allocation state and a request identifier corresponding to the service interface of each service interface supported by the service processing module, wherein the allocation state is used for indicating whether the service interface is allocated, and the request identifier is a request identifier of a service request using the service interface; and correspondingly storing the interface identifier, the distribution state and the request identifier of each service interface in the service interface resource list.
The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described method of resource allocation.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the above method of resource allocation when executing the program.
The technical scheme adopted by the specification can achieve the following beneficial effects:
it can be seen from the above method that, according to the number of service interfaces supported by each loaded service processing module, a service interface resource list is configured, a service request sent by a user is received, and according to the service request, a service processing module required by the service request is determined to be used as a target service processing module, and then, according to the service interface resource list, whether a service interface is allocated to the service request is judged, if so, the service interface allocated to the service request is allocated to the service request for executing the service provided by the target service processing module, otherwise, an unassigned service interface corresponding to the target service processing module is determined from the service interface resource list to be allocated to the service request.
The main controller and the standby controller have the same service interface resource list, and no matter the main controller or the standby controller allocates the unallocated service interface to the service request, the service interface resource lists corresponding to the main controller and the standby controller are uniformly updated according to the state of the allocated service interface, so that the main controller and the standby controller can synchronize the information of each service interface.
Meanwhile, when the number of the service interfaces of one service processing module is expanded, the number of the service interfaces of other service processing modules is not required to be expanded, and the service interfaces of the service processing module can be directly expanded, so that the resource waste is reduced. Therefore, the method can lead the main controller and the standby controller to unify the information of each service interface and reduce the resource waste.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
FIG. 1 is a flow chart illustrating a method for resource allocation according to the present disclosure;
fig. 2 is a schematic diagram illustrating a standby controller applying for a service interface from a main controller according to the present disclosure;
FIG. 3 is a schematic diagram of an apparatus for resource allocation provided herein;
fig. 4 is a schematic diagram of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a resource allocation method in this specification, which specifically includes the following steps:
s101: and determining the loaded business processing modules.
In this specification, a plurality of service processing modules may be accessed in a distributed system, and each service processing module is responsible for processing a different service. For example, if two service processing modules are accessed in the distributed system, one of the service processing modules may be responsible for calculating the service of the user score, and the other service processing module may be responsible for ranking the service of the user score. The service processing module may be hardware, for example, in a distributed system, a plurality of hardware devices inserted into device slots of the distributed system may be all used as the service processing module.
In a distributed system, there may be multiple controllers, each of which may receive a service request sent by a user and assign a service interface to the received service request. The distributed system referred to herein may refer to a VSM system composed of a plurality of controllers and employing Virtual Switch Matrix (VSM) technology. The controller mentioned herein may refer to a controller on a hardware level, and may also refer to a control system on a software level. One controller is a main controller, the other controllers are standby controllers, the main controller is responsible for main work of the controllers in the distributed system, most of service requests are received by the main controller, and if the load of the main controller is too high in pressure or is down, the standby controllers need to be responsible for partial or even all work of the main controller. Of course, the controller referred to herein may also be a combination of hardware and software in the distributed system.
For example, the VSM system may have two control systems, a primary control system and a backup control system, with two controllers, a primary controller and a backup controller in each control system. The VSM system can be controlled by the main control system during operation, the main control system is also mainly used for receiving the service request and the like, and if the main control system is down, the standby controller is used for receiving the service request. If the load pressure of the main control system is higher, the standby control system can start working.
The service interface mentioned here is an interface virtualized by a worker on a service level for a hardware interface in the service processing module. The service interface is mainly used for distinguishing some messages on some service logics. For example, a service processing module has a hardware interface, which may be an interface for receiving data or an interface for sending data to the outside, and for convenience, one or more service interfaces may be set for the hardware interface, where a service interface is only an interface in a data transmission direction sent from the hardware interface, and the hardware interface is an interface for receiving data.
In the scheme, the execution main body is a main controller in a distributed system. The main controller needs to determine each service processing module accessed in the distributed system, so that the main controller can determine the service processing module of the service corresponding to the service request after receiving the service request, so that the service processing module executes the corresponding service.
S102: and configuring a service interface resource list according to the number of the service interfaces supported by each service processing module.
After determining the loaded service processing modules, the service interface resource list can be configured according to the service processing modules. The service interface resource list mentioned here stores information such as the allocation state of the service interface in each service processing module in the distributed system.
Specifically, when configuring the service interface resource list, each service interface supported by the service processing module may be determined for each service processing module, and an interface identifier, an allocation state, and a request identifier corresponding to the service interface of the service interface may be determined for each service interface supported by each service processing module.
The allocation state of the service interface is used for indicating whether the service interface is allocated, and the request identifier corresponding to the service interface is the request identifier of the service request using the service interface. If the service interface is not allocated to a specific service request, the service interface does not have a corresponding request identifier. After determining the interface identifier, the allocation status, and the request identifier of each service interface, the interface identifier, the allocation status, and the request identifier of each service interface may be correspondingly stored in the service interface resource list.
For example, if there are two service processing modules in the distributed system, where one service processing module has 20 service interfaces and the other service processing module has 10 service interfaces, the service interfaces may be numbered according to the service module where the service interface is located, and the service interfaces may be arranged in the service interface resource list according to the order of the numbers from large to small (or from small to large). Thus, the service interface resource list stores the interface identifiers, allocation statuses, and request identifiers of 30 service interfaces.
It should be noted that, in order to enable each controller to synchronize information such as the allocation status of each service interface, each controller may determine the service interface resource list as described above. Therefore, the main controller and the standby controller can have the same service interface resource list, and the information such as the distribution state of each service interface can be synchronized.
S103: and receiving a service request sent by a user.
When the distributed system operates, the main controller may receive a service request sent by a user, and after receiving the service request, the main controller needs to allocate a service interface appropriate for the service request according to the service interface resource list.
Of course, in this specification, the standby controller in the distributed system may also be in operation, so the standby controller may also receive a service request sent by a user, and after receiving the service request, may send an interface application request to the main controller to apply for a required service interface.
S104: and determining a service processing module required by the service request as a target service processing module according to the service request.
After receiving the service request, the main controller may determine that the service processing module of the service corresponding to the service request is used as a target service processing module, for example, after the user sends the service request, the main controller may determine that the service corresponding to the service request is a load balancing service and a network acceleration service according to the request identifier corresponding to the service request, and then the main controller may determine that the load balancing service processing module and the network acceleration service processing module are both the target service processing module.
S105: and judging whether a service interface is allocated to the service request or not according to the service interface resource list.
After receiving the service request, the main controller may query whether a service interface is allocated for the service request from the aforementioned service interface resource list. Specifically, the main controller may determine a request identifier of the service request, and then determine whether a service interface allocated to the request identifier exists in the service interface resource list. If such a service interface exists, it indicates that a service interface has been allocated for the service request, and may directly allocate the allocated service interface to the service request, otherwise, it indicates that a service interface has not been allocated for the service request.
S106: if so, allocating the service interface allocated to the service request for executing the service provided by the target service processing module, otherwise, determining that the unallocated service interface corresponding to the target service processing module is allocated to the service request from the service interface resource list.
The main controller judges whether a service interface is allocated to the service request in the process, and if so, the main controller can allocate the service interface to the service request. Otherwise, determining that the unassigned service interface corresponding to the target service processing module is allocated to the service request from the service interface resource list.
After the main controller allocates the service interface to the service request, it needs to update the information of the service interface in the service interface resource list, for example, update the allocation state of the service interface to allocated, and update the request identifier corresponding to the service interface to the request identifier corresponding to the service request. In order to be able to synchronize the information of a service interface to each controller, the information of the service interface can be updated in the service interface resource lists of both the primary controller and the standby controller.
It should be noted that the service request received by the main controller may involve multiple service processing modules, in such a case, the main controller may use all of the multiple service processing modules as target service processing modules, and determine, for each target service processing module, from the service interface resource list, that an unassigned service interface corresponding to the target service processing module is allocated to the service request.
Fig. 2 is a schematic diagram of a standby controller applying for a service interface from a main controller according to the present disclosure.
As shown in fig. 2, if the main controller receives an interface application request sent by the standby controller, it may determine a service request corresponding to a request identifier carried in the interface application request, as a target service request. The target service request is a service request received by the standby controller, and the standby controller sends an interface application request to the main controller after receiving the target service request.
The main controller can judge whether a service interface is allocated to the target service request according to the service interface resource list, and if so, the service interface is allocated to the target service request through the standby controller. Specifically, the main controller may determine an interface identifier of the service interface, and send the interface identifier to the standby controller, so that the standby controller allocates the service interface corresponding to the interface identifier to the target service request.
Otherwise, the unallocated service interface needs to be queried from the service interface resource list as the target interface. When determining the target interface, it is necessary to determine a service processing module of the service corresponding to the target service request, and determine an unallocated service interface corresponding to the service processing module from the service interface resource list as the target interface.
After determining the interface identifier corresponding to the target interface, the main controller sends the interface identifier to the standby controller, so that the standby controller allocates the target interface to the target service request, and the main controller and the standby controller need to update information such as the allocation state of the target interface in respective service interface resource lists.
In addition, if the number of service interfaces supported by the service processing module needs to be increased, the number of service interfaces of the service processing module can be directly increased without increasing the number of service interfaces of other service processing modules. This is also because the main controller and the standby controller can update the number of service interfaces in the distributed system in time through the service interface resource list. Therefore, the situation that the service interface resources of some service processing modules are wasted can be reduced to a certain extent.
It can be seen from the above method that the method makes the service interface information of the main controller and the standby controller synchronous by the way of performing scheduling service interface by the main controller in the distributed system and initially configuring and updating the unified service interface resource list of the main controller and the standby controller, so as to reduce errors in the operation process of the distributed system. When the number of interfaces of a certain service processing module is expanded, the number of interfaces of other service processing modules does not need to be expanded at the same time, so that the resource waste is reduced to a certain extent.
It should be further noted that, the main controller or the standby controller may maintain a unified service interface resource list for all service processing modules supported in the distributed system, or may maintain corresponding service interface resource lists for different service processing modules. Therefore, after receiving a service request sent by a user, the main controller can query whether a corresponding service interface is already allocated to the service request from a service interface resource list corresponding to the service processing module according to the determined service processing module to which the service request belongs.
The above method for resource allocation provided for one or more embodiments of the present specification also provides a corresponding apparatus for resource allocation, based on the same idea, as shown in fig. 3.
Fig. 3 is a schematic diagram of an apparatus for resource allocation provided in this specification, which specifically includes:
a first determining module 301, configured to determine each loaded service processing module;
a configuration module 302, configured to configure a service interface resource list according to the number of service interfaces supported by each service processing module;
a receiving module 303, configured to receive a service request sent by a user;
a second determining module 304, configured to determine, according to the service request, a service processing module required by the service request, as a target service processing module;
a determining module 305, configured to determine whether a service interface is allocated to the service request according to the service interface resource list;
an allocating module 306, configured to allocate, if yes, the service interface allocated to the service request for executing the service provided by the target service processing module, and otherwise, determine, from the service interface resource list, that the unassigned service interface corresponding to the target service processing module is allocated to the service request.
Optionally, the configuration module 302 is specifically configured to, for each service processing module, determine each service interface supported by the service processing module; determining an interface identifier, an allocation state and a request identifier corresponding to the service interface of each service interface supported by the service processing module, wherein the allocation state is used for indicating whether the service interface is allocated, and the request identifier is a request identifier of a service request using the service interface; and correspondingly storing the interface identifier, the distribution state and the request identifier of each service interface in the service interface resource list.
Optionally, the apparatus further includes a second allocating module 307, configured to acquire an application interface request sent by the standby controller; and distributing a service interface to the standby controller according to the interface application request.
Optionally, the second allocating module 307 is specifically configured to determine, as a target service request, a service request corresponding to a request identifier carried in the application interface request, where the target service request is sent to the standby controller by a user; according to the request identification carried in the request for applying the interface, inquiring whether a service interface is already allocated to the target service request from the service interface resource list; if so, allocating the service interface allocated to the target service request through the standby controller, otherwise, inquiring an unallocated service interface from the service interface resource list as a target interface, allocating the target interface to the target service request through the standby controller, and updating the corresponding allocation state of the target interface in the service interface resource list.
Optionally, the second allocating module 307 is specifically configured to send the interface identifier of the service interface that has been allocated to the target service request to the standby controller, so that the standby controller allocates the service interface corresponding to the received interface identifier to the target service request according to the received interface identifier.
Optionally, the second allocating module 307 is specifically configured to send the interface identifier of the service interface that has been allocated to the target service request to the standby controller, so that the standby controller allocates the service interface corresponding to the received interface identifier to the target service request according to the received interface identifier.
The present specification also provides a computer readable storage medium having stored thereon a computer program operable to perform the method of resource allocation provided in figure 1 above.
This specification also provides a schematic block diagram of the electronic device shown in fig. 4. As shown in fig. 4, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs the computer program to implement the method for resource allocation described in fig. 1 above. Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 th generation of 20 th century, it is obvious that improvements in Hardware (for example, improvements in Circuit structures such as diodes, transistors and switches) or software (for improvement in method flow) can be distinguished for a technical improvement, however, as technology develops, many of the improvements in method flow today can be regarded as direct improvements in Hardware Circuit structures, designers almost all obtain corresponding Hardware Circuit structures by Programming the improved method flow into Hardware circuits, and therefore, it cannot be said that an improvement in method flow cannot be realized by Hardware entity modules, for example, Programmable logic devices (Programmable logic devices L organic devices, P L D) (for example, Field Programmable Gate Arrays (FPGAs) are integrated circuits whose logic functions are determined by user Programming of devices), and a digital system is "integrated" on a P L D "by self Programming of designers without requiring many kinds of integrated circuits manufactured and manufactured by special chip manufacturers to design and manufacture, and only a Hardware program is written by Hardware logic editor (software) such as Hardware editor software, software editor, software, Hardware editor, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software, Hardware, software.
A controller may be implemented in any suitable manner, e.g., in the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, microcontrollers 625D, an Atmel AT91SAM, a MicrochipPIC18F26K20, and a Silicone L abs C8051F320, which may also be implemented as part of the control logic of a memory.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, 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. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (10)

1. A method of resource allocation, comprising:
determining each loaded service processing module;
configuring a service interface resource list according to the number of service interfaces supported by each service processing module;
receiving a service request sent by a user;
determining a service processing module required by the service request as a target service processing module according to the service request;
judging whether a service interface is allocated to the service request or not according to the service interface resource list;
if so, allocating the service interface allocated to the service request for executing the service provided by the target service processing module, otherwise, determining that the unallocated service interface corresponding to the target service processing module is allocated to the service request from the service interface resource list.
2. The method of claim 1, wherein configuring the service interface resource list according to the number of service interfaces supported by each service processing module specifically comprises:
determining each service interface supported by each service processing module aiming at each service processing module;
determining an interface identifier, an allocation state and a request identifier corresponding to the service interface of each service interface supported by the service processing module, wherein the allocation state is used for indicating whether the service interface is allocated, and the request identifier is a request identifier of a service request using the service interface;
and correspondingly storing the interface identifier, the distribution state and the request identifier of each service interface in the service interface resource list.
3. The method of claim 1, wherein the method further comprises:
acquiring an application interface request sent by a standby controller;
and distributing a service interface to the standby controller according to the interface application request.
4. The method of claim 3, wherein allocating a service interface to the standby controller according to the application interface request specifically comprises:
determining a service request corresponding to a request identifier carried in the application interface request as a target service request, wherein the target service request is sent to the standby controller by a user;
according to the request identification carried in the request for applying the interface, inquiring whether a service interface is already allocated to the target service request from the service interface resource list;
if so, allocating the service interface allocated to the target service request through the standby controller, otherwise, inquiring an unallocated service interface from the service interface resource list as a target interface, allocating the target interface to the target service request through the standby controller, and updating the corresponding allocation state of the target interface in the service interface resource list.
5. The method of claim 4, wherein assigning the service interface already assigned to the target service request through the standby controller specifically comprises:
and sending the interface identifier of the service interface which is already allocated to the target service request to the standby controller, so that the standby controller allocates the service interface corresponding to the received interface identifier to the target service request according to the received interface identifier.
6. The method of claim 4, wherein assigning the target interface to the target service request via the standby controller specifically comprises:
and sending the interface identifier of the target interface to the standby controller, so that the standby controller updates the allocation state of the target interface in a service interface resource list corresponding to the standby controller according to the interface identifier of the target interface.
7. An apparatus for resource allocation, comprising:
the first determining module is used for determining the loaded business processing modules;
the configuration module is used for configuring a service interface resource list according to the number of service interfaces supported by each service processing module;
the receiving module is used for receiving a service request sent by a user;
the second determining module is used for determining a service processing module required by the service request as a target service processing module according to the service request;
the judging module is used for judging whether a service interface is allocated to the service request according to the service interface resource list;
and the allocation module is used for allocating the service interface allocated to the service request for executing the service provided by the target service processing module if the service interface allocated to the service request is the same as the service interface allocated to the service request, otherwise, determining that the unallocated service interface corresponding to the target service processing module is allocated to the service request from the service interface resource list.
8. The apparatus according to claim 7, wherein the configuration module is specifically configured to, for each service processing module, determine each service interface supported by the service processing module; determining an interface identifier, an allocation state and a request identifier corresponding to the service interface of each service interface supported by the service processing module, wherein the allocation state is used for indicating whether the service interface is allocated, and the request identifier is a request identifier of a service request using the service interface; and correspondingly storing the interface identifier, the distribution state and the request identifier of each service interface in the service interface resource list.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1 to 6.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 6 when executing the program.
CN202010135892.1A 2020-03-02 2020-03-02 Resource allocation method and device Active CN111400032B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010135892.1A CN111400032B (en) 2020-03-02 2020-03-02 Resource allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010135892.1A CN111400032B (en) 2020-03-02 2020-03-02 Resource allocation method and device

Publications (2)

Publication Number Publication Date
CN111400032A true CN111400032A (en) 2020-07-10
CN111400032B CN111400032B (en) 2023-07-21

Family

ID=71435959

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010135892.1A Active CN111400032B (en) 2020-03-02 2020-03-02 Resource allocation method and device

Country Status (1)

Country Link
CN (1) CN111400032B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112434221A (en) * 2020-11-27 2021-03-02 北京沃东天骏信息技术有限公司 Resource management method and device, and resource recommendation method and device
CN114860377A (en) * 2022-04-24 2022-08-05 支付宝(杭州)信息技术有限公司 Service processing method, device and equipment for container operation and maintenance

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040041840A1 (en) * 2002-08-27 2004-03-04 Brett Green System and method for process dependency management
CN105100075A (en) * 2015-07-01 2015-11-25 北京奇虎科技有限公司 Game business processing method, equipment and system
US20160148208A1 (en) * 2013-06-08 2016-05-26 Huawei Technologies Co., Ltd Data processing method and system, terminal, and server
CN107729141A (en) * 2017-09-27 2018-02-23 华为技术有限公司 A kind of method for distributing business, device and server
CN108512758A (en) * 2018-03-07 2018-09-07 华为技术有限公司 Message processing method, controller and forwarding unit
CN109087055A (en) * 2018-06-06 2018-12-25 北京达佳互联信息技术有限公司 The control method and device of service request
WO2019001023A1 (en) * 2017-06-26 2019-01-03 中兴通讯股份有限公司 Resource allocation method and system
WO2019052532A1 (en) * 2017-09-18 2019-03-21 阿里巴巴集团控股有限公司 Information interaction method, apparatus and device for internet of things device
WO2019136800A1 (en) * 2018-01-09 2019-07-18 平安科技(深圳)有限公司 Service processing method, apparatus and device, and computer-readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040041840A1 (en) * 2002-08-27 2004-03-04 Brett Green System and method for process dependency management
US20160148208A1 (en) * 2013-06-08 2016-05-26 Huawei Technologies Co., Ltd Data processing method and system, terminal, and server
CN105100075A (en) * 2015-07-01 2015-11-25 北京奇虎科技有限公司 Game business processing method, equipment and system
WO2019001023A1 (en) * 2017-06-26 2019-01-03 中兴通讯股份有限公司 Resource allocation method and system
WO2019052532A1 (en) * 2017-09-18 2019-03-21 阿里巴巴集团控股有限公司 Information interaction method, apparatus and device for internet of things device
CN107729141A (en) * 2017-09-27 2018-02-23 华为技术有限公司 A kind of method for distributing business, device and server
WO2019136800A1 (en) * 2018-01-09 2019-07-18 平安科技(深圳)有限公司 Service processing method, apparatus and device, and computer-readable storage medium
CN108512758A (en) * 2018-03-07 2018-09-07 华为技术有限公司 Message processing method, controller and forwarding unit
CN109087055A (en) * 2018-06-06 2018-12-25 北京达佳互联信息技术有限公司 The control method and device of service request

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112434221A (en) * 2020-11-27 2021-03-02 北京沃东天骏信息技术有限公司 Resource management method and device, and resource recommendation method and device
CN114860377A (en) * 2022-04-24 2022-08-05 支付宝(杭州)信息技术有限公司 Service processing method, device and equipment for container operation and maintenance

Also Published As

Publication number Publication date
CN111400032B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN110704155B (en) Container network construction method and device, physical host and data transmission method
CN108462656B (en) Container-based resource scheduling method and device for service convergence deployment
CN113037794B (en) Method, device and system for computing resource allocation scheduling
CN108845876B (en) Service distribution method and device
CN110597614B (en) Resource adjustment method and device
CN103049328A (en) Distribution method of internal memory resources in computer system
CN116305298B (en) Method and device for managing computing power resources, storage medium and electronic equipment
CN111400032A (en) Resource allocation method and device
CN110908774A (en) Resource scheduling method, device, system and storage medium
CN113674131A (en) Hardware accelerator equipment management method and device, electronic equipment and storage medium
CN113296926B (en) Resource allocation method, computing device and storage medium
CN112948050A (en) Method and device for deploying pod
CN108390914B (en) Service updating method, device and system
CN105874426A (en) Batch processing method and device for system invocation commands
CN113849260A (en) Instance processing core allocation method and device
CN116737345A (en) Distributed task processing system, distributed task processing method, distributed task processing device, storage medium and storage device
CN111562883B (en) Cache management system, method and device for solid state disk
CN110244964B (en) Operation and maintenance method, device and equipment based on operation and maintenance application
CN116157778A (en) System and method for hybrid centralized and distributed scheduling on shared physical hosts
CN116107728A (en) Task execution method and device, storage medium and electronic equipment
CN104281587A (en) Connection establishing method and device
CN114629958B (en) Resource allocation method, device, electronic equipment and storage medium
CN112114958A (en) Resource isolation method, distributed platform, computer device, and storage medium
CN115328608A (en) Kubernetes container vertical expansion adjusting method and device
CN108073453B (en) Method and device for scheduling CPU (Central processing Unit) resources in distributed cluster

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