Methods, systems, devices, and storage media for bidirectional service scheduling of relay chain latency and resource awareness in vehicle-to-everything (V2X) networks.
By constructing a multi-chain collaborative service architecture in the vehicle network relay chain, and combining deep reinforcement learning and near-end strategy optimization, the problems of confirmation latency and resource consumption in cross-chain transaction scheduling in the vehicle network relay chain are solved, achieving efficient and balanced transaction confirmation and resource utilization.
Patent Information
- Application Number
- CN202611111716.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies struggle to balance confirmation latency, resource consumption, and load balancing in cross-chain transaction scheduling within vehicle-to-everything (V2X) relay chains. This is especially true when a high proportion of multi-input, multi-output (MIMO) transactions arrive, which can lead to delays in high-priority transactions or a continuous backlog of low-priority transactions, as well as uneven utilization of node resources.
A latency- and resource-aware bidirectional service scheduling method based on deep reinforcement learning is adopted. By constructing a multi-chain collaborative service architecture for the Internet of Vehicles, and combining the states of relay nodes, parallel chains, and links, the transaction allocation cost is calculated, real and virtual load queues are established, and a near-end strategy optimization model is used to generate the action probability matrix of transactions to relay nodes, thereby realizing intelligent scheduling of transactions.
It improves the confirmation efficiency of important transactions, reduces resource consumption, suppresses node congestion and uneven load, has adaptive learning capabilities, and is suitable for dynamic scheduling of traffic conditions.
Smart Images

Figure CN123124002A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of vehicle networking, blockchain cross-chain service governance, queue stability control and intelligent scheduling technology, and in particular to a method, system, device and storage medium for two-way service scheduling with latency and resource awareness for vehicle networking relay chains. Background Technology
[0002] Blockchain systems have evolved from single-chain architectures to multi-chain collaborative ecosystems. In the connected vehicle (V2V) scenario, vehicle manufacturers, road infrastructure operators, service providers, regulatory agencies, and user-side platforms typically maintain independent ledgers to meet the needs of data autonomy, access control, audit trails, and business isolation. While this deployment enhances the autonomy of each entity, it also brings problems such as data silos between chains, difficulties in cross-domain service collaboration, and fragmented transaction confirmation processes.
[0003] To enable cross-organizational data exchange and business collaboration, the relay chain can serve as a service governance layer between multiple parallel chains. The relay chain does not replace the autonomous ledgers of each parallel chain, but rather provides public services such as cross-chain message collection, cross-chain transaction forwarding, signature verification, state synchronization, and block confirmation, enabling chains maintained by different entities to interact within a unified scheduling framework.
[0004] Vehicle-to-everything (V2X) services are inherently characterized by multiple sources, multiple purposes, and high timeliness. For example, the reporting of perception data may involve vehicle chains, road infrastructure chains, and regulatory chains; collaborative decision-making and control may simultaneously trigger service chains, device chains, and security audit chains; algorithm deployment, system maintenance, and user behavior services may also require the participation of multiple input accounts and multiple output accounts. Therefore, V2X cross-chain services often exhibit a multi-input, multi-output transaction pattern, meaning that a single transaction involves multiple source chains and multiple entries.
[0005] Existing cross-chain solutions focus more on cross-chain protocols, message reachability, atomicity, and consistency, while giving less consideration to the scheduling issues on the relay chain service side. When a high proportion of multi-input, multi-output transactions arrive, allocating relay nodes solely based on transaction arrival order or random methods can easily cause delays for high-priority transactions. Allocating solely based on the shortest queue may ignore link distance, differences in signature algorithms, and heterogeneous node resources. If only short-term confirmation benefits are pursued, low-priority transactions may accumulate on some nodes, leading to long-term queue instability.
[0006] Vehicle-to-everything (V2X) relay nodes are typically deployed on roadside units or edge devices, and their available computing power, transmission power, and link quality are affected by traffic conditions. When vehicle density increases in a road area, roadside units need to handle more V2X traffic, resulting in a corresponding decrease in computing and wireless communication resources available for cross-chain services. Meanwhile, different parachains may use different elliptic curve signature parameters, certificate lengths, and message formats, leading to differences in communication and verification costs for the same cross-chain transaction across different relay nodes.
[0007] Therefore, relay chain scheduling in the Internet of Vehicles (IoV) is not simply a task offloading problem, but a cross-chain governance problem oriented towards bidirectional service goals: on the one hand, it needs to meet the service quality requirements of user-side transactions being confirmed as quickly as possible; on the other hand, it needs to maintain the resource utilization, queue stability, and load fairness of the relay chain. To this end, it is necessary to establish an intelligent scheduling method that simultaneously integrates transaction priority, confirmation time, heterogeneous node resources, link costs, and queue stability. Summary of the Invention
[0008] The purpose of this invention is to provide a two-way service scheduling method for latency and resource awareness in vehicle network relay chains, so as to solve the problem that existing multi-input multi-output cross-chain transaction scheduling is difficult to balance confirmation latency, resource consumption and load balancing.
[0009] To achieve the above objectives, the present invention adopts the following technical solution: a two-way service scheduling method for latency and resource awareness in vehicle-to-everything (V2X) relay chains, comprising the following steps:
[0010] S1. Construct a multi-chain collaborative service architecture for the Internet of Vehicles, the service architecture including a terminal device layer, a service governance layer and a dense computing layer, the service governance layer including multiple relay nodes, the relay nodes connecting multiple parallel chains and receiving multi-input multi-output cross-chain transactions submitted by the parallel chain gateway;
[0011] S2. Collect the status of relay nodes, parachains, links, and cross-chain transactions arriving in the current time slot. The cross-chain transaction status includes the source chain set, the destination chain set, the transaction priority, and the expected confirmation time.
[0012] S3. Based on the set of parachains involved in the cross-chain transaction, the signature message length, the certificate length, the node transmission power, the channel gain, the link distance, and the computing power, calculate the communication cost, signature verification cost, and total processing cost when the transaction is allocated to different relay nodes.
[0013] S4. Establish actual transaction queues and virtual load queues, and construct single-slot scheduling targets based on transaction pre-confirmation revenue, processing costs, changes in actual transaction queues, and changes in virtual load queues;
[0014] S5. Input the node features, transaction features, and virtual queue features into the deep reinforcement learning scheduling model based on near-end policy optimization, and the policy network generates the action probability matrix from the transaction to the relay node;
[0015] S6. Determine the transaction allocation matrix based on the action probability matrix, so that each cross-chain transaction is processed by only one relay node, and the allocated relay node performs cross-chain message forwarding, signature verification, block writing and state synchronization.
[0016] S7. At the end of the time slot, update the actual transaction queue, virtual load queue, and relay chain status, and proceed to the next round of scheduling.
[0017] Furthermore, in step S1, the terminal device layer includes an in-vehicle terminal, a user application, and a parallel chain gateway, used to generate service requests, query on-chain data, and submit cross-chain transactions; the service governance layer includes relay nodes deployed on roadside units or edge devices, used to maintain the relay chain ledger, synchronize the state, and perform transaction verification; the intensive computing layer includes a cloud server, used to train the scheduling model and send model parameters to the relay nodes.
[0018] In step S1, the relay chain provides cross-chain service governance among multiple parallel chains, and the relay node performs at least the functions of transaction collection, cross-chain message forwarding, signature verification, consensus participation and block confirmation; when using proof-of-work consensus, the block-producing node of the newly confirmed block is designated as the scheduling agent of the next time slot.
[0019] Furthermore, in step S2, the relay node status is determined using a formula. It means that among them For relay nodes In the time slot computing power For relay nodes The length of the local unconfirmed transaction queue;
[0020] The computing power is dynamically determined by traffic state triples, which are: ,in Average vehicle speed, For the number of vehicles, Traffic density;
[0021] The traffic density and computing power are expressed by the following formulas: ;
[0022] ;
[0023] in For the statistical period, Basic computing power For time slots The maximum traffic state triplet within the area.
[0024] Furthermore, in step S3, the transaction... Assigned to relay node The communication cost, channel gain, signature verification cost, and total processing cost are expressed by the following formulas:
[0025] ;
[0026] ;
[0027] ;
[0028] ;
[0029] in Parallel chain The length of the signed message, Parallel chain Certificate length, This is the communication overhead coefficient. For bandwidth, For transmission power, For noise power, For relay nodes Parallel chains Link distance.
[0030] Furthermore, in step S4, the actual transaction queue, node load level, system load balancing level, and virtual load queue are represented by the following formulas: ;
[0031] ;
[0032] ;
[0033] , ;
[0034] in For time slots Assigned to relay node The number of transactions, The number of transactions that can be written to a block. This is a virtual load queue.
[0035] Furthermore, in step S4, the transaction confirmation utility is expressed by the following formula:
[0036] ;
[0037] in For the transaction Expected confirmation time This is the actual confirmed time. Assign variables to transactions. To handle cost scaling factors;
[0038] The single-slot scheduling target is obtained from the Lyapunov drift upper bound and is expressed by the following formula:
[0039] ;
[0040] in As a reward for the scheduling model, This is the utility scaling factor; by maximizing The scheduling decision takes into account both confirmation latency, processing cost, and the stability of the real queue and the virtual queue.
[0041] Furthermore, in step S5, the scheduling model state is represented by the following formula: ;in The node feature matrix, For the transaction feature matrix, For virtual queue vectors;
[0042] The policy network uses transaction embeddings as queries, relay node embeddings as keys and values, and obtains an action probability matrix through multi-head attention. The action probability matrix is represented by the following formula:
[0043]
[0044] Among them, the first OK Indicates transaction The probability distribution of the data assigned to each relay node;
[0045] The near-end policy optimization training process includes: according to Calculate rewards; use
[0046]
[0047] Calculate the time-series differential residuals; use Calculate the generalized advantage estimate; update the policy network by replacing the target with a pruning method, and update the value network by mean squared error.
[0048] A latency- and resource-aware bidirectional service scheduling system for vehicle-to-everything (V2X) relay chains, wherein the scheduling system is used to implement the aforementioned scheduling method, and the scheduling system includes:
[0049] The transaction receiving module receives multi-input multi-output cross-chain transactions submitted by the parachain gateway; the state acquisition module collects relay node status, link status, parachain status, and transaction status; the cost calculation module calculates communication cost, signature verification cost, and total processing cost; the queue governance module maintains the actual transaction queue and virtual load queue and constructs the Lyapunov scheduling objective; and the near-end policy optimization scheduling module generates the action probability matrix from transaction to relay node.
[0050] The execution confirmation module is used to complete cross-chain message forwarding, signature verification, block writing, and state synchronization.
[0051] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method.
[0052] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method.
[0053] Compared with existing technologies, the present invention has the following advantages: First, it can improve the confirmation efficiency of important transactions based on transaction priority and expected confirmation time; Second, it can incorporate communication costs and signature verification costs into the scheduling objectives, reducing resource consumption; Third, it can suppress node congestion and uneven load through actual transaction queues and virtual load queues; Fourth, it can adaptively learn scheduling strategies under conditions of random transaction arrival, heterogeneous node capabilities, and changing traffic conditions; Fifth, the model can be trained in the cloud and deployed to roadside units for inference, exhibiting good scalability and engineering applicability. Attached Figure Description
[0054] Figure 1 This is a schematic diagram of the vehicle network relay chain service governance architecture in an embodiment of the present invention.
[0055] Figure 2 This is a schematic diagram of the multi-input multi-output cross-chain transaction processing flow in an embodiment of the present invention.
[0056] Figure 3 This is a schematic diagram of the Lyapunov queue governance and scheduling optimization process in an embodiment of the present invention.
[0057] Figure 4 This is a schematic diagram of the near-end policy optimization scheduling model structure in an embodiment of the present invention. Detailed Implementation
[0058] The present invention will be further described below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments are used to illustrate the technical concept of the present invention and do not limit the scope of protection of the present invention. Where there is no conflict, the technical features of the various embodiments can be combined with each other.
[0059] A vehicle-to-everything (V2X) relay chain service architecture is constructed, consisting of a terminal device layer, a service governance layer, and a dense computing layer. The status of relay nodes, parachains, links, and transactions are collected. Communication costs and signature verification costs are calculated based on the set of parachains involved in a transaction. Actual transaction queues and virtual load queues are established. A single-slot scheduling target is constructed based on the Lyapunov drift upper bound. A near-end strategy optimization model is used to learn the allocation strategy from transactions to relay nodes. The queue status and on-chain status are updated after each slot ends.
[0060] In this invention, the relay chain plays a governance role in cross-chain services. The parachain gateway is responsible for aggregating cross-chain transactions from parachains and submitting the transactions to nearby relay nodes; after receiving the transactions, the relay nodes forward them, verify signatures, and confirm blocks; the scheduling agent in the current time slot collects the global state and outputs a transaction allocation matrix; all relay nodes execute synchronously according to the allocation results and update their local queues.
[0061] The Lyapunov queue modeling in this invention includes an actual transaction queue and a virtual load queue. The actual transaction queue represents the number of unconfirmed transactions on each relay node, while the virtual load queue represents the cumulative deviation of the system's load balancing constraints. By minimizing the upper bound of drift that includes transaction utility, this invention transforms the long-term queue stability problem into a single-slot learnable scheduling objective.
[0062] The near-end policy optimization scheduling model in this invention includes a feature encoder, a policy network, and a value network. The feature encoder processes node features, transaction features, and virtual queue features, respectively; the policy network generates an action probability matrix through an attention mechanism; and the value network estimates state values and assists in training. The training process uses temporal difference residuals, generalized advantage estimation, pruning of alternative targets, value loss, and entropy regularization to ensure stable policy updates.
[0063] like Figure 1As shown, the vehicle-to-everything (V2X) relay chain service governance architecture in this embodiment comprises three layers. The first layer is the terminal device layer, including in-vehicle terminals, mobile applications, enterprise business systems, and parallel chain gateways. This layer is responsible for generating business requests, submitting cross-chain transactions, querying on-chain data, and receiving service results. The second layer is the service governance layer, including relay nodes deployed on roadside units, edge servers, or institutional nodes. This layer is responsible for maintaining the relay chain ledger, performing cross-chain message forwarding, signature verification, state synchronization, and scheduling decision execution. The third layer is the intensive computing layer, including a cloud-based training server. This layer is responsible for offline training of the near-end policy optimization model and distributing the trained parameters to the service governance layer.
[0064] The parachains are independently maintained by different participants in the vehicle network. Each parachain can use different consensus protocols, signature parameters, certificate lengths, and message formats. The parachain gateway, acting as a cross-chain entry point, aggregates transaction information for the same business across multiple source and destination chains, forming multi-input, multi-output cross-chain transactions. This transaction can be represented by the following formula: in This indicates the set of source and destination chains involved in the transaction. Indicates transaction priority. Indicates the expected confirmation time.
[0065] like Figure 2 As shown, the processing flow of multi-input multi-output cross-chain transactions includes: the parachain gateway receiving input information from multiple source chains; generating a transaction containing a set of source chains, a set of destination chains, priority, and expected confirmation time; the relay node receiving the transaction according to the scheduling result; the relay node sending cross-chain messages to the relevant parachains and performing signature verification; after successful verification, the transaction is written into a new block on the relay chain; after the new block is confirmed, the status is returned to the relevant parachains and terminal devices.
[0066] In this embodiment, the relay chain can be viewed as a public ledger for the cross-chain service governance layer. It continuously receives an unpredictable number of cross-chain transactions and outputs confirmed blocks through relay nodes. Each relay node has at least three functions: first, receiving or forwarding cross-chain transactions submitted by parachain gateways; second, performing signature verification and cross-chain message verification; and third, participating in relay chain consensus and maintaining the ledger state. In scenarios employing proof-of-work consensus, the block-producing node of each newly confirmed block can be designated as the scheduling agent for the next time slot, thereby improving online performance and security through a rotation mechanism.
[0067] In each fixed time slot Within the current time slot, all relay nodes send newly arrived transactions and their local states to the current scheduling agent. After collecting the global state, the scheduling agent generates a transaction allocation matrix using a near-end strategy optimization model. This matrix is then broadcast to all relay nodes, and each relay node performs transaction verification and block writing according to the matrix. After the time slot ends, the system updates the transaction queue, virtual load queue, and on-chain state, and the next round of scheduling agents continues processing.
[0068] To characterize the impact of road traffic on relay node resources, this embodiment collects average vehicle speed, vehicle quantity, and traffic density within the coverage area of roadside units to form a traffic state triplet: in Average vehicle speed, For the number of vehicles, Traffic density. The formula for calculating traffic density is: in Indicates the statistical period.
[0069] The status of a relay node is represented by the following formula: in For relay nodes In the time slot computing power This represents the length of the local unconfirmed transaction queue. Optionally, computing power and transmission power can be dynamically set based on traffic conditions.
[0070]
[0071]
[0072] in Basic computing power Based on transmission power, This is the triplet representing the maximum traffic state in the current time slot.
[0073] The number of transactions arriving is random. To characterize the suddenness and independence of user requests, this embodiment uses time slots. Number of transactions reached Modeled as a Poisson distribution:
[0074]
[0075] in This represents the average transaction arrival rate. The block generation interval is denoted as... time slot The expected number of blocks that can be generated is:
[0076] Transaction processing costs include communication costs and signature verification costs. Let the number of parachains be... relay node To Parallel Links The link distance is The channel gain is: trade By relay node The communication cost during processing is:
[0077]
[0078] in Parallel chains The length of the signed message, Indicates the communication overhead coefficient. For bandwidth, This represents noise power.
[0079] The signature verification cost corresponds to all parachain certificates and signature data involved in the relay node's processing of transactions, and its formula is as follows:
[0080]
[0081] in Parallel chains The certificate length. After normalizing the communication and verification costs, the total processing cost is:
[0082] Transaction confirmation utility is used to characterize the benefits of early transaction completion and the penalties for resource consumption. The formula is:
[0083]
[0084] in For the transaction The actual confirmation time, Indicates transaction Assign to relay node And satisfy the unique assignment constraint:
[0085] If only confirmation utility is maximized, the system may continuously allocate transactions to a subset of nodes with high short-term returns, leading to long-term queue instability. Therefore, this embodiment introduces Lyapunov queue modeling. The actual transaction queue is updated as follows: in , indicating allocation to node The number of transactions, Represents a node The number of transactions that can be submitted to the blockchain within a time slot.
[0086] Node load level can be expressed as:
[0087]
[0088] The system's relative load balancing level can be expressed as:
[0089]
[0090] The overall load balancing level is:
[0091] Virtual load queues are used to constrain the system's load balancing level, and their update formula is: in This serves as an upper bound for load balancing constraints. When the system load balancing level consistently exceeds this upper bound, the virtual queue will continue to grow, thereby increasing the penalty for load balancing in subsequent scheduling.
[0092] Define a global Lyapunov function:
[0093]
[0094] Define a drift term that includes transaction utility: By deriving an upper bound for the squared difference between the actual transaction queue and the virtual load queue, we can obtain:
[0095] From the above upper bound of the drift, a single-slot scheduling objective can be constructed, namely, the reinforcement learning reward:
[0096]
[0097] maximize This is equivalent to simultaneously improving confirmation utility, suppressing actual queue growth, and suppressing virtual queue growth within a single time slot.
[0098] This embodiment presents the following Lyapunov queue theorem: If there exists a scheduling strategy that satisfies the Slater condition, such that... in In the scheduling process based on the aforementioned upper bound of drift, the gap between long-run average utility and optimal utility is affected. The magnitude constraint means that the average length of the actual transaction queue and the virtual load queue is affected by... It has order-of-magnitude constraints and can achieve stable average rate.
[0099] Since the original cross-chain scheduling problem involves binary allocation variables, nonlinear communication costs, random transaction arrivals, and block generation processes, directly solving it constitutes a complex mixed-integer nonlinear optimization problem. This embodiment employs a near-end strategy optimization method to approximate the single-slot scheduling objective. The scheduling state is defined as follows: in The node feature matrix, For the transaction feature matrix, This is a virtual queue vector.
[0100] The scheduling model first generates embedded representations using three feature encoders: in This indicates a modified linear unit function. Subsequently, the virtual queue embedding broadcast is added to the node embedding and transaction embedding, allowing global load pressure to participate in each transaction allocation.
[0101] The policy network uses transaction embeddings as queries and relay node embeddings as keys and values. For the... Each attention head, its matching score can be expressed as:
[0102]
[0103] Transactions are obtained after normalization Assigned to nodes The probability of:
[0104]
[0105] The action probability matrix is obtained by averaging multiple positions:
[0106]
[0107] The value network performs mean pooling on node embeddings and transaction embeddings, and outputs state values:
[0108]
[0109]
[0110]
[0111] in Used to estimate the long-term benefits of the current scheduling state.
[0112] During training, trajectory samples are collected. ,in Depend on Given: The time-series difference residual is:
[0113]
[0114] The generalized advantage is estimated as follows: The return target is:
[0115] The policy update uses pruning to replace the target. The probability ratio is:
[0116]
[0117] The target of cropping substitution is:
[0118]
[0119] The policy network uses the negative of the objective as the loss, while the value network uses... and The mean squared error between the two is used as the loss, and entropy regularization is added to maintain exploration.
[0120] The inference phase does not require the value network to participate in gradient updates, nor does it require the computation of the advantage function. Relay nodes or scheduling agents only need to input the current state, which is then processed by a feature encoder and policy network to output an action probability matrix. The transaction allocation result is then determined based on the maximum probability or sampling method. Therefore, this method can perform online scheduling on roadside units with low overhead.
[0121] In this embodiment, the system can be trained and tested based on real transaction data and vehicle trajectory data. Transaction priority can be determined by transaction fees, service type, or business time limits; traffic status can be obtained from statistics from roadside sensing devices or vehicle-to-everything (V2X) platforms; link distance and signature message length can be obtained from the deployment topology and the configuration of each parallel chain. Experimental evaluation metrics may include confirmation revenue, processing cost, average length of actual transaction queues, and virtual load queue value.
[0122] When traffic flow intensity decreases, the available computing power and transmission power of relay nodes increase, communication and verification costs decrease, and transaction confirmation revenue increases. Conversely, when the proportion of multi-input multi-output transactions increases, the number of parachains involved increases, leading to increased communication and signature verification overhead. This invention, through cost-aware and queue-aware scheduling, can maintain good confirmation efficiency and load balancing under the aforementioned dynamic conditions.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A latency and resource-aware bidirectional service scheduling method for relay chain in vehicle-to-everything, characterized in that, Includes the following steps: S1. Construct a multi-chain collaborative service architecture for the Internet of Vehicles, the service architecture including a terminal device layer, a service governance layer and a dense computing layer, the service governance layer including multiple relay nodes, the relay nodes connecting multiple parallel chains and receiving multi-input multi-output cross-chain transactions submitted by the parallel chain gateway; S2. Collect the status of relay nodes, parachains, links, and cross-chain transactions arriving in the current time slot. The cross-chain transaction status includes the source chain set, the destination chain set, the transaction priority, and the expected confirmation time. S3. Based on the set of parachains involved in the cross-chain transaction, the signature message length, the certificate length, the node transmission power, the channel gain, the link distance, and the computing power, calculate the communication cost, signature verification cost, and total processing cost when the transaction is allocated to different relay nodes. S4. Establish actual transaction queues and virtual load queues, and construct single-slot scheduling targets based on transaction pre-confirmation revenue, processing costs, changes in actual transaction queues, and changes in virtual load queues; S5. Input the node features, transaction features, and virtual queue features into the deep reinforcement learning scheduling model based on near-end policy optimization, and the policy network generates the action probability matrix from the transaction to the relay node; S6. Determine the transaction allocation matrix based on the action probability matrix, so that each cross-chain transaction is processed by only one relay node, and the allocated relay node performs cross-chain message forwarding, signature verification, block writing and state synchronization. S7. At the end of the time slot, update the actual transaction queue, virtual load queue, and relay chain status, and proceed to the next round of scheduling.
2. The method of claim 1, wherein, In step S1, the terminal device layer includes an in-vehicle terminal, a user application, and a parallel chain gateway, used to generate service requests, query on-chain data, and submit cross-chain transactions; the service governance layer includes relay nodes deployed on roadside units or edge devices, used to maintain the relay chain ledger, synchronize the state, and perform transaction verification; the intensive computing layer includes a cloud server, used to train the scheduling model and send model parameters to the relay nodes. In step S1, the relay chain provides cross-chain service governance among multiple parallel chains, and the relay node performs at least the functions of transaction collection, cross-chain message forwarding, signature verification, consensus participation and block confirmation; when using proof-of-work consensus, the block-producing node of the newly confirmed block is designated as the scheduling agent of the next time slot.
3. The method of claim 1, wherein, In step S2, the relay node state is given by the formula where is the number of relay nodes in the network, the computing power of the network, is the local unconfirmed transaction queue length of the relay node . The computing power is dynamically determined by a traffic state triple, which is wherein is the average vehicle speed, is the number of vehicles, is the traffic density; The traffic density and the computing power are respectively expressed by the following formulas: ; ; wherein is the statistical period, is the base computing power, is the maximum traffic state triple within the time slot .
4. The method of claim 1, wherein, In step S3, the transaction The communication cost, channel gain, signature verification cost and total processing cost allocated to the relay node are expressed by the following equations. ; ; ; ; in Parallel chain The length of the signed message, Parallel chain Certificate length, This is the communication overhead coefficient. For bandwidth, For transmission power, For noise power, For relay nodes Parallel chains Link distance.
5. The method of claim 1, wherein, In step S4, the actual transaction queue, the node load level, the system load balancing level and the virtual load queue are respectively expressed by the following formulas: ; ; ; , ; wherein is a time slot assigned to a relay node is the number of transactions, is the number of transactions that can be written to a block, is a virtual load queue.
6. The method of claim 5, wherein, In step S4, the transaction confirmation utility is expressed by the following formula: ; wherein is the expected confirmation time for the transaction , is the actual confirmation time, is the transaction allocation variable, is the processing cost scaling factor; The single-slot scheduling target is obtained from the Lyapunov drift upper bound and is expressed by the following formula: ; wherein is the reward of the scheduling model, is the utility scaling coefficient; by maximizing , the scheduling decision takes into account the confirmation latency, the processing cost, the real queue stability and the virtual queue stability.
7. The method of claim 1, wherein, In step S5, the dispatching model state is expressed by the following formula: ; wherein is a node feature matrix, is a transaction feature matrix, is a dummy queue vector; The policy network uses transaction embeddings as queries and relay node embeddings as keys and values, and obtains an action probability matrix through multi-head attention. The action probability matrix is represented by the following formula: ; wherein the first row represents the transaction probability distribution assigned to each relay node; The proximal policy optimization training process includes: computing a reward; employing ; Computing timing difference residuals; employing Computing generalized advantage estimates; employing a clipped surrogate target to update the policy network and mean squared error to update the value network.
8. A latency and resource-aware bidirectional service scheduling system for relay chain in Internet of Vehicles, characterized in that, The scheduling system is used to implement the scheduling method according to any one of claims 1-7, and the scheduling system includes: The transaction receiving module receives multi-input multi-output cross-chain transactions submitted by the parachain gateway; the state acquisition module collects relay node status, link status, parachain status, and transaction status; the cost calculation module calculates communication cost, signature verification cost, and total processing cost; the queue governance module maintains the actual transaction queue and virtual load queue and constructs the Lyapunov scheduling objective; and the near-end policy optimization scheduling module generates the action probability matrix from transaction to relay node. The execution confirmation module is used to complete cross-chain message forwarding, signature verification, block writing, and state synchronization.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.
