CN113839890A - Resource allocation method, device, server and storage medium - Google Patents

Resource allocation method, device, server and storage medium Download PDF

Info

Publication number
CN113839890A
CN113839890A CN202010582880.3A CN202010582880A CN113839890A CN 113839890 A CN113839890 A CN 113839890A CN 202010582880 A CN202010582880 A CN 202010582880A CN 113839890 A CN113839890 A CN 113839890A
Authority
CN
China
Prior art keywords
priority
resource
request
executing
comparison result
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
Application number
CN202010582880.3A
Other languages
Chinese (zh)
Inventor
韦杏媛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN202010582880.3A priority Critical patent/CN113839890A/en
Priority to PCT/CN2021/100377 priority patent/WO2021259108A1/en
Publication of CN113839890A publication Critical patent/CN113839890A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • H04L47/245Traffic characterised by specific attributes, e.g. priority or QoS using preemption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/24Traffic characterised by specific attributes, e.g. priority or QoS
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • H04L47/805QOS or priority aware

Abstract

The embodiment of the application discloses a resource allocation method, a resource allocation device, a server and a storage medium, and belongs to the field of communication. The method comprises the following steps: receiving a request to perform a first operation; determining a resource required to perform the first operation; if the resource is occupied, comparing the priority of the first operation with the priority of the second operation occupying the resource to obtain a comparison result; and determining whether to preempt the resources and allocate the resources to the first operation according to the comparison result, so that the resources can be reasonably allocated, resource conflict is effectively avoided, and the corresponding operation is correctly executed.

Description

Resource allocation method, device, server and storage medium
Technical Field
The present disclosure relates to the field of communications, and in particular, to a method, an apparatus, a server, and a storage medium for resource allocation.
Background
With the development of computer technology, remote management has become a powerful means for improving work efficiency. The remote management means that the network management server manages the terminal through a remote management protocol, so that the functions of acquiring the running state of the terminal, modifying the parameters of the terminal, remotely controlling the terminal, remotely diagnosing the terminal, upgrading the firmware of the terminal and the like are realized.
However, when a plurality of network management servers simultaneously perform remote operations on a terminal and resource conflicts exist among the operations, a problem that the corresponding operations requested by the network management servers cannot be correctly executed may occur.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, a server, and a storage medium for resource allocation, which can effectively avoid resource conflicts, so as to correctly execute corresponding operations.
In order to achieve the above object, an embodiment of the present application provides a resource allocation method, including: receiving a request to perform a first operation; determining a resource required to perform the first operation; if the resource is occupied, comparing the priority of the first operation with the priority of the second operation occupying the resource to obtain a comparison result; and determining whether to preempt the resource and allocate the resource to the first operation according to the comparison result.
In order to achieve the above object, an embodiment of the present application further provides a resource allocation apparatus, including: the device comprises a receiving module, a determining module and a processing module, wherein the receiving module is used for receiving a request for executing a first operation; the comparison module is used for comparing the priority of the first operation with the priority of the second operation occupying the resources to obtain a comparison result if the resources are occupied; and the allocation module is used for determining whether to preempt the resource and allocate the resource to the first operation according to the comparison result.
In order to achieve the above object, an embodiment of the present application further provides a server, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the resource allocation method described above.
To achieve the above object, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, where the computer program is executed by a processor to implement the resource allocation method described above.
Compared with the prior art, the method and the device for executing the first operation have the advantages that the request for executing the first operation is received, and the resource required for executing the first operation is determined; if the resource is occupied, the priority of the first operation and the priority of the second operation occupying the resource are compared to obtain a comparison result, whether the resource is occupied or not can be determined according to the comparison result, and the resource can be allocated to the first operation, so that the resource can be allocated reasonably, the problem that the corresponding operation cannot be executed correctly due to resource conflict is effectively solved, namely, the resource conflict is effectively avoided, and the corresponding operation is executed correctly.
Drawings
Fig. 1 is a flowchart of a resource allocation method in a first embodiment of the present application;
FIG. 2 is a flow chart of a resource allocation method in a second embodiment of the present application;
FIG. 3 is a flow chart of a resource allocation method in a third embodiment of the present application;
FIG. 4 is a flow chart of a resource allocation method in a fourth embodiment of the present application;
FIG. 5 is a flow chart of a resource allocation method in a fifth embodiment of the present application;
FIG. 6 is a flow chart of a resource allocation method in a sixth embodiment of the present application;
fig. 7 is a schematic structural diagram of a resource allocation apparatus in a seventh embodiment of the present application;
fig. 8 is a schematic structural diagram of a server in an eighth embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in detail with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that in various embodiments of the invention, numerous technical details are set forth in order to provide a better understanding of the present application. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
A first embodiment of the present application relates to a resource allocation method, which is applied to a receiving end, for example: a server; or; mobile phone, computer, etc. The present embodiment and the following embodiments are described by taking the receiving end as an example, but not limited thereto.
The specific flow of the resource allocation method of this embodiment is shown in fig. 1, and includes:
step 101, a request to perform a first operation is received.
Specifically, when a sending end needs to remotely manage a terminal, the sending end sends a request for executing operation to the terminal; the sending end comprises a network management module which is used for managing the terminal together, and the network management module can be located in different devices or can be located in the same device. The terminal may detect whether the request is received in real time, or may detect whether the request is received according to a preset period, where the preset period may be set according to actual needs, and this embodiment is not particularly limited.
At step 102, resources required to perform a first operation are determined.
In one example, if the terminal detects that a request for executing the first operation sent by the sending end is received, the terminal may determine the resource required for executing the first operation according to the pre-stored correspondence between the operation and the resource. In one example, the resource required to perform the operation may also be determined according to the type of the operation, thereby determining the resource required to perform the first operation.
And 103, if the resource is occupied, comparing the priority of the first operation with the priority of the second operation occupying the resource to obtain a comparison result.
Specifically, if the terminal does not detect that other operations are using the required resources, indicating that the resources are not occupied, the terminal executes a first operation by using the resources; or; and the terminal detects that the second operation uses the required resources, but the first operation and the second operation are executed simultaneously, the resources are not insufficient, and the resources are not occupied, and then the first operation is executed by using the rest resources. In this embodiment, the priorities of the first operation and the second operation may be determined according to the sizes of the demands of the first operation and the second operation on the resources, and the larger the demand of the operation on the resources, the higher the priority of the operation is. The operation of occupying the resource may include one second operation, or may include a plurality of second operations; if a second operation is included, comparing the priority of the first operation with the priority of the second operation; if the second operations are included, the priorities of the first operations and the second operations are respectively compared. For example: if the first operation is A and the operation occupying the resources comprises a second operation B, comparing the priority of the first operation A with the priority of the second operation B; if the operation of occupying resources comprises a plurality of second operations B1, B2, the priorities of A and B1, A and B2 are compared, respectively. The present embodiment and the following embodiments are described by taking the operation of occupying resources as an example, including a second operation, but not limited thereto.
And step 104, determining whether to preempt resources and allocate the resources to the first operation according to the comparison result.
In one example, if the comparison result is that the priority of the first operation is higher than that of the second operation, the resource is preempted and allocated to the first operation. At this time, the terminal may also feed back a message that the first operation was successfully performed to the transmitting end. And if the comparison result shows that the priority of the first operation is lower than that of the second operation, or if the comparison result shows that the priority of the first operation is the same as that of the second operation, the resource is not preempted, and the resource is continuously used for executing the second operation. At this time, the terminal may also feed back a message that the execution of the first operation fails to the sending end, and the reason why the failure is carried in the message is that the priority of the first operation is lower than the priority of the second operation, or the priority of the first operation is the same as the priority of the second operation.
In one example, if the comparison result shows that the priority of the first operation is higher than that of the second operation, or if the comparison result shows that the priority of the first operation is the same as that of the second operation, the resource is preempted and allocated to the first operation. If the comparison result shows that the priority of the first operation is lower than that of the second operation, the resource is not preempted, the resource is continuously used for executing the second operation, and a message that the execution of the first operation fails is fed back to the sending end, wherein the reason for the failure is that the priority of the first operation is lower than that of the second operation.
In this embodiment, a terminal receives a request for executing a first operation, and determines a resource required for executing the first operation; if the resource is occupied, the priority of the first operation and the priority of the second operation occupying the resource are compared to obtain a comparison result, whether the resource is occupied or not can be determined according to the comparison result, and the resource can be allocated to the first operation, so that the resource can be allocated reasonably, the problem that the corresponding operation cannot be executed correctly due to resource conflict is effectively avoided, namely, the resource conflict is effectively avoided, and the corresponding operation is executed correctly.
A second embodiment of the present application relates to a resource allocation method, and is substantially the same as the first embodiment, and mainly differs therefrom in that: it is also necessary to determine that the request to perform the first operation is allowed before determining the resources needed to perform the first operation. Fig. 2 shows a specific flowchart of the resource allocation method of this embodiment, which includes:
in step 201, a request to perform a first operation is received.
Step 201 is similar to step 101 in the first embodiment, and is not described herein again.
At step 202, it is determined that the request to perform the first operation is allowed.
In one example, a sender role attribute table of different senders is stored in the terminal in advance, and the sender role attribute table includes a correspondence between an operation type and whether a request is allowed. Therefore, after the terminal receives the request for executing the first operation sent by the sending end, the terminal queries the role attribute table of the sending end, and can search in a traversal manner until whether the request for executing the first operation is allowed or not is found, if the request for executing the first operation is allowed, the step 203 is entered, and if the request for executing the first operation is not allowed, the step is ended. At this time, the terminal may also feed back a message that the first operation fails to be performed to the sending end, and the reason for the failure may also be carried in the message that the request for performing the first operation is not allowed.
In one example, a terminal is responsible for receiving and responding to a request sent by a sending end through a network management client inside the terminal, a network management server and the sending end have a one-to-one correspondence, a network management client role attribute table of different network management clients is stored in the terminal in advance, and the network management client role attribute table comprises a correspondence of an operation type and whether the request is allowed or not. Therefore, after the terminal receives the request for executing the first operation sent by the sending end through the network management client, the terminal queries the role attribute table of the network management client, and can search in a traversal mode until whether the execution of the first operation is allowed is found. For example, a role attribute table of a network management client of the network management client corresponding to a sending end of a first operation, which is pre-stored in the terminal, is as follows:
Figure BDA0002553077380000041
wherein, the support indicates that the request is allowed, and the non-support indicates that the request is not allowed. If the first operation is reading parameter 1, determining that the request for executing the first operation is allowed; if the first operation is read for parameter 2, it is determined that the request to perform the first operation is not allowed.
In step 203, the resources required to perform the first operation are determined.
And step 204, if the resource is occupied, comparing the priority of the first operation with the priority of the second operation occupying the resource to obtain a comparison result.
Step 205, according to the comparison result, determining whether to preempt the resource and allocate the resource to the first operation.
Wherein, the steps 203-205 are similar to the steps 102-104 in the first embodiment, and are not described herein again.
In this embodiment, only when it is determined that the request for executing the first operation is allowed, the determination of the required resource and the determination of whether to preempt the resource are performed, so that a situation that the preempted resource may not be used because the request is not allowed can be avoided, and the workload is reduced.
A third embodiment of the present application relates to a resource allocation method, and is substantially the same as the first embodiment, and mainly differs therefrom in that: a specific way of comparing the priority of a first operation and a second operation occupying a resource is given. Fig. 3 shows a specific flowchart of the resource allocation method of this embodiment, which includes:
in step 301, a request to perform a first operation is received.
At step 302, resources required to perform a first operation are determined.
Wherein, the steps 301-302 are similar to the steps 101-102 in the first embodiment, and are not described herein again.
In one example, before determining the resources required to perform the first operation, the method further comprises: it is determined that the request to perform the first operation is allowed. Specifically, before determining the resource required for executing the first operation, determining whether to allow the first operation to be executed, if it is determined that the request for executing the first operation is allowed, entering step 303, and if it is determined that the request for executing the first operation is allowed, entering end; the specific content is similar to step 202 in the second embodiment, and is not described herein again.
Step 303, if the resource is occupied, comparing the operation type of the first operation with the priority of the operation type of the second operation occupying the resource.
In step 304, if the priority of the operation type of the first operation is higher than that of the second operation, the comparison result is that the priority of the first operation is higher than that of the second operation.
In one example, the operation types of the operation include, but are not limited to, the following: reading parameters, configuring parameters, remote control, diagnosis, upgrading and the like. In this embodiment, a remote operation level table is pre-stored in the terminal, the remote operation level table includes a correspondence between an operation type and a level numerical value, and the higher the level numerical value in the remote operation level table is, the higher the priority of the operation type is. Therefore, the terminal can query the remote operation level table, and search the remote operation level table in a traversal manner until the level numerical value of the operation type of the first operation and the level numerical value of the operation type of the second operation are searched, so that the priority of the operation type of the first operation and the priority of the operation type of the second operation are compared.
If the priority of the operation type of the first operation is higher than that of the operation type of the second operation, the comparison result is that the priority of the first operation is higher than that of the second operation; if the priority of the operation type of the first operation is lower than that of the operation type of the second operation, obtaining a comparison result that the priority of the first operation is lower than that of the second operation; and if the priority of the operation type of the first operation is the same as that of the operation type of the second operation, obtaining a comparison result that the priority of the first operation is the same as that of the second operation.
For example, the remote operation level table stored in advance in the terminal is as follows:
Figure BDA0002553077380000061
if the operation type of the first operation is the read parameter and the operation type of the second operation is the configuration parameter, querying the remote operation level table to determine that the level numerical value of the operation type of the first operation is 1 and the level numerical value of the operation type of the second operation is 2, so as to compare the priority of the operation type of the first operation lower than that of the operation type of the second operation, and obtain a comparison result that the priority of the first operation is lower than that of the second operation; if the operation type of the first operation is the configuration parameter and the operation type of the second operation is the read parameter, querying the remote operation level table can determine that the level numerical value of the operation type of the first operation is 2 and the level numerical value of the operation type of the second operation is 1, so that the priority of the operation type of the first operation higher than that of the operation type of the second operation is compared, and the comparison result is that the priority of the first operation is higher than that of the second operation.
In one example, the operation types may be further classified according to different contents, for example: the reading parameters can be classified into reading parameters 1, … and reading parameters n according to different parameters; the configuration parameters can be classified into configuration parameters 1, …, configuration parameters n; the remote control can be classified into a remote control 1, …, a remote control n; the remote diagnosis can be classified into remote diagnosis 1, …, remote diagnosis n; upgrades can be classified into upgrade 1, …, upgrade n, etc. according to the contents of the upgrade. When the operation types of the first operation and the second operation are the same, the priorities of the first operation and the second operation can also be determined according to specific contents.
For example: the remote control operation level table pre-stored in the terminal is as follows:
remote control 1: grade 2(1)
Remote control 2: grade 2(3)
The remote control is divided into a remote control 1 and a remote control 2 according to different control contents, and if the operation types of the first operation and the second operation are both remote control, the remote control level table can be inquired to determine the priority of the first operation and the priority of the second operation. If the first operation is the remote control 1, the second operation is the remote control 2, the grade value of the remote control 1 is determined to be 2(1) by inquiring the remote control operation grade table, and the grade value of the remote control 2 is determined to be 2(3), so that the priority of the remote control 1 is lower than that of the remote control 2, and the comparison result is that the priority of the first operation is lower than that of the second operation.
And 305, determining whether to preempt resources and allocate the resources to the first operation according to the comparison result.
Step 305 is similar to step 103 in the first embodiment, and is not described herein again.
In this embodiment, by comparing the priorities of the operation types of the operations, the priorities of the first operation and the second operation can be compared faster, that is, the comparison result can be obtained faster.
A fourth embodiment of the present application relates to a resource allocation method, and is substantially the same as the first embodiment, and mainly differs therefrom in that: a specific way of comparing the priority of a first operation and a second operation occupying a resource is given. Fig. 4 shows a specific flowchart of the resource allocation method of this embodiment, which includes:
at step 401, a request to perform a first operation is received.
At step 402, resources required to perform a first operation are determined.
Wherein, steps 401-402 are similar to steps 101-102 in the first embodiment, and are not described herein again.
In one example, before determining the resources required to perform the first operation, the method further comprises: it is determined that the request to perform the first operation is allowed. Specifically, before determining the resource required for executing the first operation, it is determined whether to allow the first operation to be executed, if it is determined that the request for executing the first operation is allowed, the process proceeds to step 403, and if it is determined that the request for executing the first operation is allowed, the process proceeds to end; the specific content is similar to step 202 in the second embodiment, and is not described herein again.
In step 403, if the resource is occupied, the priority of the sender of the request for executing the first operation is compared with the priority of the sender of the request for executing the second operation for occupying the resource.
In step 404, if the priority of the sender of the request for executing the first operation is higher than the priority of the sender of the request for executing the second operation, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
In one example, a sending-end role grade table is stored in the terminal in advance, the sending-end role grade table includes a corresponding relation between a sending end and a grade value, and the larger the grade value of the sending-end grade table is, the higher the priority of the sending end is. Therefore, the terminal may query the role level table of the sending end, and may search in a traversal manner until the level values of the sending end executing the request for the first operation and the sending end executing the request for the second operation are found, so as to compare the priorities of the sending end executing the request for the first operation and the sending end executing the request for the second operation.
In one example, a terminal is responsible for receiving and responding to a request sent by a sending end through a network management client inside the terminal, a network management server and the sending end have a one-to-one correspondence relationship, a network management client role grade table is stored in the terminal in advance, the network management client role grade table comprises the correspondence relationship between the network management client and grade values, and the higher the grade value in the network management client role grade table is, the higher the priority of the network management client is; because the network management client and the sending end have a one-to-one correspondence, the priority of the network management client is the priority of the sending end. Therefore, the terminal can query the role level table of the network management client, and can search in a traversal manner until the level value of the network management client receiving the request for executing the first operation and the level value of the network management client receiving the request for executing the second operation are found, so that the priorities of the network management client receiving the request for executing the first operation and the network management client receiving the request for executing the second operation are compared, namely the priorities of the sending end of the request for executing the first operation and the sending end of the request for executing the second operation are compared.
If the priority of the sending end executing the request of the first operation is higher than that of the sending end executing the request of the second operation, the comparison result is that the priority of the first operation is higher than that of the second operation; if the priority of the sending end executing the request of the first operation is lower than that of the sending end executing the request of the second operation, the comparison result is obtained that the priority of the first operation is lower than that of the second operation; if the priority of the sending end executing the request of the first operation is the same as the priority of the sending end executing the request of the second operation, the obtained comparison result is that the priority of the first operation is the same as the priority of the second operation.
For example, the role level table of the network management client pre-stored in the terminal is as follows:
Figure BDA0002553077380000081
if the sending end 1 sends a request for executing a first operation to the network management client end 1, the sending end 2 sends a request for executing a second operation to the network management client end 2, and the role grade table of the network management client end is inquired, so that the grade value of the network management client end 1 can be determined to be 1, and the grade value of the network management client end 2 is 1, and therefore the priority of the network management client end 1 is the same as that of the network management client end 2 by comparison, namely the priority of the sending end 1 is the same as that of the sending end 2 by comparison, and the comparison result is obtained that the priority of the first operation is the same as that of the second operation; if the sending end 1 sends the request for executing the first operation to the network management client 3, the sending end 2 sends the request for executing the second operation to the network management client 2, and the role grade table of the network management client is inquired, so that the grade value of the network management client 3 can be determined to be 2, and the grade value of the network management client 2 is 1, and thus the priority of the network management client 3 is the same as that of the network management client 2 by comparison, namely the priority of the sending end 1 is higher than that of the sending end 2, and the comparison result is that the priority of the first operation is higher than that of the second operation.
Step 405, determining whether to preempt the resource and allocate the resource to the first operation according to the comparison result.
Step 405 is similar to step 103 in the first embodiment, and is not described herein again.
In this embodiment, by comparing the priorities of the sending ends of the requests for executing the operations, the priorities of the first operation and the second operation can be determined faster, that is, the comparison result can be obtained faster.
A fifth embodiment of the present application relates to a resource allocation method, and is substantially the same as the third embodiment, and mainly differs therefrom in that: if the priority of the operation type of the first operation is the same as the priority of the operation type of the second operation, the priorities of the sender of the request to perform the first operation and the sender of the request to perform the second operation need to be compared. Fig. 5 shows a specific flowchart of the resource allocation method of this embodiment, which includes:
at step 501, a request to perform a first operation is received.
At step 502, resources required to perform a first operation are determined.
In step 503, if the resource is occupied, the operation type of the first operation is compared with the priority of the operation type of the second operation occupying the resource.
Wherein, steps 501-503 are similar to steps 301-303 in the third embodiment, and are not described herein again.
In one example, before determining the resources required to perform the first operation, the method further comprises: it is determined that the request to perform the first operation is allowed. Specifically, before determining the resource required for executing the first operation, it is determined whether to allow the first operation to be executed, if it is determined that the request for executing the first operation is allowed, the process proceeds to step 503, and if it is determined that the request for executing the first operation is allowed, the process proceeds to end; the specific content is similar to step 202 in the second embodiment, and is not described herein again.
Step 504, if the priority of the operation type of the first operation is the same as the priority of the operation type of the second operation, comparing the priorities of the sender of the request to execute the first operation and the sender of the request to execute the second operation.
In step 505, if the priority of the sender of the request for executing the first operation is higher than the priority of the sender of the request for executing the second operation, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
Step 506, according to the comparison result, determining whether to preempt the resource and allocate the resource to the first operation.
Wherein, steps 504 and 506 are similar to steps 403 and 405 in the fourth embodiment, and are not described herein again.
In this embodiment, when the priority of the operation type of the first operation is the same as the priority of the operation type of the second operation, the priority of the sending end of the request for executing the operation needs to be compared, and the priorities of the first operation and the second operation are compared from two perspectives, so that the obtained comparison result is more accurate.
A sixth embodiment of the present application relates to a resource allocation method, and is substantially the same as the fourth embodiment, and mainly differs in that: if the priority of the sender of the request to perform the first operation is the same as the priority of the sender of the request to perform the second operation, comparing the priority of the operation type of the first operation with the priority of the operation type of the second operation. Fig. 6 shows a specific flowchart of the resource allocation method of this embodiment, which includes:
step 601, a request for executing a first operation is received.
At step 602, resources required to perform a first operation are determined.
Step 603, if the resource is occupied, comparing the priority of the sender executing the request of the first operation with the priority of the sender executing the request of the second operation occupying the resource.
Wherein, the steps 601-603 are similar to the steps 401-403 in the fourth embodiment, and are not described herein again.
In one example, before determining the resources required to perform the first operation, the method further comprises: it is determined that the request to perform the first operation is allowed. Specifically, before determining the resource required for executing the first operation, it is determined whether to allow the first operation to be executed, if it is determined that the request for executing the first operation is allowed, the step 603 is entered, and if it is determined that the request for executing the first operation is allowed, the step is entered to be ended; the specific content is similar to step 202 in the second embodiment, and is not described herein again.
In step 604, if the priority of the sender of the request to perform the first operation is the same as the priority of the sender of the request to perform the second operation, the operation type of the first operation and the priority of the operation type of the second operation are compared.
In step 605, if the priority of the operation type of the first operation is higher than that of the second operation, the comparison result is that the priority of the first operation is higher than that of the second operation.
Step 606, according to the comparison result, determining whether to preempt the resource and allocate the resource to the first operation.
Wherein, steps 604 and 606 are similar to steps 303 and 305 in the third embodiment, and are not described herein again.
In this embodiment, when the priority of the sending end executing the request of the first operation is the same as the priority of the sending end executing the request of the second operation, the priorities of the operation types of the operations need to be compared, and the priorities of the first operation and the second operation need to be determined from two angles, so that the obtained comparison result is more accurate.
A seventh embodiment of the present application relates to a resource allocation apparatus, as shown in fig. 7, including:
a receiving module 701, configured to receive a request for executing a first operation;
a determining module 702 for determining a resource required to perform a first operation;
a comparing module 703, configured to compare priorities of the first operation and the second operation that occupies the resource if the resource is already occupied, to obtain a comparison result;
and an allocating module 704, configured to determine whether to preempt the resource and allocate to the first operation according to the comparison result.
In one example, the comparing module 703 is configured to compare the operation type of the first operation with the priority of the operation type of the second operation occupying the resource; if the priority of the operation type of the first operation is higher than that of the operation type of the second operation, the comparison result is that the priority of the first operation is higher than that of the second operation.
In one example, the comparing module 703 is configured to compare priorities of a sender of a request to perform a first operation and a sender of a request to perform a second operation occupying resources; if the priority of the sending end executing the request of the first operation is higher than that of the sending end executing the request of the second operation, the comparison result is that the priority of the first operation is higher than that of the second operation.
In an example, after comparing the priority of the operation type of the first operation with the priority of the operation type of the second operation occupying the resource, if the priority of the operation type of the first operation is the same as the priority of the operation type of the second operation, the comparing module 703 is further configured to compare the priorities of a sender of the request to execute the first operation and a sender of the request to execute the second operation; if the priority of the sending end executing the request of the first operation is higher than that of the sending end executing the request of the second operation, the comparison result is that the priority of the first operation is higher than that of the second operation.
In one example, after comparing priorities of a sender executing a request for a first operation and a sender executing a request for a second operation occupying resources, the method further includes: if the priority of the sending end executing the request of the first operation is the same as the priority of the sending end executing the request of the second operation, the comparing module 703 is further configured to compare the operation type of the first operation with the priority of the operation type of the second operation; if the priority of the operation type of the first operation is higher than that of the operation type of the second operation, the comparison result is that the priority of the first operation is higher than that of the second operation.
In one example, prior to determining the resources needed to perform the first operation, comprising: the determination module 702 is further configured to determine that the request to perform the first operation is allowed.
In one example, determining whether to preempt resources and allocate to the first operation based on the comparison comprises: and if the comparison result shows that the priority of the first operation is higher than that of the second operation, the resource is preempted and allocated to the first operation.
It should be understood that the present embodiment is a device embodiment corresponding to the first, second, third, fourth, fifth, or sixth embodiment, and the present embodiment can be implemented in cooperation with the first, second, third, fourth, fifth, or sixth embodiment. The related technical details mentioned in the first or second or third or fourth or fifth or sixth embodiment are still valid in this embodiment, and are not repeated herein for the sake of reducing repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first or second or third or fourth or fifth or sixth embodiment.
It should be noted that, all the modules involved in this embodiment are logic modules, and in practical application, one logic unit may be one physical unit, may also be a part of one physical unit, and may also be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, a unit which is not so closely related to solve the technical problem proposed by the present invention is not introduced in the present embodiment, but this does not indicate that there is no other unit in the present embodiment.
An eighth embodiment of the present invention relates to a server, as shown in fig. 8, including: at least one processor 801; and a memory 802 communicatively coupled to the at least one processor 801; the memory 802 stores instructions executable by the at least one processor 801, and the instructions are executed by the at least one processor 801 to enable the at least one processor 801 to perform the resource allocation method described above.
Where the memory and processor are connected by a bus, the bus may comprise any number of interconnected buses and bridges, the buses connecting together one or more of the various circuits of the processor and the memory. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor.
The processor is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory may be used to store data used by the processor in performing operations.
A ninth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. 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.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific embodiments for practicing the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

1. A method for resource allocation, comprising:
receiving a request to perform a first operation;
determining a resource required to perform the first operation;
if the resource is occupied, comparing the priority of the first operation with the priority of the second operation occupying the resource to obtain a comparison result;
and determining whether to preempt the resource and allocate the resource to the first operation according to the comparison result.
2. The method according to claim 1, wherein the comparing the priority of the first operation and the priority of the second operation occupying the resource to obtain a comparison result comprises:
comparing the operation type of the first operation with the priority of the operation type of the second operation occupying the resource;
and if the priority of the operation type of the first operation is higher than that of the operation type of the second operation, obtaining a comparison result that the priority of the first operation is higher than that of the second operation.
3. The method according to claim 1, wherein the comparing the priority of the first operation and the priority of the second operation occupying the resource to obtain a comparison result comprises:
comparing the priorities of a sender executing the request for the first operation and a sender executing the request for the second operation occupying the resource;
and if the priority of the sending end executing the request of the first operation is higher than that of the sending end executing the request of the second operation, obtaining a comparison result that the priority of the first operation is higher than that of the second operation.
4. The method of claim 2, further comprising, after the comparing the priority of the operation type of the first operation with the operation type of the second operation occupying the resource:
if the priority of the operation type of the first operation is the same as the priority of the operation type of the second operation, comparing the priorities of a sending end of the request for executing the first operation and a sending end of the request for executing the second operation;
and if the priority of the sending end executing the request of the first operation is higher than that of the sending end executing the request of the second operation, obtaining a comparison result that the priority of the first operation is higher than that of the second operation.
5. The method of claim 3, further comprising, after the comparing the priorities of the sender of the request to perform the first operation and the sender of the request to perform the second operation to occupy the resource:
if the priority of the sending end executing the request of the first operation is the same as the priority of the sending end executing the request of the second operation, comparing the priority of the operation type of the first operation with the priority of the operation type of the second operation;
and if the priority of the operation type of the first operation is higher than that of the operation type of the second operation, obtaining a comparison result that the priority of the first operation is higher than that of the second operation.
6. The method according to any of claims 1-5, wherein before said determining the resources required for performing said first operation, comprising:
determining that the request to perform the first operation is allowed.
7. The method according to any of claims 1-5, wherein said determining whether to preempt said resource and allocate to said first operation based on said comparison comprises:
and if the comparison result shows that the priority of the first operation is higher than that of the second operation, the resource is preempted and allocated to the first operation.
8. A resource allocation apparatus, comprising:
a receiving module for receiving a request to perform a first operation,
a determining module that determines a resource required to perform the first operation;
the comparison module is used for comparing the priority of the first operation with the priority of the second operation occupying the resources to obtain a comparison result if the resources are occupied;
and the allocation module is used for determining whether to preempt the resource and allocate the resource to the first operation according to the comparison result.
9. A server, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of resource allocation according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the resource allocation method of any one of claims 1 to 7.
CN202010582880.3A 2020-06-23 2020-06-23 Resource allocation method, device, server and storage medium Pending CN113839890A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010582880.3A CN113839890A (en) 2020-06-23 2020-06-23 Resource allocation method, device, server and storage medium
PCT/CN2021/100377 WO2021259108A1 (en) 2020-06-23 2021-06-16 Resource allocation method and apparatus, server, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010582880.3A CN113839890A (en) 2020-06-23 2020-06-23 Resource allocation method, device, server and storage medium

Publications (1)

Publication Number Publication Date
CN113839890A true CN113839890A (en) 2021-12-24

Family

ID=78964335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010582880.3A Pending CN113839890A (en) 2020-06-23 2020-06-23 Resource allocation method, device, server and storage medium

Country Status (2)

Country Link
CN (1) CN113839890A (en)
WO (1) WO2021259108A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101883436B (en) * 2010-06-24 2014-08-20 宇龙计算机通信科技(深圳)有限公司 Concurrent processing method and system for resources and mobile terminal
CN104581839B (en) * 2013-10-24 2018-10-16 展讯通信(上海)有限公司 A kind of method and communication equipment of information transmission
CN110427257A (en) * 2019-07-29 2019-11-08 招商局金融科技有限公司 Multi-task scheduling method, device and computer readable storage medium
CN111050199B (en) * 2019-11-19 2022-01-28 海信视像科技股份有限公司 Display device and scheduling method of Bluetooth communication resources of display device

Also Published As

Publication number Publication date
WO2021259108A1 (en) 2021-12-30

Similar Documents

Publication Publication Date Title
CN110995617B (en) MQTT-based data transmission method and device, computer equipment and storage medium
CN110808948A (en) Remote procedure calling method, device and system
CN110365508B (en) Method for instantiating virtual network function and network function virtualization orchestrator
CN110417876B (en) Session method, node server in distributed system and master control equipment
CN114710549B (en) Dynamic management method, system and service node for network card in container platform
CN109120680B (en) Control system, method and related equipment
CN113242170B (en) Address allocation method and device
CN112491951B (en) Request processing method, server and storage medium in peer-to-peer network
CN111371593B (en) Service deployment method, device, electronic equipment and storage medium
CN113938351A (en) Data acquisition method, system and computer readable storage medium
CN109922120B (en) Method and terminal for improving DNS availability
CN116567094A (en) Service information processing method based on micro service system
CN113839890A (en) Resource allocation method, device, server and storage medium
CN111338758A (en) Resource management method and device and electronic equipment
CN110913415A (en) Method and device for sending measurement configuration information and measurement report information
CN111309467B (en) Task distribution method and device, electronic equipment and storage medium
CN115277671A (en) OTA (over the air) upgrading method and device for vehicle, vehicle and storage medium
CN116418669A (en) Processing method of network slice, network element and storage medium
CN115509676A (en) Container set deployment method and device
CN108540991B (en) Base station management method and device
CN110300035B (en) Method, system, device and server for judging load state of storage system
CN113067869B (en) Node control method and device, node management method and device and distributed system
CN103457984A (en) Method and system for automatic synchronous upgrade control
CN112671871B (en) Mirror image distribution method and device, terminal equipment and storage medium
CN111092948A (en) Guiding method, guiding server, server and 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