Reputation value-based fragmented data consensus method and system in Internet of Vehicles

By adopting a sharded data consensus method based on reputation value in the Internet of Vehicles, dynamically allocate network node functions and perform sharding processing based on communication delay, the problem of large-scale data consensus delay in the Internet of Vehicles is solved, and an efficient, fast and low-latency data consensus process is achieved.

CN119946066APending Publication Date: 2025-05-06BEIJING C&W ELECTRONICS GRP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510078569.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Under large-scale data, there is a large delay in the consensus process in the Internet of Vehicles, which cannot meet the needs of efficient, fast and low latency.

Method used

The sharded data consensus method based on reputation value is adopted. By obtaining data blocks and evaluating the real-time reputation value of the vehicle, the network node functions are dynamically allocated, and the sharding process is performed according to the communication delay between nodes, combining on-chip consensus and cross-chip consensus to reduce network communication overhead.

Benefits of technology

It effectively reduces the delay of the consensus process, improves the system's response speed and overall performance, and ensures the reliability and consistency of data consensus.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946066A_ABST
    Figure CN119946066A_ABST
Patent Text Reader

Abstract

The invention provides a reputation value-based fragmented data consensus method and system in the Internet of Vehicles, and relates to the technical field of edge calculation and block chain algorithms. The vehicle is evaluated based on the dynamic reputation value, and the network nodes are endowed with functions, so that the nodes participating in the consensus are ensured to have good network guarantee. And secondly, fragmentation processing is carried out according to the communication delay between the nodes, so that the total communication delay of the same fragmentation area is relatively small, and the fragmentation mode based on the actual network performance reduces the communication overhead in the area. According to the method, a mode of combining on-chip consensus and cross-chip consensus is adopted, so that each fragment region can execute a consensus process in parallel, and meanwhile, the consistency and reliability of data among different fragment regions are ensured through a mechanism of executing cross-chip consensus by a main node. Equivalently, the number of nodes participating in single consensus is reduced in related technologies, and the network communication overhead is reduced fundamentally. And the overall response time delay of the system is reduced while the data consensus reliability is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of edge computing and blockchain algorithm technology, and in particular to a reputation-based sharding data consensus method and system in an Internet of Vehicles. Background Art

[0002] With the emergence of various services such as autonomous driving, online video streaming, and road traffic management, as well as the expansion of demand for various in-vehicle service programs, the growing vehicle data is becoming more and more diverse, and massive amounts of vehicle data will also be used to improve user experience and facilitate road traffic services. However, in edge computing applications and Internet of Vehicles scenarios, although the resource limitations of vehicle networks and data latency requirements have been solved to a certain extent, the potential risks of user privacy and security in the process of data sharing have become increasingly prominent. Therefore, how to share data safely and protect user privacy information has become a research hotspot in the current Internet of Vehicles content.

[0003] The related technology provides a solution. For example, the Chinese invention patent with the invention name "A consensus method for data sharing based on edge computing of Internet of Vehicles" and the publication number "CN116367163A" discloses the following technical solution: "1. A consensus method for data sharing based on edge computing of Internet of Vehicles, characterized in that it mainly includes the following steps: Step 1: Collect information and build data blocks. The Internet of Vehicles is monitored through the central node. The data shared between vehicles is stored in the local record pool in chronological order. When the information stored in the record pool is sufficient to fill the data block, the system packages the data into blocks. When the block is built, the central node broadcasts it to the Internet of Vehicles and waits for the consensus process to be realized. Step 2: define the factors affecting the trust value of the shared data vehicle, where the trust value includes a reward mechanism and a penalty mechanism; Step 3: Give the definition and apply the evaluation algorithm to evaluate the trust value of the vehicle; Step 4: Design the proxy node election rules for edge nodes, obtain the master node and consensus node in the consensus process based on the trust value of the vehicle, and eliminate malicious nodes; Step 5: Determine the consensus process plan for data sharing, and use the practical Byzantine fault-tolerant consensus algorithm to obtain the consensus plan for shared data in the consensus process; Step 6: After the nodes of the Internet of Vehicles reach a consensus based on the obtained consensus solution, a block is generated to complete the data sharing in the Internet of Vehicles. "To solve the above problem.

[0004] However, in actual use, as the number of vehicle nodes in the Internet of Vehicles increases, the amount of shared data and information is also increasing dramatically. There is still a large delay in the consensus process, which cannot meet the requirements of high efficiency, fast speed and low latency in the Internet of Vehicles. Therefore, there is a technical problem in the relevant technology, that is, the delay is large in the consensus process under large-scale data. Summary of the invention

[0005] The present application provides a reputation-based sharding data consensus method and system in an Internet of Vehicles, which is used to reduce latency during the consensus process under large-scale data.

[0006] In the first aspect, the present application provides a sharded data consensus method based on reputation value in the Internet of Vehicles, including: obtaining a data block, the data block contains shared data information between vehicles; evaluating the real-time reputation value of the vehicle based on a preset vehicle dynamic reputation value algorithm to obtain a dynamic reputation value for each vehicle; assigning corresponding network node functions to the corresponding vehicle according to the distribution of the dynamic reputation value in a preset reputation value interval of different categories, the network node functions include a master node and a consensus node, and the master node and the consensus node are collectively referred to as nodes; sharding the consensus area according to the communication delay between nodes, and dividing the nodes into different sharding areas; wherein the consensus node participates in the intra-shard consensus within the sharding area to which it belongs, and the master node executes the cross-shard consensus between different sharding areas; performing consensus processing on the data block and generating a consensus plan; when the nodes reach an agreement on the consensus plan, a new data block is generated and broadcast to the entire network to realize data information sharing.

[0007] By adopting the above technical solutions, vehicles are evaluated based on dynamic reputation values ​​and network node functions are assigned, ensuring that the nodes participating in the consensus have good network security. Secondly, sharding is performed according to the communication delay between nodes, so that the total communication delay in the same shard area is small. This sharding method based on actual network performance reduces the communication overhead within the area. By combining intra-shard consensus with cross-shard consensus, each shard area can execute the consensus process in parallel. At the same time, the mechanism of executing cross-shard consensus through the master node ensures the consistency and reliability of data between different shard areas. This is equivalent to the relevant technology reducing the number of nodes participating in a single consensus, fundamentally reducing the network communication overhead. While ensuring the reliability of data consensus, the overall response delay of the system is reduced.

[0008] In combination with some embodiments of the first aspect, in some embodiments, the steps of performing consensus processing on data blocks and generating a consensus solution specifically include: using a sharded practical Byzantine fault-tolerant consensus algorithm with a reputation value to perform consensus processing on data blocks and generate a consensus solution; wherein the sharded practical Byzantine fault-tolerant consensus algorithm with a reputation value includes: the network node function also includes the highest node, the highest node is the node with the highest dynamic reputation value among the master nodes; the highest node is regarded as the master node, and a consensus strategy is executed for the shard area, and the consensus strategy is: sending a shared data transaction request to the master node; the master node assigns a proposal number to the received shared data transaction request, and broadcasts a pre-prepared message to the nodes in the shard area to which it belongs; after receiving the pre-prepared message, the consensus node verifies the content of the pre-prepared message, and after the verification passes, Other nodes in the shard area broadcast pre-prepared verification messages with node identity signatures, and receive pre-prepared verification messages sent by other consensus nodes; the consensus node performs signature verification on the received pre-prepared verification messages and counts the verification results. When the number of signatures that pass the verification in the verification results exceeds the first threshold of the total number of nodes in the shard area, the confirmation message is broadcast to all nodes in the shard area; the master node receives and verifies the confirmation messages of each consensus node in the shard area. When the number of confirmations that pass the verification exceeds the second threshold of the total number of nodes in the shard area, the intra-shard consensus is completed and the consensus result is obtained; the master nodes carry the consensus results of their respective shard areas, regard the highest node as the master node, and the master node as the consensus node to execute the consensus strategy and obtain the consensus solution.

[0009] By adopting the above technical solution, when consensus is reached within the shard area, the highest node is directly regarded as the master node because the special functions of the master node are not required. The intra-shard consensus can complete data consistency confirmation through three stages: pre-prepared message verification, signature verification, and confirmation message verification. When cross-shard consensus is required, due to the lack of consensus nodes in cross-shard consensus, the master nodes of each shard area are downgraded to consensus nodes, and the highest node is regarded as the master node to coordinate the achievement of cross-shard consensus. This role conversion mechanism based on actual needs reduces the complexity of consensus and speeds up the consensus by simplifying the node roles within the shard; in cross-shard consensus, the lack of consensus nodes is supplemented by downgrading the master node, ensuring the normal progress of cross-shard consensus; this dynamic role conversion mechanism avoids unnecessary role settings, makes the system structure more streamlined and efficient, solves the problem of node role allocation under the sharding architecture, and improves the overall performance of the system.

[0010] In combination with some embodiments of the first aspect, in some embodiments, according to the distribution of dynamic reputation values ​​in the reputation value intervals of preset different categories, the corresponding vehicles are assigned corresponding network node functions, and the network node functions include master nodes and consensus nodes, and the master nodes and consensus nodes are collectively referred to as nodes. The steps specifically include: according to the distribution of dynamic reputation values ​​in the reputation value intervals of preset different categories, the corresponding vehicles are assigned node permissions; based on the node permissions, the network node functions of the vehicles in the consensus process are determined; wherein the node permissions include: for the first reputation value interval, the vehicles that do not exceed the preset number threshold are set as master nodes, and the remaining vehicles are set as master candidate nodes; wherein the master candidate nodes are transformed into master nodes when the number of master nodes is insufficient, and serve as consensus nodes in other cases; the first reputation value interval is greater than the second reputation value interval, greater than the third reputation value interval, greater than the fourth reputation value interval; for the second reputation value interval, the vehicle is set as a slave candidate node, and when the number of slave candidate master nodes is insufficient and all the master candidate nodes are selected, it is transformed into a master node, and in other cases it serves as a consensus node for the third reputation value interval, the vehicle is set as a consensus node; for the fourth reputation value interval, the vehicle is set as a malicious node, and the malicious node will be prohibited from participating in the consensus process.

[0011] By adopting the above technical solution, nodes in the first credibility interval are preferentially selected as master nodes, ensuring the reliability of core nodes; by setting up master candidate nodes and slave candidate nodes, a double-layer candidate mechanism is constructed to form a complete node backup system. When the credibility of the master node decreases, the system can immediately select a new master node from the master candidate node, avoiding the problem of large delays in the consensus process caused by the master node with a decreased credibility value in related technologies. Secondly, the slave candidate node is used as a second-layer alternative, further enhancing the fault tolerance of the system, identifying nodes with low credibility as malicious nodes and prohibiting them from participating in the consensus, effectively eliminating the participation of malicious nodes.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, the preset vehicle dynamic reputation value algorithm is: Where V i is vehicle i; is the dynamic reputation value of vehicle i; is the historical reputation value of vehicle i; R i is the reputation incentive evaluation of vehicle i; S i is the inter-vehicle mutual evaluation reputation value of vehicle i; α is the historical reputation value coefficient; β is the reputation value incentive evaluation coefficient; γ is the inter-vehicle mutual evaluation reputation value coefficient.

[0013] By adopting the above technical solutions, the long-term performance of the node is reflected through the historical reputation value, and the basic evaluation standard of the node reputation is established. The reputation value incentive evaluation is introduced as an immediate response to the current behavior of the node, and the mutual evaluation reputation value between vehicles is added to realize the decentralized mutual supervision mechanism. Through the dynamic adjustment of the three weight coefficients, the system can flexibly adjust the influence of each dimension according to actual needs, making the evaluation results more objective and accurate, and providing a reliable quantitative basis for the subsequent node function allocation.

[0014] In conjunction with some embodiments of the first aspect, in some embodiments, according to the distribution of dynamic reputation values ​​in the reputation value intervals of different preset categories, the step of assigning the corresponding vehicle to the corresponding network node function specifically includes: when the dynamic reputation value When the dynamic reputation value is When the dynamic reputation value is When the dynamic reputation value is When , the corresponding vehicle is determined to be in the fourth credibility value interval.

[0015] By adopting the above technical solutions, this grading mechanism based on specific numerical values ​​provides nodes with clear reputation targets and improves the stability and predictability of the entire system.

[0016] In combination with some embodiments of the first aspect, in some embodiments, the consensus area is sharded according to the communication delay between nodes, and the step of dividing the nodes into different sharding areas specifically includes: the communication delay calculation formula for each node to communicate with each other is: T ij =T j -T i In the formula, T ij is the communication delay between node i and node j, T i T is the time it takes for node i to send a request for latency test to node j in the IoV blockchain with n nodes in the IoV system, i is the time it takes for node i to receive the delay test result feedback from node j; the calculation formula for the average communication delay between nodes is: Where T is the average communication delay between nodes, n is the number of nodes in the Internet of Vehicles system, and T ij is the communication delay between node i and node j; the node whose communication delay is less than the average communication delay is determined as the pre-selected central node; and non-intersecting shard areas are constructed with the pre-selected central node as the center.

[0017] By adopting the above technical solution, by measuring the actual communication delay between nodes, basic data reflecting the actual status of the network is obtained. Through the calculation formula of the average communication delay, a unified standard for evaluating the communication quality between nodes is established. Nodes with communication delays less than the average value are selected as pre-selected central nodes, ensuring that each shard area has an excellent communication performance foundation. Non-intersecting shard areas are constructed based on the pre-selected central nodes, avoiding the management complexity caused by shard overlap, reducing communication overhead through the proximity principle, and improving the operating efficiency of the entire system.

[0018] In combination with some embodiments of the first aspect, in some embodiments, the shared data information includes the vehicle's own parameter information, climate factors of the area where the vehicle is located, and on-site traffic environment conditions.

[0019] By adopting the above technical solutions, this multi-dimensional shared data information provides rich decision-making basis.

[0020] In a second aspect, the present application provides a sharded data consensus system based on reputation in an Internet of Vehicles, the sharded data consensus system based on reputation in an Internet of Vehicles comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and one or more processors call the computer instructions to enable the sharded data consensus system based on reputation in an Internet of Vehicles to execute the method described in the first aspect and any possible implementation method of the first aspect.

[0021] In a third aspect, the present application provides a computer program product comprising instructions. When the computer program product is run on a sharded data consensus system based on reputation in a vehicle network, the sharded data consensus system based on reputation in the vehicle network executes the method described in the first aspect and any possible implementation method of the first aspect.

[0022] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on a sharded data consensus system based on reputation in a vehicle network, enables the sharded data consensus system based on reputation in a vehicle network to execute a method as described in the first aspect and any possible implementation method of the first aspect.

[0023] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. Evaluate vehicles based on dynamic reputation values ​​and assign network node functions, ensuring that nodes participating in the consensus have good network security. Secondly, sharding is performed based on the communication delay between nodes, so that the total communication delay in the same shard area is small. This sharding method based on actual network performance reduces the communication overhead within the area. The combination of intra-shard consensus and cross-shard consensus allows each shard area to execute the consensus process in parallel. At the same time, the mechanism of executing cross-shard consensus through the master node ensures the consistency and reliability of data between different shard areas. This is equivalent to the relevant technology reducing the number of nodes participating in a single consensus, fundamentally reducing the network communication overhead. While ensuring the reliability of data consensus, the overall response delay of the system is reduced.

[0024] 2. When reaching consensus within the shard area, since the special functions of the master node are not required, the highest node is directly regarded as the master node. The intra-shard consensus can complete data consistency confirmation through three stages: pre-prepared message verification, signature verification, and confirmation message verification. When cross-shard consensus is required, since there is a lack of consensus nodes in the cross-shard consensus, the master nodes of each shard area are downgraded to consensus nodes, and the highest node is regarded as the master node to coordinate the achievement of cross-shard consensus. This role conversion mechanism based on actual needs reduces the complexity of consensus and speeds up the consensus by simplifying the node roles within the shard; in cross-shard consensus, the lack of consensus nodes is supplemented by downgrading the master node, ensuring the normal progress of cross-shard consensus; this dynamic role conversion mechanism avoids unnecessary role settings, makes the system structure more streamlined and efficient, solves the problem of node role allocation under the sharding architecture, and improves the overall performance of the system.

[0025] 3. Nodes in the first credibility interval are selected as master nodes first, ensuring the reliability of core nodes; by setting up master candidate nodes and slave candidate nodes, a double-layer candidate mechanism is constructed to form a complete node backup system. When the credibility of the master node decreases, the system can immediately select a new master node from the master candidate node, avoiding the problem of large delays in the consensus process caused by the master node with a decreased credibility value in related technologies. Secondly, the slave candidate node is used as a second-layer alternative, further enhancing the fault tolerance of the system, identifying nodes with low credibility as malicious nodes and prohibiting them from participating in the consensus, effectively eliminating the participation of malicious nodes. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a flow chart of a sharded data consensus method based on reputation value in the Internet of Vehicles in an embodiment of the present application; Figure 2 This is a flowchart of step S103 in the embodiment of the present application; Figure 3 This is a flow chart of step S105 in the embodiment of the present application; Figure 4 It is an exemplary hardware structure diagram of a sharded data consensus system based on reputation value in the Internet of Vehicles in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.

[0028] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0029] See also Figure 1 , Figure 1 It is a flow chart of a sharded data consensus method based on reputation value in the Internet of Vehicles in an embodiment of the present application; S101, obtaining a data block, where the data block contains shared data information between vehicles; Among them, data block refers to the basic unit used to store and transmit data in the Internet of Vehicles system. Each data block contains data information generated within a specific time period; shared data information refers to various types of data that need to be transmitted between vehicles, including vehicle status information, environmental information, and traffic information.

[0030] In some embodiments, the trust center (the trust center is an official center that is considered reliable and trustworthy in the entire network) will monitor the entire network and collect shared data information between vehicles in real time. These shared data information include but are not limited to vehicle status information (such as operating parameters such as location, speed, direction, etc.), environmental information (such as climate condition data such as temperature, humidity, visibility, etc.) and traffic information (such as road congestion, accident information, etc.). The trust center temporarily stores the collected data in the local data pool and organizes them according to time sequence and data type. When the amount of data reaches the preset threshold or reaches the set packaging cycle, the system encapsulates these data according to the predefined block structure to generate a data block containing complete shared data information. In addition to shared data information, the data block also contains basic blockchain information such as timestamps and block indexes to ensure the integrity and traceability of the data. The trust center will then broadcast the content of the data block to the entire network and wait for the completion of the consensus process.

[0031] In some embodiments, the shared data information includes the vehicle's own parameter information, climate factors in the area where the vehicle is located, and on-site traffic environment conditions.

[0032] It can be seen that this multi-dimensional shared data information provides rich basis for decision-making.

[0033] S102, evaluating the real-time reputation value of the vehicle based on a preset vehicle dynamic reputation value algorithm to obtain a dynamic reputation value of each vehicle; Among them, the preset vehicle dynamic reputation value algorithm refers to the calculation method used to evaluate the vehicle's reputation; the real-time reputation value represents the vehicle's credibility score at the current moment; and the dynamic reputation value is used to represent the reputation score results that are dynamically adjusted over time.

[0034] In some embodiments, the system first collects historical behavior data of the vehicle, including communication records, data provision records, and behavior records. Then, each dimension is quantitatively scored according to the preset evaluation indicators. Then, the scores of each dimension are weighted and calculated according to the weights to obtain a comprehensive reputation value. Finally, the system will also adjust the historical reputation value according to the time decay factor to ensure that the reputation value can reflect the latest status of the vehicle in a timely manner.

[0035] In some specific embodiments, S102 specifically includes: The preset vehicle dynamic reputation value algorithm is: α+β+γ=1 Where V i is vehicle i; is the dynamic reputation value of vehicle i; is the historical reputation value of vehicle i; R i The reputation value incentive evaluation of vehicle i; S i is the inter-vehicle reputation value of vehicle i; α is the historical reputation coefficient; β is the reputation value incentive evaluation coefficient; γ is the reputation coefficient of mutual evaluation between vehicles.

[0036] It can be seen that the long-term performance of the node is reflected through the historical reputation value, and the basic evaluation standard of the node reputation is established. The introduction of reputation value incentive evaluation as an immediate response to the current behavior of the node, and the addition of mutual evaluation reputation value between vehicles have realized a decentralized mutual supervision mechanism. Through the dynamic adjustment of the three weight coefficients, the system can flexibly adjust the influence of each dimension according to actual needs, making the evaluation results more objective and accurate, and providing a reliable quantitative basis for the subsequent node function allocation.

[0037] In an exemplary embodiment, V i Vehicle i, assuming the vehicle collection is 50; The dynamic reputation value of vehicle i; The historical reputation value of vehicle i, assuming that the initial historical reputation value of all vehicles is 0.5; R i The reputation value incentive evaluation of vehicle i is randomly generated in the interval [-1, 1]; S i The mutual reputation value of vehicle i is randomly generated in the interval [-1, 1]; α historical reputation value coefficient 0.3; β reputation value incentive evaluation coefficient 0.4; γ The mutual evaluation reputation coefficient between vehicles is 0.3; S103. According to the distribution of the dynamic reputation value in the preset reputation value intervals of different categories, the corresponding vehicle is assigned a corresponding network node function, the network node functions include a master node and a consensus node, and the master node and the consensus node are collectively referred to as nodes; Among them, the reputation value interval refers to the different level segments into which the reputation value range is divided; the network node function refers to the role the node plays in the consensus network.

[0038] This step is performed after the reputation evaluation is completed to determine the role allocation of the node in the network. In some embodiments, the system first sets the reputation thresholds corresponding to different roles, including the master node threshold and the consensus node threshold. Then, the dynamic reputation of the vehicle is compared with these thresholds to determine the network role that each vehicle can assume.

[0039] In some embodiments, step S103 specifically includes: When dynamic reputation When , the corresponding vehicle is determined to be in the first credibility value interval; When dynamic reputation When , the corresponding vehicle is determined to be in the second credibility value interval; When dynamic reputation When , the corresponding vehicle is determined to be in the third credibility value interval; When dynamic reputation When , the corresponding vehicle is determined to be in the fourth credibility value interval.

[0040] It can be seen that this grading mechanism based on specific numerical values ​​provides nodes with clear credibility targets and improves the stability and predictability of the entire system.

[0041] Following the above example, in an exemplary embodiment, when the latest reputation value of the participating node , then its reputation level is determined to be A (first reputation value interval); when the latest reputation value of the participating node , then its reputation level is determined to be B (second reputation value interval); when the latest reputation value of the participating node , its reputation level is determined to be C (third reputation value interval); when the latest reputation value of the participating node , then its credit value level is determined to be D (the fourth credit value interval).

[0042] See also Figure 2 , Figure 2 This is a flowchart of step S103 in the embodiment of the present application; In some embodiments, step S103 specifically includes: S1031, assigning node authority to the corresponding vehicle according to the distribution of the dynamic reputation value in the preset reputation value intervals of different categories; Among them, node authority is used to represent the basic authority level granted to the vehicle in the network.

[0043] In some embodiments, the system first obtains the dynamic reputation values ​​of all vehicles in the entire network and counts the number of vehicles in each preset reputation value interval. Then, the system assigns corresponding node permissions to each vehicle based on the reputation value interval to which the vehicle belongs and the permission definition rules of each interval.

[0044] S1032. Determine the network node function of the vehicle in the consensus process based on the node authority; It should be noted that in this technical solution, the functions of vehicle network nodes are not statically fixed, but dynamically changeable. This dynamism is mainly reflected in two aspects: on the one hand, when the dynamic reputation value of the vehicle itself changes, it may cross different reputation value intervals, thereby triggering a change in the node's functions; on the other hand, changes in the dynamic reputation values ​​of other vehicles will also affect the overall node allocation. For example, when the number of vehicles in the high reputation value interval changes, it may lead to the promotion or demotion of candidate nodes. This dual dynamic mechanism ensures the flexibility and adaptability of the allocation of network node functions, and can better respond to changes in the network environment. The specific implementation methods and triggering conditions for the dynamic adjustment of node functions will be described in detail in subsequent chapters.

[0045] S1033. Node permissions include: For the first reputation value interval, vehicles that do not exceed the preset number threshold are set as master nodes, and the remaining vehicles are set as master candidate nodes; wherein the master candidate node is transformed into the master node when the number of master nodes is insufficient, and serves as a consensus node in other cases; the first reputation value interval is greater than the second reputation value interval, greater than the third reputation value interval, greater than the fourth reputation value interval; Among them, the master node refers to the core node responsible for coordinating the consensus process; the master candidate node refers to the alternative node that can replace the master node; the preset number threshold refers to the maximum allowed number of master nodes.

[0046] This step is performed after determining the node authority type and is used to standardize the authority allocation of vehicles within the first reputation value interval. In some embodiments, the system first selects vehicles that do not exceed a preset number threshold as master nodes in the first reputation value interval in order from high to low reputation values. For the remaining vehicles in this interval, the system sets them as master candidate nodes. When the number of master nodes in the network is insufficient, these master candidate nodes can be transformed into master nodes in sequence according to the reputation value ranking, and in other cases participate in network operation as consensus nodes.

[0047] S1034. For the second credibility value interval, the vehicle is set as a slave candidate node, and is transformed into a master node when the number of slave candidate nodes is insufficient and all master candidate nodes are selected, and is used as a consensus node in other cases; The secondary candidate node refers to a candidate node whose reputation value is lower than that of the primary candidate node.

[0048] This step is performed after the authority allocation in the first reputation value interval is completed, and is used to standardize the authority allocation of vehicles in the second reputation value interval. In some embodiments, the system initially sets all vehicles in the second reputation value interval as slave candidate nodes. When the number of master nodes in the network is insufficient and all master candidate nodes have been converted to master nodes, the system will select the slave candidate node to be converted to the master node in order of reputation value. When the conversion condition is not triggered, the slave candidate node participates in the network operation as a normal consensus node.

[0049] S1035. For the third credibility value interval, setting the vehicle as a consensus node; S1036. For the fourth credibility value interval, the vehicle is set as a malicious node, and the malicious node will be prohibited from participating in the consensus process.

[0050] In some embodiments, the system marks all vehicles in the fourth reputation value interval as malicious nodes. These nodes will be prohibited from participating in the network consensus process, and their behavior will be strictly monitored until their reputation values ​​are raised to a higher interval.

[0051] It can be seen that nodes in the first credibility interval are preferentially selected as master nodes, ensuring the reliability of core nodes; by setting up master candidate nodes and slave candidate nodes, a two-layer candidate mechanism is constructed to form a complete node backup system. When the credibility of the master node decreases, the system can immediately select a new master node from the master candidate node, avoiding the problem of large delays in the consensus process caused by the master node with a decreased credibility value in related technologies. Secondly, the slave candidate node is used as a second-layer alternative, which further enhances the fault tolerance of the system, identifies nodes with low credibility as malicious nodes and prohibits them from participating in the consensus, effectively eliminating the participation of malicious nodes.

[0052] Therefore, the calculation method for selecting the master node is: N p =N s modN A Among them, N p Indicates that the number of the master node in the zone is p, N s Represents the number of all participating nodes in the area, N A It represents the number of nodes with reputation level A, and mod is the remainder function calculation.

[0053] S104. Shard the consensus area according to the communication delay between nodes, and divide the nodes into different shard areas; wherein the consensus node participates in the intra-shard consensus within the shard area to which it belongs, and the master node executes the cross-shard consensus between different shard areas; Among them, communication latency refers to the time required for data transmission between nodes; sharding processing refers to the process of dividing the consensus area into multiple sub-areas; shard area refers to the sub-area after division; intra-shard consensus is used to represent the consensus process within the shard area; cross-shard consensus refers to the consensus coordination between different shard areas.

[0054] In some embodiments, the system first collects communication delay data between nodes and builds a network topology map. Then, based on the delay data, the shard boundaries are set, and nodes with smaller communication delays are divided into the same shard area. Next, consensus nodes are configured in each shard area, and the master node responsible for cross-shard consensus is determined. Finally, communication links between shards are established to ensure the interconnection of the entire network.

[0055] In some embodiments, step S104 specifically includes: S1041. The calculation formula for the communication delay between nodes is: T ij =T j -T i In the formula, T ij is the communication delay between node i and node j, T i T is the time it takes for node i to send a request for latency test to node j in the IoV blockchain with n nodes in the IoV system, i The time when node i receives the delay test result feedback from node j; S1042. The calculation formula for the average communication delay between nodes is: Where T is the average communication delay between nodes, n is the number of nodes in the Internet of Vehicles system, and T ij is the communication delay between node i and node j; S1043, determining a node whose communication delay is less than the average communication delay as a pre-selected central node; Among them, the pre-selected central node refers to a node with communication performance better than the average level; in some embodiments, the system compares the communication delay of each node with the calculated average delay, and marks the nodes with shorter communication delay as pre-selected central nodes, which will serve as core nodes for subsequent network sharding.

[0056] S1044. Construct mutually non-intersecting shard areas with the pre-selected central node as the center.

[0057] In some embodiments, the system takes each pre-selected central node as the core, and divides the surrounding nodes into corresponding sharding areas according to factors such as communication delay and geographical location between nodes, ensuring that there is no overlap between the sharding areas, thereby forming a network sharding structure.

[0058] In some specific embodiments, the pre-selected central nodes that have been screened are selected as the core of each shard area to evaluate their communication coverage and load capacity; based on multi-dimensional indicators such as communication delay and geographical location, a distance matrix between nodes is constructed to quantify the actual network distance between nodes; around each center point, the coverage and boundary lines of each shard are preliminarily determined based on the node distance threshold and load balancing requirements; for nodes located near the boundaries of multiple shards, the optimal shard to which they belong is determined based on their comprehensive distance from each center point and communication quality; check whether there is overlapping area between adjacent shards to ensure that the physical and logical boundaries between shards are clear and separable, which is not limited here.

[0059] It can be seen that by measuring the actual communication delay between nodes, basic data reflecting the actual status of the network is obtained. Through the calculation formula of the average communication delay, a unified standard for evaluating the communication quality between nodes is established. Nodes with communication delays less than the average value are selected as pre-selected central nodes, ensuring that each shard area has an excellent communication performance foundation. Non-intersecting shard areas are constructed based on the pre-selected central nodes, avoiding the management complexity caused by shard overlap, reducing communication overhead through the proximity principle, and improving the operating efficiency of the entire system.

[0060] S105, performing consensus processing on the data block and generating a consensus solution; In some embodiments, first, within each shard area, the consensus node verifies and votes on the data block to form an intra-shard consensus result. Then, the master node collects the consensus results of each shard area and coordinates the cross-shard consensus. Finally, the consensus results of all shards are integrated to form a final consensus solution.

[0061] See also Figure 3 , Figure 3 This is a flow chart of step S105 in the embodiment of the present application; In some embodiments, step S105 specifically includes: S1051. Use the sharded practical Byzantine fault-tolerant consensus algorithm of the reputation value to perform consensus processing on the data block and generate a consensus solution; S1052. The sharding practical Byzantine fault-tolerant consensus algorithm of the reputation value includes: The network node functions also include the highest node, which is the node with the highest dynamic reputation value among the main nodes; Among them, the highest node represents the master node with the highest reputation value.

[0062] S1053. The highest node is regarded as the master node, and the consensus strategy is executed for the shard area; S1054, the consensus strategy is: send a shared data transaction request to the master node; In some embodiments, the nodes in the system encapsulate the data that requires consensus into a request in a standard format, send it to the master node through a preset communication mechanism, and start the consensus processing process.

[0063] S1055. The master node assigns a proposal number to the received shared data transaction request and broadcasts a pre-preparation message to the nodes in the corresponding shard area; Among them, the proposal number refers to the unique serial number used to identify the consensus request; the pre-prepared message represents the notification information of the first stage of the consensus process.

[0064] In some embodiments, the master node normalizes the received requests, assigns a globally unique proposal number, and sends a pre-prepared message to all nodes in the shard area through a broadcast mechanism to convey the basic information required for consensus.

[0065] S1056. After receiving the pre-preparation message, the consensus node verifies the content of the pre-preparation message. After the verification is passed, the pre-preparation verification message with the node identity signature is broadcast to other nodes in the shard area to which it belongs, and the pre-preparation verification message sent by other consensus nodes is received; Among them, consensus node refers to the network node participating in the consensus process; pre-prepared message verification refers to the legitimacy check of the received message; node identity signature refers to the digital signature information of the node;.

[0066] This step is performed after the pre-preparation message is sent, and is used to confirm the legitimacy of the message in the pre-preparation phase. In some embodiments, after receiving the pre-preparation message, the consensus node in the shard performs multi-dimensional verification on the message content, including format, signature, timeliness, etc. After the verification is passed, the verification result with its own signature is broadcast to other nodes, and verification messages from other nodes are received at the same time.

[0067] S1057. The consensus node performs signature verification on the received pre-prepared verification message and counts the verification results. When the number of signature verification passes in the verification results exceeds the first threshold of the total number of nodes in the sharding area to which it belongs, a confirmation message is broadcast to all nodes in the sharding area to which it belongs. Among them, signature verification refers to the authenticity check of the node's digital signature; confirmation message refers to the notification of agreement to enter the next stage.

[0068] This step is performed after collecting the pre-preparation verification message to determine whether the conditions for entering the confirmation phase are met. In some embodiments, the consensus node performs signature verification on all pre-preparation verification messages received, counts the number of verification passes, and when the number of passes exceeds a preset threshold, broadcasts a confirmation message to all nodes in the shard, indicating that the pre-preparation phase is completed.

[0069] S1058. The master node receives and verifies the confirmation messages of the consensus nodes in the shard area to which it belongs. When the number of confirmed messages that pass the verification exceeds the second threshold of the total number of nodes in the shard area to which it belongs, the intra-shard consensus is completed and the consensus result is obtained. Among them, intra-shard consensus refers to the consensus reached within the shard area.

[0070] In some embodiments, the master node is responsible for receiving and verifying confirmation messages sent by each consensus node in the shard. When the number of confirmed messages that pass the verification exceeds a preset second threshold, it indicates that a consensus has been reached within the shard, thereby determining the final consensus result.

[0071] S1059. The master nodes carry the consensus results of their respective shard areas, regard the highest node as the master node, and the master node as the consensus node to execute the consensus strategy and obtain the consensus solution.

[0072] It can be seen that when reaching consensus within the shard area, since the special functions of the master node are not required, the highest node is directly regarded as the master node. The intra-shard consensus can complete data consistency confirmation through three stages: pre-prepared message verification, signature verification, and confirmation message verification. When cross-shard consensus is required, since there is a lack of consensus nodes in the cross-shard consensus, the master nodes of each shard area are downgraded to consensus nodes, and the highest node is regarded as the master node to coordinate the achievement of cross-shard consensus. This role conversion mechanism based on actual needs reduces the complexity of consensus and speeds up the consensus by simplifying the node roles within the shard; in cross-shard consensus, the lack of consensus nodes is supplemented by downgrading the master node, ensuring the normal progress of cross-shard consensus; this dynamic role conversion mechanism avoids unnecessary role settings, making the system structure more streamlined and efficient, solving the problem of node role allocation under the sharding architecture, and improving the overall performance of the system.

[0073] S106. When the nodes reach an agreement on the consensus plan, a new data block is generated and broadcast to the entire network to achieve data information sharing.

[0074] In some embodiments, the system first verifies the integrity and correctness of the consensus scheme, and then packages the consensus data into a new data block. Next, the complete information of the new data block is broadcast to the entire network, and each node receives and stores the new block to complete data synchronization. Finally, the local blockchain is updated to ensure data consistency of all nodes.

[0075] It can be seen that evaluating vehicles based on dynamic reputation values ​​and assigning network node functions ensures that the nodes participating in the consensus have good network security. Secondly, sharding is performed according to the communication delay between nodes, so that the total communication delay in the same shard area is small. This sharding method based on actual network performance reduces the communication overhead within the area. The combination of intra-shard consensus and cross-shard consensus allows each shard area to execute the consensus process in parallel. At the same time, the mechanism of executing cross-shard consensus through the master node ensures the consistency and reliability of data between different shard areas. This is equivalent to the relevant technology reducing the number of nodes participating in a single consensus, fundamentally reducing the network communication overhead. While ensuring the reliability of data consensus, the overall response delay of the system is reduced.

[0076] The following introduces a sharded data consensus system 400 based on reputation value in an exemplary Internet of Vehicles provided in an embodiment of the present application. Figure 4 It is an exemplary hardware structure diagram of a sharded data consensus system 400 based on reputation value in the Internet of Vehicles provided in an embodiment of the present application.

[0077] In some embodiments, the sharded data consensus system 400 based on reputation value in the Internet of Vehicles is a computer device or the sharded data consensus system 400 based on reputation value in the Internet of Vehicles includes a computer device. The computer device includes a processor, a memory and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with other external terminals or servers through a network connection. In some embodiments, the network interface can be a wired network interface, and in some embodiments, the network interface can also be a wireless network interface. When the computer program is executed by the processor, the method in the embodiment of the present application is implemented.

[0078] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0079] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements 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 application.

[0080] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.

[0081] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0082] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Claims

1. A sharding data consensus method based on reputation value in Internet of Vehicles, characterized in that: include: Acquire a data block, wherein the data block contains shared data information between vehicles; Evaluate the real-time reputation value of the vehicle based on a preset vehicle dynamic reputation value algorithm to obtain a dynamic reputation value of each vehicle; According to the distribution of the dynamic reputation value in the preset reputation value intervals of different categories, the corresponding vehicle is assigned a corresponding network node function, the network node function includes a master node and a consensus node, and the master node and the consensus node are collectively referred to as a node; The consensus area is sharded according to the communication delay between the nodes, and the nodes are divided into different shard areas; wherein the consensus node participates in the intra-shard consensus within the shard area to which it belongs, and the master node executes the cross-shard consensus between different shard areas; Performing consensus processing on the data blocks to generate a consensus solution; When the nodes reach an agreement on the consensus scheme, a new data block is generated and broadcast to the entire network to achieve data information sharing.

2. The method according to claim 1, characterized in that The step of performing consensus processing on the data block and generating a consensus solution specifically includes: Using the sharded practical Byzantine fault-tolerant consensus algorithm of the reputation value to perform consensus processing on the data block and generate the consensus solution; The sharded practical Byzantine fault-tolerant consensus algorithm of the reputation value includes: The network node function also includes a highest node, and the highest node is the node with the highest dynamic reputation value among the master nodes; The highest node is regarded as the master node, and a consensus strategy is executed for the shard area. The consensus strategy is: Sending a shared data transaction request to the master node; The master node assigns a proposal number to the received shared data transaction request, and broadcasts a pre-preparation message to the nodes in the shard area to which it belongs; After receiving the pre-preparation message, the consensus node verifies the content of the pre-preparation message. After the verification is passed, the pre-preparation verification message with the node identity signature is broadcast to other nodes in the sharding area to which it belongs, and the pre-preparation verification message sent by other consensus nodes is received; The consensus node performs signature verification on the received pre-prepared verification message and counts the verification results. When the number of signature verification passes in the verification results exceeds a first threshold of the total number of nodes in the sharding area, a confirmation message is broadcast to all the nodes in the sharding area. The master node receives and verifies the confirmation messages of the consensus nodes in the shard area to which it belongs. When the number of confirmed messages that pass the verification exceeds the second threshold of the total number of nodes in the shard area to which it belongs, the intra-shard consensus is completed to obtain a consensus result. The master nodes carry the consensus results of the shard areas to which they belong, regard the highest node as the master node, and regard the master node as the consensus node to execute the consensus strategy to obtain the consensus solution.

3. The method according to claim 1 or 2, characterized in that: The step of assigning corresponding network node functions to the corresponding vehicles according to the distribution of the dynamic reputation values ​​in the preset reputation value intervals of different categories, wherein the network node functions include master nodes and consensus nodes, and the master nodes and the consensus nodes are collectively referred to as nodes, specifically includes: assigning node authority to the corresponding vehicles according to the distribution of the dynamic reputation values ​​in the preset reputation value intervals of different categories; Determining the network node role of the vehicle in the consensus process based on the node authority; The node permissions include: For the first reputation value interval, vehicles that do not exceed the preset number threshold are set as the master nodes, and the remaining vehicles are set as master candidate nodes; wherein the master candidate nodes are transformed into the master nodes when the number of the master nodes is insufficient, and serve as the consensus nodes in other cases; the first reputation value interval is greater than the second reputation value interval, greater than the third reputation value interval, and greater than the fourth reputation value interval; For the second credibility value interval, the vehicle is set as a slave candidate node, and is transformed into the master node when the number of master nodes of the slave candidate node is insufficient and all the master candidate nodes are selected, and is used as the consensus node in other cases; for the third credibility value interval, the vehicle is set as the consensus node; For the fourth reputation value interval, the vehicle is set as a malicious node, and the malicious node will be prohibited from participating in the consensus process.

4. The method according to claim 1, characterized in that The preset vehicle dynamic reputation value algorithm is: α+β+γ=1 Where V i is vehicle i; C vi is the dynamic reputation value of vehicle i; is the historical reputation value of vehicle i; R i is the reputation value incentive evaluation of vehicle i; S i is the inter-vehicle reputation value of vehicle i; α is the historical reputation coefficient; β is the reputation value incentive evaluation coefficient; γ is the reputation coefficient of mutual evaluation between vehicles.

5. The method according to claim 4, characterized in that The step of assigning the corresponding vehicle to a corresponding network node function according to the distribution of the dynamic reputation value in the preset reputation value intervals of different categories specifically includes: When the dynamic reputation value C vi ≥C1, the corresponding vehicle is determined to be in the first credibility value interval; When the dynamic reputation value C1>C vi ≥C2, the corresponding vehicle is determined to be in the second credibility value interval; When the dynamic reputation value C2>C vi ≥C3, the corresponding vehicle is determined to be in the third credibility value interval; When the dynamic reputation value C3>C vi , the corresponding vehicle is determined to be in the fourth credibility value interval.

6. The method according to claim 1, characterized in that The step of sharding the consensus area according to the communication delay between the nodes and dividing the nodes into different sharding areas specifically includes: The communication delay calculation formula for each node communicating with each other is: T ij =T j -T i In the formula, T ij is the communication delay between node i and node j, T i T is the time it takes for node i to send a request for latency test to node j in the IoV blockchain with n nodes in the IoV system, i The time when node i receives the delay test result feedback from node j; The calculation formula for the average communication delay between nodes is: Where T is the average communication delay between nodes, n is the number of nodes in the Internet of Vehicles system, and T ij is the communication delay between node i and node j; Determine the node whose communication delay is less than the average communication delay as the pre-selected central node; The non-intersecting shard areas are constructed with the pre-selected central node as the center.

7. The method according to claim 1, characterized in that The shared data information includes the vehicle's own parameter information, climate factors in the area where the vehicle is located, and on-site traffic environment conditions.

8. A sharded data consensus system based on reputation value in the Internet of Vehicles, characterized in that: The sharded data consensus system based on reputation in the Internet of Vehicles includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the sharded data consensus system based on reputation in the Internet of Vehicles to execute the method described in any one of claims 1-7.

9. A computer program product comprising instructions, characterized in that When the computer program product runs on a sharded data consensus system based on reputation in an Internet of Vehicles, the sharded data consensus system based on reputation in an Internet of Vehicles executes a method as described in any one of claims 1 to 7.

10. A computer-readable storage medium comprising instructions, characterized in that: When the instruction is executed on a sharded data consensus system based on reputation in the Internet of Vehicles, the sharded data consensus system based on reputation in the Internet of Vehicles executes the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Data sharing consensus method based on Internet of Vehicles edge computing

    CN116367163A