A blockchain-based vehicle transportation data storage method and system
By evaluating the credibility and real-time load weight of the nodes and dynamically adjusting the consensus node set, the problem of node quality selection in blockchain vehicle transportation data storage is solved, and the accuracy and efficiency of data storage are improved.
Patent Information
- Application Number
- CN202511142349.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-08-15
AI Technical Summary
In blockchain vehicle transportation data storage, how to select high-quality nodes to participate in consensus to improve the accuracy and credibility of data storage, especially in the presence of malicious nodes or faulty nodes.
By obtaining the historical vehicle storage parameters of the node, evaluating the data integrity and equipment stability of the node, combining the number of online terminals and data throughput, calculating the credibility weight and real-time load weight of the node, dynamically adjusting the consensus node set, giving priority to nodes with high processing capabilities to participate in the consensus, reducing the impact of malicious nodes, and improving consensus efficiency.
It effectively improves the security and efficiency of vehicle transportation data storage, reduces data verification delays, prevents malicious nodes from interfering with the system, and ensures the accuracy and credibility of data.
Smart Images

Figure CN120675694B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain data processing technology, and in particular to a vehicle transportation data storage method and system based on blockchain. Background Art
[0002] Blockchain is a distributed, decentralized database technology. Its core feature is the secure storage of data through encryption algorithms, distributed node consensus, and a chain-like data structure. In data storage, multiple parties reach consensus on data through technical rules, making it tamper-proof. Blockchain-based vehicle transportation data storage uses blockchain technology to store and manage data generated throughout the entire vehicle transportation process.
[0003] The current practice of using blockchain technology to store vehicle transport data is to utilize a practical Byzantine fault-tolerant algorithm. This algorithm achieves consensus through inter-node messaging and voting. Even in the presence of malicious nodes or faults, other nodes can participate in the consensus verification process. Data is only uploaded to the blockchain when a certain percentage of nodes confirm its validity. This effectively identifies and eliminates erroneous data, preventing the failure of the entire system due to a single node's abnormal behavior.
[0004] However, when determining the nodes participating in the consensus, some nodes may have poor credit and quality, such as nodes participating in malicious consensus to forge data, or nodes that are disconnected, etc. If such nodes all participate in the node consensus to verify the authenticity and accuracy of other data, it may affect the accuracy of the transportation data and the credibility of the data chain.
[0005] Therefore, how to select high-quality nodes to participate in consensus and thus improve the accuracy of vehicle transportation data storage is an urgent problem to be solved. Summary of the Invention
[0006] In order to solve the technical problem of how to select high-quality nodes to participate in consensus and thus improve the accuracy of vehicle transportation data storage, the present invention provides a vehicle transportation data storage method and system based on blockchain.
[0007] In a first aspect, the present invention provides a method for storing vehicle transportation data based on blockchain, which adopts the following technical solutions:
[0008] A vehicle transportation data storage method based on blockchain, comprising the steps of:
[0009] Obtain the vehicle storage parameters of each node in the blockchain during the historical period; determine the data integrity of the node based on the ratio of the data upload volume of the vehicle storage parameters uploaded by the node to the theoretical upload volume during the historical period; determine the device stability of the node based on the online time and online connection interruption time of the node during the historical period; determine the credibility weight of the node based on the data integrity and device stability of the node; determine the real-time load weight of the node based on the online terminal number threshold of the node and the number of online terminals associated with the node, the data throughput of the node and the throughput threshold; determine the optional weight of the node based on the credibility weight and real-time load weight of the node; record the node that needs to upload the vehicle storage parameters as the target node, obtain the maximum number of faulty nodes of the target node, and obtain the consensus node set of the target node in descending order of the optional weights of all nodes based on the maximum number of faulty nodes; in response to the consensus reached by the consensus node set of the target node, store the vehicle storage parameters that the target node needs to upload in the blockchain.
[0010] When storing vehicle storage parameters, the present invention uses the Byzantine algorithm to conduct node consensus, which can enable loyal nodes to reach a consensus in the presence of malicious nodes, thereby improving the security of vehicle data storage. In the process of node consensus, the present invention evaluates the quality of the node by obtaining the node's credibility weight and real-time load weight, and gives priority to high-processing power nodes to participate in the consensus, which can reduce data verification delays and effectively improve the speed of writing vehicle data into the blockchain. When obtaining high-processing power nodes, the present invention reduces the impact of nodes with lower credibility on the consensus by obtaining the node's credibility weight, and adapts the dynamically changing vehicle transportation data through real-time load weight, which can prevent malicious nodes from interfering with the system by frequently submitting invalid data, improve consensus efficiency, and thus effectively improve the efficiency of vehicle transportation data storage.
[0011] According to a blockchain-based vehicle transportation data storage method provided by the present invention, the vehicle storage parameters of each node in the blockchain during a historical period are obtained, including: presetting the historical period of the node; obtaining the vehicle storage parameters uploaded by the node during the historical period, as well as the load status parameters and operating status parameters of the node; wherein the load status parameters include at least the node's online terminal number threshold and the node's associated online terminal number, the node's data throughput and the throughput threshold; the operating status parameters include at least the data upload amount and theoretical upload amount of the vehicle storage parameters uploaded by the node, the online time, and the online connection interruption time.
[0012] According to a blockchain-based vehicle transportation data storage method provided by the present invention, the device stability of a node is determined based on the online time and online connection interruption time of the node in a historical period, including: recording the ratio of the online connection interruption time to the online time of the node in the historical period as the device risk index of the node; and subtracting the device risk index of the node from 1 to obtain the device stability of the node.
[0013] The present invention comprehensively evaluates device stability by the online duration of nodes and the duration of online connection interruptions, which can effectively avoid the possibility of nodes that frequently go offline being included in the consensus nodes, and improve the accuracy and efficiency of consensus node selection.
[0014] According to a blockchain-based vehicle transportation data storage method provided by the present invention, the node's credibility weight is determined based on the node's data integrity and equipment stability, including: taking the geometric mean of the node's data integrity and equipment stability as the node's credibility weight.
[0015] By taking the geometric mean of the two weights as the credibility weight, the present invention can effectively reduce the impact of extreme values of a single weight value on the node credibility, avoid using nodes with high data integrity but low device stability as consensus nodes, accurately screen nodes with higher credibility, and reduce the impact of low-credibility nodes on consensus.
[0016] According to a blockchain-based vehicle transportation data storage method provided by the present invention, determining the real-time load weight of a node includes:
[0017] ;
[0018] 、 、 are the real-time load weight of the i-th node, the number of online terminals associated with the node, and the data throughput, 、 are the online terminal number threshold and throughput threshold of the i-th node, 、 are the preset terminal quantity scaling factor and the preset throughput scaling factor of the i-th node respectively, is an exponential function with base e, is the maximum value function.
[0019] According to a blockchain-based vehicle transportation data storage method provided by the present invention, determining the optional weight of a node based on the credibility weight and real-time load weight of the node includes:
[0020] ;
[0021] is the optional weight of the i-th node, is the real-time load weight of the i-th node, is the credibility weight of the i-th node.
[0022] The present invention provides an accurate method for calculating the optional weights of nodes. The optional weights of nodes are comprehensively evaluated by the real-time load weight and credibility weight of the nodes. While reducing the impact of nodes with lower credibility on the consensus, it can ensure that the selected consensus nodes can adapt to dynamically changing vehicle transportation scenarios, effectively improving the quality of the obtained consensus node set.
[0023] According to a blockchain-based vehicle transportation data storage method provided by the present invention, the method of obtaining the maximum number of faulty nodes of a target node and obtaining a consensus node set of the target node from among all nodes arranged in descending order of optional weights based on the maximum number of faulty nodes includes: determining the number of consensus nodes of the target node according to the maximum number of faulty nodes of the target node, and obtaining the consensus nodes of the target node in sequence from among all nodes arranged in descending order of optional weights based on the number of consensus nodes to obtain the consensus node set.
[0024] According to a blockchain-based vehicle transportation data storage method provided by the present invention, determining the number of consensus nodes of a target node based on the maximum number of faulty nodes of the target node includes: determining a data scale coefficient of the target node based on a ratio of the total amount of vehicle storage parameters required to be uploaded by the target node to the amount of benchmark data;
[0025] ;
[0026] 、 、 are the number of consensus nodes, data scale coefficient, and maximum number of fault nodes of the target node, respectively. 、 They are the optional weight average and real-time load weight average of all nodes in the blockchain. is the rounding symbol, is the maximum value function.
[0027] The present invention takes into account that when the node quality is relatively good, the number of consensus nodes can be appropriately increased to improve the tolerance to the number of faulty nodes. Therefore, the present invention provides an accurate method for calculating the number of consensus nodes of the target node. By analyzing the data scale coefficient of the target node and the optional weight mean and real-time load weight mean of all nodes in the blockchain, the overall quality of the blockchain node can be accurately evaluated, thereby accurately obtaining the number of consensus nodes of the target node.
[0028] According to a blockchain-based vehicle transportation data storage method provided by the present invention, a consensus is reached on a consensus node set of a target node, including: selecting a node with the largest optional weight in the consensus node set as a master node, and the remaining nodes as slave nodes; after the master node accepts an upload request from the target node, it assigns a unique serial number and broadcasts a message to the slave node; after the slave node receives a preset number of messages with the same serial number, it broadcasts a reply confirmation message to the master node; after the master node broadcasts a confirmation message of receiving the preset number of messages, the consensus node set of the target node reaches a consensus.
[0029] In a second aspect, the present invention provides a vehicle transportation data storage system based on blockchain, which adopts the following technical solutions:
[0030] A blockchain-based vehicle transportation data storage system includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned blockchain-based vehicle transportation data storage method is implemented.
[0031] By adopting the above technical solution, the above-mentioned blockchain-based vehicle transportation data storage method is generated into a computer program and stored in a memory to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.
[0032] The present invention has the following technical effects:
[0033] Based on the above technical solution, the present invention provides a vehicle transportation data storage method and system based on blockchain. When storing vehicle storage parameters, node consensus is performed through the Byzantine algorithm. In the presence of malicious nodes, loyal nodes can reach a consensus conclusion, thereby improving the security of vehicle data storage. In the process of node consensus, the present invention evaluates the quality of the node by obtaining the credibility weight and real-time load weight of the node, and gives priority to high-processing power nodes to participate in the consensus, which can reduce data verification delays and effectively improve the speed of writing vehicle data to the blockchain. When obtaining high-processing power nodes, the present invention reduces the impact of nodes with lower credibility on the consensus by obtaining the credibility weight of the node, and adapts the dynamically changing vehicle transportation data through the real-time load weight, which can prevent malicious nodes from interfering with the system by frequently submitting invalid data, improve consensus efficiency, and thus effectively improve the efficiency of vehicle transportation data storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of a process flow in a blockchain-based vehicle transportation data storage method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, but not all of the embodiments.
[0036] The embodiment of the present invention discloses a method for storing vehicle transportation data based on blockchain. For details, please refer to Figure 1 As shown, Figure 1 This is a flowchart of a blockchain-based vehicle transportation data storage method provided by an embodiment of the present invention. By dynamically adjusting the set of nodes participating in the consensus in the supply chain, this method can prioritize nodes with high processing capabilities to participate in the consensus, prevent malicious nodes from interfering with the system by frequently submitting invalid data, and improve the accuracy and credibility of the consensus by adapting to dynamically changing transportation scenarios, thereby effectively improving the efficiency of vehicle data storage. The method specifically includes the following steps:
[0037] S1: Obtain the vehicle storage parameters of each node in the blockchain during the historical period.
[0038] Among them, vehicle storage parameters can be vehicle location information, cargo status, order information, etc.
[0039] It's important to note that in a blockchain, nodes can be edge servers, transportation platform servers, and more. Each node has an associated online terminal, which can be a vehicle terminal. As a terminal device, the online terminal continuously generates vehicle storage parameter data and uploads this data to the blockchain for evidence storage. Nodes also submit basic information to the blockchain in advance, including device model, historical operating records, and load status parameters.
[0040] The nodes of a blockchain may include both normal loyal nodes and faulty Byzantine nodes. Loyal nodes can send and receive messages correctly, while Byzantine nodes can perform arbitrary actions, including sending contradictory instructions, forging messages, or delaying responses. If too many unreliable Byzantine nodes are used in the consensus node set of the Byzantine algorithm, it may cause consensus delays in data verification. Therefore, it is necessary to dynamically adjust the consensus node set based on the quality of each node to improve consensus accuracy and efficiency.
[0041] For example, in an embodiment of the present invention, obtaining the vehicle storage parameters of each node in the blockchain for a historical period includes: presetting the historical period of the node; obtaining the vehicle storage parameters uploaded by the node within the historical period, as well as the load status parameters and operating status parameters of the node; wherein the load status parameters include at least the node's online terminal number threshold and the node's associated online terminal number, the node's data throughput and the throughput threshold; the operating status parameters include at least the data upload amount and theoretical upload amount of the vehicle storage parameters uploaded by the node, the online time, and the online connection interruption time.
[0042] The node's historical period can be set to 7 days; the length of the historical period can be adjusted based on actual needs. The node's theoretical upload capacity, online terminal number threshold, and throughput threshold can be obtained from the node's system configuration file and are not detailed in this embodiment of the present invention. Online duration includes normal online time and online connection interruption time.
[0043] Specifically, the operating status parameter records of the nodes in the historical period can be extracted through the blockchain underlying log system.
[0044] It's important to note that vehicle transportation places high demands on data authenticity and integrity. Blockchain-stored data directly impacts scheduling decisions and the division of responsibilities. Therefore, when selecting consensus nodes for uploading vehicle storage parameters to the blockchain, it's crucial to choose nodes with a relatively complete and stable history of uploads. This prevents frequent node offline events from disrupting consensus and potentially missing critical transportation information. Furthermore, vehicle transportation is a constantly changing process, with frequent changes in vehicle information and data volumes surging during peak periods. Therefore, when selecting consensus nodes, it's crucial to minimize the risk of system stalls caused by node overload.
[0045] Based on this, the embodiment of the present invention can quantitatively evaluate the integrity and stability of the node's historical uploaded data and the node's current processing capacity through the following steps S2 and S3 respectively, reflect the node's credibility through the node's operating status parameters, and reflect the node's real-time load through the node's load status parameters, thereby accurately obtaining the possibility that each node can serve as a consensus node and reducing the possibility of incorporating Byzantine nodes into the consensus node combination, that is, executing the following steps.
[0046] For example, in an embodiment of the present invention, the optional weight of a node is determined based on the credibility weight and real-time load weight of the node. The higher the optional weight, the lower the possibility that the node is a Byzantine node.
[0047] S2: Obtain the data integrity and device stability of the node; determine the credibility weight of the node based on the data integrity and device stability of the node.
[0048] It should be noted that if the integrity of the node's historical data is low, key transportation information (such as records of abnormal stops during the journey) may be frequently missed, resulting in distortion of on-chain data and affecting subsequent dispute tracing; if the node equipment is unstable, frequently offline or malfunctions, it may lead to consensus interruption, slow down the speed of data on-chain, and even cause block forks.
[0049] Therefore, when obtaining consensus nodes, you can give priority to nodes with more reliable historical performance to participate in the consensus to ensure the credibility of the on-chain data.
[0050] For example, the data integrity of a node can be determined based on the ratio of the data upload amount of vehicle storage parameters uploaded by the node to the theoretical upload amount during a historical period; the device stability of the node can be determined based on the online time and online connection interruption time of the node during a historical period.
[0051] For example, in an embodiment of the present invention, the device stability of a node is determined based on the online time and the online connection interruption time of the node in a historical period, including: recording the ratio of the online connection interruption time to the online time of the node in the historical period as the device risk index of the node; and subtracting the device risk index of the node from 1 to obtain the device stability of the node.
[0052] The values of data integrity and equipment stability are both in the range of [0,1].
[0053] For example, in an embodiment of the present invention, determining the credibility weight of a node based on the data integrity and device stability of the node includes: taking the geometric mean of the data integrity and device stability of the node as the credibility weight of the node.
[0054] In this way, the embodiment of the present invention obtains the credibility weight through the geometric mean value of the two, which can avoid the credibility weight of nodes with extremely high node integrity but extremely poor stability from being abnormally increased, and improve the accuracy of consensus node quality assessment.
[0055] S3: Determine the real-time load weight of the node based on the node's online terminal number threshold, the number of online terminals associated with the node, the node's data throughput, and the throughput threshold; determine the node's optional weight based on the node's credibility weight and real-time load weight.
[0056] It should be noted that vehicle transportation has dynamic load characteristics, and the node load will fluctuate over time. For example, during the morning rush hour, transport vehicles are concentrated online, causing the node to process a large amount of related online terminal data, and the load increases rapidly. However, the number of online terminals will decrease late at night, and the online terminal data that the node needs to process will also decrease.
[0057] Therefore, the embodiment of the present invention can analyze the real-time pressure of the node based on the number of online terminals and data throughput of the node. If the number of vehicles is greater and the data processing volume is larger, the node is more likely to be delayed due to excessive resource occupation. The threshold of the number of online terminals and the throughput threshold of the node are preset values based on the hardware capabilities of the node, which can measure the critical capacity of the node device. The embodiment of the present invention can evaluate the real-time load capacity of the node by comparing the gap between the number of online terminals and data throughput and their corresponding thresholds.
[0058] Among them, in order to avoid damage to the equipment due to excessive approach to the extreme critical value, when setting the node's online terminal number threshold and throughput threshold, 80% of the actual critical value can be used as the corresponding threshold. The specific setting can be made according to actual needs. The critical value of the node can be obtained through the node device parameters, which will not be elaborated in the embodiments of the present invention.
[0059] For example, if the critical value of the number of online terminals of a node is 500, the threshold value of the number of online terminals can be set to 400.
[0060] For example, in an embodiment of the present invention, determining the real-time load weight of a node includes:
[0061] ;
[0062] is the real-time load weight of the i-th node, is the number of online terminals associated with the i-th node, is the data throughput of the i-th node, is the threshold value of the number of online terminals of the i-th node, is the throughput threshold of the i-th node, is the preset terminal number scaling factor of the i-th node, is the preset throughput scaling factor for the i-th node, is an exponential function with base e, is the maximum value function.
[0063] In this formula, the preset terminal quantity scaling factor or the preset throughput scaling factor can be set to 10% of the online terminal quantity threshold or the throughput threshold. The preset terminal quantity scaling factor and the preset throughput scaling factor are used to normalize the numerator in the formula. The values can be set as needed and are not limited in this embodiment.
[0064] and It is used to reduce the weight when the number of online terminals and data throughput associated with the i-th node exceeds the corresponding threshold. Greater than and / or Greater than When the actual load capacity of the node exceeds the load it needs to bear, the real-time load weight of the node needs to be reduced to reduce the possibility of the node being selected into the consensus node set.
[0065] After obtaining the node's credibility weight and real-time load weight according to the above steps, the node's optional weight can be obtained based on this.
[0066] For example, in an embodiment of the present invention, determining the optional weight of a node according to the credibility weight and real-time load weight of the node includes:
[0067] ;
[0068] is the optional weight of the i-th node, is the real-time load weight of the i-th node, is the credibility weight of the i-th node.
[0069] In this calculation method, the present invention combines the node's real-time load weight and credibility weight to reduce the possibility of high-credibility nodes crashing due to long-term high loads, or of low-credibility nodes being included in the consensus set, threatening data security. By fusing the two weights in the form of a square root, the impact of these two dimensions on the node's comprehensive capability assessment can be effectively balanced. If either weight is low, the optional weight can be reduced, allowing the target node to prioritize nodes that perform well in both dimensions.
[0070] After obtaining the optional weight of each node according to the above steps, the target node can select the corresponding consensus node set for this data verification based on the optional weight, that is, continue to execute the following steps.
[0071] S4: The node that needs to upload the vehicle storage parameters is recorded as the target node, the maximum number of faulty nodes of the target node is obtained, and the consensus node set of the target node is obtained from the optional weighted descending order of all nodes based on the maximum number of faulty nodes.
[0072] It should be noted that the maximum number of failed nodes for the target node is the acceptable number of failed nodes set by the blockchain system, which is usually set based on the number of all nodes in the system. The embodiments of the present invention are not described in detail here. When determining the number of consensus nodes for the target node, if the data scale of the target node is large and the network load is small, the number of consensus nodes can be increased appropriately, and more nodes can be used to verify the nodes to improve data accuracy and fault tolerance for failed nodes. Conversely, if the data scale of the target node is small and the network load is large, the number of consensus nodes can be maintained at a lower level to avoid resource waste and network congestion.
[0073] For example, in an embodiment of the present invention, the maximum number of faulty nodes of the target node is obtained, and the consensus node set of the target node is obtained from the optional weighted descending order of all nodes based on the maximum number of faulty nodes, including: determining the number of consensus nodes of the target node according to the maximum number of faulty nodes of the target node, and obtaining the consensus nodes of the target node in sequence from the optional weighted descending order of all nodes based on the number of consensus nodes to obtain the consensus node set.
[0074] For example, in an embodiment of the present invention, the number of consensus nodes of the target node is determined based on the maximum number of fault nodes of the target node, including: determining the data scale coefficient of the target node based on the ratio of the total amount of vehicle storage parameters that the target node needs to upload to the benchmark data amount.
[0075] The benchmark data volume is the amount of data that can be transmitted by the target node.
[0076] For example, calculating the number of consensus nodes of the target node includes:
[0077] ;
[0078] is the number of consensus nodes of the target node, is the data scale coefficient of the target node, is the maximum number of failed nodes of the target node, is the optional weight mean of all nodes in the blockchain, is the real-time load weight average of all nodes in the blockchain, is the rounding symbol, is the maximum value function.
[0079] In this calculation method, The larger the value, the larger the total amount of vehicle transport data currently awaiting consensus, and more nodes are needed to participate in verification to ensure accuracy.
[0080] Reflects the overall quality of all current nodes. The higher the quality, the fewer consensus nodes are required, and the fewer the corresponding consensus nodes.
[0081] Reflects the average network load level of all nodes in the network. The higher the load, the more the number of consensus nodes needs to be controlled to avoid network congestion, so the corresponding number of consensus nodes is smaller.
[0082] Use Taking the square root form can mitigate the impact of parameter changes on the number of nodes, avoid sudden increases or decreases in the number of nodes due to data volume or load fluctuations, and ensure system stability.
[0083] Based on the above steps, the number of consensus nodes of the target node can be obtained. Based on the number of consensus nodes, the consensus nodes of the target node are obtained in descending order of the optional weights of all nodes, and the consensus node set of the target node can be obtained.
[0084] It is understandable that if the obtained consensus node goes offline during the confirmation phase, a node can be selected from the descending weight sorting according to the optional weight, and the confirmation phase can be re-executed to ensure the continuity of the consensus process.
[0085] For example, if the number of consensus nodes is 20, the nodes corresponding to the first 20 optional weights in descending order of optional weights can be used as consensus nodes. If the fourth consensus node goes offline during the confirmation phase, the node corresponding to the 21st optional weight in descending order of optional weights can be used as a backup node.
[0086] It should be noted that if the maximum optional weight in the descending order of optional weights is small, it means that the quality of all current nodes is poor. At this time, the consensus can be directly suspended and wait for the nodes to recover.
[0087] For example, a comparison result between the maximum optional weight in descending order of optional weights and the optional weight threshold is obtained, and when the maximum optional weight is less than the optional weight threshold, the consensus process of the target node is stopped.
[0088] The optional weight threshold can be set according to actual needs, and the embodiment of the present invention does not limit this.
[0089] According to the above steps, the consensus node set of the target node can be obtained.
[0090] S5: In response to the consensus node set of the target node reaching a consensus, the vehicle storage parameters that the target node needs to upload are stored in the blockchain.
[0091] For example, in an embodiment of the present invention, the consensus node set of the target node reaches a consensus, including: taking the node with the largest optional weight in the consensus node set as the master node, and the remaining nodes as slave nodes; after the master node accepts the upload request of the target node, it assigns a unique serial number and broadcasts a message to the slave node; after the slave node receives a preset number of messages with the same serial number, it broadcasts a reply confirmation message to the master node; after the master node broadcasts the confirmation message of receiving the preset number of messages, the consensus node set of the target node reaches a consensus.
[0092] The preset number of items can be set to strip, The maximum number of failed nodes for the target node.
[0093] For example, after storing the vehicle storage parameters that the target node needs to upload to the blockchain, the system can also record the performance of each node in this consensus as a reference for subsequent consensus.
[0094] It can be seen that in an embodiment of the present invention, when implementing blockchain-based vehicle transportation data storage, the vehicle storage parameters of each node in the blockchain in a historical period can be obtained; the data integrity of the node is determined according to the ratio of the data upload amount of the vehicle storage parameters uploaded by the node to the theoretical upload amount during the historical period; the device stability of the node is determined according to the online time and online connection interruption time of the node in the historical period; the credibility weight of the node is determined according to the data integrity and device stability of the node; the real-time load weight of the node is determined according to the online terminal number threshold of the node and the number of online terminals associated with the node, the data throughput of the node and the throughput threshold; the optional weight of the node is determined according to the credibility weight and real-time load weight of the node; the node that needs to upload the vehicle storage parameters is recorded as the target node, the maximum number of faulty nodes of the target node is obtained, and the consensus node set of the target node is obtained in descending order of the optional weights of all nodes based on the maximum number of faulty nodes; in response to the consensus of the consensus node set of the target node, the vehicle storage parameters that the target node needs to upload are stored in the blockchain, which effectively improves the efficiency of vehicle transportation data storage.
[0095] An embodiment of the present invention also discloses a blockchain-based vehicle transportation data storage system, including a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, a blockchain-based vehicle transportation data storage method provided by the present invention is implemented.
[0096] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. The configuration and functions of these components are known in the art and will not be described in detail here.
[0097] In the present invention, the aforementioned memory may be any tangible medium that contains or stores a program, which may be used by or in combination with an instruction execution system, apparatus, or device.
[0098] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A vehicle transportation data storage method based on blockchain, characterized in that: include: Obtain the vehicle storage parameters of each node in the blockchain for the historical period; The data integrity of the node is determined based on the ratio of the data upload volume of the vehicle storage parameters uploaded by the node to the theoretical upload volume during the historical period; Determine the device stability of the node based on the node's online time and online connection interruption time in the historical period; Determine the node's credibility weight based on the node's data integrity and device stability; Determine the real-time load weight of the node based on the node's online terminal number threshold, the number of online terminals associated with the node, the node's data throughput, and the throughput threshold; Determine the optional weight of the node based on the node's credibility weight and real-time load weight; The node that needs to upload the vehicle storage parameters is recorded as the target node, the maximum number of faulty nodes of the target node is obtained, and the consensus node set of the target node is obtained from all nodes in descending order of their optional weights based on the maximum number of faulty nodes; In response to the consensus node set of the target node reaching a consensus, the vehicle storage parameters that the target node needs to upload are stored in the blockchain.
2. A vehicle transportation data storage method based on blockchain according to claim 1, characterized in that: The method of obtaining the vehicle storage parameters of each node in the blockchain for a historical period includes: Preset a historical time period of the node; obtain the vehicle storage parameters uploaded by the node, as well as the load status parameters and operating status parameters of the node within the historical time period; wherein the load status parameters at least include the node's online terminal quantity threshold and the node's associated online terminal quantity, the node's data throughput and the throughput threshold; the operating status parameters at least include the data upload volume and theoretical upload volume of the vehicle storage parameters uploaded by the node, the online time and the online connection interruption time.
3. The vehicle transportation data storage method based on blockchain according to claim 1 is characterized in that: Determining the device stability of the node according to the online duration and online connection interruption duration of the node in the historical period includes: The ratio of the online connection interruption time to the online time in the node's historical period is recorded as the device risk index of the node; the device stability of the node is obtained by subtracting the device risk index of the node from 1.
4. The vehicle transportation data storage method based on blockchain according to claim 1 is characterized in that: Determining the node's credibility weight based on the node's data integrity and device stability includes: The geometric mean of a node's data integrity and device stability is used as the node's credibility weight.
5. The vehicle transportation data storage method based on blockchain according to claim 1 is characterized in that: Determining the real-time load weight of the node includes: ; 、 、 are the real-time load weight of the i-th node, the number of online terminals associated with the node, and the data throughput, 、 are the online terminal number threshold and throughput threshold of the i-th node, 、 are the preset terminal quantity scaling factor and the preset throughput scaling factor of the i-th node respectively, is an exponential function with base e, is the maximum value function.
6. The method for storing vehicle transportation data based on blockchain according to claim 1, characterized in that: The step of determining the optional weight of a node according to the credibility weight and real-time load weight of the node includes: ; is the optional weight of the i-th node, is the real-time load weight of the i-th node, is the credibility weight of the i-th node.
7. The vehicle transportation data storage method based on blockchain according to claim 1 is characterized in that: The method of obtaining the maximum number of faulty nodes of the target node and obtaining the consensus node set of the target node in descending order of the optional weights of all nodes based on the maximum number of faulty nodes includes: The number of consensus nodes of the target node is determined according to the maximum number of faulty nodes of the target node. Based on the number of consensus nodes, the consensus nodes of the target node are obtained in descending order of the optional weights of all nodes to obtain the consensus node set.
8. The method for storing vehicle transportation data based on blockchain according to claim 7, characterized in that: Determining the number of consensus nodes of the target node according to the maximum number of failed nodes of the target node includes: Determine the data scale coefficient of the target node based on the ratio of the total amount of vehicle storage parameters that the target node needs to upload to the benchmark data volume; ; 、 、 are the number of consensus nodes, data scale coefficient, and maximum number of fault nodes of the target node, respectively. 、 They are the optional weight average and real-time load weight average of all nodes in the blockchain. is the rounding symbol, is the maximum value function.
9. The method for storing vehicle transportation data based on blockchain according to claim 8, characterized in that: The consensus node set of the target node reaches a consensus, including: The node with the largest optional weight in the consensus node set is selected as the master node, and the remaining nodes are selected as slave nodes; after the master node accepts the upload request of the target node, it assigns a unique serial number and broadcasts the message to the slave node; after the slave node receives a preset number of messages with the same serial number, it broadcasts a reply confirmation message to the master node; after the master node broadcasts the confirmation message of the preset number, the consensus node set of the target node reaches a consensus.
10. A vehicle transportation data storage system based on blockchain, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a blockchain-based vehicle transportation data storage method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Federal learning system and method based on DAG block chain
CN116702880A
Human resource data processing method and system based on recursive block chain
CN117952582A