A Distributed Traffic Signal Control Method, Device, and Medium Based on Blockchain
By determining the main node and child node in the blockchain network, encrypting the traffic signal data, and building a network topology model, the problem of data being easily tampered with in the traditional traffic signal control architecture is solved, and the data security and reliability are achieved.
Patent Information
- Application Number
- CN202510449796.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-04-11
AI Technical Summary
Data in traditional traffic signal control architectures are prone to tampering, affecting urban traffic planning and scheduling.
A distributed traffic signal control method based on blockchain is adopted, and the security value prediction of the data upload terminal is determined, the main node and child nodes are encrypted, and the network topology model is built to plan the transmission path, and the distributed storage characteristics of the blockchain are used to ensure data security and reliability.
It reduces the possibility of data being maliciously tampered with, improves data transmission efficiency and storage reliability, and ensures the security and long-term availability of traffic signal data.
Smart Images

Figure CN119992854B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent transportation technologies, and in particular, to a distributed traffic signal control method, device, and medium based on blockchain. Background Art
[0002] With the acceleration of the urbanization process, the traffic flow is increasing day by day. As a key infrastructure to ensure the orderly operation of urban traffic, the traffic signal system has become increasingly important. Traffic signal data covers multi-dimensional information such as signal lamp status, traffic flow, and vehicle driving speed. The accuracy and security of this data are directly related to the efficient operation of the traffic system and the safety and convenience of public travel.
[0003] In the traditional traffic signal control architecture, a centralized control mode is mostly adopted. In this mode, traffic signal data is centrally stored in a central server, and the central server uniformly processes data, issues instructions, and controls the system. However, in the centralized control mode, data transmission depends on a specific communication link. If the link fails or is interfered, data transmission will be interrupted, thus affecting the normal operation of the traffic signal system. In addition, since all data is centrally stored, once the central server is attacked by hackers, invaded by malware, or has internal management vulnerabilities, the data is extremely easy to be tampered with, thus affecting the planning and scheduling of the entire urban traffic. Summary of the Invention
[0004] Embodiments of this application provide a distributed traffic signal control method, device, and medium based on blockchain to solve the following technical problems: In the traditional traffic signal control architecture, a centralized control mode is mostly adopted, and the data is extremely easy to be tampered with, thus affecting the planning and scheduling of the entire urban traffic.
[0005] Embodiments of this application adopt the following technical solutions:
[0006] Embodiments of this application provide a distributed traffic signal control method based on blockchain. The method includes receiving a traffic signal storage request sent by a data upload terminal, and predicting a security value for the data upload terminal; in the case where the security value meets an adjustment threshold, determining a primary node and sub-nodes in the blockchain network, and encrypting the traffic signal data corresponding to the primary node and sub-nodes respectively; determining split factors corresponding to the primary node and sub-nodes respectively, and based on the split factors, dividing the encrypted data of each node into multiple encrypted data blocks; constructing a network topology model based on the historical traffic signal transmission data corresponding to the blockchain network and the load data of each node, so as to perform path planning on multiple encrypted data blocks respectively based on the network topology model to screen out forwarding nodes in the blockchain network; verifying the encrypted data blocks received by the forwarding nodes, and in the case where the verification passes, storing the traffic signal encrypted data corresponding to the encrypted data blocks.
[0007] In the embodiments of the present application, by predicting the security value of the data upload terminal, it is possible to intercept data from insecure terminals, reducing the possibility of data being maliciously tampered with or injected with risk data at the source, and ensuring the security of the entire traffic signal data ecosystem. Secondly, by determining the master node and sub-nodes in the blockchain network and encrypting the traffic signal data, it is difficult for the data to be stolen or cracked during the transmission and storage processes. Based on the historical traffic signal transmission data and the load data of each node in the blockchain network, a network topology model is constructed to plan the transmission path for the encrypted data block, enabling the data to avoid congested nodes and select the optimal path for transmission, reducing the transmission delay, and improving the transmission efficiency of the data from the upload terminal to the storage node. In the embodiments of the present application, by storing the traffic signal encrypted data in the blockchain network and utilizing the distributed storage characteristics of the blockchain, the data is dispersed and stored in multiple nodes. Even if some nodes fail, the data can still be obtained from other nodes, improving the reliability of data storage and ensuring the long-term availability of traffic signal data.
[0008] In one implementation manner of the present application, when receiving a traffic signal storage request sent by a data upload terminal and predicting the security value of the data upload terminal, it specifically includes: obtaining the terminal identifier corresponding to the data upload terminal, and determining the historical upload data in the historical database based on the terminal identifier; performing alignment processing on the time series data in the historical upload data to extract multi-dimensional features from the aligned data; where the multi-dimensional features at least include one of the mean, variance, minimum value, and maximum value; inputting the multi-dimensional features into a pre-set long short-term memory network to output the time series features corresponding to the data upload terminal through the pre-set long short-term memory network; classifying the time series features, and determining the classification weight value based on the classification result; and determining the time decay factor based on the interval between the current time when the traffic signal storage request is received and the most recent data upload time; and determining the risk regulation coefficient based on the number of attacks and frequency within a preset time period in the blockchain network; determining the security value corresponding to the data upload terminal based on the classification weight value, the time decay factor, and the risk regulation coefficient.
[0009] In one implementation manner of the present application, determining the security value corresponding to the data upload terminal based on the classification weight value, the time decay factor, and the risk regulation coefficient specifically includes:
[0010] Based on the function:
[0011] ;
[0012] ;
[0013] determining the security value corresponding to the data upload terminal; where is the security value; is the classification weight value; is the time decay factor; is the risk regulation coefficient; is the adjustment function; is the preset function threshold for adjusting the adjustment function.
[0014] In an implementation manner of the present application, a master node and slave nodes are determined in a blockchain network, and traffic signal data respectively corresponding to the master node and the slave nodes is encrypted, which specifically includes: determining a first traffic intersection where the controlled traffic signal is located according to the traffic signal data; determining multiple second traffic intersections having an association relationship with the first traffic intersection based on a traffic network diagram; constructing a traffic signal set based on the traffic signals respectively corresponding to the first traffic intersection and the multiple second traffic intersections; determining reference traffic data that periodically repeats in the traffic signal set, and performing encoding replacement on the reference traffic data based on a preset traffic signal dictionary table; wherein, the preset traffic signal dictionary table includes multiple reference traffic data and also includes encodings respectively corresponding to the multiple reference traffic data; constructing reference encrypted data based on the replaced encoding and the data in the traffic signal set that is not replaced; symmetrically encrypting the reference encrypted data through the master node and the slave nodes, and determining hash values respectively corresponding to each node, so as to encrypt the traffic signal data respectively corresponding to the master node and the slave nodes.
[0015] In an implementation manner of the present application, a segmentation factor respectively corresponding to the master node and the slave nodes is determined, and based on the segmentation factor, the data encrypted by each node is divided into multiple encrypted data blocks, which specifically includes: determining a first traffic signal group with an association greater than a first preset threshold based on the traffic network diagram, so as to divide the traffic network diagram into multiple traffic control areas based on the positions of the first traffic signal group; in the traffic control area, determining a second traffic signal group with an association greater than a second preset threshold, so as to divide the traffic control area into multiple traffic control sub-areas based on the positions of the second traffic signal group; wherein, the second preset threshold is greater than the first preset threshold; determining the segmentation factor corresponding to the master node based on the number of traffic control areas, so as to divide the data encrypted by the master node into multiple encrypted data blocks based on the segmentation factor; and determining the segmentation factor corresponding to the slave nodes based on the number of traffic control sub-areas, so as to divide the data encrypted by the slave nodes into multiple encrypted data blocks based on the segmentation factor.
[0016] In an implementation manner of the present application, a network topology model is constructed based on the historical traffic signal transmission data corresponding to the blockchain network and the load data of each node, specifically including: taking each node as a vertex and the connection between nodes as an edge to construct the topological structure corresponding to the blockchain network; based on the topological structure, determining the historical transmission data between vertex groups with an associated relationship to determine the historical weight value based on the historical transmission data; obtaining the current weight value of the vertex group based on the current load data and network latency data corresponding to the vertex group; and inputting the historical transmission data, current load data, and network latency data into a preset node trend prediction model, and outputting the dynamic change information corresponding to the vertex group based on the preset node trend prediction model to determine the predicted weight value based on the dynamic change information; obtaining the reference weight value between vertex groups based on the historical weight value, current weight value, and predicted weight value; and constructing a network topology model based on the topological structure corresponding to the blockchain network and the reference weight value.
[0017] In an implementation manner of the present application, path planning is performed on multiple encrypted data blocks respectively based on the network topology model to screen out forwarding nodes in the blockchain network, specifically including: when the traffic signal is an emergency signal, initializing the distance from all nodes to the source node to infinity and creating a set of nodes with undetermined shortest paths; in each iteration, determining a reference node in the set of nodes that is closest to the source node and has a load not greater than the preset load threshold, and updating the reference distance from the adjacent node corresponding to the reference node to the source node; if the path through the reference node to the adjacent node is less than the reference distance, updating the reference node as the forwarding node of the adjacent node; until the iteration ends, determining the optimal path in the set of nodes based on the determined multiple forwarding nodes.
[0018] In an implementation manner of the present application, path planning is performed on multiple encrypted data blocks respectively based on the network topology model to screen out forwarding nodes in the blockchain network, specifically including: when the data volume of the encrypted data block is greater than the preset data volume threshold, determining the number of sub-flow splits based on the data volume corresponding to the data block and the load data corresponding to the blockchain network; splitting the data block into multiple sub-flows based on the number of sub-flow splits; and determining the balanced load path based on the data volumes corresponding to the multiple sub-flows and the data transmission volumes corresponding to each node.
[0019] An embodiment of the present application provides a distributed traffic signal control device based on a blockchain, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: receive a traffic signal storage request sent by a data upload terminal, and perform a security value prediction on the data upload terminal; in the case where the security value meets the adjustment threshold, determine a primary node and a secondary node in the blockchain network, and encrypt the traffic signal data corresponding to the primary node and the secondary node respectively; determine the segmentation factors corresponding to the primary node and the secondary node respectively, and based on the segmentation factors, divide the encrypted data of each node into multiple encrypted data blocks; construct a network topology model based on the historical traffic signal transmission data corresponding to the blockchain network and the load data of each node, so as to perform path planning on the multiple encrypted data blocks respectively based on the network topology model, and screen out forwarding nodes in the blockchain network; verify the received encrypted data blocks through the forwarding nodes, and in the case where the verification passes, store the traffic signal encrypted data corresponding to the encrypted data blocks.
[0020] A non-volatile computer storage medium provided by an embodiment of the present application stores computer-executable instructions, and the computer-executable instructions are set to: receive a traffic signal storage request sent by a data upload terminal, and perform a security value prediction on the data upload terminal; in the case where the security value meets the adjustment threshold, determine a primary node and a secondary node in the blockchain network, and encrypt the traffic signal data corresponding to the primary node and the secondary node respectively; determine the segmentation factors corresponding to the primary node and the secondary node respectively, and based on the segmentation factors, divide the encrypted data of each node into multiple encrypted data blocks; construct a network topology model based on the historical traffic signal transmission data corresponding to the blockchain network and the load data of each node, so as to perform path planning on the multiple encrypted data blocks respectively based on the network topology model, and screen out forwarding nodes in the blockchain network; verify the received encrypted data blocks through the forwarding nodes, and in the case where the verification passes, store the traffic signal encrypted data corresponding to the encrypted data blocks.
[0021] The above at least one technical solution adopted in the embodiments of the present application can achieve the following beneficial effects: By predicting the security value of the data upload terminal, the embodiments of the present application can intercept data from insecure terminals, reducing the possibility of data being maliciously tampered with or injected with risk data from the source, and ensuring the security of the entire traffic signal data ecosystem. Secondly, by determining the master node and sub-nodes in the blockchain network and encrypting the traffic signal data, it is difficult for the data to be stolen or cracked during the transmission and storage processes. Based on the historical traffic signal transmission data and the load data of each node in the blockchain network, a network topology model is constructed to plan the transmission path for the encrypted data blocks, enabling the data to avoid congested nodes and select the optimal path for transmission, reducing transmission latency, and improving the transmission efficiency of the data from the upload terminal to the storage node. By storing the traffic signal encrypted data in the blockchain network and utilizing the distributed storage characteristics of the blockchain, the data is dispersed and stored in multiple nodes. Even if some nodes fail, the data can still be obtained from other nodes, improving the reliability of data storage and ensuring the long-term availability of traffic signal data. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. In the drawings:
[0023] Figure 1 It is a flowchart of a distributed traffic signal control method based on blockchain provided by an embodiment of the present application;
[0024] Figure 2 It is a schematic structural diagram of a distributed traffic signal control device based on blockchain provided by an embodiment of the present application.
[0025] Reference Numerals:
[0026] 200: Distributed traffic signal control device based on blockchain, 201: Processor, 202: Memory. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] The embodiments of the present application provide a distributed traffic signal control method, device, and medium based on blockchain.
[0028] To enable those skilled in the art to better understand the technical solutions in this application, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0029] The following will detail the technical solutions proposed in the embodiments of the present invention through the accompanying drawings.
[0030] Figure 1 The following is a flowchart of a distributed traffic signal control method based on blockchain provided for the embodiments of this application. As Figure 1 shown, the distributed traffic signal control method based on blockchain includes the following steps:
[0031] Step 101: Receive a traffic signal storage request sent by a data upload terminal and predict the security value of the data upload terminal.
[0032] In an implementation manner of this application, obtain the terminal identifier corresponding to the data upload terminal, and determine the historical upload data in the historical database based on the terminal identifier. Align the time series data in the historical upload data to perform multi-dimensional feature extraction on the aligned data; where the multi-dimensional features at least include one of the mean, variance, minimum value, and maximum value. Input the multi-dimensional features into a preset long short-term memory network to output the time series features corresponding to the data upload terminal through the preset long short-term memory network. Classify the time series features, and determine the classification weight value based on the classification result. And, based on the interval between the current time when the traffic signal storage request is received and the most recent data upload time, determine the time decay factor. And, based on the number of attacks and frequencies within a preset time period in the blockchain network, determine the risk regulation coefficient. Based on the classification weight value, time decay factor, and risk regulation coefficient, determine the security value corresponding to the data upload terminal.
[0033] Specifically, when the data upload terminal sends a traffic signal storage request, first obtain the unique identifier of the terminal. According to this identifier, perform precise retrieval in the historical database to locate all data records uploaded by the terminal historically. Among them, the information stored in the historical database includes the content of traffic signal data uploaded by the terminal at different time points, the upload time, the data format, etc. Determine the time series data from the historical data records. Through the dynamic time warping algorithm, adjust different time series data to a comparable time scale. After alignment, extract multi-dimensional features from these time series data. Input the extracted multi-dimensional features into a pre-set long short-term memory network. The memory units in the network can remember important past information and update and adjust according to the current input, and output the time series feature representation corresponding to the data upload terminal. Among them, the training process of the pre-set long short-term memory network is to use the data samples corresponding to the historical data upload terminals as inputs, and use the time series features corresponding to the input samples as output samples to train the pre-set model to obtain the pre-set long short-term memory network.
[0034] Furthermore, classify the time series features output by the pre-set long short-term memory network. According to the historical behavior patterns of the terminals, classify them into different categories, such as safe category, suspicious category, dangerous category, etc. The classification weight value is determined according to the category to which it belongs. The weight value corresponding to the safe category is relatively high, and the weight value corresponding to the dangerous category is relatively low. The time decay factor reflects the impact of the time interval between the current time and the most recent data upload time on the security assessment of the terminal. The shorter the interval, the more the recent behavior of the terminal can reflect the current state, and the closer the time decay factor is to 1; the longer the interval, the smaller the impact, and the closer the time decay factor is to 0. Determine the risk regulation coefficient based on the number of attacks and frequency of the blockchain network within a preset time period. The more attacks and the higher the frequency, the greater the overall risk of the network, and the greater the risk regulation coefficient. Determine the security value of the data upload terminal by comprehensively considering the classification weight value, the time decay factor, and the risk regulation coefficient.
[0035] Specifically, based on the function:
[0036] ;
[0037] ;
[0038] Determine the security value corresponding to the data upload terminal; among them, is the security value; is the classification weight value; is the time decay factor; is the risk regulation coefficient; is the adjustment function; is the threshold of the pre-set function, used to adjust the adjustment function.
[0039] Step 102: When the security value meets the adjustment threshold, determine the master node and slave nodes in the blockchain network, and encrypt the traffic signal data corresponding to the master node and slave nodes respectively.
[0040] In an implementation manner of the present application, based on the traffic signal data, determine the first traffic intersection where the controlled signal lamp is located. Based on the traffic network diagram, determine multiple second traffic intersections that have an associated relationship with the first traffic intersection. Based on the traffic signals corresponding to the first traffic intersection and the multiple second traffic intersections respectively, construct a traffic signal set. Determine the reference traffic data that periodically repeats in the traffic signal set, and based on the preset traffic signal dictionary table, perform encoding replacement on the reference traffic data; wherein, the preset traffic signal dictionary table includes multiple reference traffic data, and also includes the encodings respectively corresponding to the multiple reference traffic data. Based on the replaced encoding and the data in the traffic signal set that has not been replaced, construct reference encrypted data. Through the master node and slave nodes, perform symmetric encryption on the reference encrypted data, and determine the hash values corresponding to each node respectively, so as to encrypt the traffic signal data corresponding to the master node and slave nodes respectively.
[0041] Specifically, the traffic signal data contains information such as the signal lamp status and control instructions. Through the traffic signal data, the specific geographical location where the controlled signal lamp is located, that is, the first traffic intersection, can be determined. The traffic network diagram is a digital representation of the urban traffic road layout and intersection connection relationships, and multiple second traffic intersections that are directly or indirectly connected to the first traffic intersection can be determined from this diagram, and there are associated relationships such as traffic flow interaction and signal timing coordination between these intersections. Integrate the traffic signal data corresponding to the first traffic intersection and the multiple second traffic intersections respectively to form a set, that is, the traffic signal set, and this traffic signal set covers the traffic signal states of multiple intersections at the same moment or in a similar time period.
[0042] Furthermore, in the traffic signal set, by using the time series analysis method, find the data patterns that periodically repeat. These patterns reflect the regular changes of traffic signals during the normal operation cycle and are determined as reference traffic data. The preset traffic signal dictionary table in the embodiments of the present application is a pre-constructed mapping table, and each reference traffic data corresponds to a unique encoding. Through the dictionary table, replace the reference traffic data with the corresponding encoding. Doing so can compress the data volume, improve the efficiency of subsequent data processing and transmission, and enhance the confidentiality of the data to a certain extent.
[0043] Further, the encoded data after encoding replacement is combined with other data in the traffic signal set that has not been replaced to form reference encrypted data. The master node and the slave nodes undertake data processing and transmission tasks in the blockchain network. The reference encrypted data is encrypted using a symmetric encryption algorithm. Specifically, the symmetric encryption algorithm uses the same key to encrypt and decrypt data. During the encryption process, the master node and the slave nodes use the shared key to encrypt the data and generate ciphertext. At the same time, to ensure the integrity and traceability of the data, each node calculates the hash value of the encrypted data. By comparing the hash values, it can be determined whether the data has been tampered with during transmission or storage.
[0044] Step 103: Determine the splitting factors corresponding to the master node and the slave nodes respectively. Based on the splitting factors, the encrypted data of each node is divided into multiple encrypted data blocks.
[0045] In an implementation manner of the present application, based on the traffic network diagram, a first traffic signal group with a correlation greater than a first preset threshold is determined, and the traffic network diagram is divided into multiple traffic control regions based on the positions of the first traffic signal group. In the traffic control region, a second traffic signal group with a correlation greater than a second preset threshold is determined, and the traffic control region is divided into multiple traffic control sub-regions based on the positions of the second traffic signal group; where the second preset threshold is greater than the first preset threshold. The splitting factor corresponding to the master node is determined based on the number of traffic control regions, and the encrypted data corresponding to the master node is divided into multiple encrypted data blocks based on the splitting factor. And, the splitting factor corresponding to the slave nodes is determined based on the number of traffic control sub-regions, and the encrypted data corresponding to the slave nodes is divided into multiple encrypted data blocks based on the splitting factor.
[0046] Specifically, the nodes in the traffic network diagram represent traffic signal groups, and the edges represent the association relationships between the signal groups. Among them, the association relationships can be quantified based on factors such as traffic flow, geographical distance, and signal timing coordination. By setting the first preset threshold, traffic signal groups with a correlation greater than this threshold are selected. These signal groups have a greater mutual influence during traffic operation and form a closely related whole, that is, the first traffic signal group. In each traffic control region, the association relationships between the signal groups are further analyzed. Since the number of signal groups in the traffic control region is relatively small and the mutual relationships are closer, a higher second preset threshold is set to select signal groups with a stronger correlation, that is, the second traffic signal group. Similarly, based on the positions of these signal groups, the traffic control region is divided again to form multiple traffic control sub-regions.
[0047] Further, the master node is responsible for managing and processing data in the entire traffic control area, while the slave node processes data in the traffic control sub-area. The splitting factor is used to determine how many encrypted data blocks the encrypted data is divided into, and its value is related to the number of traffic control areas or traffic control sub-areas. For the master node, the more traffic control areas there are, it means that the data to be processed is more dispersed. In order to better manage and transmit data, the encrypted data corresponding to the master node is divided into corresponding encrypted data blocks according to the number of traffic control areas. Similarly, the slave node determines the splitting factor according to the number of traffic control sub-areas and divides the corresponding encrypted data blocks.
[0048] Step 104: Based on the historical traffic signal transmission data corresponding to the blockchain network and the load data of each node, construct a network topology model, and perform path planning on multiple encrypted data blocks respectively based on the network topology model to screen out forwarding nodes in the blockchain network.
[0049] In an implementation manner of the present application, each node is used as a vertex, and the connections between the nodes are used as edges to construct the topological structure corresponding to the blockchain network. Based on the topological structure, determine the historical transmission data between vertex groups with an association relationship, and determine the historical weight value based on the historical transmission data. Based on the current load data and network delay data corresponding to the vertex group, obtain the current weight value of the vertex group. And input the historical transmission data, current load data and network delay data into a preset node trend prediction model, and based on the preset node trend prediction model, output the dynamic change information corresponding to the vertex group, and determine the predicted weight value based on the dynamic change information. Based on the historical weight value, current weight value and predicted weight value, obtain the reference weight value between the vertex groups. Based on the topological structure corresponding to the blockchain network and the reference weight value, construct a network topology model.
[0050] Specifically, in the blockchain network, each participating node, such as a signal machine or a data transmission terminal in the traffic signal system, is regarded as a vertex, and the connections for data transmission between the nodes are used as edges. In this way, the connection relationship of the nodes in the blockchain network is presented in the form of a graph to form a topological structure.
[0051] Furthermore, for vertex groups with an association relationship, obtain historical transmission data over a past period of time, including information such as the amount of data transmitted, transmission time, number of successful transmissions, and number of failed transmissions. Determine a historical weight value that can reflect the historical transmission efficiency and stability between vertex groups based on this historical transmission data. For example, if a vertex group has frequently experienced data transmission delays or packet loss in history, then its historical weight value is relatively low, indicating poor reliability in transmitting data through this vertex group. Secondly, obtain the current load data corresponding to the vertex group in real time, including the CPU usage rate of the node, memory occupancy rate, network bandwidth occupancy, etc., as well as network latency data, that is, the time required for data to be transmitted from one node to another node. Based on these current state data, determine the current weight value of the vertex group. The current weight value of a vertex group with high current load or large network latency will be correspondingly reduced. In addition, input the collected historical transmission data, current load data, and network latency data into a pre-trained node trend prediction model. The node trend prediction model in the embodiments of the present application is constructed based on the machine learning algorithm recurrent neural network and can learn the time series features and trend relationships in the data. The node trend prediction model outputs the dynamic change information corresponding to the vertex group through the analysis and processing of the input data, such as predicting the load change trend and network latency change trend of the vertex group in a future period of time. Based on these dynamic change information, determine a prediction weight value, which reflects the quality of the future transmission performance of the vertex group predicted according to the current and historical data.
[0052] Furthermore, comprehensively consider the historical weight value, current weight value, and prediction weight value, and perform weight calculation on them through a preset weight coefficient to obtain a reference weight value between vertex groups. Different weight values reflect the transmission performance of vertex groups in different time dimensions and states. By reasonably integrating this information, the transmission quality and reliability between vertex groups can be evaluated more comprehensively and accurately. Based on the previously constructed blockchain network topology structure, assign the calculated reference weight value to the corresponding edge. In the topology structure, each edge not only represents the connection relationship between nodes, but also reflects the comprehensive performance of data transmission between nodes through the weight of the edge.
[0053] In an implementation manner of the present application, in the case where the traffic signal is an emergency signal, initialize the distance from all nodes to the source node to infinity, and create a set of nodes for which the shortest path has not been determined. In each iteration, determine a reference node in the set of nodes that is the closest to the source node and whose load is not greater than a preset load threshold, and update the reference distance from the adjacent node corresponding to the reference node to the source node. If the path through the reference node to the adjacent node is less than the reference distance, update the reference node as the forwarding node of the adjacent node. Until the iteration ends, determine the optimal path in the set of nodes based on the determined multiple forwarding nodes.
[0054] Specifically, when an emergency traffic signal is detected, in order to find the fastest transmission path from the source node, i.e., the node that emits the emergency signal, to all other nodes, relevant parameters are first initialized. The distances from all nodes to the source node are initialized to infinity because the actual distances between these nodes and the source node are unknown before the calculation starts. At the same time, a set of nodes with undetermined shortest paths is created. This set contains all nodes except the source node. Subsequently, the node closest to the source node will be gradually selected from this set, and its shortest path will be determined.
[0055] Furthermore, in each iteration, it is necessary to find a node in the set of nodes with undetermined shortest paths that is closest to the source node and has a load not greater than a preset load threshold, and use it as a reference node. The load of a node can be measured by indicators such as its CPU usage rate, memory occupancy rate, and network bandwidth occupancy. The preset load threshold is a standard value preset according to the hardware performance and network transmission capacity of the node, ensuring that the selected node has sufficient resources to process and forward emergency signal data, and avoiding data transmission delays or losses caused by excessive node loads. After finding the reference node, update the reference distance from the source node to the adjacent nodes corresponding to the reference node. The reference distance in the embodiments of the present application refers to the estimated distance from the source node through the reference node to the adjacent node.
[0056] For example, assume that in a traffic signal blockchain network of a city, there are nodes A, B, C, D, and E, where node A is the source node. At this time, an emergency traffic signal is detected and sent from node A. Initialize the distances from nodes B, C, D, and E to node A as infinity, which can be represented as B (∞), C (∞), D (∞), E (∞). Then create a set S of nodes with undetermined shortest paths, S = {B, C, D, E}. In the first iteration, evaluate the nodes in set S. Assume that the load of node B is 60% CPU usage, 50% memory occupancy, and 40% network bandwidth occupancy. The preset load threshold is 70% CPU usage, 60% memory occupancy, and 50% network bandwidth occupancy. The load of node B does not exceed the threshold. By calculating, the distance from node B to the source node A is 10, while the distances from nodes C, D, and E to the source node A are still infinity under the current estimation. So, select node B as the reference node. The adjacent nodes of node B are C and D. Update the reference distances from nodes C and D to the source node A. Assume that the distance from node A to node B is 10, the distance from node B to node C is 5, and the distance from node B to node D is 3. Then the reference distance from node C to the source node A passing through node B is updated to 10 + 5 = 15, and the reference distance from node D to the source node A passing through node B is updated to 10 + 3 = 13. At this time, node C (15), D (13), E (∞).
[0057] Furthermore, after updating the reference distances of adjacent nodes, it is necessary to determine whether the path through the reference node to the adjacent node is shorter than the previously recorded reference distance. If so, update the reference node as the forwarding node of the adjacent node. This means that a shorter path from the source node to the adjacent node has been found, and subsequent emergency signal data will be transmitted through this new forwarding node to improve the transmission efficiency. Continuously perform the above iterative process, constantly updating the reference node, the reference distances of adjacent nodes, and the forwarding node. Until the set of nodes with undetermined shortest paths is empty, that is, the shortest paths of all nodes have been determined. At this time, based on the determined multiple forwarding nodes, the optimal paths from the source node to each node can be constructed. These optimal paths consider the load conditions of the nodes and can ensure the fast transmission of emergency signals while avoiding affecting the transmission effect due to node overload.
[0058] In an implementation of the present application, when the data volume of the encrypted data block is greater than the preset data volume threshold, the number of sub-stream splits is determined based on the data volume corresponding to the data block and the load data corresponding to the blockchain network. The data block is split into multiple sub-streams based on the number of sub-stream splits. An equal-load path is determined based on the data volumes corresponding to the multiple sub-streams and the data transmission volumes corresponding to each node.
[0059] Specifically, when the blockchain network transmits an encrypted data block, it is first necessary to evaluate the data volume of the data block. When the data volume of the encrypted data block is greater than the preset data volume threshold, it means that if this data block is not specially processed, it may bring a relatively large load pressure to the nodes in the network, affect the data transmission efficiency, and even cause network congestion.
[0060] The load data of the blockchain network includes the current CPU usage rate, memory occupancy rate, network bandwidth occupancy of each node, etc. By analyzing this load data, the current busyness of the network can be understood. At the same time, combined with the data volume of the data block, the appropriate number of sub-stream splits is determined. The split number is determined according to the remaining processing capacity of the nodes in the network and the size of the data block, aiming to reasonably split the large-data-volume data block into multiple smaller sub-streams for more balanced transmission in the network, avoiding a single node from being overloaded due to processing too large a data volume.
[0061] Furthermore, based on the determined number of sub-stream splits, the original encrypted data block is split into multiple sub-streams according to certain rules. The split rules can be determined according to factors such as the structure of the data block and the data type. For example, if the data block is traffic signal data arranged in a time series, it can be evenly split according to the time order; if it is traffic signal parameter data of different types, it can be grouped and split according to the parameter type. Each split sub-stream contains a part of the information of the original data block, and the data volumes of these sub-streams are relatively small, which are more suitable for distributed transmission in the network. Further, determining the equal-load path requires considering the data volumes corresponding to the multiple sub-streams and the data transmission volumes corresponding to each node. The data transmission volume of each node can be obtained by monitoring the data volume already transmitted by the node within a certain period of time. By analyzing this data, a transmission path that can make the network load as balanced as possible is selected for each sub-stream. When selecting the path, nodes with a relatively low current load and sufficient remaining transmission capacity will be preferentially selected to form the transmission path, avoiding concentrating multiple sub-streams on a few high-load nodes, thereby achieving the load balance of the entire network.
[0062] Step 105: The forwarding node verifies the received encrypted data block, and stores the traffic signal encrypted data corresponding to the encrypted data block when the verification is passed.
[0063] In an implementation manner of the present application, after receiving an encrypted data block, the forwarding node first performs integrity verification. This is usually achieved through a hashing algorithm, such as using the SHA-256 hashing function. At the data sending end, when the original traffic signal encrypted data is encapsulated into an encrypted data block, its hash value is calculated and transmitted together with the data block. After receiving the data block, the forwarding node recalculates the hash value of the data block content and then compares the calculated result with the received hash value. If the two are consistent, it indicates that the data has not been tampered with during transmission and the integrity is guaranteed; if they are inconsistent, it means that the data may have been damaged or tampered with, and this data block will be marked as invalid. In addition to integrity verification, the forwarding node also needs to verify the legitimacy of the data source. In a blockchain network, each node has its unique identifier and public-private key pair. When the data sending end sends an encrypted data block, it signs the data block using its own private key. After receiving the data block, the forwarding node verifies the signature using the public key of the sending end. If the signature verification passes, it indicates that the data indeed comes from the sending node; otherwise, if the signature verification fails, the forwarding node will reject the data block to prevent malicious nodes from forging data and entering the blockchain network.
[0064] Furthermore, once the encrypted data block passes the above verifications, the forwarding node needs to determine the storage location of the data. In a blockchain network, data storage usually adopts a distributed storage method. The forwarding node will determine whether to store the data in the local storage device or forward it to other specific nodes for storage according to the storage rules of the blockchain and its own node role. For example, if the forwarding node is a storage node and there is sufficient local storage resources, it may directly store the data locally; if the forwarding node is only an intermediate forwarding role, it will select a suitable storage node for data forwarding according to the topological structure of the blockchain network and the distribution of storage nodes.
[0065] Furthermore, after storing the traffic signal encrypted data corresponding to the encrypted data block, the forwarding node will record relevant storage information on the blockchain. This includes the unique identifier of the data block, storage time, storage location, etc. At the same time, in order to facilitate subsequent data query and retrieval, the forwarding node will establish a corresponding data index. The index can be constructed based on some key features of the data block, such as the timestamp of traffic signal data, intersection identifier, etc. Through the index, when querying specific traffic signal data, the storage location of the data can be quickly located, improving data access efficiency.
[0066] Figure 2 The structural schematic diagram of a distributed traffic signal control device based on blockchain provided by the embodiment of the present application is as follows Figure 2As shown in the figure, the blockchain-based distributed traffic signal control device 200 includes: at least one processor 201; and a memory 202 communicatively connected to the at least one processor 201; wherein, the memory 202 stores instructions executable by the at least one processor 201, and the instructions are executed by the at least one processor 201 to enable the at least one processor 201 to: receive a traffic signal storage request sent by a data upload terminal, and perform a security value prediction on the data upload terminal; in the case where the security value meets the adjustment threshold, determine a primary node and a secondary node in the blockchain network, and encrypt the traffic signal data corresponding to the primary node and the secondary node respectively; determine the segmentation factors corresponding to the primary node and the secondary node respectively, and based on the segmentation factors, divide the encrypted data of each node into multiple encrypted data blocks; construct a network topology model based on the historical traffic signal transmission data corresponding to the blockchain network and the load data of each node, so as to perform path planning on the multiple encrypted data blocks respectively based on the network topology model, so as to screen out forwarding nodes in the blockchain network; perform data verification on the received encrypted data blocks through the forwarding nodes, and in the case where the verification is passed, store the traffic signal encrypted data corresponding to the encrypted data blocks.
[0067] A non-volatile computer storage medium provided by an embodiment of the present application stores computer-executable instructions, and the computer-executable instructions are set to: receive a traffic signal storage request sent by a data upload terminal, and perform a security value prediction on the data upload terminal; in the case where the security value meets the adjustment threshold, determine a primary node and a secondary node in the blockchain network, and encrypt the traffic signal data corresponding to the primary node and the secondary node respectively; determine the segmentation factors corresponding to the primary node and the secondary node respectively, and based on the segmentation factors, divide the encrypted data of each node into multiple encrypted data blocks; construct a network topology model based on the historical traffic signal transmission data corresponding to the blockchain network and the load data of each node, so as to perform path planning on the multiple encrypted data blocks respectively based on the network topology model, so as to screen out forwarding nodes in the blockchain network; perform data verification on the received encrypted data blocks through the forwarding nodes, and in the case where the verification is passed, store the traffic signal encrypted data corresponding to the encrypted data blocks.
[0068] Each embodiment in the present application is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key points of each embodiment are the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.
[0069] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various modifications and variations can be made to the embodiments of the present application. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A distributed traffic signal control method based on blockchain, characterized in that, The method includes: Receiving a traffic signal storage request sent by a data upload terminal, and predicting a security value for the data upload terminal; When the security value meets the adjustment threshold, determining a primary node and sub-nodes in the blockchain network, and encrypting the traffic signal data corresponding to the primary node and the sub-nodes respectively; Determining the segmentation factors corresponding to the primary node and the sub-nodes respectively, and based on the segmentation factors, dividing the encrypted data of each node into multiple encrypted data blocks; Based on the historical traffic signal transmission data corresponding to the blockchain network and the load data of each node, constructing a network topology model, so as to perform path planning on the multiple encrypted data blocks respectively based on the network topology model, and screening out forwarding nodes in the blockchain network; Verifying the encrypted data blocks received by the forwarding nodes, and when the verification is passed, storing the traffic signal encrypted data corresponding to the encrypted data blocks; The receiving the traffic signal storage request sent by the data upload terminal and predicting the security value for the data upload terminal specifically includes: Obtaining the terminal identifier corresponding to the data upload terminal, and determining historical upload data in the historical database based on the terminal identifier; Performing alignment processing on the time series data in the historical upload data to perform multi-dimensional feature extraction on the aligned data; wherein, the multi-dimensional features at least include one of mean, variance, minimum value, and maximum value; Inputting the multi-dimensional features into a preset long short-term memory network to output the time series features corresponding to the data upload terminal through the preset long short-term memory network; Classifying the time series features, and determining a classification weight value based on the classification result; And determining a time decay factor based on the interval between the current time when the traffic signal storage request is received and the most recent data upload time; And determining a risk regulation coefficient based on the number of attacks and frequencies of the blockchain network within a preset time period; Determining the security value corresponding to the data upload terminal based on the classification weight value, the time decay factor, and the risk regulation coefficient; The determining the segmentation factors corresponding to the primary node and the sub-nodes respectively, and based on the segmentation factors, dividing the encrypted data of each node into multiple encrypted data blocks specifically includes: Based on the traffic network diagram, determining a first traffic signal group with a correlation greater than a first preset threshold, and dividing the traffic network diagram into multiple traffic control areas based on the positions of the first traffic signal group; In the traffic control area, determining a second traffic signal group with a correlation greater than a second preset threshold, and dividing the traffic control area into multiple traffic control sub-areas based on the positions of the second traffic signal group; wherein, the second preset threshold is greater than the first preset threshold; Determining the segmentation factor corresponding to the primary node based on the number of traffic control areas, and dividing the encrypted data corresponding to the primary node into multiple encrypted data blocks based on the segmentation factor; Moreover, a segmentation factor corresponding to the sub-node is determined based on the number of the traffic control sub-regions, so as to divide the encrypted data corresponding to the sub-node into a plurality of encrypted data blocks based on the segmentation factor.
2. The distributed traffic signal control method based on blockchain according to claim 1, wherein, Determining a security value corresponding to the data upload terminal based on the classification weight value, the time decay factor, and the risk regulation coefficient specifically includes: Based on the function: ; ; Determining the security value corresponding to the data upload terminal; wherein, is a safety value; is a classification weight value; is a time decay factor; is a risk regulation coefficient; is an adjustment function; is a preset function threshold for adjusting the adjustment function.
3. A distributed traffic signal control method based on blockchain according to claim 1, characterized in that, Determining a main node and sub-nodes in the blockchain network, and encrypting the traffic signal data respectively corresponding to the main node and the sub-nodes specifically includes: Determining a first traffic intersection where the controlled signal lamp is located according to the traffic signal data; Based on the traffic network diagram, determining a plurality of second traffic intersections having an associated relationship with the first traffic intersection; Constructing a traffic signal set based on the traffic signals respectively corresponding to the first traffic intersection and the plurality of second traffic intersections; Determining reference traffic data that periodically appears repeatedly in the traffic signal set, and performing encoding replacement on the reference traffic data based on a preset traffic signal dictionary table; wherein, the preset traffic signal dictionary table includes a plurality of reference traffic data, and also includes encodings respectively corresponding to the plurality of reference traffic data; Constructing reference encrypted data based on the replaced encoding and the data in the traffic signal set that has not been replaced; Performing symmetric encryption on the reference encrypted data through the main node and the sub-nodes, and determining hash values respectively corresponding to each node, so as to encrypt the traffic signal data respectively corresponding to the main node and the sub-nodes.
4. A distributed traffic signal control method based on blockchain according to claim 1, characterized in that Constructing a network topology model based on the historical traffic signal transmission data corresponding to the blockchain network and the load data of each node specifically includes: Taking each node as a vertex and the connection between nodes as an edge to construct a topological structure corresponding to the blockchain network; Based on the topological structure, determining historical transmission data between vertex groups having an associated relationship, so as to determine a historical weight value based on the historical transmission data; Obtaining a current weight value of the vertex group based on the current load data and network delay data corresponding to the vertex group; Moreover, inputting the historical transmission data, the current load data, and the network delay data into a preset node trend prediction model, and outputting dynamic change information corresponding to the vertex group based on the preset node trend prediction model, so as to determine a predicted weight value based on the dynamic change information; Obtaining a reference weight value between the vertex groups based on the historical weight value, the current weight value, and the predicted weight value; Constructing the network topology model based on the topological structure corresponding to the blockchain network and the reference weight value.
5. A distributed traffic signal control method based on blockchain according to claim 1, characterized in that, Performing path planning on the plurality of encrypted data blocks respectively based on the network topology model to screen out forwarding nodes in the blockchain network specifically includes: In the case where the traffic signal is an emergency signal, initializing the distance from all nodes to the source node to infinity, and creating a set of nodes whose shortest paths have not been determined; In each iteration, a reference node that is closest to the source node and has a load not greater than a preset load threshold is determined in the set of nodes, and the reference distance from the adjacent node corresponding to the reference node to the source node is updated; If the path from the reference node to the adjacent node is less than the reference distance, the reference node is updated to be the forwarding node of the adjacent node; Until the iteration ends, an optimal path is determined in the set of nodes based on the determined multiple forwarding nodes.
6. The distributed traffic signal control method based on blockchain according to claim 1, wherein The path planning for multiple encrypted data blocks respectively based on the network topology model to screen out forwarding nodes in the blockchain network specifically includes: In the case where the data volume of the encrypted data block is greater than a preset data volume threshold, the number of sub-flow splits is determined based on the data volume corresponding to the data block and the load data corresponding to the blockchain network; The data block is split into multiple sub-flows based on the number of sub-flow splits; An evenly loaded path is determined based on the data volumes corresponding to the multiple sub-flows and the data transmission volumes corresponding to the respective nodes.
7. A distributed traffic signal control device based on blockchain, characterized in that, The device includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to execute the method according to any one of claims 1-6.
8. A non-volatile computer storage medium stores computer-executable instructions, characterized in that, The computer-executable instructions can execute the method according to any one of claims 1-6.
Citation Information
Patent Citations
Block chain data management method and system
CN115134169A
Urban road traffic flow state estimation method and system based on block chain
CN117671961A