CN111464357A - Resource allocation method and device - Google Patents
Resource allocation method and device Download PDFInfo
- Publication number
- CN111464357A CN111464357A CN202010251855.7A CN202010251855A CN111464357A CN 111464357 A CN111464357 A CN 111464357A CN 202010251855 A CN202010251855 A CN 202010251855A CN 111464357 A CN111464357 A CN 111464357A
- Authority
- CN
- China
- Prior art keywords
- unit
- hardware unit
- hardware
- resource
- unique identifier
- 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.)
- Pending
Links
- 238000013468 resource allocation Methods 0.000 title claims abstract description 48
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000004891 communication Methods 0.000 claims description 29
- 238000012423 maintenance Methods 0.000 claims description 21
- 230000004044 response Effects 0.000 claims description 10
- 238000001514 detection method Methods 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 6
- 239000002699 waste material Substances 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 6
- 238000007726 management method Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000011982 device technology Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0823—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
-
- 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/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (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 embodiment of the invention provides a resource allocation method and a resource allocation device, wherein the method comprises the following steps: configuring the unique identifier of each equipment unit in the equipment unit group and the unique identifier of each hardware unit in the hardware resource pool; receiving a resource acquisition request sent by the equipment unit, and inquiring the current working state of a hardware unit in the hardware resource pool according to the resource configuration request to acquire the hardware unit providing resources for the equipment unit; and associating and recording the unique identifier of the equipment unit sending the resource acquisition request and the unique identifier of the hardware unit providing the resource, and updating the working state of the hardware unit providing the resource so that the hardware unit providing the resource provides the resource to the equipment unit sending the resource acquisition request. The embodiment of the invention overcomes the problems of low fault tolerance rate, resource waste and the like caused by the preset one-to-one fixed relationship between the conventional equipment unit and the hardware unit.
Description
Technical Field
The present invention relates to the field of internet device technologies, and in particular, to a resource allocation method and apparatus.
Background
The advent of the internet and the use of internet technology have revolutionized device management over the past. Before the advent of internet technology, it was difficult to imagine remote centralized or distributed automated management of devices. With the application of internet technology, the remote centralized or distributed automatic management of the equipment is realized.
However, there is no suitable management method in the prior art for some devices that are not networked in the internet or are not convenient to deploy in such a network, how to incorporate them in the network for remote centralized management or distributed management.
Particularly, when the front-end equipment is connected to the internet, interaction with a background hardware unit is required, but the hardware unit cannot be directly connected to the internet. For this mode, the prior art often directly connects hardware units into the device, resulting in a one-to-one correspondence.
Based on the above problem analysis, a method is urgently needed to realize the matching use of the hardware unit accessing the internet and the equipment, and simultaneously, the one-to-one correspondence can be broken to form a resource pool for scheduling.
Disclosure of Invention
Embodiments of the present invention provide a resource allocation method and apparatus that overcome the above problems or at least partially solve the above problems.
In a first aspect, an embodiment of the present invention provides a resource allocation method, including:
configuring the unique identifier of each equipment unit in the equipment unit group and the unique identifier of each hardware unit in the hardware resource pool;
receiving a resource acquisition request sent by the equipment unit, and inquiring the current working state of a hardware unit in the hardware resource pool according to the resource configuration request to acquire the hardware unit providing resources for the equipment unit;
and associating and recording the unique identifier of the equipment unit sending the resource acquisition request and the unique identifier of the hardware unit providing the resource, and updating the working state of the hardware unit providing the resource so that the hardware unit providing the resource provides the resource to the equipment unit sending the resource acquisition request.
Further, the querying, according to the resource configuration request, a current working state of a hardware unit in the hardware resource pool to obtain the hardware unit providing resources to the device unit specifically includes:
judging whether the working state of the currently traversed hardware unit is a standby state or not aiming at the currently traversed hardware unit;
if the working state of the currently traversed hardware unit is a standby state, taking the currently traversed hardware unit as a hardware unit for providing resources for the equipment unit, and stopping traversing;
and if the working state of the currently traversed hardware unit is not in a standby state, taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
Further, the updating the working state of the hardware unit providing the resource specifically includes: and updating the working state of the hardware unit providing the resources to a use state.
Further, the updating the working state of the hardware unit providing the resource further includes:
receiving a hardware unit fault message sent by the equipment unit, determining a hardware unit associated with the equipment unit according to the unique identifier of the equipment unit, and updating the working state of the hardware unit to be a maintenance state;
releasing the incidence relation between the unique identifier of the equipment unit and the unique identifier of the hardware unit, and reacquiring the hardware unit providing resources for the equipment unit;
and associating the unique identifier of the equipment unit with the unique identifier of the hardware unit for providing resources again, and updating the working state of the hardware unit for providing resources again.
Further, the resource configuration method further includes: detecting the working state of each hardware unit in the hardware resource pool at preset time intervals, specifically:
judging whether the currently traversed hardware unit is in a use state or not aiming at the currently traversed hardware unit;
if the currently traversed hardware unit is not in a use state, updating the currently traversed hardware unit to be in a maintenance state;
judging whether the communication connection of the currently traversed hardware unit is normal;
if the communication connection of the currently traversed hardware unit is normal, sending an instruction to the currently traversed hardware unit, and if a response is received, triggering the currently traversed hardware unit to work;
if the currently traversed hardware unit works normally, updating the working state of the currently traversed hardware unit to a standby state;
and taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
In a second aspect, an embodiment of the present invention provides a resource allocation apparatus, including: a source allocation module, the resource allocation module further comprising:
the identification configuration unit is used for configuring the unique identification of each equipment unit in the equipment unit group and the unique identification of each hardware unit in the hardware resource pool;
a hardware configuration unit, configured to receive a resource acquisition request sent by the equipment unit, and query a current working state of a hardware unit in the hardware resource pool according to the resource configuration request, so as to acquire the hardware unit that provides resources to the equipment unit;
and the association unit is used for associating and recording the unique identifier of the equipment unit sending the resource acquisition request and the unique identifier of the hardware unit providing the resource, and updating the working state of the hardware unit providing the resource so that the hardware unit providing the resource provides the resource to the equipment unit sending the resource acquisition request.
Further, the resource configuration apparatus further includes a resource switching module, and the resource switching module further includes:
the maintenance unit is used for receiving a hardware unit fault message sent by the equipment unit, determining a hardware unit related to the equipment unit according to the unique identifier of the equipment unit, and updating the working state of the hardware unit into a maintenance state;
the recoupling unit is used for removing the incidence relation between the unique identifier of the equipment unit and the unique identifier of the hardware unit and reacquiring the hardware unit which provides resources for the equipment unit;
and the re-association unit is used for associating the unique identifier of the equipment unit with the unique identifier of the hardware unit for re-providing the resources and updating the working state of the hardware unit for re-providing the resources.
Further, the resource configuration apparatus further includes a resource detection module for detecting a working state of each hardware unit in the hardware resource pool at preset time intervals, where the resource detection module further includes:
the using state judging unit is used for judging whether the currently traversed hardware unit is in a using state or not aiming at the currently traversed hardware unit;
the maintenance updating unit is used for updating the currently traversed hardware unit into a maintenance state if the currently traversed hardware unit is not in a use state;
the communication unit is used for judging whether the communication connection of the currently traversed hardware unit is normal;
the work triggering unit is used for sending an instruction to the currently traversed hardware unit if the communication connection of the currently traversed hardware unit is normal, and triggering the currently traversed hardware unit to work if a response is received;
the standby updating unit is used for updating the working state of the currently traversed hardware unit to a standby state if the currently traversed hardware unit works normally;
and the traversal selection unit is used for taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method provided in the first aspect when executing the program.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the method as provided in the first aspect.
According to the resource allocation method and device provided by the embodiment of the invention, after the resource acquisition request of the equipment unit is received, the hardware unit for providing the resource to the equipment unit is determined according to the current working state of each hardware unit, so that the problems of low fault tolerance rate, resource waste and the like caused by the fact that the existing equipment unit and hardware unit are preset with a one-to-one fixed relation are solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a resource allocation method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a process of detecting a working status of each hardware unit in a hardware resource pool according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present invention;
FIG. 4 is an architecture diagram of a resource allocation system according to an embodiment of the present invention;
fig. 5 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to overcome the above problems in the prior art, embodiments of the present invention provide a resource allocation method, in which an execution body of the method can be communicatively connected to a (front-end) device unit directly connected to the internet, and also can be communicatively connected to a hardware unit that cannot directly access the internet, where the device unit has a need to acquire resources, and the hardware unit has resources required by the device unit.
Fig. 1 is a schematic flowchart of a resource allocation method according to an embodiment of the present invention, and as shown in fig. 1, the method includes S101, S102, and S103, specifically:
s101, configuring the unique identification of each equipment unit in the equipment unit group and the unique identification of each hardware unit in the hardware resource pool.
The method and the device for configuring the resource based on the unique identifier can be used for configuring the resource based on the unique identifier, and the device unit group and the hardware resource pool are provided with the device units and the hardware units of the number of terminals respectively. The device unit/hardware unit may be numbered according to a preset sequence, and the numbering result is used as a unique identifier, for example, the unique identifier of the device unit/hardware unit may be generated based on a preset algorithm, for example, a hash algorithm.
S102, receiving a resource obtaining request sent by the equipment unit, and inquiring the current working state of the hardware unit in the hardware resource pool according to the resource configuration request to obtain the hardware unit providing resources for the equipment unit.
When the device unit has a resource acquisition requirement, a resource acquisition request is generated to the execution main body in the embodiment of the present invention, and it can be understood that the resource acquisition request carries a unique identifier of the device unit, so that the execution main body in the embodiment of the present invention can acquire a specific device unit after receiving the resource acquisition request, and can determine a hardware unit that provides resources to the device unit by querying a current working state of each hardware unit in the hardware resource pool.
It is understood that the hardware unit of the embodiment of the present invention has more than one operating state, for example, at least a state in which a resource can be provided and a state in which a resource cannot be provided exist, and the number and types of the multiple operating states of the present invention are not further limited. The embodiment of the invention inquires any hardware unit with the working state capable of providing the resource as a hardware unit for providing the resource for the equipment unit.
The present working state of the hardware unit in the embodiment of the present invention may adopt a manner of actively querying the hardware unit by the execution main body, or may adopt a manner of periodically reporting by the hardware unit, which is not further limited in the embodiment of the present invention.
S103, associating and recording the unique identifier of the equipment unit sending the resource acquisition request and the unique identifier of the hardware unit providing the resource, and updating the working state of the hardware unit providing the resource so that the hardware unit providing the resource provides the resource to the equipment unit sending the resource acquisition request.
In the embodiment of the present invention, after determining the hardware unit providing the resource, the unique identifier of the device unit sending the resource acquisition request is associated with the unique identifier of the hardware unit providing the resource, and the purpose of this is to: the hardware unit having the association relationship means that resources are provided to the device unit at the beginning, and may be understood as being in a working state, and then when a resource acquisition request sent by another device unit is received subsequently, because the hardware unit is already in the working state, the executing subject may consider whether the hardware unit has the capability of continuously providing resources, thereby achieving the purpose of reasonably allocating the hardware unit.
The embodiment of the present invention may record the association relationship in the local execution main body, and may also distribute the association relationship to the corresponding device unit and the corresponding hardware unit for recording.
It can be understood that, in the embodiment of the present invention, the working state of the hardware unit providing the resource is updated, so that the working state of the hardware unit is different before and after the update, and the difference will affect the subsequent hardware unit allocation. In subsequent hardware unit allocation, a direct skipping of the hardware unit providing the resource may be employed.
The resource allocation method of the embodiment of the invention determines the hardware units providing resources for the equipment units according to the current working states of the hardware units after receiving the resource acquisition requests of the equipment units, thereby overcoming the problems of low fault tolerance rate, resource waste and the like caused by the preset one-to-one fixed relationship between the existing equipment units and the hardware units.
On the basis of the foregoing embodiments, as an optional embodiment, the querying, according to the resource configuration request, a current working state of a hardware unit in the hardware resource pool to obtain the hardware unit that provides resources to the device unit specifically includes:
judging whether the working state of the currently traversed hardware unit is a standby state or not aiming at the currently traversed hardware unit;
if the working state of the currently traversed hardware unit is a standby state, taking the currently traversed hardware unit as a hardware unit for providing resources for the equipment unit, and stopping traversing;
and if the working state of the currently traversed hardware unit is not in a standby state, taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
In the embodiment of the present invention, the standby state refers to a state where all indexes of the hardware unit are normal and resources can be provided to the device unit, and when it is known that the hardware unit is in the standby state, the embodiment of the present invention may use the hardware unit as resources provided to the device unit. The specific judging method of the standby state is not further limited in the embodiment of the invention.
The embodiment of the invention sequentially inquires whether the working state of each hardware unit is in the standby state or not based on the sequence of the unique identifier of the hardware unit, if the hardware unit in the standby state is traversed, the hardware unit is taken as the hardware unit for providing resources for the equipment unit, the traversal is stopped, and if the hardware unit which is not in the standby state is traversed, the next hardware unit is continuously traversed until all the hardware units are traversed or the hardware unit in the standby state is found.
On the basis of the foregoing embodiments, as an optional embodiment, the updating the working state of the hardware unit that provides the resource specifically includes: and updating the working state of the hardware unit providing the resources to a use state.
It will be appreciated that when a hardware unit is updated to a use state, this means that the hardware unit starts providing resources to the device unit.
On the basis of the above embodiments, as an optional embodiment, when a hardware unit fails, the embodiment of the present invention can also switch the hardware unit in time, and initialize a message flow, thereby ensuring that the device unit can normally interact with the hardware unit. Specifically, the updating the operating state of the hardware unit providing the resource further includes:
receiving a hardware unit fault message sent by the equipment unit, determining a hardware unit associated with the equipment unit according to the unique identifier of the equipment unit, and updating the working state of the hardware unit to be a maintenance state;
releasing the incidence relation between the unique identifier of the equipment unit and the unique identifier of the hardware unit, and reacquiring the hardware unit providing resources for the equipment unit;
and associating the unique identifier of the equipment unit with the unique identifier of the hardware unit for providing resources again, and updating the working state of the hardware unit for providing resources again.
In the process of receiving the resource sent by the hardware unit, if the device unit in the embodiment of the present invention finds the problems of resource transmission interruption, too low resource transmission speed, etc., a hardware unit failure message is sent.
In the embodiment of the invention, after the working state of the hardware unit is updated to the overhaul state, the incidence relation between the unique identifier of the equipment unit and the unique identifier of the hardware unit is removed, and the hardware unit providing resources for the equipment unit is obtained again. It can be understood that the method for reacquiring the hardware unit that provides the resource to the device unit may refer to the method for traversing the current working state of the hardware unit to acquire the hardware unit that provides the resource in the foregoing embodiment, and the embodiments of the present invention are not described again.
After the hardware unit for providing resources again is found, the unique identifier of the equipment unit and the unique identifier of the hardware unit for providing resources again are associated, and the working state of the hardware unit for providing resources again is updated.
On the basis of the foregoing embodiments, as an optional embodiment, the resource allocation method according to the embodiment of the present invention further includes: the working state of each hardware unit in the hardware resource pool is detected at preset time intervals, and the aim of the method is to repair the failed hardware unit in time so as to find the hardware unit providing resources more quickly when the equipment unit has resource requirements.
Specifically, detecting the working state of each hardware unit in the hardware resource pool at preset time intervals includes:
judging whether the currently traversed hardware unit is in a use state or not aiming at the currently traversed hardware unit;
if the currently traversed hardware unit is not in a use state, updating the currently traversed hardware unit to be in a maintenance state;
judging whether the communication connection of the currently traversed hardware unit is normal;
if the communication connection of the currently traversed hardware unit is normal, sending an instruction to the currently traversed hardware unit, and if a response is received, triggering the currently traversed hardware unit to work;
if the currently traversed hardware unit works normally, updating the working state of the currently traversed hardware unit to a standby state;
and taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
The embodiment of the invention can overhaul all the hardware units which are not in use, and the overhaul process comprises the steps of firstly updating the working state of the hardware units to the overhaul state, then judging whether the communication connection is normal or not, judging whether the hardware units can normally work or not if the communication connection is normal, updating the working state of the hardware units to the standby state if the communication connection is normal, and then continuing to overhaul the next hardware unit until all the hardware units are overhauled.
Fig. 2 is a schematic flowchart of detecting the working state of each hardware unit in the hardware resource pool according to the embodiment of the present invention, and as shown in fig. 2, the method includes:
s201, judging whether the currently traversed hardware unit is in a use state or not aiming at the currently traversed hardware unit, if the currently traversed hardware unit is in the use state, executing S202, and if the currently traversed hardware unit is in the use state, executing S211;
s202, updating the currently traversed hardware unit to be in a maintenance state;
s203, judging whether the communication connection of the currently traversed hardware unit is normal; if the communication connection of the currently traversed hardware unit is abnormal, executing S204; if the communication connection of the currently traversed hardware unit is normal, executing S205;
s204, updating the working state of the currently traversed hardware unit to be unconnected, and then executing S211;
s205, sending an instruction to the currently traversed hardware unit;
s206, judging whether a response is received within a preset time; if the response is received, executing S207; if no response is received, executing S211;
s207, triggering the currently traversed hardware unit to work;
s208, judging whether the currently traversed hardware unit works normally, if so, executing S209, and if not, executing S210;
s209, updating the working state of the currently traversed hardware unit to a standby state, and executing S211;
s210, updating the working state of the currently traversed hardware unit to be a fault state;
s211, taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit, and returning to S201.
Fig. 3 is a schematic structural diagram of a resource allocation apparatus according to an embodiment of the present invention, as shown in fig. 3, the resource allocation apparatus includes a resource allocation module 100, and the resource allocation module 100 further includes:
an identifier configuration unit 101, configured to configure a unique identifier of each device unit in the device unit group and a unique identifier of each hardware unit in the hardware resource pool;
a hardware configuration unit 102, configured to receive a resource acquisition request sent by the equipment unit, and query a current working state of a hardware unit in the hardware resource pool according to the resource configuration request, so as to acquire the hardware unit that provides resources to the equipment unit;
an associating unit 103, configured to associate and record the unique identifier of the device unit that sends the resource obtaining request and the unique identifier of the hardware unit that provides the resource, and update the working state of the hardware unit that provides the resource, so that the hardware unit that provides the resource to the device unit that sends the resource obtaining request.
The resource allocation apparatus provided in the embodiment of the present invention specifically executes the flows of the resource allocation method embodiments, and please refer to the contents of the resource allocation method embodiments in detail, which are not described herein again. The resource allocation device provided by the embodiment of the invention determines the hardware units providing resources for the equipment units according to the current working states of the hardware units after receiving the resource acquisition requests of the equipment units, and overcomes the problems of low fault tolerance rate, resource waste and the like caused by the fact that the existing equipment units and hardware units are preset with one-to-one fixed relationship.
On the basis of the foregoing embodiments, as an optional embodiment, the resource configuration apparatus further includes a resource switching module, where the resource switching module further includes:
the maintenance unit is used for receiving a hardware unit fault message sent by the equipment unit, determining a hardware unit related to the equipment unit according to the unique identifier of the equipment unit, and updating the working state of the hardware unit into a maintenance state;
the recoupling unit is used for removing the incidence relation between the unique identifier of the equipment unit and the unique identifier of the hardware unit and reacquiring the hardware unit which provides resources for the equipment unit;
and the re-association unit is used for associating the unique identifier of the equipment unit with the unique identifier of the hardware unit for re-providing the resources and updating the working state of the hardware unit for re-providing the resources.
On the basis of the foregoing embodiments, as an optional embodiment, the resource configuration apparatus further includes a resource detection module for detecting a working state of each hardware unit in the hardware resource pool at preset time intervals, where the resource detection module further includes:
the using state judging unit is used for judging whether the currently traversed hardware unit is in a using state or not aiming at the currently traversed hardware unit;
the maintenance updating unit is used for updating the currently traversed hardware unit into a maintenance state if the currently traversed hardware unit is not in a use state;
the communication unit is used for judging whether the communication connection of the currently traversed hardware unit is normal;
the work triggering unit is used for sending an instruction to the currently traversed hardware unit if the communication connection of the currently traversed hardware unit is normal, and triggering the currently traversed hardware unit to work if a response is received;
the standby updating unit is used for updating the working state of the currently traversed hardware unit to a standby state if the currently traversed hardware unit works normally;
and the traversal selection unit is used for taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
Fig. 4 is an architecture diagram of a resource allocation system according to an embodiment of the present invention, and as shown in fig. 4, the resource allocation system includes an equipment unit group 400, a resource allocation device 410, and a hardware resource pool 420, where the equipment unit group includes a plurality of equipment units, the hardware resource pool includes a plurality of hardware units, and one hardware unit is required to cooperate to implement a specified function when the equipment units operate.
The equipment unit group is connected with the internet through 3G/4G and is further connected with a resource allocation device in a communication mode 410, the resource allocation device comprises a resource allocation module 411, a resource switching module 412 and a resource detection module 413, and the resource allocation device is connected with hardware units in a hardware resource pool through a wired network.
The resource allocation module 411 configures a unique identifier of each device unit in a device unit group and a unique identifier of each hardware unit in a hardware resource pool, when a device unit needs a resource, the device unit sends a resource acquisition request to the resource allocation module, the resource allocation module queries a current working state of the hardware unit in the hardware resource pool according to the resource allocation request to acquire the hardware unit providing the resource to the device unit, and the resource allocation module associates and records the unique identifier of the device unit sending the resource acquisition request and the unique identifier of the hardware unit providing the resource, and updates the working state of the hardware unit providing the resource, so that the hardware unit providing the resource provides the resource to the device unit sending the resource acquisition request.
When the equipment unit detects that the hardware unit is in fault, the equipment unit sends a hardware unit fault message to the resource switching module, and the resource switching module determines the hardware unit related to the equipment unit according to the unique identifier of the equipment unit and updates the working state of the hardware unit into a maintenance state; releasing the incidence relation between the unique identifier of the equipment unit and the unique identifier of the hardware unit, and reacquiring the hardware unit providing resources for the equipment unit; and associating the unique identifier of the equipment unit with the unique identifier of the hardware unit for providing resources again, and updating the working state of the hardware unit for providing resources again.
The resource detection module 413 detects the working state of each hardware unit in the hardware resource pool at preset time intervals, and specifically, determines whether the currently traversed hardware unit is in a use state or not for the currently traversed hardware unit; if the currently traversed hardware unit is not in a use state, updating the currently traversed hardware unit to be in a maintenance state; judging whether the communication connection of the currently traversed hardware unit is normal; if the communication connection of the currently traversed hardware unit is normal, sending an instruction to the currently traversed hardware unit, and if a response is received, triggering the currently traversed hardware unit to work; if the currently traversed hardware unit works normally, updating the working state of the currently traversed hardware unit to a standby state; and taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
Fig. 5 is a schematic entity structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device may include: a processor (processor)510, a communication Interface (communication Interface)520, a memory (memory)530 and a communication bus 540, wherein the processor 510, the communication Interface 520 and the memory 430 are configured to communicate with each other via the communication bus 540. Processor 510 may invoke a computer program stored on memory 530 and executable on processor 510 to perform the resource configuration methods provided by the various embodiments described above, including, for example: configuring the unique identifier of each equipment unit in the equipment unit group and the unique identifier of each hardware unit in the hardware resource pool; receiving a resource acquisition request sent by the equipment unit, and inquiring the current working state of a hardware unit in the hardware resource pool according to the resource configuration request to acquire the hardware unit providing resources for the equipment unit; and associating and recording the unique identifier of the equipment unit sending the resource acquisition request and the unique identifier of the hardware unit providing the resource, and updating the working state of the hardware unit providing the resource so that the hardware unit providing the resource provides the resource to the equipment unit sending the resource acquisition request.
Furthermore, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
An embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the resource allocation method provided in the foregoing embodiments when executed by a processor, for example, the method includes: configuring the unique identifier of each equipment unit in the equipment unit group and the unique identifier of each hardware unit in the hardware resource pool; receiving a resource acquisition request sent by the equipment unit, and inquiring the current working state of a hardware unit in the hardware resource pool according to the resource configuration request to acquire the hardware unit providing resources for the equipment unit; and associating and recording the unique identifier of the equipment unit sending the resource acquisition request and the unique identifier of the hardware unit providing the resource, and updating the working state of the hardware unit providing the resource so that the hardware unit providing the resource provides the resource to the equipment unit sending the resource acquisition request.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A method for resource allocation, comprising:
configuring the unique identifier of each equipment unit in the equipment unit group and the unique identifier of each hardware unit in the hardware resource pool;
receiving a resource acquisition request sent by the equipment unit, and inquiring the current working state of a hardware unit in the hardware resource pool according to the resource configuration request to acquire the hardware unit providing resources for the equipment unit;
and associating and recording the unique identifier of the equipment unit sending the resource acquisition request and the unique identifier of the hardware unit providing the resource, and updating the working state of the hardware unit providing the resource so that the hardware unit providing the resource provides the resource to the equipment unit sending the resource acquisition request.
2. The resource allocation method according to claim 1, wherein the querying a current working state of a hardware unit in the hardware resource pool according to the resource allocation request to obtain the hardware unit providing resources to the device unit specifically includes:
judging whether the working state of the currently traversed hardware unit is a standby state or not aiming at the currently traversed hardware unit;
if the working state of the currently traversed hardware unit is a standby state, taking the currently traversed hardware unit as a hardware unit for providing resources for the equipment unit, and stopping traversing;
and if the working state of the currently traversed hardware unit is not in a standby state, taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
3. The method according to claim 2, wherein the updating the operating state of the hardware unit providing the resource specifically includes: and updating the working state of the hardware unit providing the resources to a use state.
4. The method according to claim 1, wherein the updating the working status of the hardware unit providing the resource further comprises:
receiving a hardware unit fault message sent by the equipment unit, determining a hardware unit associated with the equipment unit according to the unique identifier of the equipment unit, and updating the working state of the hardware unit to be a maintenance state;
releasing the incidence relation between the unique identifier of the equipment unit and the unique identifier of the hardware unit, and reacquiring the hardware unit providing resources for the equipment unit;
and associating the unique identifier of the equipment unit with the unique identifier of the hardware unit for providing resources again, and updating the working state of the hardware unit for providing resources again.
5. The resource allocation method according to claim 1, further comprising: detecting the working state of each hardware unit in the hardware resource pool at preset time intervals, specifically:
judging whether the currently traversed hardware unit is in a use state or not aiming at the currently traversed hardware unit;
if the currently traversed hardware unit is not in a use state, updating the currently traversed hardware unit to be in a maintenance state;
judging whether the communication connection of the currently traversed hardware unit is normal;
if the communication connection of the currently traversed hardware unit is normal, sending an instruction to the currently traversed hardware unit, and if a response is received, triggering the currently traversed hardware unit to work;
if the currently traversed hardware unit works normally, updating the working state of the currently traversed hardware unit to a standby state;
and taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
6. A resource allocation apparatus, comprising: a resource allocation module, the resource allocation module further comprising:
the identification configuration unit is used for configuring the unique identification of each equipment unit in the equipment unit group and the unique identification of each hardware unit in the hardware resource pool;
a hardware configuration unit, configured to receive a resource acquisition request sent by the equipment unit, and query a current working state of a hardware unit in the hardware resource pool according to the resource configuration request, so as to acquire the hardware unit that provides resources to the equipment unit;
and the association unit is used for associating and recording the unique identifier of the equipment unit sending the resource acquisition request and the unique identifier of the hardware unit providing the resource, and updating the working state of the hardware unit providing the resource so that the hardware unit providing the resource provides the resource to the equipment unit sending the resource acquisition request.
7. The apparatus for resource allocation according to claim 6, further comprising a resource switching module, wherein the resource switching module further comprises:
the maintenance unit is used for receiving a hardware unit fault message sent by the equipment unit, determining a hardware unit related to the equipment unit according to the unique identifier of the equipment unit, and updating the working state of the hardware unit into a maintenance state;
the recoupling unit is used for removing the incidence relation between the unique identifier of the equipment unit and the unique identifier of the hardware unit and reacquiring the hardware unit which provides resources for the equipment unit;
and the re-association unit is used for associating the unique identifier of the equipment unit with the unique identifier of the hardware unit for re-providing the resources and updating the working state of the hardware unit for re-providing the resources.
8. The resource allocation apparatus according to claim 6, further comprising a resource detection module for detecting an operating status of each hardware unit in the hardware resource pool at preset time intervals, wherein the resource detection module further comprises:
the using state judging unit is used for judging whether the currently traversed hardware unit is in a using state or not aiming at the currently traversed hardware unit;
the maintenance updating unit is used for updating the currently traversed hardware unit into a maintenance state if the currently traversed hardware unit is not in a use state;
the communication unit is used for judging whether the communication connection of the currently traversed hardware unit is normal;
the work triggering unit is used for sending an instruction to the currently traversed hardware unit if the communication connection of the currently traversed hardware unit is normal, and triggering the currently traversed hardware unit to work if a response is received;
the standby updating unit is used for updating the working state of the currently traversed hardware unit to a standby state if the currently traversed hardware unit works normally;
and the traversal selection unit is used for taking the hardware unit corresponding to the next unique identifier after the unique identifier of the currently traversed hardware unit as the next traversed hardware unit.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the resource allocation method according to any one of claims 1 to 5 are implemented when the program is executed by the processor.
10. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the resource configuration method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010251855.7A CN111464357A (en) | 2020-04-01 | 2020-04-01 | Resource allocation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010251855.7A CN111464357A (en) | 2020-04-01 | 2020-04-01 | Resource allocation method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111464357A true CN111464357A (en) | 2020-07-28 |
Family
ID=71678669
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010251855.7A Pending CN111464357A (en) | 2020-04-01 | 2020-04-01 | Resource allocation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111464357A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112732706A (en) * | 2020-11-26 | 2021-04-30 | 苏州浪潮智能科技有限公司 | Hardware equipment resource information storage method, system, equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070195745A1 (en) * | 2006-02-15 | 2007-08-23 | Ntt Docomo, Inc. | Mobile terminal, resource allocation manager, and communication control method |
CN102831015A (en) * | 2012-08-01 | 2012-12-19 | 华为技术有限公司 | Method and equipment for scheduling multi-core processor |
CN105786612A (en) * | 2014-12-23 | 2016-07-20 | 杭州华为数字技术有限公司 | Resource management method and apparatus |
CN108984465A (en) * | 2018-06-06 | 2018-12-11 | 华为技术有限公司 | A kind of method for message transmission and equipment |
US20200007624A1 (en) * | 2018-06-28 | 2020-01-02 | Tata Consultancy Services Limited | Resources management in internet of robotic things (iort) environments |
-
2020
- 2020-04-01 CN CN202010251855.7A patent/CN111464357A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070195745A1 (en) * | 2006-02-15 | 2007-08-23 | Ntt Docomo, Inc. | Mobile terminal, resource allocation manager, and communication control method |
CN102831015A (en) * | 2012-08-01 | 2012-12-19 | 华为技术有限公司 | Method and equipment for scheduling multi-core processor |
CN105786612A (en) * | 2014-12-23 | 2016-07-20 | 杭州华为数字技术有限公司 | Resource management method and apparatus |
CN108984465A (en) * | 2018-06-06 | 2018-12-11 | 华为技术有限公司 | A kind of method for message transmission and equipment |
CN110809760A (en) * | 2018-06-06 | 2020-02-18 | 华为技术有限公司 | Resource pool management method and device, resource pool control unit and communication equipment |
US20200007624A1 (en) * | 2018-06-28 | 2020-01-02 | Tata Consultancy Services Limited | Resources management in internet of robotic things (iort) environments |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112732706A (en) * | 2020-11-26 | 2021-04-30 | 苏州浪潮智能科技有限公司 | Hardware equipment resource information storage method, system, equipment and storage medium |
CN112732706B (en) * | 2020-11-26 | 2022-07-08 | 苏州浪潮智能科技有限公司 | Hardware equipment resource information storage method, system, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108710544B (en) | Process monitoring method of database system and rail transit comprehensive monitoring system | |
US10680874B2 (en) | Network service fault handling method, service management system, and system management module | |
CN109150572B (en) | Method, device and computer readable storage medium for realizing alarm association | |
CN110830283B (en) | Fault detection method, device, equipment and system | |
CN103607297A (en) | Fault processing method of computer cluster system | |
CN110275992B (en) | Emergency processing method, device, server and computer readable storage medium | |
CN110618864A (en) | Interrupt task recovery method and device | |
CN112764956B (en) | Database exception handling system, database exception handling method and device | |
CN113434327A (en) | Fault processing system, method, equipment and storage medium | |
CN109697078B (en) | Repairing method of non-high-availability component, big data cluster and container service platform | |
CN110795264A (en) | Monitoring management method and system and intelligent management terminal | |
CN112650642A (en) | Alarm processing method and device, equipment and storage medium | |
CN109684130B (en) | Method and device for backing up data of computer room | |
CN108509296B (en) | Method and system for processing equipment fault | |
CN111464357A (en) | Resource allocation method and device | |
CN112631687B (en) | Service cluster configuration method, device and equipment | |
CN109995554A (en) | The control method and cloud dispatch control device of multi-stage data center active-standby switch | |
CN110224872B (en) | Communication method, device and storage medium | |
CN114816866A (en) | Fault processing method and device, electronic equipment and storage medium | |
CN115705259A (en) | Fault processing method, related device and storage medium | |
CN110932926B (en) | Container cluster monitoring method, system and device | |
CN112612652A (en) | Distributed storage system abnormal node restarting method and system | |
CN111010286A (en) | Intelligent registration method and device based on serial bus, electronic equipment and medium | |
CN107370612B (en) | Network quality management system detection task scheduling method and device | |
CN108959170B (en) | Virtual device management method, device, stacking system and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200728 |
|
RJ01 | Rejection of invention patent application after publication |