CN119719033A - A traffic data file storage method and system based on blockchain - Google Patents
A traffic data file storage method and system based on blockchain Download PDFInfo
- Publication number
- CN119719033A CN119719033A CN202510230493.6A CN202510230493A CN119719033A CN 119719033 A CN119719033 A CN 119719033A CN 202510230493 A CN202510230493 A CN 202510230493A CN 119719033 A CN119719033 A CN 119719033A
- Authority
- CN
- China
- Prior art keywords
- blockchain
- content
- node
- chain
- updated
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application relates to the technical field of blockchains, and discloses a blockchain-based traffic data file caching method and a blockchain-based traffic data file caching system, wherein the method comprises the steps of dividing a traffic data file to be cached into first content and second content; the method comprises the steps of storing first content in a first chain node of a first blockchain, storing second content in a second chain node of a second blockchain based on a preset index tree, responding to search conditions input by a user, reading the first content and the second content from the corresponding first chain node and second chain node through the index tree, and realizing split storage of the same traffic data file by combining the index tree containing two link point addresses and two blockchains with different security levels.
Description
Technical Field
The application relates to the technical field of blockchains, in particular to a blockchain-based traffic data file caching method and system.
Background
The traditional method for caching traffic data files based on the blockchain generally simply stores traffic data in the blockchain, adopts a single encryption mode, cannot provide targeted safety protection for traffic data with different importance, adopts a single-chain structure, cannot conduct layered storage according to data content differences, adopts a fixed structure mode, is easy to master node positions in the blockchain and store data by an attacker, and cannot guarantee data safety.
The method comprises the steps of receiving data to be stored sent by a base station, wherein the data to be stored is collected by a terminal and sent to the base station, encrypting the data to be stored to obtain an electronic ciphertext, sending the electronic ciphertext to a second server, enabling the second server to generate a corresponding index value according to the electronic ciphertext, receiving the index value returned by the second server, encrypting the index value according to a preset secret key to obtain an encrypted index value, and storing the encrypted index value in a alliance block chain.
The technical scheme solves the problems that a single encryption mode is adopted, targeted safety protection cannot be provided for traffic data with different importance, a single-chain structure is adopted, hierarchical storage cannot be carried out according to data content differences, a fixed structure mode is adopted, an attacker can easily master node positions in a blockchain and store data, and the safety of the data cannot be guaranteed, and the application provides a blockchain-based traffic data file retrieval method and a blockchain-based traffic data file retrieval system.
Disclosure of Invention
Aiming at the defects of the prior art, the application mainly aims to provide a traffic data file searching and storing method and system based on a block chain, which can effectively solve the problems in the background art. The specific technical scheme of the application is as follows:
a traffic data file caching method based on block chains comprises the following steps:
Dividing a traffic data file to be stored into first content and second content, wherein the requirement security level of the first content is higher than that of the second content;
Storing the first content in a first chain node of a first block chain, and storing the second content in a second chain node of a second block chain based on a preset index tree, wherein the data encryption level of the first block chain is higher than that of the second block chain;
and responding to the search condition input by the user, and reading the first content and the second content from the corresponding first chain node and second chain node through the index tree, wherein the index tree comprises a first chain link point address and a second chain link point address of each traffic data file.
Specifically, the storing the first content in a first chain node of a first blockchain and the second content in a second chain node of a second blockchain based on a preset index tree, where a data encryption level of the first blockchain is higher than a data encryption level of the second blockchain includes:
Generating a corresponding content index according to the first content and the second content, and constructing an index tree;
Constructing a first blockchain and a second blockchain based on the structure of the index tree, wherein the first blockchain and the second blockchain are combined to obtain a double-chain structure blockchain;
And encrypting the first content and storing the first content to a first chain node of a first blockchain, and encrypting the second content and storing the second content to a second chain node of a second blockchain.
Specifically, the generating the corresponding content index according to the first content and the second content, and constructing the index tree includes:
respectively extracting information from the first content and the second content to obtain first key information and second key information;
according to the first key information and the second key information, a first key value and a second key value are obtained through hash function calculation;
determining a first link point address and a second link point address according to the first key value and the second key value;
Generating a corresponding content index according to the first link point address and the second link point address;
Storing the content index into leaf nodes to obtain a plurality of leaf nodes;
And carrying out hierarchical combination on the plurality of leaf nodes according to the key value size, and constructing an index tree.
Specifically, the constructing a first blockchain and a second blockchain based on the structure of the index tree, where the first blockchain and the second blockchain are combined to obtain a blockchain with a double-chain structure, includes:
obtaining a plurality of chain nodes according to the mechanism of the traffic data file;
According to the index tree, respectively configuring an initial first block chain and an initial second block chain on each chain node, wherein the initial first block chain and the initial second block chain are in a mirror image structure;
Respectively updating the chain link points of the initial first block chain and the initial second block chain in a preset time period to obtain an updated first block chain and an updated second block chain;
and combining the updated first blockchain and the updated second blockchain to obtain a double-chain structure blockchain.
Specifically, the updating the link points of the initial first blockchain and the initial second blockchain respectively in the preset time period to obtain an updated first blockchain and an updated second blockchain includes:
Randomly updating the chain link points in the initial second block chain in a preset time period to obtain an updated second block chain;
dynamically updating the index tree according to the updated second block chain to obtain an updated index tree;
And carrying out pseudo-random updating on the chain link points in the initial first block chain according to the updating index tree to obtain an updated first block chain.
Specifically, the performing pseudo-random update on the link points in the initial first blockchain according to the update index tree to obtain an updated first blockchain includes:
Obtaining a chain node to be updated in the initial first block chain according to the update index tree;
updating the link points to be updated through a pseudo-random algorithm according to a preset seed value to obtain updated nodes;
And recombining the updated node with the non-updated chain link points in the initial first block chain to obtain the updated first block chain.
Specifically, the storing the first content after encryption to a first chain node of a first blockchain, and storing the second content after encryption to a second chain node of a second blockchain includes:
encrypting the first content by using a preset first encryption algorithm to obtain first encrypted data;
encrypting the second content by using a preset second encryption algorithm to obtain second encrypted data;
Voting the non-first chain node of the first block chain and the non-second chain link point of the second block chain according to the legality of the storage process to obtain a voting result;
And when the number of the agreeable nodes in the voting result is larger than the number of the preset nodes, storing the first encrypted data to the first chain node, and storing the second encrypted data to the second chain node.
Specifically, the reading, by the index tree, the first content and the second content from the corresponding first chain node and the second chain node in response to a search condition input by a user includes:
searching the index tree to obtain a branch tree according to the search condition input by the user;
Determining a downward searching path in the branch tree according to the searching condition until a target leaf node is searched;
Positioning a target first chain node and a target second chain node in the double-chain structure block chain according to information stored in the target leaf node;
And acquiring target first encryption data, target second encryption data and corresponding encryption keys from the target first chain node and the target second chain node to obtain first content and second content.
Specifically, the determining a path searched downwards in the branch tree according to the search condition until the target leaf node is searched comprises the following steps:
Analyzing the search condition to obtain a search key value;
comparing the search key value with the node key value from the root node of the branch tree to obtain a comparison result;
when the comparison result is that the retrieval key value is smaller than the node key value, continuing to search downwards according to the child node pointer corresponding to the node key value;
and repeating the key value comparison and searching processes, and searching the target leaf node when the search key value is equal to the node key value or the difference value between the search key value and the node key value is in the preset key value range as the comparison result.
The utility model provides a traffic data file system of caching based on block chain, is used for realizing a traffic data file system of caching based on block chain, includes:
The file content dividing module divides the traffic data file to be searched into first content and second content, wherein the requirement security level of the first content is higher than that of the second content;
The traffic data file storage module is used for storing the first content in a first chain node of a first blockchain and storing the second content in a second chain node of a second blockchain based on a preset index tree, wherein the data encryption level of the first blockchain is higher than that of the second blockchain;
And the traffic data file retrieval module is used for responding to the retrieval condition input by a user and reading the first content and the second content from the corresponding first chain node and second chain node through the index tree, wherein the index tree comprises a first chain link point address and a second chain link point address of each traffic data file.
Compared with the prior art, the application has the following beneficial effects:
According to the application, the traffic data file is split into two subfiles (first content and second content) with different security levels and stored in the two blockchains by combining the index tree containing two link point addresses and the blockchains with two different security levels, so that the split storage of the same traffic data file can be realized, the security of the traffic data file is improved on one hand, and the risk of data loss or damage caused by single-chain faults is reduced on the other hand.
Drawings
FIG. 1 is a workflow diagram of a blockchain-based traffic data file caching method in accordance with embodiment 1 of the present application;
FIG. 2 is a schematic diagram of traffic data file classification in embodiment 1 of the present application;
FIG. 3 is a schematic diagram of a double-chain blockchain in embodiment 1 of the present application;
FIG. 4 is a diagram illustrating a process for updating a double-chain blockchain in embodiment 1 of the present application;
fig. 5 is a schematic structural diagram of a traffic data file caching system based on blockchain in embodiment 2 of the present application.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways other than those described herein, and persons skilled in the art will readily appreciate that the present invention is not limited to the specific embodiments disclosed below.
Further, reference herein to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic can be included in at least one implementation of the invention. The appearances of the phrase "in one embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments.
Example 1
The embodiment provides a traffic data file caching method based on a blockchain, as shown in fig. 1, including:
s101, dividing a traffic data file to be stored into first content and second content, wherein the requirement security level of the first content is higher than that of the second content;
S102, storing the first content in a first chain node of a first block chain, and storing the second content in a second chain node of a second block chain based on a preset index tree, wherein the data encryption level of the first block chain is higher than that of the second block chain;
s103, responding to the search condition input by a user, and reading the first content and the second content from the corresponding first chain node and second chain node through the index tree, wherein the index tree comprises a first chain link point address and a second chain link point address of each traffic data file.
In this embodiment, the traffic data file generally includes road data, traffic flow data, traffic facility data and traffic event data, for example, the time, place or accident type of the traffic accident are recorded, the encryption requirements of different contents in the traffic data file are different, the contents of the data file are classified according to the encryption requirements, as shown in fig. 2, the traffic data file a splits the contents into first contents B and second contents C according to the encryption requirements of different contents, wherein the security level of the first contents B is higher than that of the second contents C, and by classifying the different contents in the file, the security requirements of different data contents can be met, the encryption resources can be reasonably allocated, the resource waste caused by excessive encryption of the low-sensitivity data is avoided, and meanwhile, the high-sensitivity data is ensured to be fully protected.
Specifically, two corresponding blockchains are configured at each data node, one chain is used for storing the content with high encryption requirement, the content is encrypted by utilizing a high-strength encryption algorithm and uploaded to the corresponding chain node, the other chain is used for storing the content with low encryption requirement, the content is encrypted by utilizing a low-strength encryption algorithm and uploaded to the corresponding chain node, the two chains are in a mirror image structure, a double-chain structure blockchain is constructed, different encryption requirements of different contents of a traffic data file can be met by setting the double-chain structure, high-level encryption protection is provided for sensitive data, meanwhile, proper safety protection is provided for common data by reasonably utilizing resources, meanwhile, the double-chain mirror image structure enhances the reliability and fault tolerance of the data, the risk of data loss or damage caused by single-chain faults is reduced, and the continuous availability of the traffic data is ensured.
Specifically, when searching and checking a file, a user inputs a search condition according to needs, analyzes the search condition, continuously searches in an index tree, finds a leaf node conforming to the corresponding search condition, determines which chain of the double-chain structure block chains the data is stored in according to a pointer provided by the index leaf node, positions the corresponding chain node in the double-chain structure block chain, acquires stored encrypted content and a corresponding key, decrypts the encrypted file by using the key, checks the original traffic data file, searches the node through the index tree, accurately positions the corresponding node, ensures the accuracy of a search result, and realizes quick search of the traffic data file.
According to the application, the traffic data file is split into two subfiles (first content and second content) with different security levels and stored in the two blockchains by combining the index tree containing two link point addresses and the blockchains with two different security levels, so that the split storage of the same traffic data file can be realized, the security of the traffic data file is improved on one hand, and the risk of data loss or damage caused by single-chain faults is reduced on the other hand.
Further, the storing the first content in a first chain node of a first blockchain and the second content in a second chain node of a second blockchain based on a preset index tree, wherein a data encryption level of the first blockchain is higher than a data encryption level of the second blockchain, includes:
S201, generating a corresponding content index according to the first content and the second content, and constructing an index tree;
S202, constructing a first blockchain and a second blockchain based on the structure of the index tree, wherein the first blockchain and the second blockchain are combined to obtain a double-chain structure blockchain;
S203, the first content is encrypted and then stored to a first chain node of a first block chain, and the second content is encrypted and then stored to a second chain node of a second block chain.
In this embodiment, according to information in the first content and the second content, such as information of a place, time and the like in the traffic data file, different information in the key information is encoded and calculated respectively to generate a corresponding content index, the content index contains information of the key information, a storage position pointer and the like of the data file, the different information in the content index is stored in corresponding leaf nodes respectively, corresponding combination association is constructed among the leaf nodes according to a correlation relationship among the leaf nodes, an index tree is constructed, a large number of traffic data files can be organized orderly by constructing the index tree, management and maintenance are convenient, the position of the target file can be located quickly, and the retrieval speed of the traffic data file is improved.
Specifically, index information stored in each leaf node in an index tree corresponds to chain link points in a double-chain structure blockchain one by one, the structures of a first blockchain and a second blockchain in the double-chain structure blockchain are configured based on the structure of the index tree, wherein the data encryption level of the first blockchain is higher than that of the second blockchain to obtain the double-chain structure blockchain, the first content B and the second content C are respectively encrypted, the encryption algorithm intensity of the encryption algorithm for encrypting the first content B is higher than that of the encryption algorithm for encrypting the second content C, after encryption, the first encrypted content is respectively stored in the first chain node of the first blockchain, the second encrypted content is stored in the second chain node of the second blockchain, and chain splitting storage is realized.
Further, the generating a corresponding content index according to the first content and the second content, and constructing an index tree includes:
S301, respectively extracting information of the first content and the second content to obtain first key information and second key information;
S302, according to the first key information and the second key information, a first key value and a second key value are obtained through hash function calculation;
S303, determining a first link point address and a second link point address according to the first key value and the second key value;
S304, generating a corresponding content index according to the first link point address and the second link point address;
S305, storing the content index into leaf nodes to obtain a plurality of leaf nodes;
s306, carrying out hierarchical combination on the plurality of leaf nodes according to the key value size, and constructing an index tree.
In the embodiment, various traffic data files contain rich information, representative key information is extracted, efficient indexing and retrieval can be achieved, corresponding information extraction methods are adopted according to file types, for example, a regular expression technology is used for extracting key information from text files, in a piece of traffic accident report text file, specific keywords including accident types, occurrence places, time and the like are matched through the regular expression, corresponding key information is extracted, for images or video files, information such as accident scenes, vehicle types, road identifications and the like is identified as key information through a preset key information extraction model, information extraction is carried out on first content B and second content C respectively, the first key information and the second key information are obtained, core content and characteristics of different contents can be clearly defined, representative information is provided for subsequent construction indexes, the index can accurately reflect the content of the data files, and accordingly the quality and the retrieval accuracy of the index are improved.
Specifically, the first key information and the second key information are preprocessed to meet the input requirement of a hash function, for example, text is converted into byte stream, numbers are converted into specific coding modes, the preprocessed key information is calculated through the hash function to obtain unique key values, the first key values and the second key values are calculated, different data contents can be accurately distinguished in an index tree through calculating the unique key values, index conflict is avoided, searching speed and efficiency are improved, the key values are determined to be stored in which node of the index tree, for example, in a B+ tree, the key values of the key values and the root node are gradually searched downwards according to the sequence of the key values from the root node until the proper leaf node is found, a search pointer pointing to the node position of a block chain of a double-chain structure is generated according to the position of the traffic data file, the search pointer can be information such as a storage path of the file, the block number and offset in the block chain, and the like, the corresponding relationship between the search index and the storage position of the traffic data file is used for directly searching the index file according to the corresponding relationship between the search index and the storage position of the traffic data file, the search efficiency can be directly found according to the search index file, and the search efficiency is improved.
Specifically, the calculated key value, the search pointer and the pointer pointing to the next leaf node are stored in the corresponding nodes to obtain a plurality of information nodes containing index information of the data file, the information nodes are combined in a hierarchical mode according to the key value, in the B+ tree, the information nodes are gradually inserted into proper positions from the root node to construct an index tree, the index tree is constructed through comparison of the hierarchical structure and the key value, the target information node can be rapidly located, and therefore rapid search of the traffic data file is achieved.
Further, the constructing a first blockchain and a second blockchain based on the structure of the index tree, where the first blockchain and the second blockchain are combined to obtain a double-chain structure blockchain, includes:
s401, obtaining a plurality of chain nodes according to a mechanism of the traffic data file;
S402, respectively configuring an initial first block chain and an initial second block chain on each chain node according to an index tree, wherein the initial first block chain and the initial second block chain are in a mirror image structure;
S403, respectively updating the chain link points of the initial first block chain and the initial second block chain in a preset time period to obtain an updated first block chain and an updated second block chain;
s404, combining the updated first blockchain and the updated second blockchain to obtain the blockchain with the double-chain structure.
In this embodiment, the traffic data file is generally generated and managed by a plurality of different institutions, such as traffic management departments, scientific research institutions, related enterprises, and the like, the institutions are used as chain links to construct a blockchain network, so that the resources and data advantages of each institution can be fully utilized to realize distributed storage and management of data, an initial first blockchain and an initial second blockchain are configured on each chain node and are in mirror image structures, the prefixes of data uploading addresses are identical, for example, the data addresses corresponding to the data uploading addresses to the initial first blockchain are 1234.1, the data addresses uploading to the initial second blockchain are 1234.2, the first blockchain is used for storing high-encrypted data, a high-strength encryption algorithm is adopted to ensure the security of the data, the second blockchain is used for storing low-encrypted data, the relatively low encryption cost meets the basic security requirement of the data, different contents belonging to the same data file are respectively uploaded to the same nodes in the two chains through the mirror image structures, the consistency of the nodes is ensured, and the data is hierarchically managed by adopting different-strength encryption algorithms on the different chains to meet the security requirement of the data. As shown in fig. 3, the positions of the link points D corresponding to the uploading positions of the data files in the initial first blockchain and the initial second blockchain are found according to the index tree, and after the first content B and the second content C are encrypted, the encrypted first content B and the encrypted second content C are stored in the link points D in the corresponding initial first blockchain and the corresponding initial second blockchain respectively. In fig. 3E, F, G, H are different chain nodes, respectively.
The method comprises the steps of updating the chain link points of an initial first block chain and an initial second block chain according to a preset time period, effectively avoiding the problems that the chain link points of the initial first block chain and the initial second block chain are possibly reduced in performance, unbalanced in load or security loopholes and the like along with the change of traffic data continuously, updating the chain link points, avoiding an attacker from mastering a system rule, further enhancing the safety and flexibility of the system, updating the association of an index tree and a double chain to ensure the accuracy of data storage and retrieval, combining the updated first block chain and the updated second block chain to form a final double-chain structure block chain, and realizing the functions of safe hierarchical storage, mirror image backup, mutual verification and the like of the data by combining the two chains together.
Further, in the preset time period, updating the link points of the initial first blockchain and the initial second blockchain to obtain an updated first blockchain and an updated second blockchain, respectively, including:
S501, randomly updating the chain link points in the initial second block chain in a preset time period to obtain an updated second block chain;
s502, dynamically updating the index tree according to the updated second block chain to obtain an updated index tree;
S503, according to the update index tree, carrying out pseudo-random update on the chain link points in the initial first block chain to obtain an updated first block chain.
In this embodiment, in a preset time period, the link points in the initial second blockchain are randomly updated, so that the situation that the fixed node connection mode and the function allocation are stolen by an attacker can be avoided, an update range is determined according to the stability and the performance requirement of the system, whether all the link points are randomly updated or partial nodes are selected according to a certain proportion to update is determined, the update mode of the nodes is set, if the connection relation of the nodes can be randomly changed or the storage task of the nodes is redistributed, the nodes originally storing some data are changed into other data, the selected nodes are randomly updated according to the update mode, if the connection relation of the nodes is changed, other nodes are randomly selected from a node list, new connection is established, some original connections are disconnected, the updated second blockchain is obtained, after the update is completed, the integrity of the updated second blockchain is verified, the risk of the blockchain system being attacked can be effectively reduced by randomly updating the second blockchain, and the safety and privacy of traffic data are protected.
Specifically, after the link points in the second blockchain are updated, the storage position of data, the association relation between nodes and the data and the like may change, the index tree is dynamically adjusted according to the updating condition of the second blockchain, so that the corresponding data can be found accurately through the index tree, the consistency of the index and the actual data storage state is ensured, the corresponding pointers in the index tree are adjusted according to the change of the second blockchain, if the storage nodes of the data file change, the block link point pointers pointed by the corresponding key values in the index tree are modified, the updated index tree is obtained, and the index tree structure is updated, so that the index tree can always and accurately point to the data storage position in the second blockchain, and the accuracy of data retrieval is improved.
Specifically, after the chain link point of the second blockchain is updated, the first blockchain is updated, different updating methods are adopted for the updating mode of the chain link point in the first blockchain, as shown in fig. 4, the link relation between the node positions and the chain link points in the initial second blockchain and the initial first blockchain is updated respectively to obtain the updated second blockchain and the updated first blockchain, the first blockchain is prevented from being attacked after the attacker grasps the node positions and the data information of the second blockchain, the updated first blockchain and the updated second blockchain are not in mirror structures, the attack difficulty of the attacker can be increased, the updating rule of the node is difficult to predict by the attacker, the loss of high-sensitivity data is avoided, the safety and the flexibility of the system are improved, and the first blockchain is updated in a pseudo-random manner according to the updating index tree.
Further, according to the update index tree, performing pseudo-random update on the link points in the initial first blockchain to obtain an updated first blockchain, including:
S601, obtaining a chain node to be updated in an initial first block chain according to an update index tree;
S602, updating the link points to be updated through a pseudo-random algorithm according to a preset seed value to obtain updated nodes;
s603, recombining the updated node with a non-updated chain link point in the initial first block chain to obtain an updated first block chain.
In this embodiment, since the initial first blockchain and the initial second blockchain are in mirror structures, positions corresponding to leaf node positions in the index tree are consistent with those of the initial first blockchain and the initial second blockchain, chain nodes in the initial first blockchain, which need to be updated due to the update of the second blockchain or the change of the data storage condition of the second blockchain, are determined by updating the change condition of leaf node information in the index tree, so as to obtain chain nodes to be updated, avoid unnecessary update operation on all nodes of the first blockchain, save system resources and time cost, ensure update operation on nodes really needing to be adjusted, and improve update efficiency.
Specifically, a pseudo-random algorithm, such as a linear congruence method, a mersen rotation algorithm and the like, is utilized to initialize the pseudo-random algorithm according to a preset seed value, an updating strategy for the chain node of the first blockchain to be updated is formulated according to the performance requirement of the system and the safety requirement of the first blockchain, and each link point to be updated is updated based on the initialized pseudo-random algorithm and the formulated updating strategy, for example, the position and the name of the node are randomly changed. After the update operation is performed on each link point to be updated, an update node is obtained, the safety of the system can be effectively improved through pseudo-random update, the risk of an attacker attacking through analysis of the update rule of the node is reduced, and the safety and privacy of traffic data are protected. After updating part of the nodes, the updated nodes need to be recombined into the first blockchain, the updated nodes are recombined with non-updated chain nodes in the initial first blockchain, the connection relation between the updated nodes and the non-updated nodes, a data transmission mechanism and the like are ensured to be kept smooth, and the continuity of the system is maintained.
Further, the storing the first content after encryption to a first chain node of a first blockchain, and the storing the second content after encryption to a second chain node of a second blockchain includes:
S701, encrypting the first content by using a preset first encryption algorithm to obtain first encrypted data;
s702, encrypting the second content by using a preset second encryption algorithm to obtain second encrypted data;
S703, voting is carried out on non-first chain nodes of the first block chain and non-second chain link points of the second block chain according to the legality of the storage process, and a voting result is obtained;
And S704, when the number of the agreeable nodes in the voting result is larger than the number of the preset nodes, storing the first encrypted data to the first chain node, and storing the second encrypted data to the second chain node.
In this embodiment, the first content and the second content are encrypted by different encryption algorithms, and for the first content, due to the sensitivity and importance of information, a high-strength encryption algorithm is required to ensure confidentiality, integrity and anti-attack of the data, and compared with the first encryption algorithm, the preset first encryption algorithm has complex encryption logic and a longer key length, and can effectively resist various known encryption and decryption means, so that an attacker is difficult to acquire original data in a reasonable time, such as an AES-256 encryption algorithm, which performs multi-level encryption processing on the data through a complex round transformation and key expansion mechanism, so that the security of the data is greatly improved, and for the second content, although the sensitivity is relatively low, a certain encryption protection is required to prevent the data from being easily acquired or tampered with, and compared with the first encryption algorithm, the preset second encryption algorithm has relatively simple encryption logic and a shorter key length, such as an AES-128 encryption algorithm, and reduces the calculation overhead in the encryption process and improves the data processing speed.
After the first encrypted data and the second encrypted data are obtained, determining the positions of leaf nodes in an index tree according to the content of the traffic data file, positioning chain link points in corresponding block chains according to the positions of the leaf nodes to obtain chain nodes to be stored, ensuring that the data are stored on the most suitable chain link points, fully utilizing the storage capacity of each node, formulating validity standards according to the data sources, the data formats and the block chain storage rules of the traffic data file to judge the validity of the storage process of the data file, broadcasting the information to be stored of the traffic data file to all non-chain nodes in the block chain of the double-chain structure, transmitting the formulated validity standards to each non-chain node together, and ensuring that each node judges according to the same standards when voting.
Specifically, after each non-storage chain node receives information to be stored and validity standard, the storage process of the traffic data file is verified, for example, whether a digital signature of the data file is valid or not is verified, whether a data format accords with a specification or not is checked, whether storage operation violates storage rules of a blockchain is judged, and the like, a verification result is obtained, according to the verification result, each non-storage chain node carries out voting, the voting result is divided into agreements and disagreements, the voting result is counted, the decentralization characteristic of the blockchain is fully reflected in a node voting mode, the fact that a data storage decision is made by a plurality of nodes together is ensured, the fairness and the credibility of the system are improved, illegal data can be effectively prevented from entering the blockchain through strict verification on the validity of the storage process, and the safety of the blockchain and the integrity of the data are ensured.
When the number of agreeing nodes in the voting result is larger than the number of preset nodes, data storage is allowed, the preset number of nodes is generally set based on the number of nodes and the safety requirement of the blockchain network, and nodes exceeding half or a specific proportion (such as 2/3) are generally required to agree so as to prevent a few malicious nodes from operating the storage decision, and the consensus is achieved in a majority decision mode, so that the rationality and the effectiveness of the data storage decision are ensured, and the stability and the reliability of the blockchain network are improved.
Further, the reading, by the index tree, the first content and the second content from the corresponding first chain node and the second chain node in response to a search condition input by a user includes:
S801, searching in an index tree to obtain a branch tree according to a search condition input by a user;
S802, determining a downward searching path in the branch tree according to the searching condition until a target leaf node is searched;
s803, positioning a target first chain node and a target second chain node in the double-chain structure block chain according to the information stored in the target leaf node;
s804, acquiring target first encryption data, target second encryption data and corresponding encryption keys from the target first chain node and the target second chain node to obtain first content and second content.
In the method, the search condition input by a user is analyzed, the search condition is converted into a form which can be compared with the key value in the index tree, the size and the range of the key value are compared from the root node of the index tree, subtrees which do not meet the condition can be rapidly eliminated, the search range is gradually reduced, and finally the branch tree containing the key value which possibly meets the search condition is determined, so that the whole index tree can be prevented from being comprehensively searched, the search efficiency is improved, the key value information of the search condition is continuously utilized in the determined branch tree, the search is carried out downwards along the branches of the tree until the target leaf node is reached, the target leaf node stores the target data pointer, the target leaf node is accurately positioned by continuously thinning the comparison of the search condition and the node key value, the search accuracy is improved, and the time and the resource waste on irrelevant nodes are avoided.
Specifically, the target leaf node comprises pointer information pointing to chain link points in the block chain of the double-chain structure, the target chain node storing the required traffic data file can be found through the pointer information in the leaf node, the efficient positioning of the data is realized through the accurate mapping from the index structure to the storage structure, after the target chain node is positioned, the encrypted data content is read from the target chain node, the encryption key corresponding to the encrypted data is searched from metadata of the chain node, the obtained encryption key is used for decrypting the encrypted data according to an encryption algorithm (such as AES-256 or AES-128) used during storage, the decrypted data is the original target traffic data file, the decrypted data can be provided for a user in a format (such as text, image, video and the like) required by the user, the encrypted data is restored into the original data through the correct decryption operation, the available data is provided for the user, and the safe storage of the traffic data and the complete flow of the traffic data retrieval according to the requirement are realized.
Further, the determining a path searched downwards in the branch tree according to the search condition until the target leaf node is searched comprises the following steps:
s901, analyzing the search condition to obtain a search key value;
s902, starting from a root node of a branch tree, comparing the search key value with a node key value to obtain a comparison result;
s903, when the comparison result is that the search key value is smaller than the node key value, continuing to search downwards according to the child node pointer corresponding to the node key value;
s904, repeating the key value comparison and searching processes, and searching the target leaf node when the search key value is equal to the node key value or the difference value between the search key value and the node key value is in the preset key value range.
In the embodiment, the search conditions input by the user are analyzed and converted into search key values, the diversified search conditions of the user are converted into uniform search key values, the uniform comparison standard is provided for search operation by ensuring comparison with the key values in the index tree, firstly, a key value list stored by the root node of the branch tree is read, the search key values are compared with the key values of the root node to obtain comparison results, most nodes which do not meet the conditions can be rapidly removed through node comparison, the search range is greatly reduced, and the search process is accelerated.
Specifically, in the B+ tree, the node generally stores pointers pointing to the sub-nodes, when the search key value is smaller than the node key value according to the comparison result, the pointer of the left sub-node corresponding to the node key value is obtained, the current search position is updated to the sub-node so as to carry out the next round of comparison and search operation, the sub-node is searched downwards according to the size relation of the key value, the search range is continuously narrowed to a subtree more likely to contain target data, the accuracy and efficiency of the search are improved, the search is carried out according to the logical structure of the index tree, the logic and continuity of the search process are ensured, the confusion and resource waste caused by unordered search are avoided, the comparison and search operation is continuously repeated until the search key value is equal to the node key value or within a certain range, the fact that the leaf node which can possibly store the target data is found is indicated to be found, for the range query, the difference value is in the preset key value range, a part of data meeting the condition is required to be checked, the leaf node and the adjacent leaf node is required to be found, for the accurate query, the accurate query is equal to the node key value, the accurate target data storage position is required to be found, the target leaf node is finally searched to the target leaf node is required to be searched, the exact search position, the target leaf node is required to be searched to be the target leaf node to be accurate, the target data storage position is required to be found, the accurate query, and the target data can be found, the accurate query can be found, and the target node can be found and the accurate target data storage position is required to be and the target node is not be found.
Example 2
In this embodiment, as shown in fig. 5, a blockchain-based traffic data file caching system is provided, which is configured to implement the blockchain-based traffic data file caching method, including:
The file content dividing module divides the traffic data file to be searched into first content and second content, wherein the requirement security level of the first content is higher than that of the second content;
The traffic data file storage module is used for storing the first content in a first chain node of a first blockchain and storing the second content in a second chain node of a second blockchain based on a preset index tree, wherein the data encryption level of the first blockchain is higher than that of the second blockchain;
And the traffic data file retrieval module is used for responding to the retrieval condition input by a user and reading the first content and the second content from the corresponding first chain node and second chain node through the index tree, wherein the index tree comprises a first chain link point address and a second chain link point address of each traffic data file.
The foregoing has shown and described the basic principles and main features of the present invention and the advantages of the present invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, and that the above embodiments and descriptions are merely illustrative of the principles of the present invention, and various changes and modifications may be made without departing from the spirit and scope of the invention, which is defined in the appended claims. The scope of the invention is defined by the appended claims and equivalents thereof.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510230493.6A CN119719033B (en) | 2025-02-28 | 2025-02-28 | Traffic data file caching method and system based on blockchain |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202510230493.6A CN119719033B (en) | 2025-02-28 | 2025-02-28 | Traffic data file caching method and system based on blockchain |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN119719033A true CN119719033A (en) | 2025-03-28 |
| CN119719033B CN119719033B (en) | 2025-06-20 |
Family
ID=95077215
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202510230493.6A Active CN119719033B (en) | 2025-02-28 | 2025-02-28 | Traffic data file caching method and system based on blockchain |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN119719033B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120915575A (en) * | 2025-08-28 | 2025-11-07 | 智慧互通科技股份有限公司 | Traffic data safety transmission method and system based on block chain |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20210081400A1 (en) * | 2017-12-13 | 2021-03-18 | Sogang University Research Foundation | Search method using data structure for supporting multiple search in blockchain-based iot environment, and device according to method |
| CN113326317A (en) * | 2021-05-24 | 2021-08-31 | 中国科学院计算技术研究所 | Block chain evidence storing method and system based on isomorphic multi-chain architecture |
| CN114048448A (en) * | 2021-11-24 | 2022-02-15 | 中央财经大学 | Block chain based dynamic searchable encryption method and device |
| CN114372296A (en) * | 2021-12-31 | 2022-04-19 | 华南理工大学 | Block chain-based user behavior data auditing method and system |
| CN116432213A (en) * | 2022-09-07 | 2023-07-14 | 北京工商大学 | A data privacy protection method for grain supply chain based on multi-chain blockchain |
| CN117792611A (en) * | 2023-12-29 | 2024-03-29 | 国家高速列车青岛技术创新中心 | Method, device, equipment and medium for processing communication data of railway vehicle on-board network |
| CN117875975A (en) * | 2023-12-04 | 2024-04-12 | 北京工商大学 | Construction method of full-process holographic information management model for fruits and vegetables based on blockchain multi-chain |
| CN118400743A (en) * | 2024-04-18 | 2024-07-26 | 四川大学 | Distributed network node security method based on block chain segmentation consensus mechanism |
-
2025
- 2025-02-28 CN CN202510230493.6A patent/CN119719033B/en active Active
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20210081400A1 (en) * | 2017-12-13 | 2021-03-18 | Sogang University Research Foundation | Search method using data structure for supporting multiple search in blockchain-based iot environment, and device according to method |
| CN113326317A (en) * | 2021-05-24 | 2021-08-31 | 中国科学院计算技术研究所 | Block chain evidence storing method and system based on isomorphic multi-chain architecture |
| CN114048448A (en) * | 2021-11-24 | 2022-02-15 | 中央财经大学 | Block chain based dynamic searchable encryption method and device |
| CN114372296A (en) * | 2021-12-31 | 2022-04-19 | 华南理工大学 | Block chain-based user behavior data auditing method and system |
| CN116432213A (en) * | 2022-09-07 | 2023-07-14 | 北京工商大学 | A data privacy protection method for grain supply chain based on multi-chain blockchain |
| CN117875975A (en) * | 2023-12-04 | 2024-04-12 | 北京工商大学 | Construction method of full-process holographic information management model for fruits and vegetables based on blockchain multi-chain |
| CN117792611A (en) * | 2023-12-29 | 2024-03-29 | 国家高速列车青岛技术创新中心 | Method, device, equipment and medium for processing communication data of railway vehicle on-board network |
| CN118400743A (en) * | 2024-04-18 | 2024-07-26 | 四川大学 | Distributed network node security method based on block chain segmentation consensus mechanism |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120915575A (en) * | 2025-08-28 | 2025-11-07 | 智慧互通科技股份有限公司 | Traffic data safety transmission method and system based on block chain |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119719033B (en) | 2025-06-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9977918B2 (en) | Method and system for verifiable searchable symmetric encryption | |
| CN114372296B (en) | Block chain-based user behavior data auditing method and system | |
| Du et al. | Privacy-preserving indexing and query processing for secure dynamic cloud storage | |
| CN106776904B (en) | The fuzzy query encryption method of dynamic authentication is supported in a kind of insincere cloud computing environment | |
| CN101859323B (en) | Ciphertext Full-text Retrieval System | |
| Chen et al. | Bestie: Very practical searchable encryption with forward and backward security | |
| CN110413652B (en) | A big data privacy retrieval method based on edge computing | |
| CN106612320A (en) | Encrypted data dereplication method for cloud storage | |
| CN119719033B (en) | Traffic data file caching method and system based on blockchain | |
| CN115982115A (en) | A Data Sharing Method | |
| TW202304171A (en) | Improved methods & systems for signature verification in blockchain-implemented data applications | |
| Fu et al. | Searchable encryption scheme for multiple cloud storage using double‐layer blockchain | |
| CN110222520B (en) | Keyword query method for supporting graph encrypted data in cloud environment | |
| CN110661759A (en) | Access detection method and device | |
| CN116015659B (en) | A method and system for sorting keys in blockchain | |
| CN117390118A (en) | Quick data retrieval method and system based on block chain | |
| Souror et al. | Secure query processing for smart grid data using searchable symmetric encryption | |
| CN119675860B (en) | A multi-user revocable and searchable encryption method based on blockchain | |
| Zhang et al. | A blockchain based searchable encryption scheme for multiple cloud storage | |
| Williams et al. | SR-ORAM: Single round-trip oblivious ram | |
| Ghassabi et al. | DEDUCT: A Secure Deduplication of Textual Data in Cloud Environments | |
| YueJuan et al. | A searchable ciphertext retrieval method based on counting bloom filter over cloud encrypted data | |
| CN117394977A (en) | Anonymous identity data storage method and system based on blockchain | |
| CN115865461A (en) | Method and system for distributing data in high-performance computing cluster | |
| CN120934903B (en) | An improved public-key searchable encryption method, system, and device. |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |