Method and system for allocating resources in Internet of Vehicles based on block chain

By using blockchain technology and smart contracts in the Internet of Vehicles environment, dynamic allocation of computing resources is solved, and the problem of low resource allocation in the Internet of Vehicles is achieved, and efficient and fair resource allocation is achieved.

CN119854753AActive Publication Date: 2025-04-18WUHAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510325561.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-04-18
Estimated Expiration
2045-03-19

AI Technical Summary

Technical Problem

In the dynamic and complex Internet of Vehicles environment, how to efficiently realize the allocation of computing resources based on blockchain has become a technical problem that needs to be solved urgently.

Method used

By uploading the resource requirements information of the target transportation tool to the blockchain system, obtaining the available resource information of the roadside unit nodes, and automatically performing smart contract resource allocation, generating resource allocation plans based on the benefits and energy consumption of the blockchain system to ensure dynamic allocation and fair distribution of resources.

Benefits of technology

It realizes efficient and fair allocation of computing resources in a dynamic environment, and improves resource utilization efficiency and system adaptability in the Internet of Vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854753A_ABST
    Figure CN119854753A_ABST
Patent Text Reader

Abstract

The invention provides a block chain-based resource allocation method and system in the Internet of Vehicles, and relates to the technical field of Internet of Vehicles communication, and the method comprises the steps: uploading the resource demand information of a target vehicle to a first road side unit node; obtaining resource demand information uploaded by the first road side unit node and available resource information respectively uploaded by the plurality of second road side unit nodes; intelligent contract resource allocation is automatically executed, and a resource allocation scheme is generated according to benefits and energy consumption of the block chain system; and according to the resource allocation scheme, a third road side unit node in the plurality of second road side unit nodes returns a calculation result for the resource demand information to the target vehicle, and the target vehicle sends the resource demand information to the target vehicle after verifying the integrity and correctness of the calculation result. And uploading the transaction data and the reputation value for the third road side unit node to a block chain system. According to the invention, allocation of computing resources can be realized in a dynamic environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Internet of Vehicles communications, and specifically to a method and system for allocating resources within an Internet of Vehicles based on blockchain. Background Art

[0002] With the rapid development of the Internet of Vehicles, more and more vehicles and infrastructure are connected through wireless networks, building a large-scale, dynamic Internet of Vehicles system. In the Internet of Vehicles, different types of vehicles and roadside units can achieve data sharing and collaborative computing through vehicle-to-vehicle and vehicle-to-infrastructure communications. However, with the increase in the number of connected vehicles, the contradiction between supply and demand of computing resources has become increasingly prominent, and the traditional centralized resource allocation method is difficult to meet the resource allocation needs in the complex Internet of Vehicles environment.

[0003] The introduction of blockchain technology provides a new solution for resource allocation in the Internet of Vehicles. Blockchain has the characteristics of decentralization, data immutability, security and transparency, making it suitable for resource management and data sharing in the Internet of Vehicles environment. However, the application of blockchain-based resource allocation in the Internet of Vehicles also faces challenges. How to realize the allocation of computing resources in a dynamic environment has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The present application provides a method and system for allocating resources within an Internet of Vehicles based on blockchain, which can realize the allocation of computing resources in a dynamic environment.

[0005] In a first aspect of the present application, a method for allocating resources in an Internet of Vehicles based on blockchain is provided, the method comprising: Uploading resource demand information of a target vehicle to a first roadside unit node, wherein the target vehicle is a vehicle that requires computing resources, and the first roadside unit node is a roadside unit node closest to the target vehicle among multiple roadside unit nodes included in the blockchain system; Acquire the resource demand information uploaded by the first roadside unit node and the available resource information uploaded by a plurality of second roadside unit nodes, where the second roadside unit node is a roadside unit node with resource supply capability among the plurality of roadside unit nodes; Automatically execute smart contract resource allocation, and generate a resource allocation plan according to the benefits and energy consumption of the blockchain system, wherein the resource allocation plan includes a transaction and allocation method for available resource information of a plurality of the second roadside unit nodes, the quantity of resources, and information of the transaction parties; According to the resource allocation scheme, a third roadside unit node among the multiple second roadside unit nodes returns the calculation result of the resource demand information to the target vehicle. After verifying the integrity and correctness of the calculation result, the target vehicle uploads the transaction data and the reputation value of the third roadside unit node to the blockchain system.

[0006] On the basis of the above technical solution, preferably, after the third roadside unit node among the plurality of second roadside unit nodes returns the calculation result of the resource demand information to the target vehicle according to the resource allocation scheme, the method further includes: If it is determined that the priority of the target vehicle reaches the preset priority, setting the voting right of the target vehicle so that the target vehicle can participate in the node election; Based on the result of the node election, the plurality of roadside unit nodes are divided into active nodes and standby nodes according to the reputation value and the voting rights, wherein the active nodes take turns as block managers, responsible for packaging and publishing data blocks, and at the same time incentivize high-productivity roadside unit nodes to participate in data verification and become verification nodes, the verification nodes review the data content through local and mutual verification processes, and send the verification results to the block managers within the specified time, and the block managers add the verified data blocks to the blockchain system.

[0007] On the basis of the above technical solution, preferably, after verifying the integrity and correctness of the calculation result, the target vehicle uploads the transaction data and the reputation value for the third roadside unit node to the blockchain system, which specifically also includes: Retrieving the interaction record between the target vehicle and the third roadside unit node, and obtaining the recommended values ​​of a plurality of the roadside unit nodes for the third roadside unit node; Based on the interaction record and the recommendation value, a reputation value of the third roadside unit node is calculated, wherein the reputation value is calculated using a multiple weight model, and the calculation factors include familiarity, timeliness and interaction enthusiasm.

[0008] On the basis of the above technical solutions, preferably, the resource allocation of the dynamic execution smart contract generates a resource allocation plan according to the benefits and energy consumption of the blockchain system, specifically including: S1: randomly generating a group of initial populations, wherein the initial population includes different resource allocation schemes between the target vehicle and the second roadside unit node, and each individual in the initial population is a preset resource allocation scheme; S2: Determine the total system benefit objective function and the total system energy consumption objective function of each individual in the blockchain system, where the total system benefit includes the cost and income of resources, and the total system energy consumption includes transmission and computing energy consumption; S3: Perform non-dominated sorting on each of the individuals to find out the crowding degree of each of the individuals; S4: According to the calculation result of the crowding degree, a tournament selection method is used to select a target individual that meets a preset fitness from the multiple individuals; S5: performing crossover and mutation operations on the target individuals to generate a new candidate population; S6: Combining the initial population with the candidate population to obtain a combined population; S7: selecting individuals that meet the preset fitness in the combined population according to the non-dominated sorting and crowding degree to form a new population; S8: Repeat steps S1 to S7 until a preset number of iterations is reached or a convergence condition is met, and a target solution set is obtained and output to obtain the resource allocation solution.

[0009] On the basis of the above technical solution, preferably, the system total benefit objective function and the system total energy consumption objective function of each individual in the blockchain system are determined, and the system total benefit objective function is specifically determined by the following formula:

[0010] in, is the total benefit of the system, τ is the contribution of different parts to the total benefit of the system, Φ is the cost of purchasing resources, is the amount of resources purchased by the buyer, ε is the revenue from selling resources, represents the quantity of resources sold at time t, Represents the block packaging income of the block manager at time t, Represents the reward of the verification node at time t; The total energy consumption objective function of the system is determined by the following formula:

[0011] in, is the total energy consumption of the system, η is the effective capacitance parameter of the chipset, is the calculation frequency that can be provided by the roadside unit node, is the calculated delay of the target vehicle, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, p is the transmission power, To calculate the number of tasks, is the size of the blocks downloaded and uploaded during the k-th block verification process, is the link channel bandwidth, is the link channel gain, is the Gaussian noise power.

[0012] On the basis of the above technical solution, preferably, the method further comprises: Calculate the uplink transmission rate at which the target vehicle uploads the resource demand information to the roadside unit node based on the communication uplink channel bandwidth from the target vehicle to the roadside unit node, the vehicle transmission power of the target vehicle, and the uplink channel gain from the target vehicle to the roadside unit node; Based on the uplink transmission rate, calculating the uplink transmission delay; Calculating the computation delay based on the amount of tasks that the target vehicle needs to unload to the roadside unit node and the computation task processing rate of the target vehicle; Calculate the downlink transmission rate of the target vehicle uploading the resource demand information to the roadside unit node based on the downlink channel bandwidth from the target vehicle to the roadside unit node, the node transmission power of the roadside unit node, and the downlink channel gain from the target vehicle to the roadside unit node; Calculating the downlink transmission delay according to the task size included in the resource requirement information and the downlink transmission rate; The average response time of the processing task request from the target vehicle to the roadside unit node is calculated according to the uplink transmission delay, the calculation delay and the downlink transmission delay.

[0013] On the basis of the above technical solution, preferably, the reputation value of the third roadside unit node is calculated based on the interaction record and the recommendation value, and is specifically calculated by the following formula:

[0014] in, represents the reputation value at time t, represents the historical reputation value at time t-1, k represents the number of new verifications from the previous time to this time, is the reputation weight, Represents the total number of verifications. The historical reputation value is calculated using the following formula:

[0015] Wherein, ra(t) is the historical reputation value at time t, ra(t-1) is the historical reputation value at time t-1, ψ is the weight parameter, β is the transmission delay weight parameter of the target vehicle, and the transmission delay weight parameter is specifically calculated by the following formula:

[0016] Wherein, β is the transmission delay weight parameter, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, The average response time of the processing task request from the target vehicle to the roadside unit node.

[0017] In a second aspect of the present application, a resource allocation system in an Internet of Vehicles based on blockchain is provided, the system comprising an acquisition module, a processing module and an output module, wherein: The acquisition module is used to upload the resource demand information of the target vehicle to the first roadside unit node, the target vehicle is a vehicle that requires computing resources, and the first roadside unit node is the roadside unit node closest to the target vehicle among the multiple roadside unit nodes included in the blockchain system; The acquisition module is used to acquire the resource demand information uploaded by the first roadside unit node and the available resource information uploaded by multiple second roadside unit nodes respectively, where the second roadside unit node is a roadside unit node with resource supply capability among the multiple roadside unit nodes; The processing module is used to automatically execute smart contract resource allocation, generate a resource allocation plan according to the benefits and energy consumption of the blockchain system, and the resource allocation plan includes a transaction and allocation method for available resource information of multiple second roadside unit nodes, the amount of resources and information of the transaction parties; The output module is used to return the calculation result of the resource demand information to the target vehicle by the third roadside unit node among the multiple second roadside unit nodes according to the resource allocation plan, and the target vehicle uploads the transaction data and the reputation value of the third roadside unit node to the blockchain system after verifying the integrity and correctness of the calculation result.

[0018] On the basis of the above technical solution, preferably, the processing module is used to set the voting right of the target vehicle if it is determined that the priority of the target vehicle reaches the preset priority, so that the target vehicle can participate in the node election; The processing module is used to divide the multiple roadside unit nodes into active nodes and standby nodes according to the reputation value and the voting right based on the result of the node election, wherein the active nodes take turns as block managers, responsible for packaging and publishing data blocks, and at the same time incentivize high-productivity roadside unit nodes to participate in data verification and become verification nodes. The verification nodes review the data content through local and mutual verification processes, and send the verification results to the block managers within a specified time. The block managers add the verified data blocks to the blockchain system.

[0019] On the basis of the above technical solution, preferably, the acquisition module is used to retrieve the interaction record between the target vehicle and the third roadside unit node, and obtain the recommended values ​​of the plurality of roadside unit nodes for the third roadside unit node; The processing module is used to calculate the reputation value of the third roadside unit node based on the interaction record and the recommendation value, wherein the reputation value is calculated using a multiple weight model, and the calculation factors include familiarity, timeliness and interaction enthusiasm.

[0020] On the basis of the above technical solution, preferably, the processing module is used to randomly generate a group of initial populations, the initial population includes different resource allocation schemes between the target vehicle and the second roadside unit node, and the initial population includes a preset resource allocation scheme for each individual; The processing module is used to determine the system total benefit objective function and the system total energy consumption objective function of each individual in the blockchain system, where the system total benefit includes the cost and income of resources, and the system total energy consumption includes transmission and computing energy consumption; The processing module is used to perform non-dominated sorting on each of the individuals to find out the crowding degree of each of the individuals; The processing module is used to select a target individual that meets a preset fitness from the plurality of individuals using a tournament selection method according to the calculation result of the crowding degree; The processing module is used to perform crossover and mutation operations on the target individuals to generate a new candidate population; The processing module is used to combine the initial population with the candidate population to obtain a combined population; The processing module is used to select individuals that meet the preset fitness in the combined population according to the non-dominated sorting and crowding degree to form a new population; The processing module is used to repeat the above steps until a preset number of iterations is reached or a convergence condition is met, obtain and output a target solution set, and obtain the resource allocation solution.

[0021] On the basis of the above technical solution, preferably, the processing module is used to determine the system total benefit objective function and the system total energy consumption objective function of each individual in the blockchain system, and the system total benefit objective function is specifically determined by the following formula:

[0022] in, is the total benefit of the system, τ is the contribution of different parts to the total benefit of the system, Φ is the cost of purchasing resources, is the amount of resources purchased by the buyer, ε is the revenue from selling resources, represents the quantity of resources sold at time t, Represents the block packaging income of the block manager at time t, Represents the reward of the verification node at time t; The total energy consumption objective function of the system is determined by the following formula:

[0023] in, is the total energy consumption of the system, η is the effective capacitance parameter of the chipset, is the calculation frequency that can be provided by the roadside unit node, is the calculated delay of the target vehicle, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, p is the transmission power, To calculate the number of tasks, is the size of the blocks downloaded and uploaded during the k-th block verification process, is the link channel bandwidth, is the link channel gain, is the Gaussian noise power.

[0024] On the basis of the above technical solution, preferably, the processing module is used to calculate the uplink transmission rate of the target vehicle uploading the resource demand information to the roadside unit node based on the communication uplink channel bandwidth from the target vehicle to the roadside unit node, the vehicle transmission power of the target vehicle and the uplink channel gain from the target vehicle to the roadside unit node, specifically calculated by the following formula:

[0025] in, is the uplink channel bandwidth, is the vehicle transmitting power, is the uplink channel gain, is the Gaussian noise power; The processing module is used to calculate the uplink transmission delay based on the uplink transmission rate, specifically by the following formula:

[0026] in, is the uplink transmission delay, is the task size included in the resource requirement information, is the uplink transmission rate; The processing module is used to calculate the calculation delay based on the task amount that the target vehicle needs to unload to the roadside unit node and the calculation task processing rate of the target vehicle, specifically by the following formula:

[0027] in, For the calculation delay, is the task volume, U is the CPU cycle required for the target vehicle to process each bit of input data of the task volume, is the processing rate of the computing task; The processing module is used to calculate the downlink transmission rate of the target vehicle uploading the resource demand information to the roadside unit node based on the downlink channel bandwidth from the target vehicle to the roadside unit node, the node transmission power of the roadside unit node, and the downlink channel gain from the target vehicle to the roadside unit node, specifically calculated by the following formula:

[0028] in, is the downlink transmission rate, is the downlink channel bandwidth, is the node transmit power, is the downlink channel gain, is the Gaussian noise power; The downlink transmission delay is calculated according to the task size and the downlink transmission rate included in the resource requirement information, specifically by the following formula:

[0029] in, is the downlink transmission delay, is the task size included in the resource requirement information, is the downlink transmission rate; The processing module is used to calculate the average response time of the processing task request from the target vehicle to the roadside unit node according to the uplink transmission delay, the calculation delay and the downlink transmission delay, which is specifically calculated by the following formula:

[0030] in, is the average response time of the processing task request, is the uplink transmission delay, For the calculation delay, is the downlink transmission delay.

[0031] On the basis of the above technical solution, preferably, the processing module is used to calculate the reputation value of the third roadside unit node based on the interaction record and the recommendation value, which is specifically calculated by the following formula:

[0032] in, represents the reputation value at time t, represents the historical reputation value at time t-1, k represents the number of new verifications from the previous time to this time, is the reputation weight, Represents the total number of verifications. The historical reputation value is calculated using the following formula:

[0033] Wherein, ra(t) is the historical reputation value at time t, ra(t-1) is the historical reputation value at time t-1, ψ is the weight parameter, β is the transmission delay weight parameter of the target vehicle, and the transmission delay weight parameter is specifically calculated by the following formula:

[0034] Wherein, β is the transmission delay weight parameter, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, The average response time of the processing task request from the target vehicle to the roadside unit node.

[0035] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.

[0036] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the methods described above is executed.

[0037] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. This application utilizes the decentralization and smart contract mechanism of blockchain to collect the resource demand information of the target vehicle and the available resource information of multiple roadside unit nodes in real time, balance the system benefits and energy consumption through automatically executed smart contracts, and dynamically generate the optimal resource allocation plan. At the same time, the node reputation evaluation mechanism ensures the fairness and reliability of resource allocation, and the uploading of the verification results of the target vehicle further enhances the credibility of the data and the adaptability of the system. The overall design can not only cope with the dynamic changes of nodes in the Internet of Vehicles, but also ensure the transparency and efficiency of resource allocation.

[0038] 2. Through multi-objective optimization methods, the benefit and energy consumption functions of the blockchain system are used to dynamically generate resource allocation plans. The diversity of solutions is maintained through non-dominated sorting and congestion calculation, and the resource allocation strategy is continuously optimized by combining tournament selection, crossover and mutation operations to ensure that resource allocation achieves a balance between cost-effectiveness and energy consumption. Finally, through multiple rounds of iterations, it converges to the optimal solution set, maximizes resource utilization efficiency, minimizes computing energy consumption, and achieves the ability of the system to adapt to dynamic environments, thereby improving the fairness and reliability of computing resource allocation in the Internet of Vehicles.

[0039] 3. Combined with interaction records, recommendation values, transmission delays and other factors, the reputation value of the roadside unit node is dynamically calculated, and a comprehensive evaluation mechanism is established. Through the reputation increment formula of the current verification behavior and the dynamic adjustment formula of the historical reputation value, the short-term performance and long-term stability of the node are weighed, and the transmission delay weight parameter is introduced to effectively reduce the impact of inefficient nodes on the system. The accurate quantification and dynamic optimization of node reputation are achieved, the fairness and reliability of system resource allocation are improved, and a scientific basis is provided for node selection and resource collaboration in the Internet of Vehicles. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a flowchart of a resource allocation method in a vehicle network based on blockchain disclosed in an embodiment of the present application; Figure 2 It is a module schematic diagram of a resource allocation system in an Internet of Vehicles based on blockchain disclosed in an embodiment of the present application; Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.

[0041] Explanation of the reference numerals: 201, acquisition module; 202, processing module; 203, output module; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION

[0042] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0043] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.

[0044] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0045] The rapid development of the Internet of Vehicles has brought about large-scale interconnection and data sharing between vehicles and infrastructure, but the resulting contradiction between supply and demand of computing resources makes it difficult for traditional centralized resource allocation to meet demand. Blockchain technology, with its decentralized, tamper-proof, secure and transparent characteristics, provides a new approach to resource management in the Internet of Vehicles. However, in the dynamic and complex Internet of Vehicles environment, how to efficiently implement blockchain-based computing resource allocation still faces huge challenges.

[0046] This embodiment discloses a method for allocating resources in a vehicle network based on blockchain. Figure 1 , including the following steps S110-S140: S110, uploading resource demand information of the target vehicle to the first roadside unit node.

[0047] In the embodiment of the present application, the vehicles participating in resource allocation in the Internet of Vehicles are equipped with on-board units and advanced communication equipment, enabling vehicle-to-infrastructure and vehicle-to-vehicle communications. As an important part of public infrastructure, roadside unit nodes are supervised and certified by relevant regulatory agencies (such as the government or the Federal Communications Commission). In addition, roadside unit nodes have excellent computing and storage capabilities and can provide computing resources to meet computing tasks and information transmission in the Internet of Vehicles.

[0048] All entities in the Internet of Vehicles have been authenticated by global trust institutions, and all roadside unit nodes constitute the blockchain system. Roadside unit nodes are an important part of the Internet of Vehicles, mainly referring to communication and computing devices deployed on both sides of the road or on traffic infrastructure. These nodes are responsible for enabling communication between vehicles and infrastructure in the Internet of Vehicles. At the same time, in blockchain-based systems, they may also participate in data storage, verification and consensus as nodes of the blockchain network. Roadside unit nodes are subject to additional regulatory review during the authentication process, and whether they are candidates for blockchain nodes depends on whether their reputation value exceeds the set threshold. After authorization, the entity obtains public keys, private keys and encryption certificates for secure communication, and generates multiple wallet accounts on the blockchain for resource allocation and transactions.

[0049] The vehicles involved in resource allocation in the Internet of Vehicles include on-board units and communication equipment, which are specifically composed of the following components: The on-board unit OBU is used to collect vehicle status and environmental information, and communicate with the roadside unit node RSU and other vehicles. It usually includes sensors, processors, memory, etc.

[0050] Communication equipment supports V2V through Wi-Fi or Bluetooth, etc., and is usually integrated with OBU to achieve data interaction and communication between vehicles.

[0051] The roadside unit node in the Internet of Vehicles system includes a communication module, a computing module, a resource transaction module, a blockchain verification module and a transaction settlement module, specifically: The communication module completes the information exchange between the vehicle and the base station, and completes the initialization together with the blockchain verification module, transmits information through the blockchain network, and authenticates the identity through the global trust agency TA.

[0052] The computing module is the core component of the base station of the Internet of Vehicles system. It is responsible for processing the computing tasks unloaded by the vehicle. It can dynamically adjust resource allocation according to vehicle demand and traffic conditions, and coordinate vehicles for cooperative computing to improve computing efficiency and task completion speed. It also performs quality control and security control, including error detection, result feedback, access control, and behavior monitoring to ensure the accuracy of task results and the security of the system. In addition, the computing module also completes reputation evaluation and urgency assessment, calculates reputation values ​​based on a multiple weight model, forms local opinions, considers resource requirements and reputation values, prioritizes tasks according to the urgency and reputation values ​​of the vehicle, and allocates corresponding computing resources to achieve higher quality resource allocation and lower energy consumption.

[0053] The resource transaction module executes the allocation decision of the resource allocation module, sends the transaction information to the blockchain verification module for verification, settles the transaction based on the verification results, and records the transaction log to ensure the transparency and traceability of the transaction.

[0054] The blockchain verification module, through the Enhanced Delegated Proof of Reputation (eDPoR) consensus mechanism, allows the roadside unit node RSU to participate in the blockchain verification process, effectively identify and resist malicious attacks, and ensure that only trusted vehicles can participate in blockchain interactions, verify transaction data and maintain the security of the blockchain, and feed back the verification results to the resource transaction module to ensure the legitimacy and integrity of the transaction.

[0055] The transaction settlement module executes the settlement operation of resource transactions after the blockchain verification module confirms that the transaction is valid, ensuring the final completion of the transaction and the accurate transfer of resource coins.

[0056] The on-board unit OBU collects vehicle status and environmental information. When the vehicle's computing power is insufficient, the computing resource requirements can be interacted with the nearest roadside unit node communication module through the integrated communication device. The communication module of the roadside unit node transmits information and authenticates identity through the blockchain network, and publishes resource task requirements to the computing module. The computing module processes the computing tasks unloaded by the vehicle and performs resource scheduling and quality control, including reputation evaluation and urgency assessment. Subsequently, the resource transaction module executes the final resource allocation strategy from the computing module and sends the transaction information to the blockchain verification module for verification. The blockchain verification module verifies the validity of the transaction through the eDPoR consensus mechanism and protects the security of the blockchain. After the transaction is verified to be valid, the transaction settlement module performs the final transaction settlement.

[0057] In addition, the Internet of Vehicles system is divided into two layers: the physical layer and the virtual layer, specifically: At the physical layer, vehicles can receive data from roadside unit nodes and other vehicle intelligent devices through on-board units. When the vehicle's computing power is limited, it can interact with the communication module of the roadside unit node to offload the computing tasks to the computing modules of nearby roadside unit nodes for collaborative computing. Roadside unit nodes have modules such as communication, computing, resource trading, blockchain verification, and transaction settlement. They have powerful computing and storage capabilities, can connect vehicles and infrastructure, provide blockchain services, and share computing resources. Based on the allocation results, vehicles will be assigned different vehicle reputation values, which will affect the voting weight of each vehicle when calculating the final reputation value of the roadside unit node. In this embodiment, the vehicle's computing task offloading is regarded as a resource trading market, and the buyers and sellers in the trading market are roadside unit nodes and vehicles.

[0058] At the virtualization layer, the RSU nodes run the resource allocation algorithm through the computing module and the blockchain verification module. Then, the RSU nodes are selected as blockchain nodes based on the eDPoR consensus mechanism and divided into active nodes and standby nodes according to their reputation values. All blockchain nodes need to record information related to data sharing in the communication with the fleet vehicles and collaborative computing transactions between vehicles and RSU nodes. When the active node is selected as the block manager, it is responsible for incorporating the recorded information from the blockchain node into the blockchain in the form of blocks, thereby achieving effective data sharing and collaborative computing. During the block verification process, the node consumes computing resources to verify the transaction block.

[0059] The target vehicle establishes communication with the surrounding roadside unit nodes through its on-board unit and communication equipment. The on-board unit automatically determines the closest roadside unit node as the target node, i.e., the first roadside unit node, based on parameters such as signal strength, communication delay or geographic location. If there are multiple RSU nodes to choose from, the blockchain system may use a load balancing algorithm or priority rule to select the optimal node.

[0060] After establishing a secure communication link, the target vehicle sends detailed resource demand information (including task size, computing requirements, latency requirements, etc.) to the communication module of the first roadside unit node. After receiving the demand information, the communication module of the first roadside unit node uploads it to the blockchain network to prepare for resource allocation.

[0061] S120, the first roadside unit node uploads resource demand information to the blockchain system, and multiple second roadside unit nodes upload available resource information to the blockchain system respectively.

[0062] The resource demand information packaged by the first roadside unit node is broadcast to other blockchain nodes through the blockchain network. The verification nodes of the blockchain network use a consensus mechanism (such as enhanced delegated reputation proof mechanism, eDPoR) to verify the legitimacy of the information. After verification, the resource demand information is recorded in the transaction sub-block of the blockchain and associated with the transaction Merkle tree root to ensure the data cannot be tampered with.

[0063] The second roadside unit node monitors its own available resource information in real time through its computing module, including idle CPU processing power, storage space, network bandwidth, power consumption, etc., extracts the resource data that can be currently supplied, and generates a resource description, including resource type, quantity, expected response time, etc.

[0064] Each second roadside unit node formats its own available resource information, packages it into a transaction format supported by the blockchain, and uses the node's private key to digitally sign the resource description to ensure the credibility of the data source. The second roadside unit node broadcasts the signed available resource information through the blockchain network to all nodes including the first roadside unit node. Other blockchain nodes verify the authenticity of the resource information through a consensus mechanism to ensure that the data has not been tampered with.

[0065] S130, automatically executing smart contract resource allocation, and generating a resource allocation plan based on the benefits and energy consumption of the blockchain system.

[0066] In a possible implementation, the automatic execution of smart contract resource allocation generates a resource allocation plan based on the benefits and energy consumption of the blockchain system, specifically including: S1: randomly generate a group of initial populations, the initial population includes different resource allocation schemes between the target vehicle and the second roadside unit node, and the initial population includes a preset resource allocation scheme for each individual.

[0067] First, according to the resource demand information of the target vehicle and the source supply capacity of the second roadside unit node, a group of initial populations are randomly generated. Each individual (solution) represents a resource allocation plan, which contains the allocation details of the computing task, including the number of resources, allocation path, time schedule, etc. The size of the initial population is determined by the system parameters to ensure the diversity of the population.

[0068] S2: Determine the total system benefit objective function and total system energy consumption objective function of each individual in the blockchain system. The total system benefit includes the cost and benefit of resources, and the total system energy consumption includes transmission and computing energy consumption.

[0069] Among them, the system total benefit objective function is specifically determined by the following formula:

[0070] in, is the total benefit of the system, τ is the contribution of different parts to the total benefit of the system, Φ is the cost of purchasing resources, is the amount of resources purchased by the buyer, ε is the revenue from selling resources, represents the quantity of resources sold at time t, Represents the block packaging income of the block manager at time t, Represents the reward of the verification node at time t.

[0071] In the formula, Describing the economic benefits of resource trading, the cost that buyers pay for resources reduces the system benefits and is therefore represented by a negative sign. Sellers gain revenue by selling resources, increasing the system benefits. Describe the benefits of blockchain-related participants. The benefits obtained by block managers through packaging blocks and the rewards obtained by verification nodes through block verification jointly increase the benefits of the system. By dynamically monitoring the amount of resources purchased by buyers and sold by sellers, as well as the benefits of block managers and verification nodes, the smart contract calculates the total benefits of the system according to the transaction and reward rules. The optimization goal is to maximize the total benefits of the system.

[0072] The total energy consumption objective function of the system is determined by the following formula:

[0073] in, is the total energy consumption of the system, η is the effective capacitance parameter of the chipset, is the calculation frequency that can be provided by the roadside unit node, is the calculated delay of the target vehicle, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, p is the transmission power, To calculate the number of tasks, is the size of the blocks downloaded and uploaded during the k-th block verification process, is the link channel bandwidth, is the link channel gain, is the Gaussian noise power.

[0074] In the formula, Represents computing energy consumption, which increases with the square of computing frequency. It represents the energy consumption of channel transmission, including the energy consumption of the number of tasks and block size. The channel transmission rate is calculated by Shannon's formula, taking into account bandwidth, transmission power, channel gain and noise power. By calculating the calculation delay, transmission delay and energy consumption of the target vehicle and the roadside unit node, combined with the communication channel parameters (such as bandwidth, channel gain, noise power), the system evaluates the total energy consumption in real time. The optimization goal is to minimize the total energy consumption of the system.

[0075] In the calculation formula of the total energy consumption objective function of the above system, the calculation process of some parameters is as follows: Based on the communication uplink channel bandwidth from the target vehicle to the roadside unit node, the vehicle transmission power of the target vehicle, and the uplink channel gain from the target vehicle to the roadside unit node, the uplink transmission rate of the target vehicle uploading resource demand information to the roadside unit node is calculated, which is specifically calculated by the following formula:

[0076] in, is the uplink channel bandwidth, is the vehicle transmitting power, is the uplink channel gain, is the Gaussian noise power. The uplink is the communication link where data is uploaded from the user-end device (vehicle) to the infrastructure (roadside unit node). Based on the Shannon formula, it is used to calculate the maximum data transmission rate of the uplink. The channel bandwidth determines the spectrum range that can be transmitted. The signal-to-noise ratio is determined by the vehicle's transmission power, channel gain and noise. The data transmission rate is logarithmically related to the signal-to-noise ratio: the higher the signal-to-noise ratio, the greater the transmission rate.

[0077] Based on the uplink transmission rate, the uplink transmission delay is calculated using the following formula:

[0078] in, is the downlink transmission delay, is the task size included in the resource requirement information, is the downlink transmission rate. Transmission delay is the ratio of task size to transmission rate. The larger the task size or the smaller the transmission rate, the longer the delay. The sum of task sizes in the formula represents the situation where multiple tasks are combined for processing.

[0079] Based on the amount of tasks that the target vehicle needs to unload to the roadside unit node and the computing task processing rate of the target vehicle, the computing delay is calculated, which is specifically calculated by the following formula:

[0080] in, For the calculation delay, is the task volume, U is the CPU cycle required for the target vehicle to process each bit of input data of the task volume, is the processing rate of the computing task. The computing delay is equal to the total data volume of the task multiplied by the CPU cycle required per bit, divided by the processing rate. Indicates the total amount of computation required for a task. The higher the computational task processing rate, the lower the computational latency.

[0081] Based on the downlink channel bandwidth from the target vehicle to the roadside unit node, the node transmission power of the roadside unit node, and the downlink channel gain from the target vehicle to the roadside unit node, the downlink transmission rate of the target vehicle uploading resource demand information to the roadside unit node is calculated, which is specifically calculated by the following formula:

[0082] in, is the downlink transmission rate, is the downlink channel bandwidth, is the node transmit power, is the downlink channel gain, is the Gaussian noise power. The downlink refers to the communication link where data is transmitted from the infrastructure (roadside unit node) to the user end device (vehicle). Similar to the calculation of the uplink transmission rate, the downlink transmission rate is calculated based on the Shannon formula. The difference is that the signal transmission source is the roadside unit, whose transmission power and channel gain may be different from those of the vehicle.

[0083] The downlink transmission delay is calculated based on the task size and downlink transmission rate included in the resource requirement information, and is specifically calculated using the following formula:

[0084] in, is the downlink transmission delay, is the task size included in the resource requirement information, is the downlink transmission rate. The delay is also calculated based on the ratio of the task size and the transmission rate. The signal characteristics of the downlink may be different from those of the uplink, so they need to be calculated separately.

[0085] According to the uplink transmission delay, calculation delay and downlink transmission delay, the average response time of the processing task request from the target vehicle to the roadside unit node is calculated, which is specifically calculated by the following formula:

[0086] in, is the average response time of the processing task request, is the uplink transmission delay, For the calculation delay, is the downlink transmission delay. The average response time is equal to the sum of the uplink transmission, calculation process and downlink transmission time. It measures the total delay from task request to result return.

[0087] S3: Perform non-dominated sorting on each individual and find out the crowding degree of each individual; All individuals in the population are sorted according to the objective function value. The ranking of each individual is based on its superiority in the two objectives of total system benefit and total system energy consumption. A non-dominated solution means that no other individual is better than the solution in both objectives. The neighborhood distance of each individual in the objective space (i.e., the distribution density with other solutions) is calculated. The crowding degree reflects the sparsity of the individual in the objective function value space and is used to maintain the diversity of the population. Each individual has multiple objective function values ​​(such as total system benefit and total system energy consumption). These values ​​define the pros and cons of the solution. All individuals in the population are non-dominatedly sorted and divided into different levels (Pareto frontier). Individuals at the same level are sorted according to the objective function value. The neighborhood distance of the individual in the objective space is calculated, that is, the gap between the adjacent individuals in front and behind. The individuals with higher crowding degrees indicate that the distribution of solutions around them is sparser, and they are retained first to enhance the diversity of solutions.

[0088] S4: Based on the calculation results of the crowding degree, the tournament selection method is used to select the target individual that meets the preset fitness from multiple individuals; Randomly select several individuals from the current population to participate in the "tournament", and give priority to individuals with high non-dominated sorting and low crowding as target individuals to enter the next generation. Tournament selection is a competition-based individual selection strategy used to select individuals that meet fitness requirements from the current population. A certain number of individuals, usually 2 or more, are randomly selected from the population to form a subset. Compare the individuals in the subset and select a winner based on the preset fitness including non-dominated sorting and crowding. Repeat the above process until the required number of target individuals are selected.

[0089] Specifically, a certain number of individuals are randomly selected from the current population to form a subset, namely the tournament pool. First, the non-dominated sorting levels are compared and the individuals with higher levels are selected. If two individuals are at the same level, the crowding degree is compared and the individual with higher crowding degree is selected. The individuals who win the tournament are selected as target individuals and enter the next generation population. The above steps are repeated many times until a sufficient number of target individuals are selected.

[0090] S5: Perform crossover and mutation operations on the target individuals to generate a new candidate population; The details of the resource allocation plan of the target individual, such as the allocation path, resource amount, etc., are crossed, and the two parent individuals exchange some genes to generate new candidate solutions and increase the diversity of solutions. Some genes of the candidate solutions are randomly changed (such as adjusting the path or resource amount of task allocation). The mutation rate is controlled by system parameters and is used to explore better solutions.

[0091] S6: Combine the initial population with the candidate population to obtain a combined population; The initial population is combined with the newly generated candidate population to form a larger combined population, which contains all the solutions of the current generation.

[0092] S7: Select individuals that meet the preset fitness in the combined population according to the non-dominated sorting and crowding degree to form a new population; Perform non-dominated sorting on the combined population and recalculate the crowding degree.

[0093] Select individuals that meet the preset fitness (such as a better balance between benefits and energy consumption) to form the next generation of population.

[0094] S8: Repeat steps S1 to S7 until a preset number of iterations is reached or convergence conditions are met, obtain and output the target solution set, and obtain a resource allocation solution.

[0095] Repeat the above steps to optimize the population generation by generation. The smart contract records the non-dominated solutions of each generation and tracks the optimal solution in the iterative process until the preset number of iterations is reached or the objective function value of the population converges (i.e. the change of the solution tends to be stable). The final output solution set is the Pareto frontier, which contains multiple optimal solutions that meet the balance between system benefits and energy consumption. The system selects an optimal solution from the solution set as the resource allocation plan based on the needs of the target vehicle.

[0096] S140, according to the resource allocation plan, the third roadside unit node among the multiple second roadside unit nodes returns the calculation results of the resource demand information to the target vehicle. After verifying the integrity and correctness of the calculation results, the target vehicle uploads the transaction data and the reputation value of the third roadside unit node to the blockchain system.

[0097] According to the resource allocation scheme, the third roadside unit node among the multiple second roadside unit nodes is selected to perform the calculation task of the target vehicle. The third roadside unit node uses its calculation module to process the task and completes data analysis, calculation or information processing as required. After the task is completed, the calculation results are generated and preliminary integrity verification is performed, including error detection and redundancy check.

[0098] The calculation result is then digitally signed using the private key of the third roadside unit node to ensure the source and integrity of the result. If sensitive data is involved, the calculation result can be encrypted using the public key of the target vehicle to ensure transmission security. The third roadside unit node sends the calculation result to the target vehicle via a downlink, and the transmission adopts the encrypted communication mechanism of the blockchain network to prevent data leakage or tampering.

[0099] The received calculation result is decrypted using the private key of the target vehicle, and the digital signature of the third roadside unit node is verified to ensure the authenticity and integrity of the calculation result. According to the task requirements, the target vehicle checks whether the result meets the expectations through local calculation or preset verification method. If the result is found to be wrong or does not meet the requirements, the target vehicle will refuse to accept the result and record the exception.

[0100] In one possible implementation, after a third roadside unit node among multiple second roadside unit nodes returns the calculation result of the resource demand information to the target vehicle according to the resource allocation plan, the method also includes: if the blockchain system determines that the priority of the target vehicle reaches the preset priority, the voting rights of the target vehicle are set so that the target vehicle can participate in the node election; based on the result of the node election, multiple roadside unit nodes are divided into active nodes and standby nodes according to trust value and voting rights, wherein the active nodes take turns as block managers, responsible for packaging and publishing data blocks, and at the same time encourage high-productivity roadside unit nodes to participate in data verification and become verification nodes, the verification nodes review the data content through local and mutual verification processes, and send the verification results to the block managers within the specified time, and the block managers add the verified data blocks to the blockchain system.

[0101] Specifically, if the target vehicle reaches the preset priority, it will obtain the right to vote in the node election. The priority is divided according to the purpose of the vehicle, specifically: Emergency and special purpose vehicles include vehicles that perform emergency tasks such as ambulances and fire trucks, and vehicles that transport specific materials such as tankers and trailers. Both types of vehicles bear important social responsibilities and need priority access to communications and resources in emergencies to ensure emergency safety and the normal operation of infrastructure.

[0102] Public service vehicles include logistics trailers, express delivery vehicles, etc., which support social logistics and transportation needs, and public buses, tourist buses, etc., which provide public transportation services. These two types of vehicles provide public services to the society and need to obtain better communication conditions under network congestion to maintain the normal operation of social transportation systems and logistics transportation.

[0103] Commercial and private vehicles include online ride-hailing vehicles, taxis, commercial cars that provide commercial travel services, and private cars that are mainly used for personal travel needs. These two types of vehicles mainly provide convenience for individuals and have relatively low priority. They usually only receive additional priority when network resources are sufficient.

[0104] In the embodiment of the present application, emergency and special purpose vehicles are classified into priority 1, public service vehicles are classified into priority 2, and commercial and private purpose vehicles are classified into priority 3.

[0105] According to the trust value and voting rights, the roadside unit nodes are divided into active nodes and standby nodes, and the active nodes take turns to serve as block managers. Active nodes take turns to serve as block managers, responsible for packaging and publishing blocks, and motivating high-productivity nodes to participate in block verification. The verification node reviews the block content through local and mutual verification processes, and sends the verification results to the block manager within k timestamps. Finally, the block manager adds the verified blocks to the blockchain through the blockchain verification module.

[0106] Furthermore, the target vehicle retrieves the historical interaction data between itself and the third roadside unit node, including transaction completion status, task response time and other information, and reads the recommendation value of other roadside unit nodes to the third roadside unit node from the blockchain to evaluate its overall credibility. Based on the interaction records and recommendation values, the reputation value of the third roadside unit node at the current moment is calculated. It is specifically calculated using the following formula:

[0107] in, represents the reputation value at time t, represents the historical reputation value at time t-1, k represents the number of new verifications from the previous time to this time, is the reputation weight, Represents the total number of verifications. The reputation value increases over time, and the number of newly added verifications and weights reflect the positive contribution of the third roadside unit node in the current period. To prevent the reputation value from expanding rapidly, the growth rate is limited by the total number of verifications. The calculated result is calculated with the maximum value in 1 to ensure that the reputation value is not less than 1 and maintain the minimum reputation baseline.

[0108] The historical reputation value is calculated by the following formula:

[0109] Among them, ra(t) is the historical reputation value at time t, ra(t-1) is the historical reputation value at time t-1, ψ is the weight parameter, and β is the transmission delay weight parameter of the target vehicle. The historical reputation value is based on the last historical reputation value adjustment, reflecting the long-term evolution trend of the reputation. By adjusting the weight parameter, the contribution of the historical reputation value and the real-time adjustment is balanced. The transmission delay weight parameter reduces the reputation weight of unstable or inefficient nodes.

[0110] The transmission delay weight parameter is calculated using the following formula:

[0111] Among them, β is the transmission delay weight parameter, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, The average response time of processing task requests from the target vehicle to the roadside unit node.

[0112] This embodiment also discloses a resource allocation system in the Internet of Vehicles based on blockchain, referring to Figure 2 The system includes an acquisition module 201, a processing module 202 and an output module 203, wherein: The acquisition module 201 is used to upload the resource demand information of the target vehicle to the first roadside unit node, where the target vehicle is a vehicle that requires computing resources, and the first roadside unit node is the roadside unit node closest to the target vehicle among the multiple roadside unit nodes included in the blockchain system.

[0113] The acquisition module 201 is used to obtain resource demand information uploaded by a first roadside unit node and available resource information uploaded by multiple second roadside unit nodes respectively. The second roadside unit node is a roadside unit node with resource supply capability among the multiple roadside unit nodes.

[0114] The processing module 202 is used to automatically execute smart contract resource allocation and generate a resource allocation plan based on the benefits and energy consumption of the blockchain system. The resource allocation plan includes a transaction and allocation method for available resource information of multiple second roadside unit nodes, the quantity of resources, and information of the parties to the transaction.

[0115] The output module 203 is used to return the calculation results of the resource demand information to the target vehicle by the third roadside unit node among the multiple second roadside unit nodes according to the resource allocation plan. After verifying the integrity and correctness of the calculation results, the target vehicle uploads the transaction data and the reputation value of the third roadside unit node to the blockchain system.

[0116] In a possible implementation, the processing module 202 is configured to set the voting right of the target vehicle if it is determined that the priority of the target vehicle reaches a preset priority, so that the target vehicle can participate in the node election.

[0117] Processing module 202 is used to divide multiple roadside unit nodes into active nodes and standby nodes according to reputation values ​​and voting rights based on the results of node elections, where the active nodes take turns to serve as block managers, responsible for packaging and publishing data blocks, and at the same time incentivize high-productivity roadside unit nodes to participate in data verification and become verification nodes. The verification nodes review the data content through local and mutual verification processes, and send the verification results to the block managers within the specified time. The block managers add the verified data blocks to the blockchain system.

[0118] In a possible implementation, the acquisition module 201 is used to retrieve the interaction record between the target vehicle and the third roadside unit node, and obtain the recommendation values ​​of multiple roadside unit nodes for the third roadside unit node.

[0119] The processing module 202 is used to calculate the reputation value of the third roadside unit node based on the interaction record and the recommendation value, wherein the reputation value is calculated using a multiple weight model, and the calculation factors include familiarity, timeliness and interaction enthusiasm.

[0120] In a possible implementation, the processing module 202 is used to randomly generate a group of initial populations, where the initial population includes different resource allocation schemes between the target vehicle and the second roadside unit node, and each individual in the initial population is a preset resource allocation scheme.

[0121] The processing module 202 is used to determine the system total benefit objective function and the system total energy consumption objective function of each individual in the blockchain system. The system total benefit includes the cost and income of resources, and the system total energy consumption includes transmission and computing energy consumption.

[0122] The processing module 202 is used to perform non-dominated sorting on each individual to find out the crowding degree of each individual.

[0123] The processing module 202 is used to select a target individual that meets a preset fitness from a plurality of individuals using a tournament selection method according to the calculation result of the crowding degree.

[0124] The processing module 202 is used to perform crossover and mutation operations on the target individuals to generate a new candidate population.

[0125] The processing module 202 is used to combine the initial population with the candidate population to obtain a combined population.

[0126] The processing module 202 is used to select individuals that meet a preset fitness in the combined population according to the non-dominated sorting and the crowding degree to form a new population.

[0127] The processing module 202 is used to repeat the above steps until a preset number of iterations is reached or a convergence condition is met, obtain and output a target solution set, and obtain a resource allocation solution.

[0128] In a possible implementation, the processing module 202 is used to determine the system total benefit objective function and the system total energy consumption objective function of each individual in the blockchain system. The system total benefit objective function is specifically determined by the following formula:

[0129] in, is the total benefit of the system, τ is the contribution of different parts to the total benefit of the system, Φ is the cost of purchasing resources, is the amount of resources purchased by the buyer, ε is the revenue from selling resources, represents the quantity of resources sold at time t, Represents the block packaging income of the block manager at time t, Represents the reward of the verification node at time t.

[0130] The total energy consumption objective function of the system is determined by the following formula:

[0131] in, is the total energy consumption of the system, η is the effective capacitance parameter of the chipset, is the calculation frequency that can be provided by the roadside unit node, is the calculated delay of the target vehicle, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, p is the transmission power, To calculate the number of tasks, is the size of the blocks downloaded and uploaded during the k-th block verification process, is the link channel bandwidth, is the link channel gain, is the Gaussian noise power.

[0132] In one possible implementation, the processing module 202 is used to calculate the uplink transmission rate at which the target vehicle uploads resource demand information to the roadside unit node based on the communication uplink channel bandwidth from the target vehicle to the roadside unit node, the vehicle transmit power of the target vehicle, and the uplink channel gain from the target vehicle to the roadside unit node.

[0133] The processing module 202 is configured to calculate an uplink transmission delay based on an uplink transmission rate.

[0134] The processing module 202 is used to calculate the calculation delay based on the task amount that the target vehicle needs to unload to the roadside unit node and the calculation task processing rate of the target vehicle.

[0135] The processing module 202 is used to calculate the downlink transmission rate of the target vehicle uploading resource demand information to the roadside unit node based on the downlink channel bandwidth from the target vehicle to the roadside unit node, the node transmission power of the roadside unit node, and the downlink channel gain from the target vehicle to the roadside unit node.

[0136] The downlink transmission delay is calculated according to the task size and the downlink transmission rate included in the resource requirement information.

[0137] The processing module 202 is used to calculate the average response time of the processing task request from the target vehicle to the roadside unit node according to the uplink transmission delay, the calculation delay and the downlink transmission delay.

[0138] In a possible implementation, the processing module 202 is used to calculate the reputation value of the third roadside unit node based on the interaction record and the recommendation value, which is specifically calculated by the following formula:

[0139] in, represents the reputation value at time t, represents the historical reputation value at time t-1, k represents the number of new verifications from the previous time to this time, is the reputation weight, Represents the total number of verifications. The historical reputation value is calculated using the following formula:

[0140] Where ra(t) is the historical reputation value at time t, ra(t-1) is the historical reputation value at time t-1, ψ is the weight parameter, β is the transmission delay weight parameter of the target vehicle, and the transmission delay weight parameter is calculated by the following formula:

[0141] Among them, β is the transmission delay weight parameter, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, The average response time of processing task requests from the target vehicle to the roadside unit node.

[0142] It should be noted that: when the system provided in the above embodiment realizes its functions, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0143] This embodiment also discloses an electronic device, referring to Figure 3 The electronic device may include: at least one processor 301 , at least one communication bus 302 , a user interface 303 , a network interface 304 , and at least one memory 305 .

[0144] The communication bus 302 is used to realize the connection and communication between these components.

[0145] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.

[0146] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0147] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.

[0148] Among them, the memory 305 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may also be at least one storage device located away from the aforementioned processor 301. The memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface 303 module, and an application program for a method for allocating resources in a vehicle network based on blockchain.

[0149] exist Figure 3In the electronic device shown, the user interface 303 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 301 can be used to call an application program stored in the memory 305 for a resource allocation method within the Internet of Vehicles based on blockchain. When executed by one or more processors 301, the electronic device executes one or more methods in the above-mentioned embodiments.

[0150] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0151] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0152] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0153] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0154] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0155] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory 305 and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory 305 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.

[0156] The present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores instructions. When executed by one or more processors 301, the electronic device executes one or more of the methods described in the above embodiments.

[0157] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and the truth of practice, it will be easy for those skilled in the art to think of other embodiments of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field that are not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A method for allocating resources in an Internet of Vehicles based on blockchain, characterized in that: The method comprises: Uploading resource demand information of a target vehicle to a first roadside unit node, wherein the target vehicle is a vehicle that requires computing resources, and the first roadside unit node is a roadside unit node closest to the target vehicle among multiple roadside unit nodes included in the blockchain system; Acquire the resource demand information uploaded by the first roadside unit node and the available resource information uploaded by a plurality of second roadside unit nodes, where the second roadside unit node is a roadside unit node with resource supply capability among the plurality of roadside unit nodes; Automatically execute smart contract resource allocation, and generate a resource allocation plan according to the benefits and energy consumption of the blockchain system, wherein the resource allocation plan includes a transaction and allocation method for available resource information of a plurality of the second roadside unit nodes, the quantity of resources, and information of the transaction parties; According to the resource allocation scheme, a third roadside unit node among the multiple second roadside unit nodes returns the calculation result of the resource demand information to the target vehicle. After verifying the integrity and correctness of the calculation result, the target vehicle uploads the transaction data and the reputation value of the third roadside unit node to the blockchain system.

2. A method for allocating resources in a vehicle network based on blockchain according to claim 1, characterized in that: After the third roadside unit node among the plurality of second roadside unit nodes returns the calculation result of the resource demand information to the target vehicle according to the resource allocation scheme, the method further includes: If it is determined that the priority of the target vehicle reaches the preset priority, setting the voting right of the target vehicle so that the target vehicle can participate in the node election; Based on the result of the node election, the plurality of roadside unit nodes are divided into active nodes and standby nodes according to the reputation value and the voting rights, wherein the active nodes take turns as block managers, responsible for packaging and publishing data blocks, and at the same time incentivize high-productivity roadside unit nodes to participate in data verification and become verification nodes, the verification nodes review the data content through local and mutual verification processes, and send the verification results to the block managers within the specified time, and the block managers add the verified data blocks to the blockchain system.

3. The method for allocating resources in a vehicle network based on blockchain according to claim 1, characterized in that: After verifying the integrity and correctness of the calculation result, the target vehicle uploads the transaction data and the reputation value for the third roadside unit node to the blockchain system, which specifically includes: Retrieving the interaction record between the target vehicle and the third roadside unit node, and obtaining the recommended values ​​of a plurality of the roadside unit nodes for the third roadside unit node; Based on the interaction record and the recommendation value, a reputation value of the third roadside unit node is calculated, wherein the reputation value is calculated using a multiple weight model, and the calculation factors include familiarity, timeliness and interaction enthusiasm.

4. The method for allocating resources in a vehicle network based on blockchain according to claim 1, characterized in that: The automatic execution of smart contract resource allocation generates a resource allocation plan based on the benefits and energy consumption of the blockchain system, specifically including: S1: randomly generating a group of initial populations, wherein the initial population includes different resource allocation schemes between the target vehicle and the second roadside unit node, and each individual in the initial population is a preset resource allocation scheme; S2: Determine the total system benefit objective function and the total system energy consumption objective function of each individual in the blockchain system, where the total system benefit includes the cost and income of resources, and the total system energy consumption includes transmission and computing energy consumption; S3: Perform non-dominated sorting on each of the individuals to find out the crowding degree of each of the individuals; S4: According to the calculation result of the crowding degree, a tournament selection method is used to select a target individual that meets a preset fitness from the multiple individuals; S5: performing crossover and mutation operations on the target individuals to generate a new candidate population; S6: Combining the initial population with the candidate population to obtain a combined population; S7: selecting individuals that meet the preset fitness in the combined population according to the non-dominated sorting and crowding degree to form a new population; S8: Repeat steps S1 to S7 until a preset number of iterations is reached or a convergence condition is met, and a target solution set is obtained and output to obtain the resource allocation solution.

5. The method for allocating resources in a vehicle network based on blockchain according to claim 4 is characterized in that: The system total benefit objective function and the system total energy consumption objective function of each individual in the blockchain system are determined, and the system total benefit objective function is specifically determined by the following formula: ; in, is the total benefit of the system, τ is the contribution of different parts to the total benefit of the system, Φ is the cost of purchasing resources, is the amount of resources purchased by the buyer, ε is the revenue from selling resources, represents the quantity of resources sold at time t, Represents the block packaging income of the block manager at time t, Represents the reward of the verification node at time t; The total energy consumption objective function of the system is determined by the following formula: ; in, is the total energy consumption of the system, η is the effective capacitance parameter of the chipset, is the calculation frequency that can be provided by the roadside unit node, is the calculated delay of the target vehicle, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, p is the transmission power, To calculate the number of tasks, is the size of the blocks downloaded and uploaded during the k-th block verification process, is the link channel bandwidth, is the link channel gain, is the Gaussian noise power.

6. A method for allocating resources in a vehicle network based on blockchain according to claim 5, characterized in that: The method further comprises: Calculate the uplink transmission rate at which the target vehicle uploads the resource demand information to the roadside unit node based on the communication uplink channel bandwidth from the target vehicle to the roadside unit node, the vehicle transmission power of the target vehicle, and the uplink channel gain from the target vehicle to the roadside unit node; Based on the uplink transmission rate, calculating the uplink transmission delay; Calculating the computation delay based on the amount of tasks that the target vehicle needs to unload to the roadside unit node and the computation task processing rate of the target vehicle; Calculate the downlink transmission rate of the target vehicle uploading the resource demand information to the roadside unit node based on the downlink channel bandwidth from the target vehicle to the roadside unit node, the node transmission power of the roadside unit node, and the downlink channel gain from the target vehicle to the roadside unit node; Calculating the downlink transmission delay according to the task size included in the resource requirement information and the downlink transmission rate; The average response time of the processing task request from the target vehicle to the roadside unit node is calculated according to the uplink transmission delay, the calculation delay and the downlink transmission delay.

7. The method for allocating resources in a vehicle network based on blockchain according to claim 3 is characterized in that: The reputation value of the third roadside unit node is calculated based on the interaction record and the recommendation value, specifically by the following formula: ; in, represents the reputation value at time t, represents the historical reputation value at time t-1, k represents the number of new verifications from the previous time to this time, is the reputation weight, Represents the total number of verifications. The historical reputation value is calculated using the following formula: ; Wherein, ra(t) is the historical reputation value at time t, ra(t-1) is the historical reputation value at time t-1, ψ is the weight parameter, β is the transmission delay weight parameter of the target vehicle, and the transmission delay weight parameter is specifically calculated by the following formula: ; Wherein, β is the transmission delay weight parameter, is the uplink transmission delay from the target vehicle to the roadside unit node, is the downlink transmission delay from the target vehicle to the roadside unit node, The average response time of the processing task request from the target vehicle to the roadside unit node.

8. A resource allocation system in an Internet of Vehicles based on blockchain, characterized in that: The system comprises an acquisition module (201), a processing module (202) and an output module (203), wherein: The acquisition module (201) is used to upload resource demand information of a target vehicle to a first roadside unit node, wherein the target vehicle is a vehicle that requires computing resources, and the first roadside unit node is a roadside unit node that is closest to the target vehicle among a plurality of roadside unit nodes included in the blockchain system; The acquisition module (201) is used to acquire the resource demand information uploaded by the first roadside unit node and the available resource information uploaded by a plurality of second roadside unit nodes, wherein the second roadside unit node is a roadside unit node with resource supply capability among the plurality of roadside unit nodes; The processing module (202) is used to automatically execute smart contract resource allocation, generate a resource allocation plan according to the benefits and energy consumption of the blockchain system, and the resource allocation plan includes a transaction and allocation method for available resource information of a plurality of second roadside unit nodes, the quantity of resources and information of the transaction parties; The output module (203) is used to return the calculation result of the resource demand information to the target vehicle by a third roadside unit node among the plurality of second roadside unit nodes according to the resource allocation plan, and the target vehicle uploads the transaction data and the reputation value of the third roadside unit node to the blockchain system after verifying the integrity and correctness of the calculation result.

9. An electronic device, characterized in that: The electronic device comprises a processor (301), a communication bus (302), a user interface (303), a network interface (304) and a memory (305), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are both used to communicate with other devices, the communication bus (302) is used to realize connection and communication between components in the electronic device, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • Internet of vehicles multi-target computing task unloading scheduling method based on non-dominated sorting genetic strategy

    CN112995289A

  • Power distribution network maintenance strategy generation method based on heuristic algorithm

    CN118898475A