Resource allocation method, device, server and storage medium
By receiving and comparing remote operation requests from multiple network management servers to terminals, determining priorities and seizing resources, the problem of resource conflicts is solved and the correct execution of operations and reasonable allocation of resources are ensured.
Patent Information
- Application Number
- CN202010582880.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-23
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-06-23
AI Technical Summary
When multiple network management servers perform remote operations on terminals at the same time, resource conflicts may occur, resulting in the inability to correctly perform the corresponding operations requested by the network management server.
By receiving the request to perform the first operation, determine the required resources. If the resources have been occupied, the priority of the first operation and the second operation of the resource is compared, and decide whether to seize the resources and allocate the first operation based on the comparative results. Essence
Effectively avoid resource conflicts, ensure the correct execution of the corresponding operations, and realize the reasonable distribution of resources.
Smart Images

Figure CN113839890B_ABST
Abstract
Description
Technical Field
[0001] 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. Background Art
[0002] With the development of computer technology, remote management has become a powerful means to improve work efficiency. Remote management refers to the management of terminals by network management servers through remote management protocols, which can obtain the running status of terminals, modify terminal parameters, remotely control terminals, remotely diagnose terminals, and upgrade terminal firmware.
[0003] However, when multiple network management servers perform remote operations on the terminal at the same time and there is a resource conflict between the operations, the problem of not being able to correctly execute the corresponding operations requested by the network management servers may occur. Summary of the invention
[0004] 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 and thus correctly execute corresponding operations.
[0005] To achieve the above-mentioned purpose, an embodiment of the present application provides a resource allocation method, including: receiving a request to perform a first operation; determining the resources required to perform the first operation; if the resources are already occupied, comparing the priority of the first operation with the priority of a second operation occupying the resources to obtain a comparison result; based on the comparison result, determining whether to preempt the resources and allocate them to the first operation.
[0006] To achieve the above-mentioned purpose, an embodiment of the present application also provides a resource allocation device, including: a receiving module, used to receive a request to perform a first operation, and a determining module, used to determine the resources required to perform the first operation; a comparing module, used to compare the priority of the first operation and the second operation occupying the resources if the resources are already occupied, and obtain a comparison result; an allocating module, used to determine whether to preempt the resources and allocate them to the first operation based on the comparison result.
[0007] To achieve the above-mentioned purpose, an embodiment of the present application also provides a server, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the resource allocation method described above.
[0008] To achieve the above objectives, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program implements the resource allocation method described above when executed by a processor.
[0009] Compared with the prior art, the embodiment of the present application receives a request to execute a first operation and determines the resources required to execute the first operation; if the resources are occupied, compares the priority of the first operation and the second operation occupying the resources to obtain a comparison result, and determines whether to preempt the resources and allocate them to the first operation based on the comparison result. In this way, the resources can be reasonably allocated, and the problem of not being able to correctly execute the corresponding operation due to resource conflicts can be effectively avoided, that is, resource conflicts can be effectively avoided, so that the corresponding operation can be correctly executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 is a flow chart of a resource allocation method in the first embodiment of the present application;
[0011] Figure 2 is a flow chart of a resource allocation method in a second embodiment of the present application;
[0012] Figure 3 is a flow chart of a resource allocation method in a third embodiment of the present application;
[0013] Figure 4 is a flowchart of a resource allocation method in a fourth embodiment of the present application;
[0014] Figure 5 is a flowchart of a resource allocation method in a fifth embodiment of the present application;
[0015] Figure 6 is a flowchart of a resource allocation method in a sixth embodiment of the present application;
[0016] Figure 7 is a schematic diagram of the structure of a resource allocation device in the seventh embodiment of the present application;
[0017] Figure 8 It is a schematic diagram of the structure of the server in the eighth embodiment of the present application. DETAILED DESCRIPTION
[0018] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.
[0019] The first embodiment of the present application relates to a resource allocation method, which is applied to a receiving end, such as a server; or a terminal such as a mobile phone, a computer, etc. This embodiment and the following embodiments are described by taking the receiving end as a terminal as an example, but are not limited thereto.
[0020] The specific process of the resource allocation method in this embodiment is as follows: Figure 1 As shown, including:
[0021] Step 101: Receive a request to perform a first operation.
[0022] Specifically, when the sending end needs to remotely manage the terminal, the sending end sends a request to the terminal to perform an operation; wherein the sending end includes a network management module for jointly managing the terminal, and the network management module can be in different devices or 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, and the preset period can be set according to actual needs, and this embodiment does not make specific limitations.
[0023] Step 102: Determine resources required to perform a first operation.
[0024] In one example, if the terminal detects that a request to perform a first operation is received from the sender, the resource required for performing the first operation can be determined based on the pre-stored correspondence between the operation and the resource. In another example, the resource required for performing the operation can also be determined based on the type of operation, thereby determining the resource required for performing the first operation.
[0025] Step 103: If the resource is occupied, compare the priority of the first operation with the priority of the second operation occupying the resource to obtain a comparison result.
[0026] Specifically, if the terminal does not detect that other operations are using the required resources, indicating that the resources are not occupied, the first operation is performed using the resources; or; if the terminal detects that the required resources are being used by the second operation, but there will be no shortage of resources when the first operation and the second operation are performed at the same time, indicating that the resources are not occupied, the first operation is performed using the remaining resources. If the terminal detects that the required resources are being used by the second operation, and there will be insufficient resources when the first operation and the second operation are performed at the same time, indicating that the resources are occupied, in this embodiment, the priority of the first operation and the second operation can be determined according to the size of the resource requirements of the first operation and the second operation. The greater the resource requirements of the operation, the higher the priority of the operation. Among them, the operation occupying resources may include one second operation or multiple second operations; if one second operation is included, the priority of the first operation and the second operation is compared; if multiple second operations are included, the priority of the first operation and the multiple second operations are compared respectively. For example: if the first operation is A, and the operation occupying resources includes one second operation B, the priority of the first operation A and the second operation B are compared; if the operation occupying resources includes multiple second operations B1 and B2, the priority of A and B1, A and B2 are compared respectively. This embodiment and the following embodiments are described by taking the operation of occupying resources including a second operation as an example, but the present invention is not limited thereto.
[0027] Step 104: Determine whether to seize resources and allocate them to the first operation based on the comparison result.
[0028] In one example, if the comparison result is that the priority of the first operation is higher than the priority of the second operation, the resources are seized and allocated to the first operation. At this time, the terminal can also feedback a message to the sending end that the first operation is successfully executed. 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 is the same as the priority of the second operation, the resources are not seized and the resources continue to be used to execute the second operation. At this time, the terminal can also feedback a message to the sending end that the execution of the first operation failed, and the message can also carry the reason for the failure 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.
[0029] In one example, if the comparison result is that the priority of the first operation is higher than the priority of the second operation, or if the comparison result is that the priority of the first operation is the same as the priority of the second operation, the resources are preempted and allocated to the 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 are not preempted, the resources continue to be used to execute the second operation, and a message indicating that the execution of the first operation failed is fed back to the sending end, and the message may also carry the reason for the failure that the priority of the first operation is lower than the priority of the second operation.
[0030] In this embodiment, the terminal receives a request to execute a first operation and determines the resources required to execute the first operation; if the resources are occupied, the priority of the first operation and the second operation occupying the resources are compared to obtain a comparison result. According to the comparison result, it can be determined whether to preempt the resources and allocate them to the first operation. In this way, the resources can be reasonably allocated, and the problem of not being able to correctly execute the corresponding operation due to resource conflicts can be effectively avoided, that is, resource conflicts can be effectively avoided, so that the corresponding operation can be correctly executed.
[0031] The second embodiment of the present application relates to a resource allocation method. The second embodiment is substantially the same as the first embodiment, except that: before determining the resources required to perform the first operation, it is also necessary to determine whether the request to perform the first operation is allowed. The specific flow chart of the resource allocation method of this embodiment is as follows: Figure 2 As shown, including:
[0032] Step 201: Receive a request to perform a first operation.
[0033] Wherein, step 201 is similar to step 101 in the first embodiment and will not be described in detail here.
[0034] Step 202: Determine whether the request to perform the first operation is allowed.
[0035] In one example, the terminal pre-stores a sender role attribute table of different senders, and the sender role attribute table includes a 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, the terminal queries the sender role attribute table of the sender, and can search by traversal until it finds whether the request to perform the first operation is allowed. If it is determined that the request to perform the first operation is allowed, it proceeds to step 203. If it is determined that the request to perform the first operation is not allowed, it ends. At this time, the terminal can also feedback a message to the sender that the first operation failed to be performed, and the message can also carry the reason for the failure that the request to perform the first operation is not allowed.
[0036] In one example, the terminal is responsible for receiving and responding to requests 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 sender. The terminal pre-stores network management client role attribute tables of different network management clients, and 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, and can search by traversal until it finds out whether the execution of the first operation is allowed. For example, 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:
[0037]
[0038] 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.
[0039] Step 203: Determine the resources required to perform the first operation.
[0040] Step 204: If the resource is occupied, compare the priority of the first operation with the priority of the second operation occupying the resource to obtain a comparison result.
[0041] Step 205: Determine whether to seize resources and allocate them to the first operation based on the comparison result.
[0042] Among them, steps 203-205 are similar to steps 102-104 in the first embodiment and are not described in detail here.
[0043] In this embodiment, the required resources and whether to preempt the resources are determined only when it is determined that the request to execute the first operation is allowed. This can avoid the situation where the preempted resources cannot be used because the request is not allowed, thereby reducing the workload.
[0044] The third embodiment of the present application relates to a resource allocation method. The third embodiment is substantially the same as the first embodiment, except that a specific method for comparing the priority of a first operation and a second operation occupying resources is provided. The specific flow chart of the resource allocation method of this embodiment is as follows: Figure 3 As shown, including:
[0045] Step 301: Receive a request to perform a first operation.
[0046] Step 302: Determine resources required to perform a first operation.
[0047] Among them, steps 301-302 are similar to steps 101-102 in the first embodiment and are not described again here.
[0048] In one example, before determining the resources required for performing the first operation, it further includes: determining whether the request for performing the first operation is allowed. Specifically, before determining the resources required for performing the first operation, it is determined whether the first operation is allowed. If it is determined that the request for performing the first operation is allowed, the process proceeds to step 303. If it is determined that the request for performing the first operation is allowed, the process ends. The specific content is similar to step 202 in the second embodiment and will not be repeated here.
[0049] Step 303: If the resource is occupied, compare the priority of the operation type of the first operation and the operation type of the second operation occupying the resource.
[0050] 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.
[0051] In one example, the operation types of the operation include but are not limited to the following categories: reading parameters, configuring parameters, remote control, diagnosis and upgrading, etc. In this embodiment, a remote operation level table is pre-stored in the terminal, and the remote operation level table includes the correspondence between the operation type and the level value, and 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 can search by traversing until the level value of the operation type of the first operation and the level value of the operation type of the second operation are found, thereby comparing the priority of the operation type of the first operation and the operation type of the second operation.
[0052] 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; if the priority of the operation type of the first operation is lower than the priority of the operation type of the second operation, 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 is the same as the priority of the operation type of the second operation, the comparison result is that the priority of the first operation is the same as the priority of the second operation.
[0053] For example, the remote operation level table pre-stored in the terminal is as follows:
[0054]
[0055] If the operation type of the first operation is reading parameters and the operation type of the second operation is configuring parameters, querying the remote operation level table can 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 is 2, thereby comparing the priority of the operation type of the first operation 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 operation type of the first operation is configuring parameters and the operation type of the second operation is reading parameters, querying the remote operation level table can 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 is 1, thereby comparing the priority of the operation type of the first operation is higher than the priority of the operation type 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.
[0056] In one example, the operation type can be further classified according to the different contents, for example: reading parameters can be divided into reading parameters 1, ..., reading parameters n according to the different parameters; configuring parameters can be divided into configuring parameters 1, ..., configuring parameters n according to the different parameters; remote control can be divided into remote control 1, ..., remote control n according to the different control contents; remote diagnosis can be divided into remote diagnosis 1, ..., remote diagnosis n according to the different diagnosis contents; upgrading can be divided into upgrading 1, ..., upgrading n according to the different upgraded contents, etc. When the operation types of the first operation and the second operation are the same, the priority of the first operation and the second operation can also be determined according to the specific contents.
[0057] For example: The remote control operation level table pre-stored in the terminal is as follows:
[0058] Remote Control 1: Level 2 (1) Remote Control 2: Level 2(3)
[0059] Among them, remote control is divided into remote control 1 and remote control 2 according to different control contents. If the operation types of the first operation and the second operation are both remote control, the remote control level table can be queried to determine the priority of the first operation and the second operation. If the first operation is remote control 1 and the second operation is remote control 2, the remote control operation level table can be queried to determine that the level value of remote control 1 is 2(1) and the level value of remote control 2 is 2(3), thereby comparing that the priority of remote control 1 is lower than that of remote control 2, and the comparison result is that the priority of the first operation is lower than that of the second operation.
[0060] Step 305: Determine whether to seize resources and allocate them to the first operation based on the comparison result.
[0061] Wherein, step 305 is similar to step 103 in the first embodiment and will not be described in detail here.
[0062] 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 more quickly, that is, the comparison result can be obtained more quickly.
[0063] The fourth embodiment of the present application relates to a resource allocation method. The fourth embodiment is substantially the same as the first embodiment, except that a specific method for comparing the priority of a first operation and a second operation occupying resources is provided. The specific flow chart of the resource allocation method of this embodiment is as follows: Figure 4 As shown, including:
[0064] Step 401: Receive a request to perform a first operation.
[0065] Step 402: Determine resources required to perform a first operation.
[0066] Among them, steps 401-402 are similar to steps 101-102 in the first embodiment and are not described again here.
[0067] In one example, before determining the resources required for performing the first operation, it further includes: determining whether the request for performing the first operation is allowed. Specifically, before determining the resources required for performing the first operation, it is determined whether the execution of the first operation is allowed. If it is determined that the request for performing the first operation is allowed, the process proceeds to step 403. If it is determined that the request for performing the first operation is allowed, the process proceeds to the end. The specific content is similar to step 202 in the second embodiment and will not be repeated here.
[0068] Step 403: If the resource is already occupied, compare the priorities of the sender of the request to execute the first operation and the sender of the request to execute the second operation that occupies the resource.
[0069] 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.
[0070] In one example, a sender role level table is pre-stored in the terminal, and the sender role level table includes a correspondence between senders and level values, and the larger the level value in the sender level table, the higher the priority of the sender. Therefore, the terminal can query the sender role level table, and can search by traversing until the level values of the sender of the request to perform the first operation and the sender of the request to perform the second operation are found, thereby 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.
[0071] In one example, 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 sender. A network management client role level table is pre-stored in the terminal, and the network management client role level table includes the correspondence 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; since there is a one-to-one correspondence between the network management client and the sender, the priority of the network management client is the priority of the sender. Therefore, the terminal can query the network management client role level table, and can search by traversal until the level value of the network management client that receives the request to perform the first operation and the level value of the network management client that receives the request to perform the second operation are found, thereby comparing the priorities of the network management client that receives the request to perform the first operation and the network management client that receives the request to perform the second operation, that is, comparing the priorities of the sender that performs the request to perform the first operation and the sender that performs the request to perform the second operation.
[0072] 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; if the priority of the sender of the request to perform the first operation is lower 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 lower than the priority of the second operation; 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 comparison result is that the priority of the first operation is the same as the priority of the second operation.
[0073] For example, the network management client role level table pre-stored in the terminal is as follows:
[0074]
[0075] If sending terminal 1 sends a request to execute the first operation to network management client 1, and sending terminal 2 sends a request to execute the second operation to network management client 2, by querying the network management client role level table, it can be determined that the level value of network management client 1 is 1, and the level value of network management client 2 is 1, thereby comparing and finding that the priorities of network management client 1 and network management client 2 are the same, that is, comparing and finding that the priority of sending terminal 1 is the same as the priority of sending terminal 2, and obtaining a comparison result that the priority of the first operation is the same as the priority of the second operation; if sending terminal 1 sends a request to execute the first operation to network management client 3, and sending terminal 2 sends a request to execute the second operation to network management client 2, by querying the network management client role level table, it can be determined that the level value of network management client 3 is 2, and the level value of network management client 2 is 1, thereby comparing and finding that the priorities of network management client 3 and network management client 2 are the same, that is, comparing and finding that the priority of sending terminal 1 is higher than the priority of sending terminal 2, and obtaining a comparison result that the priority of the first operation is higher than the priority of the second operation.
[0076] Step 405: Determine whether to seize resources and allocate them to the first operation according to the comparison result.
[0077] Wherein, step 405 is similar to step 103 in the first embodiment and will not be described in detail here.
[0078] In this embodiment, by comparing the priorities of the senders of the requests for executing the operations, the priorities of the first operation and the second operation can be determined more quickly, that is, the comparison result can be obtained more quickly.
[0079] The fifth embodiment of the present application relates to a resource allocation method. The fifth embodiment is substantially the same as the third embodiment, with the main difference being 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, it is also necessary 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. The specific flow chart of the resource allocation method of this embodiment is as follows: Figure 5 As shown, including:
[0080] Step 501: Receive a request to perform a first operation.
[0081] Step 502: Determine resources required to perform a first operation.
[0082] Step 503: If the resource is occupied, compare the priority of the operation type of the first operation and the operation type of the second operation occupying the resource.
[0083] Among them, steps 501-503 are similar to steps 301-303 in the third embodiment and are not described again here.
[0084] In one example, before determining the resources required for performing the first operation, it further includes: determining whether the request for performing the first operation is allowed. Specifically, before determining the resources required for performing the first operation, it is determined whether the first operation is allowed. If it is determined that the request for performing the first operation is allowed, the process proceeds to step 503. If it is determined that the request for performing the first operation is allowed, the process ends. The specific content is similar to step 202 in the second embodiment and will not be repeated here.
[0085] 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 execute the first operation and the sender of the request to execute the second operation.
[0086] Step 505: If the priority of the sender of the request to execute the first operation is higher than the priority of the sender of the request to execute the second operation, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
[0087] Step 506: Determine whether to seize resources and allocate them to the first operation based on the comparison result.
[0088] Among them, steps 504-506 are similar to steps 403-405 in the fourth embodiment and are not described again here.
[0089] 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, it is also necessary to compare the priority of the sender of the request to execute the operation, and compare the priorities of the first operation and the second operation from two perspectives to make the comparison result more accurate.
[0090] The sixth embodiment of the present application relates to a resource allocation method. The sixth embodiment is substantially the same as the fourth embodiment, with the main difference being 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, the priority of the operation type of the first operation is compared with the priority of the operation type of the second operation. The specific flow chart of the resource allocation method of this embodiment is as follows: Figure 6 As shown, including:
[0091] Step 601: Receive a request to perform a first operation.
[0092] Step 602: Determine resources required to perform a first operation.
[0093] Step 603: If the resources are occupied, compare the priorities of the sender of the request to execute the first operation and the sender of the request to execute the second operation that occupies the resources.
[0094] Among them, steps 601-603 are similar to steps 401-403 in the fourth embodiment and are not described again here.
[0095] In one example, before determining the resources required for performing the first operation, it further includes: determining whether the request for performing the first operation is allowed. Specifically, before determining the resources required for performing the first operation, it is determined whether the first operation is allowed. If it is determined that the request for performing the first operation is allowed, the process proceeds to step 603. If it is determined that the request for performing the first operation is allowed, the process ends. The specific content is similar to step 202 in the second embodiment and will not be repeated here.
[0096] 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, compare the priorities of the operation type of the first operation and the operation type of the second operation.
[0097] 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.
[0098] Step 606: Determine whether to seize resources and allocate them to the first operation based on the comparison result.
[0099] Among them, steps 604-606 are similar to steps 303-305 in the third embodiment and are not described again here.
[0100] In this embodiment, when 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, it is also necessary to compare the priorities of the operation types of the operations, and determine the priorities of the first operation and the second operation from two perspectives to make the comparison result more accurate.
[0101] The seventh embodiment of the present application relates to a resource allocation device, such as Figure 7 As shown, including:
[0102] The receiving module 701 is used to receive a request to perform a first operation;
[0103] A determination module 702, configured to determine resources required to perform a first operation;
[0104] A comparison module 703 is used to compare the priority of the first operation and the second operation occupying the resource if the resource is occupied, and obtain a comparison result;
[0105] The allocation module 704 is used to determine whether to seize the resource and allocate it to the first operation according to the comparison result.
[0106] In one example, the comparison module 703 is used to compare the priority of the operation type of a first operation and the priority of the operation type of a second operation that occupies 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, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
[0107] In one example, the comparison module 703 is used to compare the priorities of a sender of a request to perform a first operation and a sender of a request to perform a second operation that occupies 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, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
[0108] In one example, after comparing the priorities of the operation type of a first operation and the operation type of a second operation that occupies resources, if the priority of the operation type of the first operation and the priority of the operation type of the second operation are the same, the comparison module 703 is also used 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; 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.
[0109] In one example, after comparing the priorities of the sender of a request to perform a first operation and the sender of a request to perform a second operation that occupies resources, it also includes: 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 comparison module 703 is also used to compare the priorities of the operation type of the first operation and the operation type of the second operation; 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.
[0110] In one example, before determining the resources required to perform the first operation, the determining module 702 is further configured to determine whether the request to perform the first operation is allowed.
[0111] In one example, determining whether to seize resources and allocate them to the first operation based on the comparison result includes: if the comparison result shows that the priority of the first operation is higher than the priority of the second operation, seizing the resources and allocating them to the first operation.
[0112] It is not difficult to find that this embodiment is a device embodiment corresponding to the first or second or third or fourth or fifth or sixth embodiment, and this embodiment can be implemented in conjunction with the first or second or third or fourth or fifth or sixth embodiment. The relevant 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 are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the first or second or third or fourth or fifth or sixth embodiment.
[0113] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, this embodiment does not introduce units that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other units in this embodiment.
[0114] An eighth embodiment of the present invention relates to a server, such as Figure 8 As shown, it includes: at least one processor 801; and a memory 802 that is communicatively connected to the at least one processor 801; wherein the memory 802 stores instructions that can be executed by the at least one processor 801, and the instructions are executed by the at least one processor 801 so that the at least one processor 801 can execute the above-mentioned resource allocation method.
[0115] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.
[0116] 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. Memory can be used to store data used by the processor when performing operations.
[0117] A ninth embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.
[0118] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0119] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present invention, and that in actual applications, various changes may be made in form and detail without departing from the spirit and scope of the present invention.
Claims
1. A resource allocation method, characterized in that: include: receiving a request to perform a first operation; determining that the request to perform the first operation is allowed; determining resources required to perform the first operation; In the case where it is determined that the resource has been occupied, comparing the priority of the first operation with the priority of a second operation occupying the resource to obtain a comparison result; Seizing the resource according to the comparison result and allocating the resource to the first operation; The determining that the request to perform the first operation is allowed includes: Querying a sender role attribute table of a sender of a request to execute the first operation; According to the correspondence between the first operation and the request to execute the first operation in the sender role attribute table, it is determined that the request to execute the first operation is allowed.
2. The resource allocation method according to claim 1, characterized in that: The comparing the priority of the first operation and the priority of the second operation occupying the resource to obtain a comparison result includes: comparing the priority of the operation type of the first operation and the operation type of the second operation occupying the resource; In the case where 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.
3. The resource allocation method according to claim 1, characterized in that: The comparing the priority of the first operation and the priority of the second operation occupying the resource to obtain a comparison result includes: comparing the priorities of a sender of a request to perform the first operation and a sender of a request to perform a second operation occupying the resource; In the case where the priority of the sender of the request to execute the first operation is higher than the priority of the sender of the request to execute the second operation, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
4. The resource allocation method according to claim 2, characterized in that: After comparing the priority of the operation type of the first operation and the operation type of the second operation occupying the resource, the method further includes: 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, 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; In the case where the priority of the sender of the request to execute the first operation is higher than the priority of the sender of the request to execute the second operation, the comparison result is that the priority of the first operation is higher than the priority of the second operation.
5. The resource allocation method according to claim 3, characterized in that: After 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 occupying the resource, the method further includes: When 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 and the priority of the operation type of the second operation; In the case where 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.
6. The resource allocation method according to any one of claims 1 to 5, characterized in that: Seizing the resource according to the comparison result and allocating the resource to the first operation comprises: When the comparison result is that the priority of the first operation is higher than the priority of the second operation, the resource is seized and allocated to the first operation.
7. A server, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the resource allocation method according to any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the resource allocation method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Concurrent processing method and system for resources and mobile terminal
CN101883436A
Display equipment and scheduling method for Bluetooth communication resources of display equipment
CN111050199A