Resource allocation method and apparatus, electronic device, and medium

By obtaining the evaluation index values ​​of the tasks and the total resources of the edge servers, the weight of each evaluation index is determined, and resources are allocated to each task. This solves the problem of unreasonable resource allocation on the edge servers and achieves more efficient resource utilization.

CN115827233BActive Publication Date: 2026-05-29CHINA UNITED NETWORK COMM GRP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA UNITED NETWORK COMM GRP CO LTD
Filing Date
2022-12-07
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

How to rationally allocate resources to edge servers in order to reduce the computing pressure on cloud servers and improve the efficiency of edge computing.

Method used

By obtaining the evaluation index values ​​of the tasks and the total resources of the edge servers, the weight of each evaluation index is determined, and resources are allocated to each task according to the weight and total resources. The evaluation indexes include computational value, transmission latency, computation time, and energy consumption.

Benefits of technology

This achieves a more rational allocation of resources, avoiding problems such as low processing efficiency or excessive costs caused by a single indicator, and improving the rationality and efficiency of edge server resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115827233B_ABST
    Figure CN115827233B_ABST
Patent Text Reader

Abstract

The resource allocation method and device, electronic equipment and medium provided by the application include: obtaining evaluation values of evaluation indexes of current tasks and total resources of an edge server, wherein the evaluation indexes include calculation value, transmission delay, calculation time and energy consumption, determining current weights of the evaluation indexes, and for each task, calculating a weight of each task according to the weights of the evaluation indexes, the evaluation value of each evaluation index of the task and the sum of the evaluation values of each evaluation index of the tasks, and then allocating resources of the edge server to the tasks according to the weights of the tasks and the total resources of the edge server. The scheme can reasonably allocate resources of the edge server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a resource allocation method, apparatus, electronic device and medium. Background Technology

[0002] With the rapid development of IoT technology, the amount of data that cloud servers need to process is also increasing. To reduce the computing pressure on cloud servers, edge computing has emerged. Edge computing mainly moves data computation forward, that is, by using edge servers closer to the terminal to preprocess the massive amounts of data from the terminal to filter out useful data, and then transmitting the preprocessed data to the cloud server, thereby reducing the processing pressure on the cloud server.

[0003] In practical applications, edge servers connect to multiple terminal devices, and each terminal device may have multiple tasks. However, edge server resources are limited. Therefore, how to reasonably allocate edge server resources becomes a problem that needs to be considered. Summary of the Invention

[0004] This application provides a resource allocation method, apparatus, electronic device, and medium, which are designed to rationally allocate resources of an edge server.

[0005] In a first aspect, this application provides a resource allocation method, comprising: obtaining the evaluation values ​​of evaluation metrics for each task, and the total resources of the edge server; the evaluation metrics include the computational value, transmission latency, computation time, and energy consumption of the task; the computational value represents the ratio of the value of the task to the data volume of the task; determining the weight of each evaluation metric; and, for each task, calculating the weight of each task based on the weight of each evaluation metric, the evaluation value of each evaluation metric of the task, and the sum of the evaluation values ​​of each evaluation metric of the tasks; and allocating the resources of the edge server to each task based on the weight of each task and the total resources of the edge server.

[0006] Optionally, determining the weight of each evaluation indicator includes: establishing a decision matrix based on the evaluation values ​​of the evaluation indicators for each task; different columns of the decision matrix represent different evaluation indicators, and different rows of the decision matrix represent different tasks; calculating the corresponding entropy for each column of the decision matrix, which is used as the entropy of the evaluation indicator corresponding to the column; and calculating the corresponding entropy weight for each evaluation indicator based on the entropy of the evaluation indicator and the entropy of each evaluation indicator, which is used as the weight of the evaluation indicator.

[0007] Optionally, obtaining the evaluation values ​​of the evaluation metrics for each task includes: for each task, calculating the ratio of the task's value to its data volume to obtain an evaluation value of the task's computational value; based on the task's data volume, communication link bandwidth, and transmission power, and using Shannon's theorem, obtaining the task's transmission latency; calculating the product of the task's computational complexity and its data volume, and dividing the product by the total resources of the edge server to obtain the task's computation time; multiplying the task's transmission power by its transmission latency to obtain a first product; and multiplying the task's computational power by its computation time to obtain a second product; and adding the first product and the second product to obtain the task's energy consumption.

[0008] Optionally, the step of calculating the weight of each task for each task based on the weight of each evaluation indicator, the evaluation value of each evaluation indicator of the task, and the sum of the evaluation values ​​of each evaluation indicator of all tasks includes: for each evaluation indicator of each task, calculating the ratio of the evaluation value of the evaluation indicator under the task to the sum of the evaluation values ​​of the evaluation indicators of all tasks to obtain a first result corresponding to each evaluation indicator under the task; calculating the product of the first result corresponding to each evaluation indicator under the task and the weight of the evaluation indicator to obtain a second result corresponding to each evaluation indicator under the task; and calculating the sum of the second results corresponding to each evaluation indicator under the task to obtain the weight of the task.

[0009] Optionally, allocating edge server resources to each task based on the weight of each task and the total resources of the edge server includes: for each task, calculating the product of the weight of the task and the total resources of the edge server to obtain the resource amount corresponding to the task; and allocating edge server resources to each task according to the resource amount of each task.

[0010] Secondly, this application provides a resource allocation apparatus, comprising: an acquisition module, configured to acquire the evaluation values ​​of evaluation indicators for each task and the total resources of the edge server; the evaluation indicators include the computational value, transmission latency, computation time, and energy consumption of the task; the computational value represents the ratio of the value of the task to the data volume of the task; a calculation module, configured to determine the weight of each evaluation indicator; and, for each task, calculate the weight of each task based on the weight of each evaluation indicator, the evaluation value of each evaluation indicator of the task, and the sum of the evaluation values ​​of each evaluation indicator of the tasks; and an allocation module, configured to allocate the resources of the edge server to each task based on the weight of each task and the total resources of the edge server.

[0011] Optionally, the calculation module is specifically used to establish a decision matrix based on the evaluation values ​​of the evaluation indicators of each task; different columns of the decision matrix represent different evaluation indicators, and different rows of the decision matrix represent different tasks; the calculation module is further used to calculate the corresponding entropy for each column of the decision matrix, as the entropy corresponding to the evaluation indicator of the column; the calculation module is further used to calculate the corresponding entropy weight for each evaluation indicator based on the entropy corresponding to the evaluation indicator and the entropy corresponding to each evaluation indicator, as the weight of the evaluation indicator.

[0012] Optionally, the acquisition module is specifically used to calculate the ratio of the value of the task to the data volume of the task for each task, thereby obtaining an evaluation value of the computational value of the task; the acquisition module is further used to obtain the transmission delay of the task based on the data volume of the task, the bandwidth of the communication link, and the transmission power, using Shannon's theorem; the acquisition module is further used to calculate the product of the computational complexity of the task and the data volume of the task, and divide the product by the total resources of the edge server to obtain the computation time of the task; the acquisition module is further used to multiply the transmission power of the task by the transmission delay of the task to obtain a first product; and multiply the computational power of the task by the computation time of the task to obtain a second product; and add the first product and the second product to obtain the energy consumption of the task.

[0013] Optionally, the calculation module is specifically used to calculate, for each evaluation indicator of each task, the ratio of the evaluation value of the evaluation indicator under that task to the sum of the evaluation values ​​of the evaluation indicators under all tasks, to obtain a first result corresponding to each evaluation indicator under the task; the calculation module is further used to calculate the product of the first result corresponding to each evaluation indicator under the task and the weight of the evaluation indicator, to obtain a second result corresponding to each evaluation indicator under the task; and to calculate the sum of the second results corresponding to each evaluation indicator under the task, to obtain the weight of the task.

[0014] Optionally, the allocation module is specifically used to calculate the product of the weight of the task and the total resources of the edge server for each task to obtain the resource amount corresponding to the task; the allocation module is specifically used to allocate the resources of the edge server to each task according to the resource amount of each task.

[0015] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method described above.

[0016] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described above.

[0017] The resource allocation method, apparatus, electronic device, and medium provided in this application obtain the evaluation values ​​of the current evaluation indicators for each task and the total resources of the edge server. The evaluation indicators include computational value, transmission latency, computation time, and energy consumption. The current weight of each evaluation indicator is determined. For each task, the weight of each task is calculated based on its weight, the evaluation value of each evaluation indicator for that task, and the sum of the evaluation values ​​of each evaluation indicator for all tasks. Then, edge server resources are allocated to each task based on its weight and the total resources of the edge server. This solution allocates total server resources based on four evaluation indicators: computational value, transmission latency, computation time, and energy consumption. This more comprehensive evaluation approach avoids the problems of low processing efficiency or excessive cost caused by the one-sidedness of a single indicator. Therefore, this solution can rationally allocate edge server resources. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with those of this application and, together with the description, serve to explain the principles of the embodiments of this application.

[0019] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the embodiments of this application in any way, but rather to illustrate the concepts of the embodiments of this application to those skilled in the art through reference to specific embodiments.

[0020] Figure 1 This is a diagram of a computing system architecture for IoT communication in an example.

[0021] Figure 2 A flowchart illustrating a resource allocation method provided in Embodiment 1 of this application;

[0022] Figure 3 A flowchart illustrating another resource allocation method provided in Embodiment 1 of this application;

[0023] Figure 4 A flowchart illustrating another resource allocation method provided in Embodiment 1 of this application;

[0024] Figure 5 This is a schematic diagram of the structure of a resource allocation device provided in Embodiment 2 of this application;

[0025] Figure 6This is a schematic diagram of the structure of the electronic device provided in Embodiment 3 of this application.

[0026] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0027] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0028] Figure 1 Here is a diagram of a computing system architecture for IoT communication in an example, such as Figure 1 As shown, the computing system includes a terminal 11, an edge server 12, and a cloud server 13. The terminal 11 can be a mobile phone, smart bracelet, smart camera, or various other communication-enabled devices. The terminal 11 is connected to the edge server 12, and uploads a large amount of collected and measured data to the edge server 12. The edge server 12 preprocesses the received data to filter out invalid information and then transmits the preprocessed data to the cloud server 13, where the cloud server 13 performs the final processing. This significantly reduces the processing load on the cloud server 13.

[0029] Continue to refer to Figure 1 The edge server 12 is connected to multiple terminals 11, and each terminal 11 has multiple tasks. However, the resources of the edge server are limited, so the reasonable allocation of resources becomes an important issue. Therefore, this example provides a resource allocation method to reasonably allocate the resources of the edge server.

[0030] The technical solutions of this application will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. In the description of this application, unless otherwise expressly specified and limited, the terms should be broadly understood within the art. The embodiments of this application will now be described with reference to the accompanying drawings.

[0031] Example 1

[0032] Figure 2This is a flowchart illustrating a resource allocation method provided in Embodiment 1 of this application. The executing entity of this method can be an edge computing device, which can be an edge server or an electronic device integrated with an edge computing device. Figure 2 As shown, the method provided in this embodiment includes:

[0033] S201. Obtain the evaluation values ​​of the evaluation metrics for each task, as well as the total resources of the edge server;

[0034] S202. Determine the weight of each evaluation indicator; and, for each task, calculate the weight of each task based on the weight of each evaluation indicator, the evaluation value of each evaluation indicator of the task, and the sum of the evaluation values ​​of each evaluation indicator of the task.

[0035] S203. Based on the weight of each task and the total resources of the edge server, allocate the resources of the edge server to each task.

[0036] In practical applications, an IoT communication system may include multiple edge servers. This embodiment only uses one edge server as an example to allocate resources for that edge server. The resource allocation for other edge servers can be performed using the method described in this embodiment.

[0037] In this embodiment, step S201 involves obtaining the evaluation values ​​of assessment metrics for tasks on the same edge server. These evaluation metrics include the computational value, transmission latency, computation time, and energy consumption of the task. These metrics all affect the rationality of resource allocation. The computational value of a task represents the ratio of its value to the amount of data it contains. Generally, a higher computational value indicates a more important task. For example, an autonomous driving task is more important than a Content Delivery Network (CDN) task, thus the autonomous driving task would have a higher evaluation value. Transmission latency refers to the time required for a task to be transmitted from the terminal to the edge server. Computation time reflects the complexity of the task; higher complexity results in longer computation time. Energy consumption refers to the energy required to process the task, and this metric is related to cost; higher energy consumption indicates higher processing costs.

[0038] In this step, the total resources of the edge server processing the tasks are also obtained, meaning these total resources are allocated to different tasks. In this embodiment, resources are allocated based on the computational value, transmission latency, computation time, and energy consumption of the tasks. The corresponding resources are obtained from the total resources of the edge server to perform edge computing. Compared with evaluation schemes based on a single evaluation metric in related technologies, this improves the rationality of task resource allocation.

[0039] In step S202, the current weight of each evaluation indicator is determined. Different tasks place varying degrees of importance on each evaluation indicator; therefore, this embodiment also requires confirming the current weight of each evaluation indicator. As an example, the weight of each evaluation indicator can be determined using the entropy weight method, based on the evaluation values ​​of the evaluation indicators for each task. Alternatively, the analytic hierarchy process (AHP) can be used to determine the weight of each evaluation indicator based on the evaluation values ​​of the evaluation indicators for each task.

[0040] Then, for each task, the weight of each task is calculated based on the weight of each evaluation metric, the evaluation value of each evaluation metric for the task, and the sum of the evaluation values ​​of each evaluation metric for all tasks. It can be understood that the higher the weight of a task, the more resources it receives. In step S203, edge server resources are allocated to each task based on its weight and the total resources of the edge servers. In other words, resources are obtained from the total resources according to the weight of each task.

[0041] As an example, for each task, the product of the task's weight and the total resources of the edge servers can be calculated to obtain the resource amount corresponding to that task; based on the resource amount of each task, edge server resources can be allocated to each task. This solution can allocate edge server resources to each task based on the weight of each task and the total resources of the edge servers, thereby achieving rational resource allocation.

[0042] For example, suppose there are 5 tasks in total, and the total resources of the edge server are S. C The weights of these five tasks are 0.1, 0.3, 0.2, 0.35, and 0.05, respectively, so the corresponding resource allocation is 0.1 * S. C 0.3*S C 0.2*S C 0.35*S C 0.05*S C .

[0043] In practical applications, in order to further improve the rationality of resource allocation, Figure 3 A flowchart illustrating another resource allocation method provided in Embodiment 1 of this application is shown below. Figure 3 As shown, the weights of each evaluation indicator are determined, including:

[0044] S301. Based on the evaluation values ​​of the evaluation indicators of each task, establish a decision matrix;

[0045] S302. Calculate the corresponding entropy for each column of the decision matrix, and use it as the entropy of the evaluation index corresponding to the column.

[0046] S303. For each evaluation indicator, calculate the corresponding entropy weight based on the entropy corresponding to the evaluation indicator and the entropy corresponding to each evaluation indicator, and use it as the weight of the evaluation indicator.

[0047] This example demonstrates a scheme for determining the weights of each indicator based on the entropy weight method. First, a decision matrix is ​​established based on the weights of each evaluation indicator for each task. Different columns of the decision matrix represent different evaluation indicators, and different rows represent different tasks. For each column of the decision matrix, the corresponding entropy is calculated and used as the entropy of the evaluation indicator corresponding to that column. Then, for each evaluation indicator, the corresponding entropy weight is calculated based on the entropy of that indicator and the entropy of each other, and this weight is used as the evaluation indicator's weight.

[0048] The following is an example using a specific scenario: There are n tasks in the current period, and the evaluation metrics for the first to nth tasks are as follows: (V cal,1 T trans,1 T cal,1 (E1), ..., (V) cal,n T trans,n T cal,n E n ), where V cal,n T is the computational value of the nth task. trans,n Let T be the transmission delay of the nth task. cal,n E represents the computation time for the nth task. n Let the energy consumption of the nth task be denoted as follows. Based on the evaluation values ​​of the above evaluation indicators, the following decision matrix is ​​established, where the first column corresponds to the computational value, the second column to the transmission delay, the third column to the computation time, and the fourth column to the energy consumption; rows one through n represent the first through nth tasks, as detailed below:

[0049]

[0050] Then, based on the entropy calculation formula of the decision matrix (as shown in Formula 1), the entropy H of each column is calculated as follows:

[0051]

[0052] Among them, H j Let H be the entropy of the j-th column. Then the entropy of the j-th evaluation index corresponding to the j-th column is H. j For example, H1, H2, H3, and H4 can represent computational value, transmission delay, computation time, and energy consumption, respectively; K is a constant coefficient of entropy, typically K = 1 / ln 4; x ij Let be the element in the i-th row and j-th column of the decision matrix X.

[0053] Based on the entropy calculation formula above, the entropy of each evaluation indicator is obtained. Then, the weight of each evaluation indicator is obtained based on the entropy weight calculation formula, as shown in Formula 2:

[0054]

[0055] Where θ j Let be the weight of the j-th evaluation indicator.

[0056] In this example, a decision matrix is ​​established based on the evaluation values ​​of each evaluation indicator, and the weight of each evaluation indicator is obtained based on the entropy value calculation formula and the entropy weight calculation formula. This avoids the influence of subjective evaluation on the weight of each evaluation indicator, making the weight of the evaluation indicators obtained based on this scheme more reasonable, thereby further improving the rationality of resource allocation.

[0057] In practical applications, the accuracy of the evaluation values ​​of each evaluation metric obtained in S201 directly affects the subsequent allocation of resources. Therefore, in one example, the evaluation values ​​of each task's evaluation metrics obtained in S201 include:

[0058] For each task, the ratio of the task's value to the amount of data in that task is calculated to obtain an evaluation value of the task's computational value.

[0059] Based on the data volume of the task, the bandwidth of the communication link, and the transmission power, the transmission delay of the task is obtained using Shannon's theorem.

[0060] Calculate the product of the computational complexity of the task and the amount of data in the task, and divide the product by the total resources of the edge server to obtain the computation time of the task;

[0061] Multiply the transmission power of the task by the transmission delay of the task to obtain a first product; and multiply the computing power of the task by the computing time of the task to obtain a second product; add the first product and the second product to obtain the energy consumption of the task.

[0062] This example illustrates the methods for obtaining each evaluation indicator, establishes a mathematical model for each indicator, and calculates the corresponding evaluation value using the mathematical model. The following is an illustrative explanation of this approach:

[0063] (1) Obtain the computational value assessment of the task.

[0064] The computational value of a task is evaluated based on the ratio of its value to the amount of data it contains, as shown in Formula 3.

[0065] V cal,k =V k / D k(Formula 3)

[0066] Where V cal,k The computational value of the task; D k V represents the amount of data for the task. k The total value of the task is defined as follows: In practical applications, each task corresponds to a specific task type. The total value can be set based on the importance of the task type. For example, the total value for autonomous driving tasks should be set relatively high, while the total value for CDN tasks should be set relatively low. Based on this, the current computational value of each task is evaluated.

[0067] (2) Obtain the evaluation value of transmission delay

[0068] Based on the data volume of the task, the bandwidth of the communication link, and the transmission power, the transmission delay of the task is obtained according to Shannon's theorem, as shown in Formula 4.

[0069]

[0070] Among them, T trans,k Let β be the transmission delay of the Kth task, and β be a random independent and identically distributed variable representing the channel gain between the task terminal and the edge server; N0 is the noise power in the channel, and W is the transmission delay of the Kth task. k B is the transmit power for sending data from the terminal to the edge server; B is the data bandwidth of the wireless communication link. Based on the above mathematical model, the estimated transmission delay for each task is obtained.

[0071] (3) Obtain the evaluation value of the task's computation time.

[0072] A mathematical model for the computation time of the task is established, as shown in Formula 5.

[0073] T cal,k =σ k D k / S c (Formula 5)

[0074] Where, σ k Given the computational complexity of K tasks, D k S represents the computational data volume (in bits) for the Kth task. c This represents the total resources of the edge servers. Based on the mathematical model described above, an estimated computation time for each task is obtained.

[0075] (4) Obtain the assessment value of the energy consumption of the task.

[0076] A mathematical model for the energy consumption of the task is established, as shown in Formula 6.

[0077]

[0078] Where E k The energy consumption for processing the Kth task mainly consists of two parts: the energy consumed during the transmission process from the terminal to the edge server, and the energy consumed during the computation process of calculating the task. k The transmit power for sending data from the terminal to the edge server for the task; T trans,k Pc is the transmission delay of the Kth task; Pc is the power consumed during the computation process; T cal,k Let be the computation time for the Kth task. Based on the mathematical model above, obtain the estimated energy consumption value for each task.

[0079] In this example, based on the above mathematical model and corresponding calculation parameters, the evaluation values ​​of each evaluation index for each task can be accurately obtained, thereby further ensuring the rationality of the resources allocated to each task.

[0080] The following will provide an exemplary description of the scheme for obtaining the weight of each task in S202. In one example, S202 includes:

[0081] For each evaluation indicator of each task, calculate the ratio of the evaluation value of the evaluation indicator under the task to the sum of the evaluation values ​​of the evaluation indicators under all tasks, and obtain the first result corresponding to each evaluation indicator under the task.

[0082] Calculate the product of the first result corresponding to each evaluation indicator under the task and the weight of the evaluation indicator to obtain the second result corresponding to each evaluation indicator under the task; and calculate the sum of the second results corresponding to each evaluation indicator under the task to obtain the weight of the task.

[0083] This solution can be illustrated by the following seven examples of calculation formulas:

[0084]

[0085] Among them, S c,k Resources obtained for the Kth task; θ1, θ2, θ3, and θ4 are the weights of computational value, transmission latency, computation time, and energy consumption, respectively, V cal,k T trans,k T cal,k E k These are the evaluation values ​​of the computational value, transmission latency, computation time, and energy consumption of the Kth task, respectively; S C This refers to the total resources of the edge servers.

[0086] This scheme obtains a first result by calculating the ratio of the evaluation value of each assessment indicator to the sum of the evaluation values ​​of that indicator for each task. The first result is then multiplied by the weight of that assessment indicator to obtain a second result. Finally, the second results for each indicator are summed to obtain the task weight. This scheme considers the impact of each assessment indicator and its weight on the weight of each task, thus ensuring the rationality of the obtained task weights and further guaranteeing the rationality of resource allocation.

[0087] The following will provide an exemplary description of this implementation using specific scenarios: Figure 4 This is a flowchart illustrating another resource allocation method provided in one embodiment, as shown below. Figure 4 As shown, there are n tasks to be processed on the edge server, and the total resources S obtained from the edge server are... c And to obtain the value V of each task k Data volume D k The parameters are: communication link bandwidth B, transmission power Wk, computational power Pc, and computational complexity σk. Then, for each task, the ratio of the task's value to its data volume is calculated to obtain the task's computational value evaluation value V. cal,k (Refer to Formula 3); Based on the data volume of the task, the bandwidth of the communication link, and the transmission power, and using Shannon's theorem, obtain the transmission delay T of the task. trans,k (Refer to Formula 4); the computational complexity D of the computational task k The amount of data D for this task k The product of the two factors is then divided by the total resources of the edge server to obtain the computation time T of the task. cal,k (Refer to Formula 5); Combine the mission's transmit power Wk with the mission's transmission delay T. trans,k Multiply to obtain the first product; and multiply the computational power Pc of the task by the computational time T of the task. cal,k Multiply the first product to obtain the second product; add the first product to the second product to obtain the energy consumption E of the task. k(Refer to Formula 6). Then, based on the evaluation values ​​of the evaluation indicators for each task, a decision matrix is ​​established. For each column of the decision matrix, the corresponding entropy is calculated as the entropy corresponding to the evaluation indicator for that column (refer to Formula 1). For each evaluation indicator, the corresponding entropy weight is calculated based on the entropy corresponding to the evaluation indicator and the entropy corresponding to each evaluation indicator, and is used as the weights θ1, θ2, θ3, and θ4 of the evaluation indicator (refer to Formula 2). For each evaluation indicator of each task, the ratio of the evaluation value of the evaluation indicator under that task to the sum of the evaluation values ​​of the evaluation indicator under all tasks is calculated to obtain the first result corresponding to each evaluation indicator under that task. The product of the first result corresponding to each evaluation indicator under that task and the weight of the evaluation indicator is calculated to obtain the second result corresponding to each evaluation indicator under that task. The sum of the second results corresponding to each evaluation indicator under that task is calculated to obtain the weight of the task. Finally, for each task, the product of the weight of the task and the total resources of the edge server is calculated to obtain the resource amount corresponding to the task (refer to Formula 7). Based on the resource amount of each task, edge server resources are allocated to each task.

[0088] The resource allocation method provided in this application obtains the evaluation values ​​of the current evaluation indicators for each task and the total resources of the edge server. The evaluation indicators include computational value, transmission latency, computation time, and energy consumption. The method determines the current weight of each evaluation indicator and, for each task, calculates its weight based on the weight of each evaluation indicator, the evaluation value of each indicator for the task, and the sum of the evaluation values ​​of each indicator for all tasks. Then, based on the weights of each task and the total resources of the edge server, edge server resources are allocated to each task. This solution allocates total server resources based on four evaluation indicators: computational value, transmission latency, computation time, and energy consumption. This more comprehensive evaluation approach avoids the problems of low processing efficiency or excessive cost caused by the one-sidedness of a single indicator, thus enabling the reasonable allocation of edge server resources.

[0089] Example 2

[0090] Figure 5 This is a schematic diagram of the structure of a resource allocation device provided in Embodiment 2 of this application, as shown below. Figure 5 As shown, the resource allocation device provided in this embodiment includes:

[0091] The acquisition module 51 is used to acquire the evaluation values ​​of the evaluation indicators of each task, as well as the total resources of the edge server; the evaluation indicators include the computational value, transmission latency, computation time and energy consumption of the task; the computational value represents the ratio of the value of the task to the amount of data of the task;

[0092] The calculation module 52 is used to determine the weight of each evaluation index; and, for each task, to calculate the weight of each task based on the weight of each evaluation index, the evaluation value of each evaluation index of the task, and the sum of the evaluation values ​​of each evaluation index of the tasks.

[0093] The allocation module 53 is used to allocate the resources of the edge server to each task based on the weight of each task and the total resources of the edge server.

[0094] In practical applications, an IoT communication system may include multiple edge servers. This embodiment only uses one edge server as an example to allocate resources for that edge server. The resource allocation for other edge servers can be performed using the method described in this embodiment.

[0095] In this embodiment, the acquisition module 51 acquires the evaluation values ​​of the evaluation metrics for tasks on the same edge server. These evaluation metrics include the computational value, transmission latency, computation time, and energy consumption of the task. These metrics all affect the rationality of resource allocation. The computational value of a task represents the ratio of its value to the amount of data it contains. Generally, the higher the computational value, the more important the task. For example, an autonomous driving task is more important than a Content Delivery Network (CDN) task, thus the autonomous driving task has a higher evaluation value. Transmission latency refers to the time required for the task to be transmitted from the terminal to the edge server. Computation time represents the complexity of the task; higher complexity means longer computation time. Energy consumption refers to the energy required to process the task. This metric can be considered related to cost; higher energy consumption means higher processing costs.

[0096] In this step, the acquisition module 51 also acquires the total resources of the edge server processing the tasks, that is, it allocates the total resources to different tasks. In this embodiment, based on the computational value, transmission latency, computation time, and energy consumption of the tasks, corresponding resources are allocated, and corresponding resources are obtained from the total resources of the edge server to perform edge computing. Compared with the evaluation scheme based on a single evaluation index in related technologies, this can improve the rationality of task resource allocation.

[0097] The calculation module 52 determines the current weight of each evaluation indicator. Different tasks place varying degrees of importance on each evaluation indicator; therefore, this embodiment also requires confirming the current weight of each evaluation indicator. As an example, the weight of each evaluation indicator can be determined using the entropy weight method, based on the evaluation values ​​of the evaluation indicators for each task. Alternatively, the analytic hierarchy process (AHP) can also be used to determine the weight of each evaluation indicator based on the evaluation values ​​of the evaluation indicators for each task.

[0098] Then, for each task, the calculation module 52 calculates the weight of each task based on the weight of each evaluation indicator, the evaluation value of each evaluation indicator for the task, and the sum of the evaluation values ​​of each evaluation indicator for all tasks. It can be understood that the higher the weight of a task, the more resources it receives. In step S203, edge server resources are allocated to each task based on its weight and the total resources of the edge servers. In other words, resources are obtained from the total resources according to the weight of each task.

[0099] As an example, allocation module 53 is specifically used to calculate the product of the weight of each task and the total resources of the edge server for each task, thereby obtaining the resource amount corresponding to that task; allocation module 53 is specifically used to allocate the resources of the edge server to each task according to the resource amount of each task. This solution can allocate the resources of the edge server to each task based on the weight of each task and the total resources of the edge server, thereby achieving rational resource allocation.

[0100] In practical applications, to further improve the rationality of resource allocation, one example includes:

[0101] The calculation module 52 is specifically used to establish a decision matrix based on the evaluation values ​​of the evaluation indicators of each task; different columns of the decision matrix represent different evaluation indicators, and different rows of the decision matrix represent different tasks.

[0102] The calculation module 52 is further used to calculate the corresponding entropy for each column of the decision matrix, which serves as the entropy of the evaluation index corresponding to the column.

[0103] The calculation module 52 is further used to calculate the corresponding entropy weight for each evaluation indicator based on the entropy corresponding to the evaluation indicator and the entropy corresponding to each evaluation indicator, and use it as the weight of the evaluation indicator.

[0104] This example demonstrates a scheme for determining the weights of each indicator based on the entropy weight method. First, the calculation module establishes a decision matrix based on the weights of each evaluation indicator for each task. Different columns of the decision matrix represent different evaluation indicators, and different rows represent different tasks. For each column of the decision matrix, the corresponding entropy is calculated and used as the entropy of the evaluation indicator corresponding to that column. Then, for each evaluation indicator, the corresponding entropy weight is calculated based on the entropy of that indicator and the entropy of each other, and this weight is used as the evaluation indicator's weight.

[0105] In this example, the calculation module establishes a decision matrix based on the evaluation values ​​of each evaluation indicator, and obtains the weight of each evaluation indicator based on the entropy value calculation formula and the entropy weight calculation formula. This avoids the influence of subjective evaluation on the weight of each evaluation indicator, making the weight of the evaluation indicators obtained based on this scheme more reasonable, thereby further improving the rationality of resource allocation.

[0106] In practical applications, the accuracy of the evaluation values ​​of each acquired evaluation indicator directly affects the subsequent allocation of resources. Therefore, in one example, module 51 is specifically used to calculate the ratio of the value of each task to the amount of data for that task, thereby obtaining an evaluation value of the task's computational value.

[0107] The acquisition module 51 is further configured to acquire the transmission delay of the task based on the data volume of the task, the bandwidth of the communication link, and the transmission power, and based on Shannon's theorem.

[0108] The acquisition module 51 is further used to calculate the product of the computational complexity of the task and the amount of data in the task, and divide the product by the total resources of the edge server to obtain the computation time of the task;

[0109] The acquisition module 51 is further configured to multiply the transmission power of the task by the transmission delay of the task to obtain a first product; and multiply the computing power of the task by the computing time of the task to obtain a second product; and add the first product and the second product to obtain the energy consumption of the task.

[0110] This example illustrates the methods for obtaining each evaluation indicator. A mathematical model is established for each indicator, and the evaluation value is calculated using the mathematical model. Based on the aforementioned mathematical model and corresponding calculation parameters, the acquisition module in this example can accurately obtain the evaluation values ​​of each evaluation indicator for each task, thereby further ensuring the rationality of resource allocation for each task.

[0111] The following is an exemplary description of the calculation module. In one example,

[0112] The calculation module 52 is specifically used to calculate the ratio of the evaluation value of the evaluation indicator under each task to the sum of the evaluation values ​​of the evaluation indicators under all tasks for each evaluation indicator of each task, so as to obtain the first result corresponding to each evaluation indicator under the task.

[0113] The calculation module 52 is further configured to calculate the product of the first result corresponding to each evaluation indicator under the task and the weight of the evaluation indicator to obtain the second result corresponding to each evaluation indicator under the task; and to calculate the sum of the second results corresponding to each evaluation indicator under the task to obtain the weight of the task.

[0114] This scheme obtains a first result by calculating the ratio of the evaluation value of each assessment indicator to the sum of the evaluation values ​​of that indicator for each task. The first result is then multiplied by the weight of that assessment indicator to obtain a second result. Finally, the second results for each indicator are summed to obtain the task weight. This scheme considers the impact of each assessment indicator and its weight on the weight of each task, thus ensuring the rationality of the obtained task weights and further guaranteeing the rationality of resource allocation.

[0115] In the resource allocation device provided in this application embodiment, the acquisition module acquires the evaluation values ​​of the current evaluation indicators of each task and the total resources of the edge server. The evaluation indicators include computational value, transmission latency, computation time, and energy consumption. The calculation module determines the current weight of each evaluation indicator and, for each task, calculates the weight of each task based on the weight of each evaluation indicator, the evaluation value of each evaluation indicator for the task, and the sum of the evaluation values ​​of each evaluation indicator for all tasks. Then, the analysis module allocates edge server resources to each task based on the weight of each task and the total resources of the edge server. This solution allocates the total resources of the server based on four evaluation indicators: computational value, transmission latency, computation time, and energy consumption. The evaluation indicators are more comprehensive, thus avoiding the problems of low processing efficiency or excessive cost caused by the one-sidedness of a single indicator. Therefore, this solution can reasonably allocate edge server resources.

[0116] Example 3

[0117] Figure 6 This is a schematic diagram of the structure of the electronic device provided in Embodiment 3 of this application, as shown below. Figure 6 As shown, the electronic device includes:

[0118] The electronic device includes a processor 291 and a memory 292; it may also include a communication interface 293 and a bus 294. The processor 291, memory 292, and communication interface 293 can communicate with each other via the bus 294. The communication interface 293 can be used for information transmission. The processor 291 can invoke logical instructions stored in the memory 292 to execute the methods of the above embodiments.

[0119] Furthermore, the logic instructions in the aforementioned memory 292 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0120] The memory 292, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this application. The processor 291 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 292, thereby implementing the methods in the above-described method embodiments.

[0121] The memory 292 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 292 may include high-speed random access memory and may also include non-volatile memory.

[0122] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods described in any of the embodiments.

[0123] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.

[0124] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A resource allocation method, characterized in that, include: Obtain the evaluation values ​​of the evaluation metrics for each task, as well as the total resources of the edge server; the evaluation metrics include the computational value, transmission latency, computation time, and energy consumption of the task. The computational value represents the ratio of the value of the task to the amount of data in the task; The weights of each evaluation indicator are determined; and, for each task, the weight of each task is calculated based on the weights of each evaluation indicator, the evaluation value of each evaluation indicator of the task, and the sum of the evaluation values ​​of each evaluation indicator of the task. Based on the weight of each task and the total resources of the edge server, allocate the resources of the edge server to each task; For each task, the weight of each task is calculated based on the weight of each evaluation indicator, the evaluation value of each evaluation indicator for the task, and the sum of the evaluation values ​​of each evaluation indicator for all tasks, including: For each evaluation indicator of each task, calculate the ratio of the evaluation value of the evaluation indicator under the task to the sum of the evaluation values ​​of the evaluation indicators under all tasks, and obtain the first result corresponding to each evaluation indicator under the task. Calculate the product of the first result corresponding to each evaluation indicator under the task and the weight of the evaluation indicator to obtain the second result corresponding to each evaluation indicator under the task; and calculate the sum of the second results corresponding to each evaluation indicator under the task to obtain the weight of the task.

2. The method according to claim 1, characterized in that, Determining the weights of each evaluation indicator includes: Based on the evaluation values ​​of the evaluation indicators for each task, a decision matrix is ​​established; different columns of the decision matrix represent different evaluation indicators, and different rows of the decision matrix represent different tasks. For each column of the decision matrix, the corresponding entropy is calculated and used as the entropy of the evaluation index corresponding to the column. For each evaluation indicator, the corresponding entropy weight is calculated based on the entropy corresponding to the evaluation indicator and the entropy corresponding to each evaluation indicator, and is used as the weight of the evaluation indicator.

3. The method according to claim 1, characterized in that, The process of obtaining the evaluation values ​​of the evaluation metrics for each task includes: For each task, the ratio of the task's value to the amount of data in that task is calculated to obtain an evaluation value of the task's computational value. Based on the data volume of the task, the bandwidth of the communication link, and the transmission power, the transmission delay of the task is obtained using Shannon's theorem. Calculate the product of the computational complexity of the task and the amount of data in the task, and divide the product by the total resources of the edge server to obtain the computation time of the task; Multiply the transmission power of the task by the transmission delay of the task to obtain a first product; and multiply the computing power of the task by the computing time of the task to obtain a second product; add the first product and the second product to obtain the energy consumption of the task.

4. The method according to any one of claims 1-3, characterized in that, The allocation of edge server resources to each task based on the weight of each task and the total resources of the edge server includes: For each task, the weight of the task is calculated as the product of the total resources of the edge server to obtain the resource amount corresponding to the task; Based on the resource availability of each task, allocate resources from the edge server to each task.

5. A resource allocation device, characterized in that, include: The acquisition module is used to obtain the evaluation values ​​of the evaluation metrics for each task, as well as the total resources of the edge server; The evaluation metrics include the computational value, transmission latency, computation time, and energy consumption of the task; the computational value represents the ratio of the value of the task to the amount of data in the task. A calculation module is used to determine the weight of each evaluation indicator; and, for each task, to calculate the weight of each task based on the weight of each evaluation indicator, the evaluation value of each evaluation indicator of the task, and the sum of the evaluation values ​​of each evaluation indicator of the tasks. The allocation module is used to allocate the resources of the edge server to each task based on the weight of each task and the total resources of the edge server; The calculation module is specifically used to calculate the ratio of the evaluation value of the evaluation indicator under each task to the sum of the evaluation values ​​of the evaluation indicators under all tasks for each evaluation indicator of each task, so as to obtain the first result corresponding to each evaluation indicator under the task. The calculation module is further configured to calculate the product of the first result corresponding to each evaluation indicator under the task and the weight of the evaluation indicator to obtain the second result corresponding to each evaluation indicator under the task; and to calculate the sum of the second results corresponding to each evaluation indicator under the task to obtain the weight of the task.

6. The apparatus according to claim 5, characterized in that, The calculation module is specifically used to establish a decision matrix based on the evaluation values ​​of the evaluation indicators of each task; different columns of the decision matrix represent different evaluation indicators, and different rows of the decision matrix represent different tasks. The calculation module is further configured to calculate the corresponding entropy for each column of the decision matrix, which serves as the entropy of the evaluation index corresponding to the column. The calculation module is further configured to calculate the corresponding entropy weight for each evaluation indicator based on the entropy corresponding to the evaluation indicator and the entropy corresponding to each evaluation indicator, and use it as the weight of the evaluation indicator.

7. The apparatus according to claim 5, characterized in that, The acquisition module is specifically used to calculate the ratio of the value of the task to the amount of data for each task, and obtain an evaluation value of the computational value of the task. The acquisition module is further configured to acquire the transmission delay of the task based on the data volume of the task, the bandwidth of the communication link, and the transmission power, using Shannon's theorem. The acquisition module is further configured to calculate the product of the computational complexity of the task and the amount of data in the task, and divide the product by the total resources of the edge server to obtain the computation time of the task. The acquisition module is further configured to multiply the transmission power of the task by the transmission delay of the task to obtain a first product; and multiply the computing power of the task by the computing time of the task to obtain a second product; and add the first product and the second product to obtain the energy consumption of the task.

8. The apparatus according to any one of claims 5-7, characterized in that, The allocation module is specifically used to calculate the product of the weight of the task and the total resources of the edge server for each task, so as to obtain the resource amount corresponding to the task. The allocation module is specifically used to allocate the resources of the edge server to each task based on the resource quantity of each task.

9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-4.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-4.