Communication and computing resource joint allocation algorithm based on diffusion model

Through a joint allocation algorithm of communication and computing resources based on a diffusion model, environmental information classification and a custom loss function are used to generate an efficient resource allocation solution, which solves the problems of high complexity and slow convergence in existing technologies and realizes high-precision resource allocation in the Internet of Vehicles environment.

CN120743510APending Publication Date: 2025-10-03NORTHEASTERN UNIV AT QINHUANGDAO
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510833930.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-10-03

AI Technical Summary

Technical Problem

When dealing with complex, high-dimensional communication and computing resource allocation problems, existing technologies have problems such as high algorithm complexity, slow convergence, easy falling into local optimal solutions, and inaccurate resource allocation. Especially in dynamically changing systems, especially in large-scale resource allocation scenarios, the training process is complex and unstable.

Method used

A communication and computing resource joint allocation algorithm based on a diffusion model is adopted to generate an efficient resource allocation scheme by constructing an environmental information dataset, using K-Means clustering and convolutional neural network classifier, combined with a custom loss function and an improved sampling function.

Benefits of technology

The accuracy and efficiency of the resource allocation scheme are improved, and the problems of high complexity and slow convergence of the existing algorithm are solved. The generated scheme performs well in terms of latency and energy consumption and is suitable for real-time Internet of Vehicles environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743510A_ABST
    Figure CN120743510A_ABST
Patent Text Reader

Abstract

The invention provides a communication and computing resource joint allocation algorithm based on a diffusion model, and relates to the technical field of allocation algorithms. The communication and computing resource joint allocation algorithm based on the diffusion model comprises the following steps: S1, defining input and output; s2, constructing an environment information data set; s3, preprocessing the data set; s4, training an environment information classifier; s5, training a diffusion model; s6, generating a communication and computing resource joint allocation scheme by using a diffusion model; and S7, evaluating a resource allocation scheme. According to the method, real-time Internet of Vehicles environment information is input into a pre-trained environment information classifier to predict the category of the environment information, and the category of the environment information is used as a guide word to guide a diffusion model to generate a proper communication and computing resource joint allocation scheme in the environment. The problems that an existing algorithm is high in complexity, low in convergence speed and prone to falling into a local optimal solution are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of allocation algorithms, and in particular to a communication and computing resource joint allocation algorithm based on a diffusion model. Background Art

[0002] DQN is a value-based reinforcement learning algorithm that guides decision-making by learning an action-value function. When solving the joint allocation of communication and computing resources, DQN discretizes the action space to learn the Q-value function, which is inefficient for continuous resource allocation problems and may result in poor accuracy. Furthermore, DQN is prone to slow convergence and unstable training in high-dimensional environments, especially in dynamically changing systems. Deep Deterministic Policy Gradient (DDPG) is a reinforcement learning algorithm that handles continuous action spaces by directly learning a policy function to guide action selection. While DDPG has advantages in continuous action spaces, its ability to handle complex, high-dimensional state spaces and constraints is limited. DDPG's policy network is prone to unstable training or overfitting in high-dimensional environments. Furthermore, due to its deterministic policy, it lacks sufficient exploration and may become stuck in local optima. The MADRL algorithm optimizes resource allocation through the cooperation of multiple agents. The training process is extremely complex, especially when multiple agents need to interact in a highly dynamic and competitive environment, which can severely affect the algorithm's stability and convergence speed. At the same time, as the number of intelligent agents increases, the dimensions of the state space and action space expand dramatically, and the computing resources and time required for training also grow exponentially, resulting in limited application in large-scale, real-time communication and computing resource allocation problems.

[0003] Algorithms based on multi-agent Dueling DQN combined with distributed coordinated learning lack adaptability in complex and high-dimensional environments. Multi-agent systems require managing the collaboration and competition between multiple agents, which complicates the algorithm's training process. This is particularly true in large-scale resource allocation scenarios, resulting in slow convergence and a tendency to become trapped in local optima. Furthermore, while distributed coordinated learning can accelerate convergence, it can encounter communication delays or data synchronization issues in distributed systems, impacting overall system optimization.

[0004] The JTO-CCRO algorithm decouples the two problems of task offloading and resource allocation and optimizes them using an alternating iterative approach. Although this approach simplifies the system optimization process to a certain extent, due to the close relationship between task offloading and resource allocation, this decoupling may result in a failure to fully consider the synergistic effects of the two, thereby affecting the accuracy of the optimization results. In addition, JTO-CCRO uses the Nash equilibrium solution in game theory to deal with the task offloading problem. Although it can provide a relatively accurate offloading strategy, the computational complexity of solving the Nash equilibrium in complex systems is high, which may lead to low efficiency. In terms of resource optimization, JTO-CCRO relies on the Lagrange multiplication method for solution, which may be limited to local optimal solutions when dealing with nonlinear and complex constraints, and has difficulty coping with the uncertainty in complex scenarios. Summary of the Invention

[0005] (1) Technical problems solved

[0006] In view of the deficiencies in the prior art, the present invention provides a joint allocation algorithm for communication and computing resources based on a diffusion model, which solves the defects and deficiencies in the prior art.

[0007] (2) Technical solution

[0008] To achieve the above objectives, the present invention is implemented through the following technical solution: a communication and computing resource joint allocation algorithm based on a diffusion model, the algorithm comprising the following steps:

[0009] S1: Define input and output: The input is defined as real-time Internet of Vehicles environment information, and the output is defined as a joint allocation scheme for communication and computing resources. Both input and output are represented in the form of tensors, where the dimension of the output tensor is three times the number of channels, representing the communication power, bandwidth, and CPU frequency allocated to each channel respectively.

[0010] S2: Constructing an environmental information dataset: First, build a simulation environment for the Internet of Vehicles scenario using Python. Then, collect environmental information in this simulation environment and organize the collected environmental information data into an environmental information dataset.

[0011] S3: Dataset preprocessing: For the dataset obtained in step 2, use the K-Means clustering algorithm to cluster all the data in the dataset. According to the clustering results, add a "category" item to the dataset. The category obtained by the K-Means algorithm is the content of the "category" item.

[0012] S4: Training the environmental information classifier: Use Python to write a convolutional neural network classifier, and then use the preprocessed dataset in step 3 to train the written classifier;

[0013] S5: Training the diffusion model: Set the training parameters and use the preprocessed dataset in step 3 to train the diffusion model.

[0014] S6: Generate a joint allocation plan for communication and computing resources using the diffusion model: Continue to collect real-time Internet of Vehicles environmental information from the simulation environment built in step 2, and input the collected environmental information into the environmental information classifier to predict the category of the environmental information. The category of the environmental information is then used as a guide word to guide the diffusion model to generate a corresponding resource allocation plan;

[0015] S7: Resource allocation scheme evaluation: The generated communication and computing resource joint allocation scheme is evaluated using latency, energy consumption, and the combined weight of latency and energy consumption as evaluation indicators.

[0016] Preferably, in the step one, the definitions of input and output are first clarified, wherein the input is environmental information and the output is a resource allocation plan, both of which are expressed in the form of tensors; a scenario is considered in which a UAV cooperates with an edge computing node to communicate in the Internet of Vehicles, in which the UAV acts as a mobile edge computing node; the input environmental information includes the number of channels, the total communication power of the UAV, the total bandwidth of the UAV, the total CPU frequency of the UAV, the total communication power of the edge computing node, the total bandwidth of the edge computing node, the total CPU frequency of the edge computing node, the data volume and computing volume of the data transmission task, the data volume and computing volume of the computing task, the UAV channel gain, the edge computing node channel gain, the vehicle channel gain, the UAV height, the UAV coverage range, the edge computing node coverage range and the noise power of the channel; the dimension of the output tensor is three times the number of channels, corresponding to the communication power, bandwidth and CPU frequency allocated to each channel respectively.

[0017] Preferably, the algorithm takes the pure Gaussian noise generated by the noise addition process, the category predicted by the environmental information classifier, and the time step as input and feeds them into U-net for noise prediction; then, removes the predicted noise to obtain a new resource allocation plan representation, and repeats this process according to the set number of time steps until the final high-dimensional resource allocation plan representation is obtained; finally, the high-dimensional tensor is converted into a low-dimensional tensor through a dimensionality reduction operation, thereby obtaining a low-dimensional representation of the final resource allocation plan.

[0018] Preferably, the denoising process of the diffusion model includes the following improvements: data dimensionality increase and dimensionality reduction: in the process of generating content by the diffusion model, if the data dimension is low, the generated content will be poor; in order to avoid generating a joint allocation scheme of communication and computing resources with poor quality, a method of data dimensionality increase and dimensionality reduction is proposed; specifically, first starting from a random resource allocation scheme represented by a low-dimensional tensor, the low-dimensional tensor representing the random resource allocation scheme is expanded to a high-dimensional tensor through a data dimensionality increase operation; in the process of denoising the diffusion model, the high-dimensional tensor representing the random resource allocation scheme is used as the input of the diffusion model, and the high-dimensional tensor representing the random resource allocation scheme is used as the input of the diffusion model under the guidance of environmental information. Under the guidance, the diffusion model is guided to generate a high-dimensional tensor representation of the final resource allocation plan; finally, the high-dimensional tensor representing the final resource allocation plan is reduced to a low-dimensional tensor through data dimensionality reduction, and the low-dimensional tensor is converted into a joint allocation plan for communication and computing resources; among them, the dimensions of the low-dimensional tensor representing the random resource allocation plan and the low-dimensional tensor representing the final resource allocation plan should be three times the number of channels, representing the communication power, bandwidth and CPU frequency allocated to each channel respectively; through this method of data dimensionality increase and decrease, the generation ability of the diffusion model is fully utilized to avoid the problem of poor generation effect due to low data dimensionality.

[0019] Preferably, the denoising process of the diffusion model further includes the following improvements: Deterministic sampling function: In the traditional diffusion model, the sampling function is as shown in formula (1);

[0020]

[0021] Here, X t-1 represents the data before adding noise, X t Indicates that in X t-1 The data after adding one step of noise; α t is the noise scaling factor at step t, β t is the noise variance at step t; α t and β t The relationship between α is: t +β t =1; In addition, σ t It is a parameter related to the time step t, which is used to indicate the degree of added noise; ∈ θ (X t , t, y) represents the noise predicted by U-net; y represents the category of wireless network environment information, that is, the guide word that guides the diffusion model to generate resource allocation solutions; z represents Gaussian noise; In this sampling formula, σ t Z can be regarded as adding a certain degree of random Gaussian noise to the sampled data during the sampling process, thereby increasing the diversity of the content generated by the diffusion model;

[0022] The sampling function of the diffusion model is improved specifically. The improved sampling function is shown in formula (2).

[0023]

[0024] This approach effectively reduces the diversity of resource allocation solutions generated by the diffusion model, allowing the model to focus more on generating a single optimal solution. This optimization results in better performance in terms of latency and energy consumption, significantly improving the overall efficiency and accuracy of the solution.

[0025] Preferably, the denoising process of the diffusion model further includes the following improvements: a customized delay energy consumption weighting function is used as the loss function of the diffusion model: in the traditional diffusion model, the loss function is shown in formula (3);

[0026] L=||∈-∈ θ (X t , t, y)|| 2 (3)

[0027] This loss function represents the noise ∈ added during the noise addition process and the noise ∈ predicted by U-net (the core component of the diffusion model, used to predict noise) θ (X t , t, y) between the square; where y represents the category of wireless network environment information, that is, the guide word for the diffusion model to generate a resource allocation solution;

[0028] In order to enable the diffusion model to generate a joint allocation scheme for communication and computing resources with smaller latency, energy consumption, and the combined weight of latency and energy consumption, a custom loss function suitable for generating a joint allocation scheme for communication and computing resources is proposed; the improved loss function is shown in formula (4);

[0029] L=δ·(ρT+ξE) (4)

[0030] Where T is the delay corresponding to the resource allocation scheme generated by the diffusion model, and E is the energy consumption corresponding to the resource allocation scheme generated by the diffusion model. ρ and ξ are weight coefficients used to determine the impact of delay and energy consumption in the loss function. δ is a hyperparameter used to control the magnitude of the overall loss.

[0031] (3) Beneficial effects

[0032] The present invention provides a joint allocation algorithm for communication and computing resources based on a diffusion model. It has the following beneficial effects:

[0033] 1. This invention inputs real-time Internet of Vehicles (IoV) environmental information into a pre-trained environmental information classifier to predict the environmental information category. Using the environmental information category as a guide, the diffusion model generates an appropriate joint allocation plan for communication and computing resources in this environment. This solves the problems of existing algorithms, such as high complexity, slow convergence, and the tendency to fall into local optimal solutions.

[0034] 2. The present invention improves the denoising process of the diffusion model in three aspects: data dimensionality increase and decrease, deterministic sampling function, and customized delay energy consumption weighting function as the loss function of the diffusion model. These improvements are used to optimize the process of generating resource allocation plans for the diffusion model, thereby enabling the diffusion model to better generate joint allocation plans for communication and computing resources in a real-time Internet of Vehicles environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is the flow chart of the algorithm of the present invention;

[0036] Figure 2 This is the architecture diagram of the diffusion model training phase of the present invention;

[0037] Figure 3 This is the architecture diagram of the diffusion model reasoning stage of the present invention;

[0038] Figure 4 Schematic diagram of the joint allocation scheme for communication and computing resources (comprehensive weight index of latency and energy consumption) generated by DM-JCR, DDPG, and random strategies of the present invention;

[0039] Figure 5 Schematic diagram of the communication and computing resource joint allocation scheme (energy consumption index) generated by DM-JCR, DDPG, and random strategies of the present invention;

[0040] Figure 6 Schematic diagram of the joint allocation scheme (latency index) of communication and computing resources generated by DM-JCR, DDPG, and random strategies in the present invention. DETAILED DESCRIPTION

[0041] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0042] Example:

[0043] like Figures 1-6 As shown, an embodiment of the present invention provides a communication and computing resource joint allocation algorithm based on a diffusion model, the algorithm comprising the following steps:

[0044] S1: Define input and output: The input is defined as real-time Internet of Vehicles environment information, and the output is defined as a joint allocation scheme for communication and computing resources. Both input and output are represented in the form of tensors, where the dimension of the output tensor is three times the number of channels, representing the communication power, bandwidth, and CPU frequency allocated to each channel respectively.

[0045] S2: Constructing an environmental information dataset: First, build a simulation environment for the Internet of Vehicles scenario using Python. Then, collect environmental information in this simulation environment and organize the collected environmental information data into an environmental information dataset.

[0046] S3: Dataset preprocessing: For the dataset obtained in step 2, use the K-Means clustering algorithm to cluster all the data in the dataset. According to the clustering results, add a "category" item to the dataset. The category obtained by the K-Means algorithm is the content of the "category" item.

[0047] S4: Training the environmental information classifier: Use Python to write a convolutional neural network classifier, and then use the preprocessed dataset in step 3 to train the written classifier;

[0048] S5: Training the diffusion model: Set the training parameters and use the preprocessed dataset in step 3 to train the diffusion model.

[0049] S6: Generate a joint allocation plan for communication and computing resources using the diffusion model: Continue to collect real-time Internet of Vehicles environmental information from the simulation environment built in step 2, and input the collected environmental information into the environmental information classifier to predict the category of the environmental information. The category of the environmental information is then used as a guide word to guide the diffusion model to generate a corresponding resource allocation plan;

[0050] S7: Resource allocation scheme evaluation: The generated communication and computing resource joint allocation scheme is evaluated using latency, energy consumption, and the combined weight of latency and energy consumption as evaluation indicators.

[0051] In this algorithm, the present invention first defines the input and output: the input is environmental information, and the output is the resource allocation plan, both represented in tensor form. This algorithm considers a scenario in which a UAV collaborates with an edge computing node to communicate in the Internet of Vehicles (IoV), in which the UAV acts as a mobile edge computing node. The input environmental information includes the number of channels, the total communication power of the UAV, the total bandwidth of the UAV, the total CPU frequency of the UAV, the total communication power of the edge computing node, the total bandwidth of the edge computing node, the total CPU frequency of the edge computing node, the data volume and computational load of the data transmission task, the data volume and computational load of the computation task, the UAV channel gain, the edge computing node channel gain, the vehicle channel gain, the UAV altitude, the UAV coverage range, the edge computing node coverage range, and the channel noise power. The output tensor has a dimension three times the number of channels, corresponding to the communication power, bandwidth, and CPU frequency allocated to each channel, respectively. Next, a simulation environment is constructed and environmental information is collected based on this environment. An environmental information dataset is then constructed and clustered using the K-Means algorithm. The processed environmental information dataset is then used to train an environmental information classifier and a diffusion model. Finally, with the help of the trained diffusion model, a corresponding resource allocation plan is generated based on real-time environmental information and the generated plan is evaluated. In this process, training the diffusion model and using it to generate a joint allocation plan for communication and computing resources are the core contents of the algorithm.

[0052] The architecture of the diffusion model training phase in the present invention is as follows Figure 2 As shown. During the training process, a tensor with a dimension three times the number of channels is first generated to represent the low-dimensional random resource allocation scheme. Subsequently, the low-dimensional tensor is expanded to a high-dimensional tensor through a dimensionality increase operation, and random noise of the same dimension is added to it until the high-dimensional tensor is converted into pure Gaussian noise. Next, environmental information data is extracted from the environmental information dataset, and pure Gaussian noise, environmental information category, and time step are used as input and sent to U-net for noise prediction. Then, the predicted noise is removed to obtain a new resource allocation scheme representation, and it is iterated according to the set number of time steps until the final high-dimensional resource allocation scheme representation is obtained. Finally, the results are evaluated by combining the environmental information with the generated resource allocation scheme, and the parameters of the U-net model are updated based on the evaluation results.

[0053] The architecture of the diffusion model inference stage in the present invention is as follows Figure 3As shown. In the inference phase, a tensor with a dimension three times the number of channels is first generated to represent the low-dimensional random resource allocation scheme. Subsequently, the low-dimensional tensor is expanded to a high dimension through a dimensionality increase operation, and random noise of the same dimension is added to it until the tensor becomes pure Gaussian noise. Next, the environmental information is input into the environmental information classifier for classification, and the predicted environmental information category is obtained from it. Then, the pure Gaussian noise generated by the noise addition process, the category predicted by the environmental information classifier, and the time step are used as input and sent to the U-net for noise prediction. After that, the predicted noise is removed to obtain a new resource allocation scheme representation, and this process is repeated according to the set number of time steps until the final high-dimensional resource allocation scheme representation is obtained. Finally, the high-dimensional tensor is converted into a low-dimensional tensor through a dimensionality reduction operation, thereby obtaining the final low-dimensional representation of the resource allocation scheme.

[0054] In addition, to enable the algorithm proposed in this invention to more stably generate high-quality joint allocation solutions for communication and computing resources, this invention makes targeted improvements to the denoising process of the diffusion model. These improvements include the following three aspects:

[0055] 1. Data Dimensionality Increase and Reduction: When using a diffusion model to generate content, if the data dimension is low, the generated content may be ineffective. To avoid generating a low-quality joint allocation scheme for communication and computing resources, the present invention proposes a method for data dimensionality increase and reduction. Specifically, the present invention begins with a random resource allocation scheme represented by a low-dimensional tensor. This low-dimensional tensor representing the random resource allocation scheme is then expanded to a high-dimensional tensor through a data dimensionality increase operation. During the diffusion model denoising process, the high-dimensional tensor representing the random resource allocation scheme is used as input to the diffusion model. Guided by environmental information, the diffusion model is guided to generate a high-dimensional tensor representation of the final resource allocation scheme. Finally, the high-dimensional tensor representing the final resource allocation scheme is reduced to a low-dimensional tensor through a data dimensionality reduction operation, and the low-dimensional tensor is converted into a joint allocation scheme for communication and computing resources. The dimensions of the low-dimensional tensor representing the random resource allocation scheme and the low-dimensional tensor representing the final resource allocation scheme should both be three times the number of channels, representing the communication power, bandwidth, and CPU frequency allocated to each channel, respectively. By using this method of data dimensionality increase and decrease, we can fully utilize the generation capability of the diffusion model and avoid the problem of poor generation effect caused by low data dimensionality.

[0056] 2. Deterministic sampling function: In the traditional diffusion model, the sampling function is shown in formula (1);

[0057]

[0058] Here, X t-1 represents the data before adding noise, X t Indicates that in Xt-1 The data after adding one step of noise; α t is the noise scaling factor at step t, β t is the noise variance at step t; α t and β t The relationship between α is: t +β t =1; In addition, σ t It is a parameter related to the time step t, which is used to indicate the degree of added noise; ∈ θ (X t , t, y) represents the noise predicted by U-net; y represents the category of wireless network environment information, that is, the guide word that guides the diffusion model to generate resource allocation solutions; z represents Gaussian noise; In this sampling formula, σ t Z can be regarded as adding a certain degree of random Gaussian noise to the sampled data during the sampling process, thereby increasing the diversity of the content generated by the diffusion model;

[0059] The sampling function of the diffusion model is improved specifically. The improved sampling function is shown in formula (2).

[0060]

[0061] This approach effectively reduces the diversity of resource allocation solutions generated by the diffusion model, allowing the model to focus more on generating a single optimal solution. This optimization results in better performance in terms of latency and energy consumption, significantly improving the overall efficiency and accuracy of the solution.

[0062] The present invention uses a diffusion model to generate a joint allocation scheme for communication and computing resources, thereby solving the problem of joint allocation of communication and computing resources in complex and dynamic multi-user and multi-task vehicle networking scenarios. In this problem, the present invention hopes that the diffusion model can generate the corresponding optimal solution based on real-time environmental information. However, in the problem of joint allocation of communication and computing resources, there is often only one optimal solution. Therefore, the present invention does not want the diffusion model to have diversity when generating the joint allocation scheme for communication and computing resources. Strong diversity will cause the diffusion model to be less stable when generating the joint allocation scheme for communication and computing resources. To address this problem, the present invention makes targeted improvements to the sampling function of the diffusion model (DDPM), and the improved sampling function is shown in formula (2).

[0063]

[0064] This approach effectively reduces the diversity of resource allocation solutions generated by the diffusion model, allowing the model to focus on generating a single optimal solution. This optimization results in a resource allocation solution that performs better in terms of latency and energy consumption, significantly improving the overall efficiency and accuracy of the solution.

[0065] 3. Customized delay-energy consumption weighted function as the loss function of the diffusion model: In the traditional diffusion model (DDPM), the loss function is shown in formula (3).

[0066] L=||∈-∈ θ (X t , t, y)|| 2 (3)

[0067] This loss function represents the noise ∈ added during the noise addition process and the noise ∈ predicted by U-net (the core component of the diffusion model, used to predict noise) θ (X t , t, y). Where y represents the category of wireless network environment information, that is, the guiding word that guides the diffusion model to generate resource allocation solutions.

[0068] In the present invention, due to the lack of support for expert solutions, the noise addition process starts with a random resource allocation scheme and continues until pure Gaussian noise is obtained. Therefore, formula (3) is not applicable in the present invention. In order to enable the diffusion model to generate a joint allocation scheme for communication and computing resources with low latency, energy consumption, and the combined weight of latency and energy consumption, the present invention proposes a custom loss function suitable for generating a joint allocation scheme for communication and computing resources. The improved loss function is shown in formula (4).

[0069] L=δ·(ρT+ξE) (4)

[0070] Where T is the delay corresponding to the resource allocation scheme generated by the diffusion model, and E is the energy consumption corresponding to the resource allocation scheme generated by the diffusion model. ρ and ξ are weight coefficients used to determine the impact of delay and energy consumption in the loss function. δ is a hyperparameter used to control the magnitude of the overall loss.

[0071] By constructing a customized loss function to guide the diffusion model in generating resource allocation solutions, the model can be more focused on optimizing specific performance metrics, such as latency and energy consumption. Therefore, despite not relying on large amounts of expert data, the model can still generate more efficient resource allocation solutions that better meet practical needs, ensuring the practicality and accuracy of the results.

[0072] Through the algorithm proposed above and the improvements made, the present invention uses the diffusion model to generate a joint allocation scheme for communication and computing resources with smaller delay, energy consumption, and the combined weight of delay and energy consumption, and normalizes these three indicators. The present invention also compares the proposed algorithm with the DDPG algorithm and the random generation algorithm. The algorithm proposed by the present invention surpasses the DDPG algorithm and the random generation algorithm in terms of delay, energy consumption, and the combined weight of delay and energy consumption. The results are as follows: Figure 4 、 Figure 5 、 Figure 6 shown.

[0073] It should be noted that, in this document, relational terms such as first and second, etc., are used only 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. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the statement "comprising a reference structure" does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0074] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. A joint allocation algorithm for communication and computing resources based on a diffusion model, characterized by: The algorithm comprises the following steps: S1: Define input and output: The input is defined as real-time Internet of Vehicles environment information, and the output is defined as a joint allocation scheme for communication and computing resources. Both input and output are represented in the form of tensors, where the dimension of the output tensor is three times the number of channels, representing the communication power, bandwidth, and CPU frequency allocated to each channel respectively. S2: Constructing an environmental information dataset: First, build a simulation environment for the Internet of Vehicles scenario using Python. Then, collect environmental information in this simulation environment and organize the collected environmental information data into an environmental information dataset. S3: Dataset preprocessing: For the dataset obtained in step 2, use the K-Means clustering algorithm to cluster all the data in the dataset. Based on the clustering results, add a "category" item to the dataset. The category obtained by the K-Means algorithm is the content of the "category" item. S4: Training the environmental information classifier: Use Python to write a convolutional neural network classifier, and then use the preprocessed dataset in step 3 to train the written classifier; S5: Training the diffusion model: Set the training parameters and use the preprocessed dataset in step 3 to train the diffusion model. S6: Generate a joint allocation plan for communication and computing resources using the diffusion model: Continue to collect real-time Internet of Vehicles environmental information from the simulation environment built in step 2, and input the collected environmental information into the environmental information classifier to predict the category of the environmental information. The category of the environmental information is then used as a guide word to guide the diffusion model to generate a corresponding resource allocation plan; S7: Resource allocation scheme evaluation: The generated communication and computing resource joint allocation scheme is evaluated using latency, energy consumption, and the combined weight of latency and energy consumption as evaluation indicators.

2. The communication and computing resource joint allocation algorithm based on the diffusion model according to claim 1, characterized in that: In the step one, the definitions of input and output are first clarified, where the input is environmental information and the output is a resource allocation plan, both of which are expressed in tensor form; a scenario is considered in which a UAV cooperates with an edge computing node to communicate in the Internet of Vehicles, in which the UAV acts as a mobile edge computing node; the input environmental information includes the number of channels, the total communication power of the UAV, the total bandwidth of the UAV, the total CPU frequency of the UAV, the total communication power of the edge computing node, the total bandwidth of the edge computing node, the total CPU frequency of the edge computing node, the data volume and computing volume of the data transmission task, the data volume and computing volume of the computing task, the UAV channel gain, the edge computing node channel gain, the vehicle channel gain, the UAV height, the UAV coverage range, the edge computing node coverage range and the noise power of the channel; the dimension of the output tensor is three times the number of channels, corresponding to the communication power, bandwidth and CPU frequency allocated to each channel respectively.

3. The communication and computing resource joint allocation algorithm based on the diffusion model according to claim 1, characterized in that: The algorithm takes pure Gaussian noise generated by the noise addition process, the category predicted by the environmental information classifier, and the time step as input and feeds them into a U-net for noise prediction. Then, the predicted noise is removed to obtain a new resource allocation plan representation. This process is repeated according to the set number of time steps until the final high-dimensional resource allocation plan representation is obtained. Finally, a dimensionality reduction operation is performed to convert the high-dimensional tensor into a low-dimensional tensor, thereby obtaining the final low-dimensional representation of the resource allocation plan.

4. The communication and computing resource joint allocation algorithm based on the diffusion model according to claim 1, characterized in that: The denoising process of the diffusion model includes the following improvements: data dimensionality increase and reduction: When the diffusion model generates content, if the data dimension is low, the generated content will be poor. To avoid generating a joint allocation scheme of communication and computing resources with poor quality, a method of data dimensionality increase and reduction is proposed. Specifically, starting with a random resource allocation scheme represented by a low-dimensional tensor, the low-dimensional tensor representing the random resource allocation scheme is expanded to a high-dimensional tensor through a data dimensionality increase operation. During the diffusion model denoising process, the high-dimensional tensor representing the random resource allocation scheme is used as the input of the diffusion model. Under the guidance of environmental information, the diffusion model is guided to generate a high-dimensional tensor representation of the final resource allocation scheme. Finally, the high-dimensional tensor representing the final resource allocation plan is reduced to a low-dimensional tensor through data dimensionality reduction, and the low-dimensional tensor is converted into a joint allocation plan for communication and computing resources; among them, the dimensions of the low-dimensional tensor representing the random resource allocation plan and the low-dimensional tensor representing the final resource allocation plan should be three times the number of channels, representing the communication power, bandwidth and CPU frequency allocated to each channel respectively; through this method of data dimensionality increase and decrease, the generation capacity of the diffusion model is fully utilized to avoid the problem of poor generation effect caused by the low dimensionality of the data.

5. The communication and computing resource joint allocation algorithm based on the diffusion model according to claim 1, characterized in that: The denoising process of the diffusion model also includes the following improvements: Deterministic sampling function: In the traditional diffusion model, the sampling function is as shown in formula (1); Here, X t-1 represents the data before adding noise, X t Indicates that in X t-1 The data after adding one step of noise; α t is the noise scaling factor at step t, β t is the noise variance at step t; α t and β t The relationship between α is: t +β t =1; In addition, σ t It is a parameter related to the time step t, which is used to indicate the degree of added noise; ∈ θ (X t , t, y) represents the noise predicted by U-net; y represents the category of wireless network environment information, that is, the guide word that guides the diffusion model to generate resource allocation solutions; z represents Gaussian noise; In this sampling formula, σ t Z can be regarded as adding a certain degree of random Gaussian noise to the sampled data during the sampling process, thereby increasing the diversity of the content generated by the diffusion model; The sampling function of the diffusion model is improved specifically. The improved sampling function is shown in formula (2). This approach effectively reduces the diversity of resource allocation solutions generated by the diffusion model, allowing the model to focus more on generating a single optimal solution. This optimization results in better performance in terms of latency and energy consumption, significantly improving the overall efficiency and accuracy of the solution.

6. The communication and computing resource joint allocation algorithm based on the diffusion model according to claim 1, characterized in that: The denoising process of the diffusion model also includes the following improvements: a customized delay energy consumption weighting function is used as the loss function of the diffusion model: In the traditional diffusion model, the loss function is shown in formula (3); L=||∈-∈ θ (X t ,t,y)|| 2 (3) This loss function represents the noise ∈ added during the noise addition process and the noise ∈ predicted by U-net (the core component of the diffusion model, used to predict noise) θ (X t , t, y) between the square; where y represents the category of wireless network environment information, that is, the guide word for the diffusion model to generate a resource allocation solution; In order to enable the diffusion model to generate a joint allocation scheme for communication and computing resources with smaller latency, energy consumption, and the combined weight of latency and energy consumption, a custom loss function suitable for generating a joint allocation scheme for communication and computing resources is proposed; the improved loss function is shown in formula (4); L=δ·(ρT+ξE) (4) Where T is the delay corresponding to the resource allocation scheme generated by the diffusion model, and E is the energy consumption corresponding to the resource allocation scheme generated by the diffusion model. ρ and ξ are weight coefficients used to determine the impact of delay and energy consumption in the loss function. δ is a hyperparameter used to control the magnitude of the overall loss.

Citation Information

Cited By

  • Multi-subject style migration method based on diffusion model

    CN122244220A