WO2021259108A1 - 资源分配方法、装置、服务器及存储介质 - Google Patents

资源分配方法、装置、服务器及存储介质 Download PDF

Info

Publication number
WO2021259108A1
WO2021259108A1 PCT/CN2021/100377 CN2021100377W WO2021259108A1 WO 2021259108 A1 WO2021259108 A1 WO 2021259108A1 CN 2021100377 W CN2021100377 W CN 2021100377W WO 2021259108 A1 WO2021259108 A1 WO 2021259108A1
Authority
WO
WIPO (PCT)
Prior art keywords
priority
request
perform
sender
resource
Prior art date
Application number
PCT/CN2021/100377
Other languages
English (en)
French (fr)
Inventor
韦杏媛
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2021259108A1 publication Critical patent/WO2021259108A1/zh

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

Definitions

  • the embodiments of the present application relate to the field of communications, and in particular to a resource allocation method, device, server, and storage medium.
  • Remote management means that the network management server manages the terminal through the remote management protocol to achieve functions such as obtaining the operating status of the terminal, modifying the terminal parameters, remotely controlling the terminal, remotely diagnosing the terminal, and upgrading the terminal's firmware.
  • the purpose of the embodiments of the present application is to provide a resource allocation method, device, server, and storage medium, which can effectively avoid resource conflicts, so that corresponding operations can be performed correctly.
  • An embodiment of the present application provides a resource allocation method, including: receiving a request to perform a first operation; determining resources required to perform the first operation; if the resources are already occupied, comparing the first operation and the occupation The priority of the second operation of the resource obtains a comparison result; according to the comparison result, it is determined whether to preempt the resource and allocate it to the first operation.
  • An embodiment of the present application also provides a resource allocation device, including: a receiving module, configured to receive a request to perform a first operation, a determining module, to determine a resource required to perform the first operation; a comparing module, configured to: If the resource is occupied, the priority of the first operation and the second operation occupying the resource are compared to obtain a comparison result; the allocation module is used to determine whether to preempt the resource and allocate it to all the resources based on the comparison result. Mentioned first operation.
  • An embodiment of the present application further provides a server, including: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor The instruction is executed by the at least one processor, so that the at least one processor can execute the above-mentioned resource allocation method.
  • the embodiment of the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the above-mentioned resource allocation method is implemented.
  • Fig. 1 is a flowchart of a resource allocation method in the first embodiment of the present application
  • Fig. 2 is a flowchart of a resource allocation method in a second embodiment of the present application
  • Fig. 3 is a flowchart of a resource allocation method in a third embodiment of the present application.
  • Fig. 4 is a flowchart of a resource allocation method in a fourth embodiment of the present application.
  • Fig. 5 is a flowchart of a resource allocation method in a fifth embodiment of the present application.
  • Fig. 6 is a flowchart of a resource allocation method in a sixth embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a resource allocation device in a seventh embodiment of the present application.
  • FIG. 8 is a schematic diagram of the structure of the server in the eighth embodiment of the present application.
  • the first embodiment of the present application relates to a resource allocation method, which is applied to a receiving end, such as a terminal such as a server, a mobile phone, or a computer.
  • a receiving end such as a terminal such as a server, a mobile phone, or a computer.
  • This embodiment and the following embodiments take the receiving end as the terminal as an example for description, but it is not limited thereto.
  • Fig. 1 The flow of the resource allocation method of this embodiment is shown in Fig. 1, and includes:
  • Step 101 Receive a request to perform the first operation.
  • the sender when the sender needs to remotely manage the terminal, the sender sends a request to execute an operation to the terminal; where the sender includes a network management module for joint management of the terminal.
  • the network management module can be in a different device or Can be in the same device.
  • the terminal can detect whether the request is received in real time, or detect whether the request is received according to a preset period.
  • the preset period can be set according to actual needs, and this embodiment does not specifically limit it.
  • Step 102 Determine the resources required to perform the first operation.
  • the terminal if it detects that it has received a request to perform the first operation sent by the sender, it can determine the resource required to perform the first operation according to the pre-stored correspondence between the operation and the resource.
  • the resources required to perform the operation can also be determined according to the type of operation, so as to determine the resources required to perform the first operation.
  • Step 103 If the resource is already occupied, compare the priorities of the first operation and the second operation occupying the resource to obtain a comparison result.
  • the terminal does not detect that other operations are using the required resources, indicating that the resources are not occupied, it uses the resources to perform the first operation; or; the terminal detects that the second operation is using the required resources, but When the first operation and the second operation are executed at the same time, there will be no shortage of resources, indicating that the resources are not occupied, and the remaining resources are used to perform the first operation. If the terminal detects that the second operation is using the required resources, and the first operation and the second operation are executed at the same time, there will be insufficient resources, indicating that the resources have been occupied. In this embodiment, the first operation and the first operation can be used. The second operation requires the size of resources to determine the priority of the first operation and the second operation.
  • the operation of occupying resources may include a second operation or multiple second operations; if it includes a second operation, compare the priority of the first operation and the second operation; if it includes multiple second operations , Compare the priority of the first operation and multiple second operations respectively. For example: if the first operation is A and the resource occupation operation includes a second operation B, compare the priorities of the first operation A and the second operation B; if the resource occupation operation includes multiple second operations B1, B2, Compare the priorities of A and B1, and A and B2 respectively.
  • This embodiment and the following embodiments take the resource occupation operation including a second operation as an example for description, but it is not limited thereto.
  • Step 104 Determine whether to preempt resources and allocate them to the first operation according to the comparison result.
  • the terminal may also feed back a message that the first operation is successfully performed to the sending end. If the comparison result is that the priority of the first operation is lower than the priority of the second operation, or if the comparison result is that the priority of the first operation and the priority of the second operation are the same, the resources are not preempted and the resources are continued for execution The second operation. At this time, the terminal can also feed back to the sender a message that the execution of the first operation failed. The message can also carry the reason for the failure because the priority of the first operation is lower than the priority of the second operation, or the priority and the first operation of the first operation. The priority of the two operations is the same.
  • the resources are preempted and allocated to First operation. If the comparison result is that the priority of the first operation is lower than the priority of the second operation, the resources will not be preempted, the resources will continue to be used to execute the second operation, and the message that the execution of the first operation failed will be fed back to the sender.
  • the message can also be The reason for the failure to carry is that the priority of the first operation is lower than the priority of the second operation.
  • the terminal receives the request to perform the first operation and determines the resources required to perform the first operation; if the resources are already occupied, compare the priorities of the first operation and the second operation occupying the resources to obtain the comparison result, According to the comparison result, it can be determined whether to preempt the resource and allocate it to the first operation, so that the resource can be allocated reasonably, effectively avoiding the problem of incorrect execution of the corresponding operation caused by the resource conflict, that is, effectively avoiding the resource conflict, so as to execute the corresponding correctly Operation.
  • the second embodiment of the present application relates to a resource allocation method.
  • the second embodiment is roughly the same as the first embodiment.
  • the main difference is: before determining the resources required to perform the first operation, you also need to determine the execution of the first operation.
  • the operation request is allowed.
  • the flowchart of the resource allocation method of this embodiment is shown in Fig. 2, and includes:
  • Step 201 Receive a request to perform the first operation.
  • step 201 is similar to step 101 in the first embodiment, and will not be repeated here.
  • Step 202 It is determined that the request to perform the first operation is allowed.
  • the sending end role attribute table of different sending ends is pre-stored in the terminal, and the sending end role attribute table includes the corresponding relationship between the operation type and whether the request is allowed. Therefore, after the terminal receives the request to perform the first operation sent by the sender, the terminal queries the sender role attribute table of the sender, and can search through the traversal method until it finds whether the request to perform the first operation is allowed. If the request to perform the first operation is allowed, then step 203 is entered. If it is determined that the request to perform the first operation is not allowed, then the entry ends. At this time, the terminal may also feed back a message that the execution of the first operation failed to the sending end, and the message may also carry the reason for the failure that the request to execute the first operation is not allowed.
  • the terminal is responsible for receiving and responding to the request sent by the sender through the network management client inside the terminal, and there is a one-to-one correspondence between the network management server and the sending end, and the network management client role attribute table of different network management clients is pre-stored in the terminal.
  • the network management client role attribute table includes the correspondence between the operation type and whether the request is allowed. Therefore, after the terminal receives the request to perform the first operation sent by the sender through the network management client, the terminal queries the network management client role attribute table of the network management client. It can be searched by traversal until it finds whether the first operation is performed allowed.
  • the network management client role attribute table of the network management client corresponding to the sender of the first operation pre-stored in the terminal is as follows:
  • support means that the request is allowed, and not support means that the request is not allowed. If the first operation is to read parameter 1, it is determined that the request to execute the first operation is allowed; if the first operation is to read parameter 2, it is determined that the request to execute the first operation is not allowed.
  • Step 203 Determine the resources required to perform the first operation.
  • Step 204 If the resource is already occupied, compare the priorities of the first operation and the second operation occupying the resource to obtain a comparison result.
  • Step 205 Determine whether to preempt resources and allocate them to the first operation according to the comparison result.
  • steps 203-205 are similar to steps 102-104 in the first embodiment, and will not be repeated here.
  • the third embodiment of the present application relates to a resource allocation method.
  • the third embodiment is roughly the same as the first embodiment.
  • the main difference is that the priority of comparing the first operation and the second operation occupying resources is given.
  • Implementation mode The flowchart of the resource allocation method of this embodiment is shown in FIG. 3, and includes:
  • Step 301 Receive a request to perform the first operation.
  • Step 302 Determine the resources required to perform the first operation.
  • steps 301-302 are similar to steps 101-102 in the first embodiment, and will not be repeated here.
  • the method before determining the resources required to perform the first operation, the method further includes: determining that the request to perform the first operation is allowed. In some cases, before determining the resources required to perform the first operation, determine whether the execution of the first operation is allowed. If it is determined that the request to perform the first operation is allowed, then go to step 303, if the request to perform the first operation is determined If allowed, the entry ends; the specific content is similar to step 202 in the second embodiment, and will not be repeated here.
  • Step 303 If the resource is already occupied, compare the priority of the operation type of the first operation with the operation type of the second operation occupying the resource.
  • Step 304 If the priority of the operation type of the first operation is higher than the priority of the operation type of the second operation, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
  • the operation types of operations include but are not limited to the following categories: read parameters, configuration parameters, remote control, diagnosis, and upgrade.
  • a remote operation level table is pre-stored in the terminal.
  • the remote operation level table includes the corresponding relationship between operation types and level values. The larger the level value in the remote operation level table, the higher the priority of the operation type. . Therefore, the terminal can query the remote operation level table, and search through traversal until it finds the level value of the operation type of the first operation and the level value of the operation type of the second operation, so as to compare the operation type and the operation type of the first operation. The priority of the operation type of the second operation.
  • the comparison result is that the priority of the first operation is higher than the priority of the second operation; if the operation type of the first operation has priority The priority is lower than the priority of the operation type of the second operation, and the comparison result is that the priority of the first operation is lower than the priority of the second operation; if the priority of the operation type of the first operation and the operation type of the second operation are different The priority is the same, and the comparison result is that the priority of the first operation and the priority of the second operation are the same.
  • the remote operation level table pre-stored in the terminal is as follows:
  • the operation type of the first operation is read parameters and the operation type of the second operation is configuration parameters, query the remote operation level table to determine that the level value of the operation type of the first operation is 1, and the level value of the operation type of the second operation It is 2, thus comparing the priority of the operation type of the first operation lower than the priority of the second operation, and the comparison result is that the priority of the first operation is lower than the priority of the second operation.
  • the operation type of the first operation is a configuration parameter and the operation type of the second operation is a read parameter
  • query the remote operation level table to determine that the level value of the operation type of the first operation is 2, and the level value of the operation type of the second operation It is 1, thus comparing the priority of the operation type of the first operation higher than the priority of the second operation, and the comparison result is that the priority of the first operation is higher than the priority of the second operation.
  • the operation type can also be classified again according to the content.
  • read parameters can be divided into read parameters 1,..., read parameters n according to different parameters
  • configuration parameters can be divided into different parameters according to different parameters
  • remote control can be divided into remote control 1,..., remote control n according to different control contents
  • remote diagnosis can be divided into remote diagnosis 1,..., remote diagnosis n according to different diagnosis contents
  • the upgrade can be divided into upgrade 1,..., upgrade n, etc. according to the content of the upgrade.
  • the remote control operation level table pre-stored in the terminal is as follows:
  • Remote control 1 Level 2 (1)
  • Remote control 2 Level 2 (3)
  • the remote control is divided into remote control 1 and remote control 2 according to the different control content. If the operation types of the first operation and the second operation are both remote control, you can query the remote control level table to determine the first operation and the second operation. The priority of the operation. If the first operation is remote control 1 and the second operation is remote control 2, query the remote control operation level table to determine that the level value of remote control 1 is 2(1), and the level value of remote control 2 is 2(3), so It is compared that the priority of remote control 1 is lower than the priority of remote control 2, and the comparison result is that the priority of the first operation is lower than the priority of the second operation.
  • Step 305 Determine whether to preempt resources and allocate them to the first operation according to the comparison result.
  • step 305 is similar to step 103 in the first embodiment, and will not be repeated here.
  • the priority of the first operation and the second operation can be quickly compared, that is, the comparison result can be obtained faster.
  • the fourth embodiment of the present application relates to a resource allocation method.
  • the fourth embodiment is roughly the same as the first embodiment.
  • the main difference is that the priority of comparing the first operation and the second operation occupying resources is given.
  • Implementation mode The flowchart of the resource allocation method of this embodiment is shown in FIG. 4, and includes:
  • Step 401 Receive a request to perform the first operation.
  • Step 402 Determine the resources required to perform the first operation.
  • steps 401-402 are similar to steps 101-102 in the first embodiment, and will not be repeated here.
  • the method before determining the resources required to perform the first operation, the method further includes: determining that the request to perform the first operation is allowed. In some cases, before determining the resources required to perform the first operation, determine whether the execution of the first operation is allowed. If it is determined that the request to perform the first operation is allowed, then go to step 403, if the request to perform the first operation is determined If allowed, the entry ends; the specific content is similar to step 202 in the second embodiment, and will not be repeated here.
  • Step 403 If the resource is already occupied, compare the priorities of the sender of the request for performing the first operation and the sender of the request for the second operation of occupying resources.
  • Step 404 If the priority of the sender of the request to perform the first operation is higher than the priority of the sender of the request to perform the second operation, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
  • a sender role level table is pre-stored in the terminal, and the sender role level table includes the corresponding relationship between the sender and the level value, and the higher the level value of the sender level table, the higher the priority of the sender . Therefore, the terminal can query the sender role level table, and it can search by traversal until it finds the level value of the sender of the request to perform the first operation and the sender of the request to perform the second operation, so as to compare the performance of the first operation. The priority of the sender of the request and the sender of the request to perform the second operation.
  • the terminal is responsible for receiving and responding to the request sent by the sender through the network management client inside the terminal, and there is a one-to-one correspondence between the network management server and the sending end.
  • the network management client role level table is pre-stored in the terminal, and the network management client The role level table includes the corresponding relationship between the network management client and the level value, and the larger the level value in the network management client role level table, the higher the priority of the network management client; because there is a one-to-one correspondence between the network management client and the sending end , So the priority of the network management client is the priority of the sender.
  • the terminal can query the network management client role level table, and search it through traversal until it finds the level value of the network management client that received the request to perform the first operation and the level value of the network management client that received the request to perform the second operation.
  • the priorities of the network management client receiving the request to perform the first operation and the network management client receiving the request to perform the second operation are compared, that is, the sender of the request to perform the first operation is compared with the sending of the request to perform the second operation. The priority of the end.
  • the comparison result is that the priority of the first operation is higher than the priority of the second operation; if the first operation is performed The priority of the sender of the request is lower than the priority of the sender of the request to perform the second operation, and the comparison result is that the priority of the first operation is lower than the priority of the second operation; if the priority of the sender of the request to perform the first operation The priority is the same as the priority of the sender of the request to perform the second operation, and the comparison result is that the priority of the first operation is the same as the priority of the second operation.
  • the pre-stored network management client role level table in the terminal is as follows:
  • the sender 1 sends a request to perform the first operation to the network management client 1
  • the sender 2 sends a request to perform the second operation to the network management client 2
  • querying the role level table of the network management client can determine the network management client 1.
  • the level value is 1, and the level value of the network management client 2 is 1, so that the priority of the network management client 1 and the network management client 2 are the same, that is, the priority of the sender 1 and the priority of the sender 2 are the same.
  • the comparison result is that the priority of the first operation is the same as the priority of the second operation.
  • the sender 1 sends a request to perform the first operation to the network management client 3, and the sender 2 sends a request to perform the second operation to the network management client 2, querying the role level table of the network management client can determine the status of the network management client 3.
  • the level value is 2, and the level value of the network management client 2 is 1, so that the priority of the network management client 3 and the network management client 2 are the same, that is, the priority of the sender 1 is higher than the priority of the sender 2.
  • the comparison result is that the priority of the first operation is higher than the priority of the second operation.
  • Step 405 Determine whether to preempt resources and allocate them to the first operation according to the comparison result.
  • step 405 is similar to step 103 in the first embodiment, and will not be repeated here.
  • the priority of the first operation and the second operation can be determined faster, that is, the comparison result can be obtained faster.
  • the fifth embodiment of the present application relates to a resource allocation method.
  • the fifth embodiment is roughly the same as the third embodiment.
  • the main difference is: if the priority of the operation type of the first operation is different from the operation type of the second operation The priority is the same, and it is also necessary to compare the priorities of the sender of the request to perform the first operation and the sender of the request to perform the second operation.
  • the flowchart of the resource allocation method of this embodiment is shown in FIG. 5, and includes:
  • Step 501 Receive a request to perform the first operation.
  • Step 502 Determine the resources required to perform the first operation.
  • Step 503 If the resource is already occupied, compare the priority of the operation type of the first operation with the operation type of the second operation occupying the resource.
  • steps 501-503 are similar to steps 301-303 in the third embodiment, and will not be repeated here.
  • the method before determining the resources required to perform the first operation, the method further includes: determining that the request to perform the first operation is allowed. In some cases, before determining the resources required to perform the first operation, determine whether the execution of the first operation is allowed. If it is determined that the request to perform the first operation is allowed, then go to step 503, if the request to perform the first operation is determined If allowed, the entry ends; the specific content is similar to step 202 in the second embodiment, and will not be repeated here.
  • 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, compare the priorities of the sender of the request to perform the first operation and the sender of the request to perform the second operation.
  • Step 505 If the priority of the sender of the request to perform the first operation is higher than the priority of the sender of the request to perform 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 Determine whether to preempt resources and allocate them to the first operation according to the comparison result.
  • steps 504-506 are similar to steps 403-405 in the fourth embodiment, and will not be repeated here.
  • the sixth embodiment of the present application relates to a resource allocation method.
  • the sixth embodiment is roughly the same as the fourth embodiment, and the main difference is: if the priority of the sender of the request to perform the first operation and the priority of the second operation The priority of the sender of the request is the same, and the priority of the operation type of the first operation and the operation type of the second operation are compared.
  • the flowchart of the resource allocation method of this embodiment is shown in FIG. 6, and includes:
  • Step 601 Receive a request to perform the first operation.
  • Step 602 Determine the resources required to perform the first operation.
  • Step 603 If the resource is already occupied, compare the priorities of the sender of the request for performing the first operation and the sender of the request for the second operation of occupying resources.
  • steps 601-603 are similar to steps 401-403 in the fourth embodiment, and will not be repeated here.
  • the method before determining the resources required to perform the first operation, the method further includes: determining that the request to perform the first operation is allowed. In some cases, before determining the resources required to perform the first operation, determine whether the execution of the first operation is allowed. If it is determined that the request to perform the first operation is allowed, then go to step 603, if the request to perform the first operation is determined If allowed, the entry ends; the specific content is similar to step 202 in the second embodiment, and will not be repeated here.
  • Step 604 If the priority of the sender of the request to execute the first operation is the same as the priority of the sender of the request to execute the second operation, compare the priority of the operation type of the first operation with the priority of the second operation.
  • Step 605 If the priority of the operation type of the first operation is higher than the priority of the operation type of the second operation, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
  • Step 606 Determine whether to preempt resources and allocate them to the first operation according to the comparison result.
  • steps 604-606 are similar to steps 303-305 in the third embodiment, and will not be repeated here.
  • 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 priority of the operation type of the operation needs to be compared to determine the first from two perspectives.
  • the priority of the operation and the second operation makes the comparison result more accurate.
  • the seventh embodiment of the present application relates to a resource allocation device, as shown in FIG. 7, including:
  • the receiving module 701 is configured to receive a request to perform the first operation
  • the determining module 702 is configured to determine the resources required to perform the first operation
  • the comparison module 703 is configured to compare the priority of the first operation and the second operation occupying the resource if the resource is already occupied, to obtain a comparison result;
  • the allocation module 704 is configured to determine whether to preempt the resource and allocate it to the first operation according to the comparison result.
  • the comparison module 703 is used to compare the priority of the operation type of the first operation with the priority of the operation type of the second operation occupying resources; if the priority of the operation type of the first operation is higher than the priority of the operation type of the second operation Priority, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
  • the comparison module 703 is used to compare the priority of the sender of the request to perform the first operation and the sender of the request to perform the second operation occupying resources; if the priority of the sender of the request to perform the first operation is higher than The priority of the sender of the request to perform the second operation, and the comparison result is that the priority of the first operation is higher than the priority of the second operation.
  • the comparison module 703 is also used to compare the priority of the sender of the request to perform the first operation and the sender of the request to perform the second operation; if the priority of the sender of the request to perform the first operation is higher than the priority of the request to perform the second operation.
  • the priority of the sender the comparison result is that the priority of the first operation is higher than the priority of the second operation.
  • the comparison module 703 is also used to compare the priority of the operation type of the first operation and the priority of the second operation; if the priority of the operation type of the first operation is higher than the priority of the second operation The priority of the operation type of the operation, and the comparison result is that the priority of the first operation is higher than the priority of the second operation.
  • the method before determining the resources required to perform the first operation, the method includes: the determining module 702 is further configured to determine that the request to perform the first operation is allowed.
  • determining whether to preempt resources and assign them to the first operation according to the comparison result includes: if the comparison result is that the priority of the first operation is higher than the priority of the second operation, preempt the resources and allocate them to the first operation. operate.
  • this embodiment is a device embodiment corresponding to the first or second or third or fourth or fifth or sixth embodiment.
  • This embodiment can be compared with the first or second or third or third
  • the fourth or fifth or sixth embodiment is implemented in cooperation with each other.
  • 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 in order to reduce repetition, they will not be repeated here.
  • the related technical details mentioned in this embodiment can also be applied to the first or second or third or fourth or fifth or sixth embodiment.
  • modules involved in this embodiment are all logical modules.
  • a logical unit can be a physical unit, a part of a physical unit, or multiple physical units. The combination of units is realized.
  • this embodiment does not introduce a unit that is not closely related to solving the technical problem proposed by the present invention, but this does not indicate that there are no other units in this embodiment.
  • the functional modules/units in all or some of the above devices include a non-transitory machine-readable storage medium that stores logic that can be used to perform at least a part of the following functions, for example: a storage module, an acquisition module, a trigger module, and Delete modules, etc.
  • Logic may include instructions, data, and/or codes. If these instructions, data, and/or codes are executed by a machine, the machine can perform the methods, processes, and/or operations described herein.
  • the machine can include, for example, any suitable processing platform, computing platform, computing device, processing device, computing system, processing system, computer, processor, etc., and can be implemented using any appropriate combination of hardware, software, firmware, etc. .
  • Logic may include or may be implemented as: software, software modules, applications, programs, subroutines, instructions, instruction sets, calculation codes, words, values, symbols, etc.
  • These instructions may include any suitable type of code, for example, source code, compiled code, interpreted code, executable code, static code, dynamic code, and so on.
  • These instructions can be implemented according to a predetermined computer language, manner, or grammar to instruct the processor to perform a certain function.
  • These instructions can be implemented using any suitable high-level, low-level, object-oriented, visual, compiled and/or interpreted programming language, for example, C, C++, Java, BASIC, Matlab, Pascal, Visual BASIC, assembly Language, machine code, etc.
  • the eighth embodiment of the present invention relates to a server. As shown in FIG. 8, it includes: at least one processor 801; and a memory 802 communicatively connected with the at least one processor 801; The instructions executed by the processor 801 are executed by the at least one processor 801, so that the at least one processor 801 can execute the foregoing resource allocation method.
  • the memory and the processor are connected in a bus mode
  • the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors and various circuits of the memory together.
  • the bus can also connect various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are all known in the art, and therefore, will not be further described herein.
  • the bus interface provides an interface between the bus and the transceiver.
  • the transceiver may be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on the transmission medium.
  • the data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor.
  • the processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions.
  • the memory can be used to store data used by the processor when performing operations.
  • the ninth embodiment of the present invention relates to a computer-readable storage medium storing a computer program.
  • the computer-readable storage medium includes transient or non-transitory, removable or Non-removable media.
  • the program is stored in a storage medium and includes several instructions to enable a device ( It may be a single-chip microcomputer, a chip, etc.) or a processor (processor) that executes all or part of the steps of the methods described in the embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)
  • Hardware Redundancy (AREA)

Abstract

本申请实施例公开一种资源分配方法、装置、服务器及存储介质,属于通信领域。方法包括:接收执行第一操作的请求;确定执行所述第一操作所需的资源;若所述资源已被占用,比较所述第一操作和占用所述资源的第二操作的优先级,得到比较结果;根据所述比较结果,确定是否抢占所述资源并分配给所述第一操作。

Description

资源分配方法、装置、服务器及存储介质
相关申请的交叉引用
本申请基于申请号为202010582880.3、申请日为2020年6月23日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以引入方式并入本申请。
技术领域
本申请实施例涉及通信领域,特别涉及一种资源分配方法、装置、服务器及存储介质。
背景技术
随着计算机技术的发展,远程管理已经成为提高工作效率的有力手段。远程管理是指网管服务器通过远程管理协议对终端进行管理,实现获取终端的运行状态、修改终端的参数、对终端进行远程控制、对终端进行远程诊断以及对终端的固件进行升级等功能。
然而,当多个网管服务器同时对终端进行远程操作,且操作之间存在资源冲突时,可能会出现无法正确执行网管服务器请求的相应操作的问题。
发明内容
本申请实施例的目的在于提供一种资源分配方法、装置、服务器及存储介质,可以有效避免资源冲突,从而正确执行相应的操作。
本申请实施例提供了一种资源分配方法,包括:接收执行第一操作的请求;确定执行所述第一操作所需的资源;若所述资源已被占用,比较所述第一操作和占用所述资源的第二操作的优先级,得到比较结果;根据所述比较结果,确定是否抢占所述资源并分配给所述第一操作。
本申请实施例还提供了一种资源分配装置,包括:接收模块,用于接收执行第一操作的请求,确定模块,确定执行所述第一操作所需的资源;比较模块,用于若所述资源已被占用,比较所述第一操作和占用所述资源的第二操作的优先级,得到比较结果;分配模块,用于根据所述比较结果,确定是否抢占所述资源并分配给所述第一操作。
本申请实施例还提供了一种服务器,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述所述的资源分配方法。
本申请实施例还提供了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时实现上述所述的资源分配方法。
附图说明
图1是本申请第一实施例中的资源分配方法的流程图;
图2是本申请第二实施例中的资源分配方法的流程图;
图3是本申请第三实施例中的资源分配方法的流程图;
图4是本申请第四实施例中的资源分配方法的流程图;
图5是本申请第五实施例中的资源分配方法的流程图;
图6是本申请第六实施例中的资源分配方法的流程图;
图7是本申请第七实施例中的资源分配装置的结构示意图;
图8是本申请第八实施例中的服务器的结构示意图。
具体实施方式
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施例进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施例中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施例的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本发明的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。
本申请第一实施例涉及一种资源分配方法,应用于接收端,例如:服务器、手机、或电脑等终端。本实施例及以下各实施例以接收端为终端为例进行说明,然不以此为限。
本实施例的资源分配方法的流程如图1所示,包括:
步骤101,接收执行第一操作的请求。
在一些情形中,当发送端需要对终端进行远程管理时,发送端向终端发送执行操作的请求;其中,发送端包括网管模块,用于共同管理终端,网管模块可以处于不同的设备中,也可以处于同一个设备中。终端可以实时检测是否收到请求,也可以按照预设周期检测是否收到请求,预设周期可以根据实际需要进行设定,本实施例不做具体限定。
步骤102,确定执行第一操作所需的资源。
在一个例子中,若终端检测出接收到发送端发送的执行第一操作的请求,可以根据预先存储的操作与资源的对应关系,确定执行第一操作所需的资源。在一个例子中,也可以根据操作的类型确定执行操作所需的资源,从而确定执行第一操作所需的资源。
步骤103,若资源已被占用,比较第一操作和占用资源的第二操作的优先级,得到比较结果。
在一些情形中,终端若未检测到其他操作正在使用所需的资源,表明资源未被占用,则利用资源执行第一操作;或者;终端检测到存在第二操作正在使用所需的资源,但是同时执行第一操作和第二操作时不会出现资源不足,表明资源未被占用,则利用剩余的资源执行第一操作。终端若检测到存在第二操作正在使用所需的资源,且同时执行第一操作和第二操作时会出现资源不足,表明资源已被占用,在本实施例中,可以根据第一操作和第二操作对于 资源需求的大小,确定第一操作和第二操作的优先级,操作对于资源的需求越大,表明操作的优先级越高。其中,占用资源的操作可以包括一个第二操作,也可以包括多个第二操作;若包括一个第二操作,比较第一操作和这一个第二操作的优先级;若包括多个第二操作,分别比较第一操作和多个第二操作的优先级。例如:若第一操作为A,占用资源的操作包括一个第二操作B,则比较第一操作A和第二操作B的优先级;若占用资源的操作包括多个第二操作B1、B2,分别比较A和B1、A和B2的优先级。本实施例及以下各实施例以占用资源的操作包括一个第二操作为例进行说明,然不以此为限。
步骤104,根据比较结果,确定是否抢占资源并分配给第一操作。
在一个例子中,若比较结果为第一操作的优先级高于第二操作的优先级,抢占资源并分配给第一操作。此时终端还可以向发送端反馈执行第一操作成功的消息。若比较结果为第一操作的优先级低于第二操作的优先级,或者,若比较结果为第一操作的优先级和第二操作的优先级相同,不抢占资源,将资源继续用于执行第二操作。此时终端还可以向发送端反馈执行第一操作失败的消息,消息中还可以携带失败的原因是第一操作的优先级低于第二操作的优先级,或第一操作的优先级和第二操作的优先级相同。
在一个例子中,若比较结果为第一操作的优先级高于第二操作的优先级,或者,若比较结果为第一操作的优先级和第二操作的优先级相同,抢占资源并分配给第一操作。若比较结果为第一操作的优先级低于第二操作的优先级,不抢占资源,将资源继续用于执行第二操作,并向发送端反馈执行第一操作失败的消息,消息中还可以携带失败的原因是第一操作的优先级低于第二操作的优先级。
本实施例中,终端接收执行第一操作的请求,并确定执行第一操作所需的资源;若资源已被占用,比较第一操作和占用资源的第二操作的优先级,得到比较结果,根据比较结果可以确定是否抢占资源并分配给第一操作,这样可以对资源进行合理的分配,有效避免了资源冲突而造成的无法正确执行相应操作的问题,即有效避免资源冲突,从而正确执行相应的操作。
本申请的第二实施例涉及一种资源分配方法,第二实施例与第一实施例大致相同,主要区别之处在于:在确定执行第一操作所需的资源之前,还需要确定执行第一操作的请求被允许。本实施例的资源分配方法的流程图如图2所示,包括:
步骤201,接收执行第一操作的请求。
其中,步骤201与第一实施例中的步骤101类似,在此不再赘述。
步骤202,确定执行第一操作的请求被允许。
在一个例子中,终端内预先存储有不同发送端的发送端角色属性表,发送端角色属性表中包括操作类型和请求是否被允许的对应关系。所以,终端接收到发送端发送的执行第一操作的请求后,终端查询该发送端的发送端角色属性表,可以通过遍历的方式查找,直到查找到执行第一操作的请求是否被允许,若确定执行第一操作的请求被允许,则进入步骤203,若确定执行第一操作的请求不被允许,则进入结束。此时终端还可以向发送端反馈执行第一 操作失败的消息,消息中还可以携带失败的原因是执行第一操作的请求不被允许。
在一个例子中,终端通过终端内部的网管客户端负责接收和响应发送端发送的请求,且网管服务器和发送端存在一一对应关系,终端内预先存储有不同网管客户端的网管客户端角色属性表,网管客户端角色属性表中包括操作类型和请求是否被允许的对应关系。所以,终端在通过网管客户端接收到发送端发送的执行第一操作的请求后,终端查询该网管客户端的网管客户端角色属性表,可以通过遍历的方式查找,直到查找到执行第一操作是否被允许。例如,终端内预先存储的与第一操作的发送端对应的网管客户端的网管客户端角色属性表如下所示:
Figure PCTCN2021100377-appb-000001
其中,支持表示请求被允许,不支持表示请求不被允许。若第一操作为读取参数1,确定执行第一操作的请求被允许;若第一操作为读取参数2,确定执行第一操作的请求不被允许。
步骤203,确定执行第一操作所需的资源。
步骤204,若资源已被占用,比较第一操作和占用资源的第二操作的优先级,得到比较结果。
步骤205,根据比较结果,确定是否抢占资源并分配给第一操作。
其中,步骤203-205与第一实施例中的步骤102-104类似,在此不再赘述。
本实施例中,只有在确定执行第一操作的请求被允许时,才进行确定所需的资源以及确定是否抢占资源,这样可以避免抢占的资源可能因为请求不被允许而无法被使用的情况,减轻工作负担。
本申请的第三实施例涉及一种资源分配方法,第三实施例与第一实施例大致相同,主要区别之处在于:给出了比较第一操作和占用资源的第二操作的优先级的实施方式。本实施例的资源分配方法的流程图如图3所示,包括:
步骤301,接收执行第一操作的请求。
步骤302,确定执行第一操作所需的资源。
其中,步骤301-302与第一实施例中的步骤101-102类似,在此不再赘述。
在一个例子中,在确定执行第一操作所需的资源之前,还包括:确定执行第一操作的请求被允许。在一些情形中,在确定执行第一操作所需的资源之前,判断执行第一操作是否被允许,若确定执行第一操作的请求被允许,则进入步骤303,若确定执行第一操作的请求被允许,则进入结束;具体内容与第二实施例中的步骤202类似,在此不再赘述。
步骤303,若资源已被占用,比较第一操作的操作类型和占用资源的第二操作的操作类型的优先级。
步骤304,若第一操作的操作类型的优先级高于第二操作的操作类型的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
在一个例子中,操作的操作类型包括但不限于以下几类:读取参数、配置参数、远程控制、诊断和升级等。本实施例中,终端内预先存储有远程操作等级表,远程操作等级表中包括操作类型和等级数值的对应关系,且远程操作等级表中的等级数值越大,表明操作类型的优先级越高。所以,终端可以查询远程操作等级表,可以通过遍历的方式查找,直到查找到第一操作的操作类型的等级数值和第二操作的操作类型的等级数值,从而比较出第一操作的操作类型和第二操作的操作类型的优先级。
若第一操作的操作类型的优先级高于第二操作的操作类型的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级;若第一操作的操作类型的优先级低于第二操作的操作类型的优先级,得到比较结果为第一操作的优先级低于第二操作的优先级;若第一操作的操作类型的优先级和第二操作的操作类型的优先级相同,得到比较结果为第一操作的优先级和第二操作的优先级相同。
例如,终端内预先存储的远程操作等级表如下所示:
Figure PCTCN2021100377-appb-000002
若第一操作的操作类型为读取参数,第二操作的操作类型为配置参数,查询远程操作等级表可以确定第一操作的操作类型的等级数值为1,第二操作的操作类型的等级数值为2,从而比较出第一操作的操作类型低于第二操作的操作类型的优先级,得到比较结果为第一操作的优先级低于第二操作的优先级。若第一操作的操作类型为配置参数,第二操作的操作类型为读取参数,查询远程操作等级表可以确定第一操作的操作类型的等级数值为2,第二操作的操作类型的等级数值为1,从而比较出第一操作的操作类型高于第二操作的操作类型的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
在一个例子中,操作类型还可以根据内容的不同再次进行分类,例如:读取参数可以根据参数的不同分为读取参数1,…,读取参数n;配置参数可以根据参数的不同分为配置参数1,…,配置参数n;远程控制可以根据控制内容的不同分为远程控制1,…,远程控制n;远程诊断可以根据诊断内容的不同分为远程诊断1,…,远程诊断n;升级可以按照升级的内容不同分为升级1,…,升级n等。当第一操作和第二操作的操作类型相同时,还可以根据具体的内容确定第一操作和第二操作的优先级。
例如:终端内预先存储的远程控制操作等级表如下所示:
远程控制1:等级2(1)
远程控制2:等级2(3)
其中,远程控制根据控制内容的不同分为远程控制1和远程控制2,若第一操作和第二操作的操作类型均为远程控制时,可以再查询远程控制等级表确定第一操作和第二操作的优先级。若第一操作为远程控制1,第二操作为远程控制2,查询远程控制操作等级表可以确定远程控制1的等级数值为2(1),远程控制2的等级数值为2(3),从而比较出远程控制1的优先级低于远程控制2的优先级,得到比较结果为第一操作的优先级低于第二操作的优先级。
步骤305,根据比较结果,确定是否抢占资源并分配给第一操作。
其中,步骤305与第一实施例中的步骤103类似,在此不再赘述。
本实施例中,通过比较操作的操作类型的优先级,可以较快的比较出第一操作和第二操作的优先级,即较快的得到比较结果。
本申请的第四实施例涉及一种资源分配方法,第四实施例与第一实施例大致相同,主要区别之处在于:给出了比较第一操作和占用资源的第二操作的优先级的实施方式。本实施例的资源分配方法的流程图如图4所示,包括:
步骤401,接收执行第一操作的请求。
步骤402,确定执行第一操作所需的资源。
其中,步骤401-402与第一实施例中的步骤101-102类似,在此不再赘述。
在一个例子中,在确定执行第一操作所需的资源之前,还包括:确定执行第一操作的请求被允许。在一些情形中,在确定执行第一操作所需的资源之前,判断执行第一操作是否被允许,若确定执行第一操作的请求被允许,则进入步骤403,若确定执行第一操作的请求被允许,则进入结束;具体内容与第二实施例中的步骤202类似,在此不再赘述。
步骤403,若资源已被占用,比较执行第一操作的请求的发送端和执行占用资源的第二操作的请求的发送端的优先级。
步骤404,若执行第一操作的请求的发送端的优先级高于执行第二操作的请求的发送端的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
在一个例子中,终端内预先存储有发送端角色等级表,发送端角色等级表中包括发送端和等级数值的对应关系,且发送端等级表的等级数值越大,表明发送端的优先级越高。所以,终端可以查询发送端角色等级表,可以通过遍历的方式查找,直到查找到执行第一操作的请求的发送端和执行第二操作的请求的发送端的等级数值,从而比较出执行第一操作的请求的发送端和执行第二操作的请求的发送端的优先级。
在一个例子中,终端通过终端内部的网管客户端负责接收和响应发送端发送的请求,且网管服务器和发送端存在一一对应关系,终端内预先存储有网管客户端角色等级表,网管客户端角色等级表中包括网管客户端和等级数值的对应关系,且网管客户端角色等级表中的等级数值越大,表明网管客户端的优先级越高;由于网管客户端和发送端存在一一对应关系,所以网管客户端的优先级即为发送端的优先级。所以,终端可以查询网管客户端角色等级表,可以通过遍历的方式查找,直到查找到接收执行第一操作的请求的网管客户端的等级数值和接收执行第二操作的请求的网管客户端的等级数值,从而比较出接收执行第一操作的请求的网管客户端和接收执行第二操作的请求的网管客户端的优先级,即比较出执行第一操作的请求的发送端和执行第二操作的请求的发送端的优先级。
若执行第一操作的请求的发送端的优先级高于执行第二操作的请求的发送端的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级;若执行第一操作的请求的发送端 的优先级低于执行第二操作的请求的发送端的优先级,得到比较结果为第一操作的优先级低于第二操作的优先级;若执行第一操作的请求的发送端的优先级和执行第二操作的请求的发送端的优先级相同,得到比较结果为第一操作的优先级和第二操作的优先级相同。
例如,终端内预先存储的网管客户端角色等级表如下所示:
Figure PCTCN2021100377-appb-000003
若发送端1将执行第一操作的请求发送给网管客户端1,发送端2将执行第二操作的请求发送给网管客户端2,查询网管客户端角色等级表,可以确定网管客户端1的等级数值为1,网管客户端2的等级数值为1,从而比较出网管客户端1和网管客户端2的优先级相同,即比较出发送端1的优先级和发送端2的优先级相同,得到比较结果为第一操作的优先级和第二操作的优先级相同。若发送端1将执行第一操作的请求发送给网管客户端3,发送端2将执行第二操作的请求发送给网管客户端2,查询网管客户端角色等级表,可以确定网管客户端3的等级数值为2,网管客户端2的等级数值为1,从而比较出网管客户端3和网管客户端2的优先级相同,即比较出发送端1的优先级高于发送端2的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
步骤405,根据比较结果,确定是否抢占资源并分配给第一操作。
其中,步骤405与第一实施例中的步骤103类似,在此不再赘述。
本实施例中,通过比较执行操作的请求的发送端的优先级,可以较快的确定出第一操作和第二操作的优先级,即较快的得到比较结果。
本申请的第五实施例涉及一种资源分配方法,第五实施例与第三实施例大致相同,主要区别之处在于:若第一操作的操作类型的优先级和第二操作的操作类型的优先级相同,还需要比较执行第一操作的请求的发送端和执行第二操作的请求的发送端的优先级。本实施例的资源分配方法的流程图如图5所示,包括:
步骤501,接收执行第一操作的请求。
步骤502,确定执行第一操作所需的资源。
步骤503,若资源已被占用,比较第一操作的操作类型和占用资源的第二操作的操作类 型的优先级。
其中,步骤501-503与第三实施例中的步骤301-303类似,在此不再赘述。
在一个例子中,在确定执行第一操作所需的资源之前,还包括:确定执行第一操作的请求被允许。在一些情形中,在确定执行第一操作所需的资源之前,判断执行第一操作是否被允许,若确定执行第一操作的请求被允许,则进入步骤503,若确定执行第一操作的请求被允许,则进入结束;具体内容与第二实施例中的步骤202类似,在此不再赘述。
步骤504,若第一操作的操作类型的优先级和第二操作的操作类型的优先级相同,比较执行第一操作的请求的发送端和执行第二操作的请求的发送端的优先级。
步骤505,若执行第一操作的请求的发送端的优先级高于执行第二操作的请求的发送端的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
步骤506,根据比较结果,确定是否抢占资源并分配给第一操作。
其中,步骤504-506与第四实施例中的步骤403-405类似,在此不再赘述。
本实施例中,当第一操作的操作类型的优先级和第二操作的操作类型的优先级相同时,还需要比较执行操作的请求的发送端的优先级,从两个角度比较第一操作和第二操作的优先级,使得到的比较结果更加准确。
本申请的第六实施例涉及一种资源分配方法,第六实施例与第四实施例大致相同,主要区别之处在于:若执行第一操作的请求的发送端的优先级和执行第二操作的请求的发送端的优先级相同,比较第一操作的操作类型和第二操作的操作类型的优先级。本实施例的资源分配方法的流程图如图6所示,包括:
步骤601,接收执行第一操作的请求。
步骤602,确定执行第一操作所需的资源。
步骤603,若资源已被占用,比较执行第一操作的请求的发送端和执行占用资源的第二操作的请求的发送端的优先级。
其中,步骤601-603与第四实施例中的步骤401-403类似,在此不再赘述。
在一个例子中,在确定执行第一操作所需的资源之前,还包括:确定执行第一操作的请求被允许。在一些情形中,在确定执行第一操作所需的资源之前,判断执行第一操作是否被允许,若确定执行第一操作的请求被允许,则进入步骤603,若确定执行第一操作的请求被允许,则进入结束;具体内容与第二实施例中的步骤202类似,在此不再赘述。
步骤604,若执行第一操作的请求的发送端的优先级和执行第二操作的请求的发送端的优先级相同,比较第一操作的操作类型和第二操作的操作类型的优先级。
步骤605,若第一操作的操作类型的优先级高于第二操作的操作类型的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
步骤606,根据比较结果,确定是否抢占资源并分配给第一操作。
其中,步骤604-606与第三实施例中的步骤303-305类似,在此不再赘述。
本实施例中,当执行第一操作的请求的发送端的优先级和执行第二操作的请求的发送端的优先级相同时,还需要比较操作的操作类型的优先级,从两个角度确定第一操作和第二操作的优先级,使得到的比较结果更加准确。
本申请的第七实施例涉及一种资源分配装置,如图7所示,包括:
接收模块701,用于接收执行第一操作的请求;
确定模块702,用于确定执行第一操作所需的资源;
比较模块703,用于若资源已被占用,比较第一操作和占用资源的第二操作的优先级,得到比较结果;
分配模块704,用于根据比较结果,确定是否抢占所述资源并分配给第一操作。
在一个例子中,比较模块703用于比较第一操作的操作类型和占用资源的第二操作的操作类型的优先级;若第一操作的操作类型的优先级高于第二操作的操作类型的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
在一个例子中,比较模块703用于比较执行第一操作的请求的发送端和执行占用资源的第二操作的请求的发送端的优先级;若执行第一操作的请求的发送端的优先级高于执行第二操作的请求的发送端的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
在一个例子中,在比较第一操作的操作类型和占用资源的第二操作的操作类型的优先级之后,若第一操作的操作类型的优先级和第二操作的操作类型的优先级相同,比较模块703还用于比较执行第一操作的请求的发送端和执行第二操作的请求的发送端的优先级;若执行第一操作的请求的发送端的优先级高于执行第二操作的请求的发送端的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
在一个例子中,在比较执行第一操作的请求的发送端和执行占用资源的第二操作的请求的发送端的优先级之后,还包括:若执行第一操作的请求的发送端的优先级和执行第二操作的请求的发送端的优先级相同,比较模块703还用于比较第一操作的操作类型和第二操作的操作类型的优先级;若第一操作的操作类型的优先级高于第二操作的操作类型的优先级,得到比较结果为第一操作的优先级高于第二操作的优先级。
在一个例子中,在确定执行第一操作所需的资源之前,包括:确定模块702还用于确定执行第一操作的请求被允许。
在一个例子中,根据比较结果,确定是否抢占资源并分配给所述第一操作,包括:若比较结果为第一操作的优先级高于第二操作的优先级,抢占资源并分配给第一操作。
不难发现,本实施例为与第一或第二或第三或第四或第五或第六实施例相对应的装置实施例,本实施例可与第一或第二或第三或第四或第五或第六实施例互相配合实施。第一或第二或第三或第四或第五或第六实施例中提到的相关技术细节在本实施例中依然有效,为了减少重复,这里不再赘述。相应地,本实施例中提到的相关技术细节也可应用在第一或第二或 第三或第四或第五或第六实施例中。
值得一提的是,本实施例中所涉及到的各模块均为逻辑模块,在实际应用中,一个逻辑单元可以是一个物理单元,也可以是一个物理单元的一部分,还可以以多个物理单元的组合实现。此外,为了突出本发明的创新部分,本实施例中并没有将与解决本发明所提出的技术问题关系不太密切的单元引入,但这并不表明本实施例中不存在其它的单元。
本领域的技术人员应该明白,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件(可以用计算装置可执行的计算机程序代码来实现)、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。
上文中的全部或某些装置中的功能模块/单元包括储存逻辑非暂态机器可读存储介质,该逻辑可用于例如执行如下各项的功能的至少一部分:存储模块、获取模块、触发模块和删除模块等。逻辑可包括指令、数据和/或代码,如果这些指令、数据和/或代码被机器执行,则可以使得机器执行本文所述的方法、处理和/或操作。该机器可包括:例如,任意适当的处理平台、计算平台、计算装置、处理装置、计算系统、处理系统、计算机、处理器等,并且可使用硬件、软件、固件等的任意适当的组合来实施。逻辑可包括或可被实施为:软件、软件模块、应用、程序、子程序、指令、指令集、计算代码、词、值、符号等。这些指令可包括任意合适类型的代码,例如,源代码、编译代码、解译代码、可执行代码、静态代码、动态代码等。这些指令可根据预定的计算机语言、方式或语法来实现,以指导处理器执行某一功能。这些指令可使用任意合适的高级、低级、面向对象的、可视的、编译的和/或解译的编程语言来实现,例如,C、C++、Java、BASIC、Matlab、Pascal、Visual BASIC、汇编语言、机器代码等等。
本发明第八实施例涉及一种服务器,如图8所示,包括:至少一个处理器801;以及,与至少一个处理器801通信连接的存储器802;其中,存储器802存储有可被至少一个处理器801执行的指令,指令被至少一个处理器801执行,以使至少一个处理器801能够执行上述的资源分配方法。
其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器。
处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的 数据。
本发明第九实施例涉及一种计算机可读存储介质,存储有计算机程序。计算机程序被处理器执行时实现上述方法实施例。该计算机可读存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、计算机程序模块或其他数据)的任何方法或技术中实施的暂态性或非暂态性、可移除或不可移除的介质。
即,本领域技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
本领域的普通技术人员可以理解,上述各实施例是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。

Claims (15)

  1. 一种资源分配方法,其中,包括:
    接收执行第一操作的请求;
    确定执行所述第一操作所需的资源;
    若所述资源已被占用,比较所述第一操作和占用所述资源的第二操作的优先级,得到比较结果;
    根据所述比较结果,确定是否抢占所述资源并分配给所述第一操作。
  2. 根据权利要求1所述的资源分配方法,其中,所述比较所述第一操作和占用所述资源的第二操作的优先级,得到比较结果,包括:
    比较所述第一操作的操作类型和占用所述资源的第二操作的操作类型的优先级;
    若所述第一操作的操作类型的优先级高于所述第二操作的操作类型的优先级,得到比较结果为所述第一操作的优先级高于所述第二操作的优先级。
  3. 根据权利要求2所述的资源分配方法,其中,所述操作类型包括读取参数、配置参数、远程控制、诊断和升级中的至少一种;其中,所述比较所述第一操作的操作类型和占用所述资源的第二操作的操作类型的优先级包括:
    通过遍历的方式查询预先存储的操作类型等级表,直到查找到第一操作的操作类型的等级数值和第二操作的操作类型的等级数值,从而比较出第一操作的操作类型和第二操作的操作类型的优先级;其中所述操作类型等级表包括操作类型和等级数值的对应关系。
  4. 根据权利要求1所述的资源分配方法,其中,所述比较所述第一操作和占用所述资源的第二操作的优先级,得到比较结果,包括:
    比较执行所述第一操作的请求的发送端和执行占用所述资源的第二操作的请求的发送端的优先级;
    若执行所述第一操作的请求的发送端的优先级高于执行所述第二操作的请求的发送端的优先级,得到比较结果为所述第一操作的优先级高于所述第二操作的优先级。
  5. 根据权利要求4所述的资源分配方法,其中,所述比较执行所述第一操作的请求的发送端和执行占用所述资源的第二操作的请求的发送端的优先级包括:通过遍历的方式查询发送端角色等级表,直到查找到执行第一操作的请求的发送端和执行第二操作的请求的发送端的等级数值,从而比较出执行第一操作的请求的发送端和执行第二操作的请求的发送端的优先级;其中所述发送端角色等级表包括发送端和等级数值的对应关系。
  6. 根据权利要求4所述的资源分配方法,其中,所述比较执行所述第一操作的请求的发送端和执行占用所述资源的第二操作的请求的发送端的优先级包括:通过遍历的方式查询网管客户端角色等级表,直到查找到接收执行第一操作的请求的网管客户端的等级数值和接收执行第二操作的请求的网管客户端的等级数值,从而比较出接收执行第一操作的请求的网管 客户端和接收执行第二操作的请求的网管客户端的优先级;其中所述网管客户端角色等级表中包括网管客户端和等级数值的对应关系。
  7. 根据权利要求2所述的资源分配方法,其中,在所述比较所述第一操作的操作类型和占用所述资源的第二操作的操作类型的优先级之后,还包括:
    若所述第一操作的操作类型的优先级和所述第二操作的操作类型的优先级相同,比较执行所述第一操作的请求的发送端和执行所述第二操作的请求的发送端的优先级;
    若执行所述第一操作的请求的发送端的优先级高于执行所述第二操作的请求的发送端的优先级,得到比较结果为所述第一操作的优先级高于所述第二操作的优先级。
  8. 根据权利要求4所述的资源分配方法,其中,在所述比较执行所述第一操作的请求的发送端和执行占用所述资源的第二操作的请求的发送端的优先级之后,还包括:
    若执行所述第一操作的请求的发送端的优先级和执行所述第二操作的请求的发送端的优先级相同,比较所述第一操作的操作类型和所述第二操作的操作类型的优先级;
    若所述第一操作的操作类型的优先级高于所述第二操作的操作类型的优先级,得到比较结果为所述第一操作的优先级高于所述第二操作的优先级。
  9. 根据权利要求1-8任一所述的资源分配方法,其中,在所述确定执行所述第一操作所需的资源之前,包括:
    确定执行所述第一操作的请求被允许。
  10. 根据权利要求9所述的资源分配方法,其中,所述确定执行所述第一操作的请求被允许包括:
    通过遍历的方式查找预先存储的发送端角色属性表,直到查找到执行第一操作的请求是否被允许;其中,所述发送端角色属性表中包括操作类型和请求是否被允许的对应关系。
  11. 根据权利要求9所述的资源分配方法,其中,所述确定执行所述第一操作的请求被允许包括:
    通过遍历的方式查找预先存储的网管客户端角色属性表,直到查找到执行第一操作的请求是否被允许;其中所述网管客户端角色属性表中包括操作类型和请求是否被允许的对应关系。
  12. 根据权利要求1-11任一所述的资源分配方法,其中,所述根据所述比较结果,确定是否抢占所述资源并分配给所述第一操作,包括:
    若所述比较结果为所述第一操作的优先级高于所述第二操作的优先级,抢占所述资源并分配给所述第一操作。
  13. 一种资源分配装置,其中,包括:
    接收模块,用于接收执行第一操作的请求,
    确定模块,确定执行所述第一操作所需的资源;
    比较模块,用于若所述资源已被占用,比较所述第一操作和占用所述资源的第二操作的优先级,得到比较结果;
    分配模块,用于根据所述比较结果,确定是否抢占所述资源并分配给所述第一操作。
  14. 一种服务器,其中,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至12中任一项所述的资源分配方法。
  15. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现权利要求1至12中任一项所述的资源分配方法。
PCT/CN2021/100377 2020-06-23 2021-06-16 资源分配方法、装置、服务器及存储介质 WO2021259108A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010582880.3A CN113839890A (zh) 2020-06-23 2020-06-23 资源分配方法、装置、服务器及存储介质
CN202010582880.3 2020-06-23

Publications (1)

Publication Number Publication Date
WO2021259108A1 true WO2021259108A1 (zh) 2021-12-30

Family

ID=78964335

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/100377 WO2021259108A1 (zh) 2020-06-23 2021-06-16 资源分配方法、装置、服务器及存储介质

Country Status (2)

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

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101883436A (zh) * 2010-06-24 2010-11-10 宇龙计算机通信科技(深圳)有限公司 一种资源的并发处理方法、系统及移动终端
CN104581839A (zh) * 2013-10-24 2015-04-29 展讯通信(上海)有限公司 一种信息传输的方法和通信设备
CN110427257A (zh) * 2019-07-29 2019-11-08 招商局金融科技有限公司 多任务调度方法、装置及计算机可读存储介质
CN111050199A (zh) * 2019-11-19 2020-04-21 青岛海信电器股份有限公司 显示设备及显示设备蓝牙通信资源的调度方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101883436A (zh) * 2010-06-24 2010-11-10 宇龙计算机通信科技(深圳)有限公司 一种资源的并发处理方法、系统及移动终端
CN104581839A (zh) * 2013-10-24 2015-04-29 展讯通信(上海)有限公司 一种信息传输的方法和通信设备
CN110427257A (zh) * 2019-07-29 2019-11-08 招商局金融科技有限公司 多任务调度方法、装置及计算机可读存储介质
CN111050199A (zh) * 2019-11-19 2020-04-21 青岛海信电器股份有限公司 显示设备及显示设备蓝牙通信资源的调度方法

Also Published As

Publication number Publication date
CN113839890A (zh) 2021-12-24

Similar Documents

Publication Publication Date Title
CN110908770A (zh) 虚拟机的运行及创建方法、虚拟机及虚拟机化管理平台
CN109495542B (zh) 基于性能监控的负载分配方法及终端设备
CN110196860B (zh) 唯一标识分配方法及装置、电子设备、存储介质
CN108874549B (zh) 资源复用方法、装置、终端和计算机可读存储介质
EP3879875A1 (en) Resource change method and device, apparatus, and storage medium
CN114979286B (zh) 容器服务的访问控制方法、装置、设备及计算机存储介质
CN110069265B (zh) 服务集群的升级方法、装置及存储介质
CN111459676A (zh) 一种节点资源管理方法、装置及存储介质
WO2020135517A1 (zh) 部署虚拟化网络功能的方法和装置
CN109818977B (zh) 一种接入服务器通信优化方法、接入服务器以及通信系统
CN113242170B (zh) 一种地址分配的方法和装置
CN109120680B (zh) 一种控制系统、方法及相关设备
WO2021259108A1 (zh) 资源分配方法、装置、服务器及存储介质
CN109922120B (zh) 提高dns可用性的方法及终端
CN116567094A (zh) 一种基于微服务系统的服务信息处理方法
CN103442041A (zh) 嵌入式设备固件升级的方法、装置及其系统
CN114070889B (zh) 配置方法、流量转发方法、设备、存储介质及程序产品
CN112822299B (zh) 基于rdma的数据传输方法、装置及电子设备
CN113472599B (zh) 网络节点的数据通信方法及系统
CN117519988B (zh) 一种基于raid的内存池动态调配方法、装置
CN111352710A (zh) 进程管理方法及装置、计算设备、存储介质
CN116089020B (zh) 虚拟机运行方法、扩容方法、扩容系统
TWI798807B (zh) 行固網整合ip位址資源管理系統、方法及電腦可讀媒介
CN115514735B (zh) 一种服务器真实ip地址的获取方法、装置和存储介质
CN113992516B (zh) 物联网设备的固件更新方法、装置及物联网

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21829451

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 12.05.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21829451

Country of ref document: EP

Kind code of ref document: A1