A method for resource allocation and related devices
By considering the correlation between users in resource allocation, and using the target graph attention network model to predict resource allocation characteristics, the problem of inaccurate resource allocation in the existing technology is solved, and more efficient resource utilization is achieved.
Patent Information
- Application Number
- CN202210589159.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2042-05-27
AI Technical Summary
The prior art cannot consider the relationship between each user when allocating resources, resulting in inaccurate resource allocation and problems such as waste of resources and reduced resource utilization.
By obtaining the resource allocation characteristics of the target user and the associated user, and using the target graph attention network model to predict the future resource allocation characteristics of the target user, resource allocation is calculated considering the association relationship between users.
Improve the accuracy of resource allocation, reduce resource waste, and maximize resource utilization.
Smart Images

Figure CN114968582B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to a method for resource allocation and related devices. Background Art
[0002] With the rapid development of cloud computing technology, resources such as storage, network, memory, computing, input / output, etc. in a cloud computing system need to be allocated to each required user in a fine-grained manner. Based on this, in order to avoid wasting resources and maximize resource utilization, resources need to be reasonably allocated to each user.
[0003] In the prior art, the resource allocation method combines simple machine learning methods and data analysis methods, and only uses the resource usage quantities of each user at historical moments as training samples. By learning the resource usage quantities of each user at historical moments, resources are adaptively allocated to each user to obtain the resource allocation quantities of each user.
[0004] However, there is a certain correlation relationship between each user, and there is a certain mutual influence between the resource allocation quantities required by different users with a correlation relationship among each user. Using the above method simply cannot consider this mutual influence, resulting in inaccurate resource allocation quantities for each user, and there are situations such as certain resource waste and reduced resource utilization. Summary of the Invention
[0005] In view of this, embodiments of this application provide a method for resource allocation and related devices, so that after resources are allocated to each user, the resource allocation quantities of each user are more accurate, further avoiding resource waste and maximizing resource utilization.
[0006] In a first aspect, an embodiment of this application provides a method for resource allocation, and the method includes:
[0007] Obtain the resource allocation feature of the target user at the t-th moment; t is a positive integer, t≥1;
[0008] Based on the association topology graph between the target user and other users, determine the associated users having an association relationship with the target user from the other users;
[0009] Obtain the resource allocation feature of the associated user at the t-th moment;
[0010] Predict the resource allocation feature of the target user at the (t + 1)-th moment according to the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the target graph attention network model; the target graph attention network model is obtained by training a preset graph attention network according to the association topology graph and the resource usage quantities of each user in the association topology graph at multiple historical moments;
[0011] According to the preset conversion method, convert the resource allocation feature of the target user at the (t + 1)-th moment into the resource allocation quantity of the target user at the (t + 1)-th moment.
[0012] Optionally, the predicting the resource allocation feature of the target user at the (t + 1)-th moment according to the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the target graph attention network model includes:
[0013] Based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the attention mechanism function in the target graph attention network model, determine the correlation coefficient at the t-th moment between the target user and the associated user;
[0014] Based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the correlation coefficient at the t-th moment, predict the resource allocation feature of the target user at the (t + 1)-th moment.
[0015] Optionally, the determining the correlation coefficient at the t-th moment between the target user and the associated user based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the attention mechanism function in the target graph attention network model includes:
[0016] Based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, the linear transformation matrix, and the attention mechanism function, determine the attention coefficient at the t-th moment between the target user and the associated user;
[0017] Perform regularization processing and normalization processing on the attention coefficient at the t-th moment to obtain the correlation coefficient at the t-th moment.
[0018] Optionally, the training steps of the target graph attention network model:
[0019] Obtain the associated topology structure diagram and the resource usage quantities of each user in the associated topology structure diagram at multiple historical moments;
[0020] Based on the resource usage quantities of each user in the associated topology structure diagram at multiple historical moments, determine the resource usage features at multiple historical moments;
[0021] Input the resource usage feature at the q-th moment and the associated topology structure diagram in the resource usage features at multiple historical moments into the preset graph attention network, and output the predicted resource allocation feature at the (q + 1)-th moment corresponding to the resource usage feature at the (q + 1)-th moment in the resource usage features at multiple historical moments; q is a positive integer, q ≥ 1;
[0022] Based on the predicted resource allocation feature at the (q + 1)-th moment, the resource usage feature at the (q + 1)-th moment, and a preset loss function of the preset graph attention network, train the network parameters of the preset graph attention network to minimize the preset loss function.
[0023] Determine the trained preset graph attention network as the target graph attention network model.
[0024] Optionally, the preset loss function includes a mean square error function.
[0025] In a second aspect, an embodiment of the present application provides a resource allocation device, which includes: a first acquisition unit, a determination unit, a second acquisition unit, a prediction unit, and a conversion unit.
[0026] The first acquisition unit is configured to acquire the resource allocation feature of the target user at the t-th moment; t is a positive integer, t ≥ 1.
[0027] The determination unit is configured to determine, based on the association topology graph between the target user and other users, the associated users having an association relationship with the target user from the other users.
[0028] The second acquisition unit is configured to acquire the resource allocation feature of the associated users at the t-th moment.
[0029] The prediction unit is configured to predict the resource allocation feature of the target user at the (t + 1)-th moment according to the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated users at the t-th moment, and the target graph attention network model; the target graph attention network model is obtained by training a preset graph attention network according to the association topology graph and the resource usage quantities of each user in the association topology graph at multiple historical moments.
[0030] The conversion unit is configured to convert the resource allocation feature of the target user at the (t + 1)-th moment into the resource allocation quantity of the target user at the (t + 1)-th moment according to a preset conversion method.
[0031] Optionally, the prediction unit includes: a determination subunit and a prediction subunit.
[0032] The determination subunit is configured to determine the correlation coefficient at the t-th moment between the target user and the associated users based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated users at the t-th moment, and the attention mechanism function in the target graph attention network model.
[0033] The prediction subunit is configured to predict the resource allocation feature of the target user at the (t + 1)-th moment based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the correlation coefficient at the t-th moment.
[0034] Optionally, the determination subunit includes a determination module and a processing module;
[0035] The determination module is configured to determine the attention coefficient at the t-th moment between the target user and the associated user based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, a linear transformation matrix, and the attention mechanism function;
[0036] The processing module is configured to perform regularization processing and normalization processing on the attention coefficient at the t-th moment to obtain the correlation coefficient at the t-th moment.
[0037] Optionally, the apparatus further includes: a training unit, and the training unit is configured to:
[0038] Obtain the associated topology structure diagram and the resource usage quantities of each user in the associated topology structure diagram at multiple historical moments;
[0039] Determine resource usage features at multiple historical moments based on the resource usage quantities of each user in the associated topology structure diagram at multiple historical moments;
[0040] Input the resource usage feature at the q-th moment and the associated topology structure diagram in the multiple historical moment resource usage features into the preset graph attention network, and output the predicted resource allocation feature at the (q + 1)-th moment corresponding to the resource usage feature at the (q + 1)-th moment in the multiple historical moment resource usage features; q is a positive integer, q ≥ 1;
[0041] Train the network parameters of the preset graph attention network based on the predicted resource allocation feature at the (q + 1)-th moment, the resource usage feature at the (q + 1)-th moment, and the preset loss function of the preset graph attention network to minimize the preset loss function;
[0042] Determine the trained preset graph attention network as the target graph attention network model.
[0043] Optionally, the preset loss function includes a mean square error function.
[0044] In a third aspect, an embodiment of the present application provides a computer device, and the computer device includes a processor and a memory:
[0045] The memory is configured to store program code and transmit the program code to the processor;
[0046] The processor is configured to execute the resource allocation method described in the first aspect above according to the instructions in the program code.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing program code, where the program code is used to execute the resource allocation method described in the first aspect above.
[0048] Compared with the prior art, the present application has at least the following advantages:
[0049] Adopting the technical solution of the embodiment of the present application, obtain the resource allocation feature of the target user at the t-th moment; t is a positive integer, t≥1; based on the association topology graph between the target user and other users, determine the associated users having an association relationship with the target user from other users; obtain the resource allocation feature of the associated users at the t-th moment; according to the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated users at the t-th moment, and the target graph attention network model, obtain the resource allocation feature of the target user at the (t + 1)-th moment; the target graph attention network model is obtained by training a preset graph attention network according to the association topology graph and the resource usage quantities of each user in the association topology graph at multiple historical moments; convert the resource allocation feature of the target user at the (t + 1)-th moment into the resource allocation quantity of the target user at the (t + 1)-th moment according to a preset conversion method.
[0050] It can be seen that through the target graph attention network model, this method not only considers the resource allocation feature of the target user at the t-th moment, but also considers the resource allocation feature of the associated users having an association relationship with the target user at the t-th moment, jointly determines the resource allocation feature of the target user at the (t + 1)-th moment, and converts it into the resource allocation quantity of the target user at the (t + 1)-th moment. That is, this method fully considers the mutual influence between the resource allocation quantities required by the target user and the associated users having an association relationship, makes the resource allocation quantity of the target user at the (t + 1)-th moment more accurate, and further avoids resource waste and maximizes resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0052] Figure 1 It is a schematic diagram of the system framework involved in an application scenario in an embodiment of the present application;
[0053] Figure 2A flowchart of a resource allocation method provided by an embodiment of the present application;
[0054] Figure 3 A schematic diagram of a correlation coefficient provided by an embodiment of the present application;
[0055] Figure 4 A schematic structural diagram of a resource allocation device provided by an embodiment of the present application. Detailed implementation manners
[0056] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0057] At present, resource allocation methods generally combine simple machine learning methods and data analysis methods, and only use the resource usage quantities of each user at historical moments as training samples. By learning the resource usage quantities of each user at historical moments, resources are adaptively allocated to each user to obtain the resource allocation quantities of each user. However, through research, it is found that there is a certain correlation relationship between each user, and there is a certain mutual influence between the resource allocation quantities required by different users with a correlation relationship among each user. Using the above methods simply cannot consider this mutual influence, resulting in inaccurate resource allocation quantities for each user, and there are situations such as certain resource waste and reduced resource utilization rate.
[0058] To solve this problem, in the embodiment of the present application, obtain the resource allocation feature of the target user at the t-th moment; t is a positive integer, t≥1; based on the correlation topology graph between the target user and other users, determine the associated users having a correlation relationship with the target user from other users; obtain the resource allocation feature of the associated users at the t-th moment; according to the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated users at the t-th moment, and the target graph attention network model, obtain the resource allocation feature of the target user at the (t + 1)-th moment; the target graph attention network model is obtained by training a preset graph attention network according to the correlation topology graph and the resource usage quantities of each user in the correlation topology graph at multiple historical moments; according to a preset conversion method, convert the resource allocation feature of the target user at the (t + 1)-th moment into the resource allocation quantity of the target user at the (t + 1)-th moment.
[0059] It can be seen that through the target graph attention network model, this method not only considers the resource allocation characteristics of the target user at the t-th moment, but also considers the resource allocation characteristics of the associated users with an associated relationship with the target user at the t-th moment, jointly determines the resource allocation characteristics of the target user at the (t + 1)-th moment, and converts them into the resource allocation quantity of the target user at the (t + 1)-th moment. That is, this method fully considers the mutual influence between the resource allocation quantities required by the target user and the associated users with an associated relationship, making the resource allocation quantity of the target user at the (t + 1)-th moment more accurate, further avoiding resource waste and maximizing resource utilization.
[0060] For example, one of the scenarios of the embodiments of the present application can be applied to the scenario as Figure 1 shown. This scenario includes a server 101 and various terminal devices 102. Each user uses a respective terminal device 102. Any one of the users is used as the target user, and the users other than the target user among all users are used as other users. The server 101 adopts the implementation manner provided by the embodiments of the present application to adaptively allocate resources to each user to obtain the resource allocation quantity of each user.
[0061] First, in the above application scenario, although the action description of the implementation manner provided by the embodiments of the present application is described as being executed by the server 101; however, the embodiments of the present application are not limited in terms of the execution subject, as long as the actions disclosed in the implementation manner provided by the embodiments of the present application are executed.
[0062] Second, the above scenario is only a scenario example provided by the embodiments of the present application, and the embodiments of the present application are not limited to this scenario.
[0063] Next, in conjunction with the accompanying drawings, the specific implementation manners of the resource allocation method and related devices in the embodiments of the present application will be described in detail through embodiments.
[0064] Exemplary method
[0065] Refer to Figure 2 , which shows a schematic flowchart of a resource allocation method in the embodiments of the present application.
[0066] In this embodiment, the method may include the following steps, for example:
[0067] Step 201: Obtain the resource allocation characteristics of the target user at the t-th moment; t is a positive integer, t ≥ 1.
[0068] In the embodiments of the present application, any one of the users is used as the target user, and the users other than the target user among all the users are used as other users. In the process of resource allocation, in order to reasonably allocate resources to each user, first, it is necessary to obtain the resource allocation characteristics of the target user at the t-th moment; wherein, the resource allocation characteristics of the target user at the t-th moment are obtained by converting the resource allocation quantity of the target user at the t-th moment.
[0069] As an example, the resources mainly include K types such as computing resources, memory resources, external storage resources,..., and network resources, that is, the number of resource categories is K, and the resource allocation quantity of the target user i at the t-th moment is Wherein, represents the resource allocation quantity of the first type of the target user i at the t-th moment, represents the resource allocation quantity of the second type of the target user i at the t-th moment, represents the resource allocation quantity of the k-th type of the target user i at the t-th moment. The resource allocation quantities of each type can be concatenated as a one-dimensional vector to obtain the resource allocation characteristics of the target user i at the t-th moment
[0070] Step 202: Based on the association topology graph between the target user and other users, determine the associated users having an association relationship with the target user from the other users.
[0071] In the embodiments of the present application, since there is a certain association relationship between each user, there is a certain mutual influence between the resource allocation quantities required by different users having an association relationship among all the users; therefore, it is necessary to determine the associated users having an association relationship with the target user from the other users through the association topology graph between the target user and other users indicating a certain association relationship between each user, so as to consider the certain mutual influence between the resource allocation quantities required by the target user and the associated users having an association relationship during subsequent resource allocation.
[0072] Step 203: Obtain the resource allocation characteristics of the associated users at the t-th moment.
[0073] In the embodiments of the present application, after determining the associated users having an association relationship with the target user in step 202, referring to step 201, it is also necessary to obtain the resource allocation characteristics of the associated users at the t-th moment; wherein, the resource allocation characteristics of the associated users at the t-th moment are obtained by converting the resource allocation quantity of the associated users at the t-th moment.
[0074] As an example, if the target user and the associated users are a total of N users, then the resource allocation characteristics of the target user at the t-th moment and the resource allocation characteristics of the associated users at the t-th moment can be expressed as F represents the dimension of the resource allocation feature, and its initial value is equal to the number of resource categories K.
[0075] Step 204: Predict the resource allocation feature of the target user at the (t + 1)-th moment according to the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the target graph attention network model; the target graph attention network model is obtained by training a preset graph attention network according to the associated topology structure graph and the resource usage quantities of each user in the associated topology structure graph at multiple historical moments.
[0076] In the embodiment of the present application, after obtaining the resource allocation feature of the target user at the t-th moment in step 201 and obtaining the resource allocation feature of the associated user at the t-th moment in step 203, the resource allocation feature of the target user at the t-th moment and the resource allocation feature of the associated user at the t-th moment can be input into the target graph attention network model obtained by training a preset graph attention network according to the associated topology structure graph in step 202 and the resource usage quantities of each user in the associated topology structure graph at multiple historical moments for prediction, and the resource allocation feature of the target user at the (t + 1)-th moment is output.
[0077] When specifically implementing step 204, first, input the resource allocation feature of the target user at the t-th moment and the resource allocation feature of the associated user at the t-th moment into the target graph attention network model. Through the attention mechanism function in the target graph attention network model, the correlation coefficient at the t-th moment between the target user and the associated user can be determined, indicating that there is a certain mutual influence between the resource allocation quantities required by the target user and the associated user with an associated relationship; then, on this basis, through the resource allocation feature of the target user at the t-th moment and the resource allocation feature of the associated user at the t-th moment, combined with the correlation coefficient at the t-th moment between the target user and the associated user, the resource allocation feature of the target user at the (t + 1)-th moment can be predicted. Therefore, in an optional implementation manner of the embodiment of the present application, step 204 may include the following steps 2041-2042:
[0078] Step 2041: Determine the correlation coefficient at the t-th moment between the target user and the associated user based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the attention mechanism function in the target graph attention network model.
[0079] When specifically implementing step 2041, first, after inputting the resource allocation feature of the target user at the t-th moment and the resource allocation feature of the associated user at the t-th moment into the target graph attention network model, the dimension of the resource allocation feature may change. To retain sufficient expressive power, a learnable linear transformation matrix is used to transform the resource allocation feature into a high-order feature, and through the attention mechanism function, the attention coefficient at the t-th moment between the target user and the associated user is calculated; then, considering that there is more than one associated user associated with the target user, in order to better express the certain mutual influence between the resource allocation quantities required by the target user and the associated users with an associated relationship, it is also necessary to perform unified regularization processing and normalization processing on the attention coefficient at the t-th moment between the target user and the associated user, so as to obtain the correlation coefficient at the t-th moment between the target user and the associated user. Therefore, in an optional implementation manner of the embodiments of the present application, step 2041 may include the following steps A-step B:
[0080] Step A: Based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, the linear transformation matrix, and the attention mechanism function, determine the attention coefficient at the t-th moment between the target user and the associated user.
[0081] As an example, the following formula is used to determine the attention coefficient at the t-th moment between the target user and the associated user:
[0082]
[0083] Wherein, represents the attention coefficient at the t-th moment between the target user i and the associated user j, represents the resource allocation feature of the target user i at the t-th moment, represents the resource allocation feature of the associated user j at the t-th moment, W represents the linear transformation matrix, φ represents the attention mechanism function, and regarding the selection of φ, it can be any parameter-free form of distance metric method, such as the inner product.
[0084] Step B: Perform regularization processing and normalization processing on the attention coefficient at the t-th moment to obtain the correlation coefficient at the t-th moment.
[0085] As an example, the following formula is used to determine the correlation coefficient at the t-th moment between the target user and the associated user:
[0086]
[0087] Wherein, softmax represents the normalization function, represents the user set formed by the target user and the associated users.
[0088] To more effectively achieve non - linear representation, when calculating α ij , the LeakyReLU function is added as follows:
[0089]
[0090] Among them, LeakyReLU is one of the commonly used activation functions in deep learning, y = LeakyReLU(x)=max(0,x)+leak×min(0,x), where leak is a very small constant.
[0091] Based on the above formula, refer to Figure 3 a schematic diagram of the correlation coefficient shown as follows.
[0092] Step 2042: Predict the resource allocation feature of the target user at the (t + 1)-th moment based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the correlation coefficient at the t-th moment.
[0093] As an example, the following formula is used to predict the resource allocation feature of the target user at the (t + 1)-th moment:
[0094]
[0095] Among them, σ represents the non - linear activation function.
[0096] Regarding the training process of the target graph attention network model in step 204: First, obtain a preset graph attention network for training a preset model, that is, an associated topological structure graph and the resource usage quantities of each user in the associated topological structure graph at multiple historical moments, and determine the corresponding resource usage features at multiple historical moments based on the resource usage quantities at multiple historical moments; Secondly, input the resource usage feature at the q-th moment and the associated topological structure graph in the resource usage features at multiple historical moments into the preset graph attention network for prediction, and output the predicted resource allocation feature at the (q + 1)-th moment corresponding to the resource usage feature at the (q + 1)-th moment; Then, through the predicted resource allocation feature at the (q + 1)-th moment and the resource usage feature at the (q + 1)-th moment, combined with the preset loss function of the preset graph attention network, with minimizing the preset loss function as the training objective, iteratively train the network parameters of the preset graph attention network; Finally, determine the trained preset graph attention network as the target graph attention network model. Therefore, in an optional implementation manner of the embodiments of the present application, the training steps of the target graph attention network model may, for example, include the following steps C - step G:
[0097] Step C: Obtain the associated topological structure graph and the resource usage quantities of each user in the associated topological structure graph at multiple historical moments.
[0098] Step D: Determine the resource usage characteristics at multiple historical moments based on the resource usage quantities of each user in the associated topological structure diagram at multiple historical moments.
[0099] Step E: Input the resource usage characteristic at the q-th moment and the associated topological structure diagram among the resource usage characteristics at multiple historical moments into the preset graph attention network, and output the predicted resource allocation characteristic at the (q + 1)-th moment corresponding to the resource usage characteristic at the (q + 1)-th moment; q is a positive integer, and q ≥ 1.
[0100] As an example, the resource usage characteristic at the (q + 1)-th moment of each user (a total of M users) is The predicted resource allocation characteristic at the (q + 1)-th moment is
[0101] Step F: Based on the predicted resource allocation characteristic at the (q + 1)-th moment, the resource usage characteristic at the (q + 1)-th moment, and the preset loss function of the preset graph attention network, train the network parameters of the preset graph attention network to minimize the preset loss function.
[0102] Among them, the preset loss function represents the difference between the predicted resource allocation characteristic at the (q + 1)-th moment and the resource usage characteristic at the (q + 1)-th moment. For example, the preset loss function may include the mean square error function. Therefore, in an optional implementation manner of the embodiments of the present application, the preset loss function includes the mean square error function.
[0103] As an example, the preset loss function adopts the following formula:
[0104]
[0105] Step G: Determine the trained preset graph attention network as the target graph attention network model.
[0106] Step 205: Convert the resource allocation characteristic at the (t + 1)-th moment of the target user into the resource allocation quantity at the (t + 1)-th moment of the target user according to a preset conversion method.
[0107] In the embodiments of the present application, after predicting the resource allocation characteristic at the (t + 1)-th moment of the target user in step 204, it is also necessary to convert the resource allocation characteristic at the (t + 1)-th moment of the target user into the resource allocation quantity at the (t + 1)-th moment of the target user according to a preset conversion method representing the conversion method between the resource allocation quantity and the resource allocation characteristic, so as to complete the reasonable allocation of resources.
[0108] Through various embodiments provided by this embodiment, obtain the resource allocation characteristics of the target user at the t-th moment; t is a positive integer, t≥1; based on the association topology graph between the target user and other users, determine the associated users having an association relationship with the target user from other users; obtain the resource allocation characteristics of the associated users at the t-th moment; according to the resource allocation characteristics of the target user at the t-th moment, the resource allocation characteristics of the associated users at the t-th moment, and the target graph attention network model, obtain the resource allocation characteristics of the target user at the (t + 1)-th moment; the target graph attention network model is obtained by training a preset graph attention network according to the association topology graph and the resource usage quantities of each user in the association topology graph at multiple historical moments; convert the resource allocation characteristics of the target user at the (t + 1)-th moment into the resource allocation quantity of the target user at the (t + 1)-th moment according to a preset conversion method.
[0109] It can be seen that through the target graph attention network model, this method not only considers the resource allocation characteristics of the target user at the t-th moment, but also considers the resource allocation characteristics of the associated users having an association relationship with the target user at the t-th moment, jointly determines the resource allocation characteristics of the target user at the (t + 1)-th moment, and converts them into the resource allocation quantity of the target user at the (t + 1)-th moment. That is, this method fully considers the mutual influence between the resource allocation quantities required by the target user and the associated users having an association relationship, makes the resource allocation quantity of the target user at the (t + 1)-th moment more accurate, and further avoids resource waste and maximizes resource utilization rate.
[0110] See Figure 4 , which shows a schematic structural diagram of a resource allocation device in an embodiment of the present application. In this embodiment, the device may specifically include, for example: a first acquisition unit 401, a determination unit 402, a second acquisition unit 403, a prediction unit 404, and a conversion unit 405;
[0111] The first acquisition unit 401 is configured to acquire the resource allocation characteristics of the target user at the t-th moment; t is a positive integer, t≥1;
[0112] The determination unit 402 is configured to determine, based on the association topology graph between the target user and other users, the associated users having an association relationship with the target user from the other users;
[0113] The second acquisition unit 403 is configured to acquire the resource allocation characteristics of the associated users at the t-th moment;
[0114] A prediction unit 404, configured to predict the resource allocation feature of the target user at the (t + 1)-th moment according to the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and a target graph attention network model; the target graph attention network model is obtained by training a preset graph attention network according to the associated topology graph and the resource usage quantities of each user in the associated topology graph at multiple historical moments;
[0115] A conversion unit 405, configured to convert the resource allocation feature of the target user at the (t + 1)-th moment into the resource allocation quantity of the target user at the (t + 1)-th moment according to a preset conversion method.
[0116] In an optional implementation manner of the embodiment of the present application, the prediction unit 404 includes: a determination subunit and a prediction subunit;
[0117] The determination subunit is configured to determine the correlation coefficient at the t-th moment between the target user and the associated user based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the attention mechanism function in the target graph attention network model;
[0118] The prediction subunit is configured to predict the resource allocation feature of the target user at the (t + 1)-th moment based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the correlation coefficient at the t-th moment.
[0119] In an optional implementation manner of the embodiment of the present application, the determination subunit includes a determination module and a processing module;
[0120] The determination module is configured to determine the attention coefficient at the t-th moment between the target user and the associated user based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, a linear transformation matrix, and the attention mechanism function;
[0121] The processing module is configured to perform regularization processing and normalization processing on the attention coefficient at the t-th moment to obtain the correlation coefficient at the t-th moment.
[0122] In an optional implementation manner of the embodiment of the present application, the device further includes: a training unit, and the training unit is configured to:
[0123] Obtain the associated topology graph and the resource usage quantities of each user in the associated topology graph at multiple historical moments;
[0124] Determine resource usage features at multiple historical moments based on the resource usage quantities of each user in the associated topology graph at multiple historical moments;
[0125] Input the resource usage feature at the q-th moment and the associated topological structure diagram among the multiple historical moment resource usage features into the preset graph attention network, and output the predicted resource allocation feature at the (q + 1)-th moment corresponding to the resource usage feature at the (q + 1)-th moment among the multiple historical moment resource usage features; q is a positive integer, q ≥ 1;
[0126] Based on the predicted resource allocation feature at the (q + 1)-th moment, the resource usage feature at the (q + 1)-th moment, and the preset loss function of the preset graph attention network, train the network parameters of the preset graph attention network to minimize the preset loss function;
[0127] Determine the trained preset graph attention network as the target graph attention network model.
[0128] In an optional implementation manner of the embodiments of the present application, the preset loss function includes a mean square error function.
[0129] Through various implementation manners provided in this embodiment, obtain the resource allocation feature of the target user at the t-th moment; t is a positive integer, t ≥ 1; based on the associated topological structure diagram between the target user and other users, determine the associated users having an associated relationship with the target user from other users; obtain the resource allocation feature of the associated users at the t-th moment; according to the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated users at the t-th moment, and the target graph attention network model, obtain the resource allocation feature of the target user at the (t + 1)-th moment; the target graph attention network model is obtained by training a preset graph attention network according to the associated topological structure diagram and the resource usage quantities of each user in the associated topological structure diagram at multiple historical moments; convert the resource allocation feature of the target user at the (t + 1)-th moment into the resource allocation quantity of the target user at the (t + 1)-th moment according to a preset conversion manner.
[0130] It can be seen that through the target graph attention network model, this method not only considers the resource allocation feature of the target user at the t-th moment, but also considers the resource allocation feature of the associated users having an associated relationship with the target user at the t-th moment, jointly determines the resource allocation feature of the target user at the (t + 1)-th moment, and converts it into the resource allocation quantity of the target user at the (t + 1)-th moment. That is, this method fully considers the mutual influence between the resource allocation quantities required by the target user and the associated users having an associated relationship, makes the resource allocation quantity of the target user at the (t + 1)-th moment more accurate, and further avoids resource waste and maximizes resource utilization.
[0131] In addition, an embodiment of the present application further provides a computer device, and the computer device includes a processor and a memory:
[0132] The memory is used to store program code and transmit the program code to the processor;
[0133] The processor is used to execute the resource allocation method described in the above method embodiments according to the instructions in the program code.
[0134] An embodiment of the present application further provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the resource allocation method described in the above method embodiments.
[0135] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method part.
[0136] Those skilled in the art can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of the examples have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0137] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. The term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0138] The above are only the preferred embodiments of the present application and do not impose any formal restrictions on the present application. Although the present application has been disclosed above with the preferred embodiments, it is not intended to limit the present application. Any person skilled in the art can make many possible changes and modifications to the technical solution of the present application, or modify it into equivalent embodiments with equivalent changes, without departing from the scope of the technical solution of the present application. Therefore, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application still fall within the scope of the protection of the technical solution of the present application.
Claims
1. A method for resource allocation, characterized in that, Including: Obtain the resource allocation characteristics of the target user at the t-th moment; t is a positive integer, t≥1; Based on the association topology graph between the target user and other users, determine the associated users having an association relationship with the target user from the other users; Obtain the resource allocation characteristics of the associated users at the t-th moment; According to the resource allocation characteristics of the target user at the t-th moment, the resource allocation characteristics of the associated users at the t-th moment, and the target graph attention network model, predict the resource allocation characteristics of the target user at the (t + 1)-th moment; the target graph attention network model is obtained by training a preset graph attention network according to the association topology graph and the resource usage quantities of each user in the association topology graph at multiple historical moments; Convert the resource allocation characteristics of the target user at the (t + 1)-th moment into the resource allocation quantity of the target user at the (t + 1)-th moment according to a preset conversion method; Among them, the training steps of the target graph attention network model include: Obtain the association topology graph and the resource usage quantities of each user in the association topology graph at multiple historical moments; Based on the resource usage quantities of each user in the association topology graph at multiple historical moments, determine the resource usage characteristics at multiple historical moments; Input the resource usage characteristics at the q-th moment and the association topology graph in the resource usage characteristics at multiple historical moments into the preset graph attention network, and output the predicted resource allocation characteristics at the (q + 1)-th moment corresponding to the resource usage characteristics at the (q + 1)-th moment; q is a positive integer, q≥1; Based on the predicted resource allocation characteristics at the (q + 1)-th moment, the resource usage characteristics at the (q + 1)-th moment, and the preset loss function of the preset graph attention network, train the network parameters of the preset graph attention network to minimize the preset loss function; Determine the trained preset graph attention network as the target graph attention network model.
2. The method according to claim 1, characterized in that, The predicting the resource allocation characteristics of the target user at the (t + 1)-th moment according to the resource allocation characteristics of the target user at the t-th moment, the resource allocation characteristics of the associated users at the t-th moment, and the target graph attention network model includes: Based on the resource allocation characteristics of the target user at the t-th moment, the resource allocation characteristics of the associated users at the t-th moment, and the attention mechanism function in the target graph attention network model, determine the correlation coefficient at the t-th moment between the target user and the associated users; Based on the resource allocation characteristics of the target user at the t-th moment, the resource allocation characteristics of the associated users at the t-th moment, and the correlation coefficient at the t-th moment, predict the resource allocation characteristics of the target user at the (t + 1)-th moment.
3. The method according to claim 2, characterized in that, The determining the correlation coefficient at the t-th moment between the target user and the associated users based on the resource allocation characteristics of the target user at the t-th moment, the resource allocation characteristics of the associated users at the t-th moment, and the attention mechanism function in the target graph attention network model includes: Determine the attention coefficient at the t-th moment between the target user and the associated user based on the resource allocation characteristics of the target user at the t-th moment, the resource allocation characteristics of the associated user at the t-th moment, the linear transformation matrix, and the attention mechanism function; Perform regularization processing and normalization processing on the attention coefficient at the t-th moment to obtain the correlation coefficient at the t-th moment.
4. The method according to claim 1, characterized in that, The preset loss function includes the mean square error function.
5. A device for resource allocation, characterized in that, It includes: The first acquisition unit, the determination unit, the second acquisition unit, the prediction unit, and the conversion unit; The first acquisition unit is used to acquire the resource allocation characteristics of the target user at the t-th moment; t is a positive integer, t≥1; The determination unit is used to determine the associated user having an association relationship with the target user from the other users based on the association topology graph between the target user and the other users; The second acquisition unit is used to acquire the resource allocation characteristics of the associated user at the t-th moment; The prediction unit is used to predict the resource allocation characteristics of the target user at the (t + 1)-th moment according to the resource allocation characteristics of the target user at the t-th moment, the resource allocation characteristics of the associated user at the t-th moment, and the target graph attention network model; the target graph attention network model is obtained by training a preset graph attention network according to the association topology graph and the resource usage amounts of each user in the association topology graph at multiple historical moments; The conversion unit is used to convert the resource allocation characteristics of the target user at the (t + 1)-th moment into the resource allocation amount of the target user at the (t + 1)-th moment according to a preset conversion method; The device further includes a training unit, which is used for: Acquire the association topology graph and the resource usage amounts of each user in the association topology graph at multiple historical moments; Determine the resource usage characteristics at multiple historical moments based on the resource usage amounts of each user in the association topology graph at multiple historical moments; Input the resource usage characteristics at the q-th moment and the association topology graph in the resource usage characteristics at multiple historical moments into the preset graph attention network, and output the predicted resource allocation characteristics at the (q + 1)-th moment corresponding to the resource usage characteristics at the (q + 1)-th moment; q is a positive integer, q≥1; Based on the predicted resource allocation characteristics at the (q + 1)-th moment, the resource usage characteristics at the (q + 1)-th moment, and the preset loss function of the preset graph attention network, train the network parameters of the preset graph attention network to minimize the preset loss function; Determine the trained preset graph attention network as the target graph attention network model.
6. The device according to claim 5, characterized in that, The prediction unit includes: a determination subunit and a prediction subunit; The determination subunit is used to determine the correlation coefficient at the t-th moment between the target user and the associated user based on the resource allocation characteristics of the target user at the t-th moment, the resource allocation characteristics of the associated user at the t-th moment, and the attention mechanism function in the target graph attention network model; The prediction subunit is configured to predict the resource allocation feature of the target user at the (t + 1)-th moment based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, and the correlation coefficient at the t-th moment.
7. The device according to claim 6, wherein, The determination subunit includes a determination module and a processing module; The determination module is configured to determine the attention coefficient at the t-th moment between the target user and the associated user based on the resource allocation feature of the target user at the t-th moment, the resource allocation feature of the associated user at the t-th moment, a linear transformation matrix, and the attention mechanism function; The processing module is configured to perform regularization processing and normalization processing on the attention coefficient at the t-th moment to obtain the correlation coefficient at the t-th moment.
8. A computer device, wherein, The computer device includes a processor and a memory: The memory is configured to store program code and transmit the program code to the processor; The processor is configured to execute the resource allocation method according to any one of claims 1-4 based on the instructions in the program code.
9. A computer-readable storage medium, wherein, The computer-readable storage medium is configured to store program code, and the program code is used to execute the resource allocation method according to any one of claims 1-4.
Citation Information
Patent Citations
Resource data processing method and device, computer equipment and storage medium
CN112749005A
Data recommendation method and device based on graph neural network, and electronic equipment
CN114491294A