CN111400032B - Resource allocation method and device - Google Patents
Resource allocation method and device Download PDFInfo
- Publication number
- CN111400032B CN111400032B CN202010135892.1A CN202010135892A CN111400032B CN 111400032 B CN111400032 B CN 111400032B CN 202010135892 A CN202010135892 A CN 202010135892A CN 111400032 B CN111400032 B CN 111400032B
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques 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 specification discloses a method and a device for allocating resources, 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 for the service request according to the service interface resource list. If yes, the service interface is allocated to the service request for executing 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. The service interfaces are distributed to the service requests by the main controller or the standby controller, and the resource list of each service interface is uniformly updated, so that the main controller and the standby controller can synchronize the information of each service interface. Therefore, the method can unify the information of each service interface of the main controller and the standby controller, and reduce resource waste.
Description
Technical Field
The present disclosure relates to the field of computers, and in particular, to a method and 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 an interface which is virtual aiming at a hardware interface on a service layer. For example, a hardware interface in the distributed system is configured to receive a service request of a user, and after receiving the service request, return data for the service request through the service interface.
In the prior art, a distributed system is provided with a plurality of service processing modules, each service processing module is responsible for processing a fixed service, and if a service interface needs to be expanded for one service processing module, the service interface needs to be expanded for all the service processing modules. Because some services are widely used and some services are less used, only a few service interfaces in some service processing modules are used, so that resources are wasted.
And there are multiple controllers in the distributed system, one of which is the master controller and the other of which are standby controllers. The service interfaces are allocated by the master controller when the distributed system is running, and by the backup controller when the master controller is under excessive pressure. However, when the standby controller controls the distributed system, there may be a case where the service interface resource configuration in the standby controller is inconsistent with the service interface resource configuration in the main controller. For example, the master controller assigns one service interface to one service request, and the standby controller assigns the service interface to another service request. This may cause problems in the distributed system when processing service requests.
Therefore, how to reduce the service interface resource waste and keep the service interface resource allocation in the main controller and the standby controller synchronous is a problem to be solved.
Disclosure of Invention
The present disclosure provides a method and apparatus for resource allocation, so as to partially solve the above-mentioned problems in the prior art.
The technical scheme adopted in the specification is as follows:
the present specification provides a method for resource allocation, including:
determining each loaded business 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;
according to the service request, determining a service processing module required by the service request as a target service processing module;
judging whether a service interface is allocated for the service request according to the service interface resource list;
if yes, distributing the service interface distributed to the service request for executing the service provided by the target service processing module, otherwise, determining that the unassigned service interface corresponding to the target service processing module is distributed to the service request from the service interface resource list.
Optionally, a service interface resource list is configured according to the number of service interfaces supported by each service processing module, which specifically includes:
for each service processing module, determining each service interface supported by the service processing module;
for 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, wherein the allocation state is used for indicating whether the service interface is allocated or not, and the request identifier is a request identifier of a service request using the service interface;
and correspondingly storing the interface identification, the allocation state and the request identification 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 application interface request.
Optionally, according to the request for applying for an interface, a service interface is allocated to the standby controller, which 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;
inquiring whether a service interface is allocated for the target service request or not from the service interface resource list according to a request identifier carried in the application interface request;
if yes, distributing the service interface distributed to the target service request through the standby controller, otherwise, inquiring the unassigned service interface from the service interface resource list as a target interface, distributing the target interface to the target service request through the standby controller, and updating the corresponding distribution state of the target interface in the service interface resource list.
Optionally, the service interface allocated to the target service request is allocated to the target service request through the standby controller, which specifically includes:
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, the 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 the 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, including:
the first determining module is used for determining each loaded business processing module;
the configuration module is used for configuring a service interface resource list according to the number of the service interfaces supported by each service processing module;
the receiving module receives a service request sent by a user;
the second determining module is used for determining a service processing module required by the service request according to the service request and taking the service processing module as a target service processing module;
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 allocates the service interface allocated to the service request for executing the service provided by the target service processing module if the service interface is allocated to the service request, otherwise, determines 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, the configuration module is specifically configured to determine, for each service processing module, each service interface supported by the service processing module; for 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, wherein the allocation state is used for indicating whether the service interface is allocated or not, and the request identifier is a request identifier of a service request using the service interface; and correspondingly storing the interface identification, the allocation state and the request identification of each service interface in the service interface resource list.
The present description 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-described method of resource allocation when executing the program.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
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 as a target service processing module, then, according to the service interface resource list, it can be determined whether a service interface is allocated to the service request, if yes, 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, the unallocated 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 the service interface resource list corresponding to the main controller and the standby controller is uniformly updated according to the state of the allocated service interface no matter whether the main controller or the standby controller allocates the unallocated service interface to the service request, 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 does not need to be expanded, so that the service interfaces of the service processing module can be directly expanded, and the resource waste is reduced. Therefore, the method can unify the information of each service interface of the main controller and the standby controller, and reduce resource waste.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. In the drawings:
FIG. 1 is a flow chart of a method of resource allocation in the present specification;
FIG. 2 is a schematic diagram of a standby controller applying a service interface to a main controller according to the present disclosure;
FIG. 3 is a schematic diagram of an apparatus for resource allocation provided in the present specification;
fig. 4 is a schematic view of the electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
Fig. 1 is a flow chart of a method for allocating resources in the present specification, specifically including the following steps:
s101: and determining each loaded business processing module.
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 connected in the distributed system, one service processing module may be responsible for calculating the service of the user points, and the other service processing module may be responsible for sorting the service of the user points. The service processing module may be hardware, for example, in a distributed system, there may be a plurality of hardware devices inserted into device slots of the distributed system, which are all used as the service processing module.
There may be multiple controllers in a distributed system, each of which may receive a service request sent by a user and allocate a service interface to the received service request. The distributed system referred to herein may refer to a VSM system consisting of a plurality of controllers employing virtual switching matrix (Virtual Switch Matrix, VSM) technology. The controller referred to herein may refer to a hardware-level controller or a software-level control system. One of the controllers is a main controller, the other controllers are standby controllers, the main controller is responsible for the main work of the controllers in the distributed system, most of service requests are received by the main controller, and if the load pressure of the main controller is too high or the main controller is down, the standby controllers need to be responsible for part or even all of the work of the main controller. Of course, the controller mentioned here may also exist in the distributed system in a combination of hardware and software.
For example, there may be two control systems, a primary control system and a backup control system in the VSM system, and two controllers, a primary controller and a backup controller in each control system. The VSM system can be controlled by the main control system only when running, and the main control system is mainly responsible for receiving service requests and other works by the main controller, and if the main controller is down, the standby controller receives the service requests. If the load pressure of the main control system is high, the standby control system can start to work.
The service interface mentioned here is an interface that a worker virtual aims at a hardware interface in a service processing module on a service level. The service interface is mainly used for distinguishing some messages on some service logics. For example, a service processing module has a hardware interface, where the hardware interface may be an interface for receiving data or an interface for sending data to the outside, for convenience, one or more service interfaces may be set for this hardware interface, where the 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 this scheme the execution body is the master controller in the 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 service interfaces supported by each service processing module.
After each loaded service processing module is determined, the service interface resource list can be configured according to each service processing module. The service interface resource list stores information such as the allocation status of the service interfaces in each service processing module in the distributed system.
Specifically, when the service interface resource list is configured, each service interface supported by the service processing module can be determined for each service processing module, and for each service interface supported by each service processing module, the interface identifier, the allocation state and the request identifier corresponding to the service interface are determined.
The allocation status 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 also has no corresponding request identifier. After the interface identifier, the allocation state and the request identifier of each service interface are determined, the interface identifier, the allocation state and the request identifier of each service interface can be correspondingly stored in a service interface resource list.
For example, if there are two service processing modules in the distributed system, 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 modules, and the service interfaces may be arranged in the service interface resource list in the order from large to small (or from small to large) according to the numbers. Thus, the service interface resource list stores information such as interface identifiers, allocation states, request identifiers, and the like of 30 service interfaces.
It should be noted that, in order to enable each controller to synchronize information such as allocation status of each service interface, each controller may determine a service interface resource list as described above. In this way, the main controller and the standby controller can have the same service interface resource list, and thus can synchronize the information such as the allocation status of each service interface.
S103: and receiving a service request sent by the user.
When the distributed system operates, the main controller can receive the service request sent by the user, and after receiving the service request, the main controller needs to allocate the 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 running, so the standby controller may also receive the service request sent by the user, and after receiving the service request, may send an application interface request to the main controller to apply for the 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 can determine that the service processing module corresponding to the service request is a target service processing module, for example, after the user sends the service request, the main controller can 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 can determine that the service processing module with load balancing and the service processing module with network acceleration are both target service processing modules.
S105: and judging whether a service interface is allocated for the service request according to the service interface resource list.
After receiving the service request, the main controller can query whether the service interface is allocated for the service request from the service interface resource list mentioned above. Specifically, the main controller can determine the request identifier of the service request, and then judge whether the service interface allocated to the request identifier exists in the service interface resource list. If such a service interface exists, it indicates that the service interface has been allocated for the service request, and the allocated service interface may be directly allocated to the service request, otherwise, it indicates that the service interface has not been allocated for the service request.
S106: if yes, distributing the service interface distributed to the service request for executing the service provided by the target service processing module, otherwise, determining that the unassigned service interface corresponding to the target service processing module is distributed to the service request from the service interface resource list.
And the main controller judges whether a service interface is allocated to the service request or not in the process, and if so, the main controller can allocate the service interface to the service request. Otherwise, determining that the unassigned business interface corresponding to the target business processing module is assigned to the business request from the business interface resource list.
After the main controller distributes the service interface to the service request, the information of the service interface needs to be updated in a service interface resource list, for example, the distribution state of the service interface is updated to be distributed, and the request identifier corresponding to the service interface is updated to be the request identifier corresponding to the service request. In order to be able to synchronize the information of the service interface to each controller, the information of the service interface may be updated in the service interface resource list of both the main controller and the standby controller.
It should be noted that, the service request received by the main controller may relate to a plurality of service processing modules, in this case, the main controller may use the plurality of service processing modules as target service processing modules, and for each target service processing module, determine, from the service interface resource list, that an unallocated 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 a service interface to a main controller provided in the present specification.
As shown in fig. 2, if the main controller receives the request for the application interface sent by the standby controller, the service request corresponding to the request identifier carried in the request for the application interface may be determined as the 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 the service interface is allocated to the target service request according to the service interface resource list, if yes, 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 unassigned business interface needs to be inquired out from the business interface resource list as a target interface. When determining the target interface, a service processing module of the service corresponding to the target service request needs to be determined, and an unallocated service interface corresponding to the service processing module is determined from the service interface resource list to be used 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 distributes the target interface to the target service request, and the main controller and the standby controller need to update the information such as the distribution state of the target interface in the respective service interface resource list.
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. In this way, the waste of service interface resources of certain service processing modules can be reduced to a certain extent.
According to the method, the service interface is scheduled by the main controller in the distributed system, and the main controller and the standby controller unify the initial configuration and updating modes of the service interface resource list, so that the service interface information of the main controller and the standby controller can be synchronized, and errors in the running process of the distributed system are reduced. And when the interface number of a certain service processing module is expanded, the interface number of other service processing modules is not required to be expanded at the same time, so that the resource waste is reduced to a certain extent.
It should be noted that, the above-mentioned main controller or standby controller may maintain a uniform 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 respectively. In this way, after receiving the service request sent by the user, the main controller can query whether a corresponding service interface has been allocated to the service request from the 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 allocating resources provided for one or more embodiments of the present disclosure further provides a corresponding apparatus for allocating resources based on the same concept, as shown in fig. 3.
Fig. 3 is a schematic diagram of a device for resource allocation provided in the present 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 judging module 305, configured to judge whether a service interface is allocated for the service request according to the service interface resource list;
and the allocation module 306 is configured to allocate the service interface allocated to the service request for executing the service provided by the target service processing module if yes, and otherwise determine 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, the configuration module 302 is specifically configured to determine, for each service processing module, each service interface supported by the service processing module; for 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, wherein the allocation state is used for indicating whether the service interface is allocated or not, and the request identifier is a request identifier of a service request using the service interface; and correspondingly storing the interface identification, the allocation state and the request identification of each service interface in the service interface resource list.
Optionally, the apparatus further includes a second allocation module 307, configured to obtain an application interface request sent by the standby controller; and distributing a service interface to the standby controller according to the application interface request.
Optionally, the second allocation module 307 is specifically configured to determine a service request corresponding to a request identifier carried in the application interface request, as a target service request, where the target service request is sent by a user to the standby controller; inquiring whether a service interface is allocated for the target service request or not from the service interface resource list according to a request identifier carried in the application interface request; if yes, distributing the service interface distributed to the target service request through the standby controller, otherwise, inquiring the unassigned service interface from the service interface resource list as a target interface, distributing the target interface to the target service request through the standby controller, and updating the corresponding distribution state of the target interface in the service interface resource list.
Optionally, the second allocation module 307 is specifically configured to send an interface identifier of a service interface that has been allocated to the target service request to the standby controller, so that the standby controller allocates, according to the received interface identifier, a service interface corresponding to the received interface identifier to the target service request.
Optionally, the second allocation module 307 is specifically configured to send an interface identifier of a service interface that has been allocated to the target service request to the standby controller, so that the standby controller allocates, according to the received interface identifier, a service interface corresponding to the received interface identifier to the target service request.
The present specification also provides a computer readable storage medium storing a computer program operable to perform the method of resource allocation provided in fig. 1 above.
The present specification also provides a schematic structural diagram of the electronic device 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 storage, as described in fig. 4, although other hardware required by other services may be included. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to implement the method of resource allocation described above with respect to fig. 1. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (ProgrammableLogic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (HardwareDescription Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera HardwareDescription Language), confluence, CUPL (Cornell University ProgrammingLanguage), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit HardwareDescription Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take 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, application specific integrated circuits (Application SpecificIntegrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchipPIC F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, 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 functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
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 storage media for a computer 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, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
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 one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The 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.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present description.
Claims (10)
1. A method of resource allocation, comprising:
determining each loaded business processing module;
configuring a service interface resource list according to the number of service interfaces supported by each service processing module, wherein the service interface resource list at least stores a request identifier corresponding to each service interface supported by each service processing module, and the request identifier is a request identifier of a service request using the service interface;
receiving a service request sent by a user;
according to the service request, determining a service processing module required by the service request as a target service processing module;
judging whether a service interface is allocated for the service request according to a request identifier corresponding to the service interface stored in the service interface resource list;
if yes, distributing the service interface distributed to the service request for executing the service provided by the target service processing module, otherwise, determining that the unassigned service interface corresponding to the target service processing module is distributed 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:
for each service processing module, determining each service interface supported by the service processing module;
for 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, wherein the allocation state is used for indicating whether the service interface is allocated or not;
and correspondingly storing the interface identification, the allocation state and the request identification 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 application interface request.
4. A method according to claim 3, wherein the 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;
inquiring whether a service interface is allocated for the target service request or not from the service interface resource list according to a request identifier carried in the application interface request;
if yes, distributing the service interface distributed to the target service request through the standby controller, otherwise, inquiring the unassigned service interface from the service interface resource list as a target interface, distributing the target interface to the target service request through the standby controller, and updating the corresponding distribution 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 by the standby controller, 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, by the standby controller, the target interface to the target service request, 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 the 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 each loaded business processing module;
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, wherein the service interface resource list at least stores a request identifier corresponding to each service interface supported by each service processing module, and the request identifier is a request identifier of a service request using the service interface;
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 according to the service request, serving as a target service processing module and determining a request identifier of the service request;
the judging module is used for judging whether the service interface is allocated for the service request according to the request identifier corresponding to the service interface stored in 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 yes, 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 of claim 7, wherein the configuration module is specifically configured to determine, for each service processing module, a respective service interface supported by the service processing module; for 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, wherein the allocation state is used for indicating whether the service interface is allocated or not, and the request identifier is a request identifier of a service request using the service interface; and correspondingly storing the interface identification, the allocation state and the request identification 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-6.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of the preceding claims 1-6 when executing the program.
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 CN111400032A (en) | 2020-07-10 |
CN111400032B true 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) |
Families Citing this family (2)
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 (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Family Cites Families (7)
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 |
CN103310370A (en) * | 2013-06-08 | 2013-09-18 | 华为技术有限公司 | Data processing method, data processing system, terminal and server |
CN105100075B (en) * | 2015-07-01 | 2019-06-21 | 北京奇虎科技有限公司 | Game business processing method, device and system |
CN107729141B (en) * | 2017-09-27 | 2022-06-10 | 华为技术有限公司 | Service distribution method, device and server |
CN108196879A (en) * | 2018-01-09 | 2018-06-22 | 平安科技(深圳)有限公司 | Method for processing business, device, equipment and computer readable storage medium |
CN108512758B (en) * | 2018-03-07 | 2021-09-14 | 华为技术有限公司 | Message processing method, controller and forwarding equipment |
CN109087055B (en) * | 2018-06-06 | 2022-04-08 | 北京达佳互联信息技术有限公司 | Service request control method and device |
-
2020
- 2020-03-02 CN CN202010135892.1A patent/CN111400032B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Also Published As
Publication number | Publication date |
---|---|
CN111400032A (en) | 2020-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108228672B (en) | Metadata migration method, device, system and equipment | |
CN108459898B (en) | Resource recovery method and device | |
CN110597614B (en) | Resource adjustment method and device | |
CN108628688B (en) | Message processing method, device and equipment | |
CN110609749B (en) | Distributed task operation method, system and equipment | |
CN108845876B (en) | Service distribution method and device | |
CN109739627B (en) | Task scheduling method, electronic device and medium | |
CN111400032B (en) | Resource allocation method and device | |
CN110955720B (en) | Data loading method, device and system | |
CN114780225A (en) | Distributed model training system, method and device | |
CN111459724B (en) | Node switching method, device, equipment and computer readable storage medium | |
JP2024536659A (en) | Task execution method, apparatus, storage medium and electronic device | |
CN112948050A (en) | Method and device for deploying pod | |
CN116170289A (en) | Node election method and device, storage medium and electronic equipment | |
CN116737345A (en) | Distributed task processing system and method, device, storage medium and equipment | |
CN116932175A (en) | Heterogeneous chip task scheduling method and device based on sequence generation | |
CN112181979B (en) | Data updating method and device, storage medium and electronic equipment | |
CN111866169B (en) | Service updating method, device and system | |
CN111459573B (en) | Method and device for starting intelligent contract execution environment | |
CN112434986B (en) | Order reassignment method, device, computer-readable storage medium and electronic device | |
CN110022351B (en) | Service request processing method and device | |
CN117376317A (en) | Address conflict detection method, equipment and medium based on DHCP server | |
CN117314512A (en) | Resource allocation method and device, and coupon allocation method and device | |
CN109614388B (en) | Budget deduction method and device | |
CN112750003B (en) | Order distribution method, device, storage medium and electronic equipment |
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 |