Railway construction quality data safety management method based on block chain

By adopting blockchain-based data security management methods in railway tunnel construction, the problem of insufficient data security in the existing technology is solved, efficient data storage and security management are realized, and the authenticity and completeness of construction quality data are ensured. sex.

CN119416271APending Publication Date: 2025-02-11XIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411573216.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The integrated application of existing BIM and blockchain technologies in the field of railway tunnel construction has insufficient data integrity protection, tamper detection and log traceability, which makes it difficult to guarantee the safety and accuracy of construction quality data, affecting project quality and construction period management. .

Method used

Adopt blockchain-based railway construction quality data security management method, by acquiring and preprocessing construction images, identifying and removing similar images, storing structured and unstructured data, log encryption and hash verification, and using blocks The immutable characteristics of the chain are used for data traceability and integrity verification.

Benefits of technology

It significantly improves data storage efficiency, enhances data security and transparency, ensures data authenticity and integrity, supports real-time monitoring and rapid response, and reduces the risk of data loss or tampering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416271A_ABST
    Figure CN119416271A_ABST
Patent Text Reader

Abstract

The invention discloses a railway construction quality data safety management method based on a block chain, and the method specifically comprises the following steps: 1, obtaining a construction tunnel face image, carrying out the preprocessing of the tunnel face image, and recognizing and removing similar images; 2, storing the structured data, the file data and the preprocessed construction image; step 3, performing log security encryption on log information generated by storing the construction quality data in the step 2; step 4, generating file hash and MySQL data record hash corresponding to the construction quality data stored in the step 2; 5, performing integrity verification on the construction quality data stored in the step 2, and judging whether the construction quality data is tampered or not; step 6, positioning the tampered construction quality data; and step 7, carrying out transaction traceability on the construction quality data which are not tampered. According to the invention, the problems of difficulty in data traceability and insufficient security in the existing data management system are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of blockchain and relates to a railway construction quality data security management method based on blockchain. Background Art

[0002] Railway tunnel construction is a very challenging engineering activity. Due to its complex and ever-changing environment, it has extremely high requirements for data accuracy and real-time performance. Ensuring the security, accuracy and integrity of data during the construction process is crucial to preventing railway construction accidents and ensuring project progress and quality.

[0003] At present, BIM (Building Information Modeling) technology has been widely used in railway tunnel construction to improve the efficiency of data management and engineering coordination. BIM technology enables project teams to plan and design more accurately by creating virtual building models. At the same time, blockchain technology is also being explored for improving data security and transparency due to its characteristics of data immutability and transparency.

[0004] However, in the field of tunnel construction, the integrated application of BIM and blockchain technology is not mature enough and faces some challenges. Existing BIM and blockchain technologies have deficiencies in data integrity protection, tampering detection and log traceability, which allows construction parties, supervisors, etc. to maliciously modify and update data and is difficult to detect. Especially in the complex environment of tunnel construction, the security and accuracy of these construction quality data are crucial to preventing accidents and ensuring project quality. In addition, a large number of similar construction images will be generated during the measurement and collection of construction quality data. Existing technical solutions are often difficult to efficiently deduplicate and store, resulting in inefficient management of railway construction quality data, which in turn affects the railway construction project schedule management and project quality.

[0005] To meet these challenges, more advanced technical solutions need to be developed to improve the flexibility and responsiveness of data management and meet the needs of real-time monitoring, rapid response and problem tracing in complex construction environments. Summary of the invention

[0006] The purpose of the present invention is to provide a railway construction quality data security management method based on blockchain, which solves the problems of difficult data tracing and insufficient security in existing data management systems.

[0007] The technical solution adopted by the present invention is a railway construction quality data security management method based on blockchain, which specifically includes the following steps:

[0008] Step 1: Acquire the tunnel face image under construction, pre-process the tunnel face image, identify and eliminate similar images;

[0009] Step 2, storing the structured data, file data and pre-processed construction images;

[0010] Step 3, performing log security encryption on the log information generated by storing the construction quality data in step 2;

[0011] Step 4, generating a file hash and a MySQL data record hash corresponding to the construction quality data stored in step 2;

[0012] Step 5, performing integrity check on the construction quality data stored in step 2 to determine whether the construction quality data has been tampered with;

[0013] Step 6, locating the tampered construction quality data;

[0014] Step 7: Conduct transaction traceability for construction quality data that has not been tampered with.

[0015] The present invention is also characterized in that:

[0016] The specific process of step 1 is:

[0017] Step 1.1: Image the face of the tunnel Divide into N non-overlapping small blocks Where i = 1, 2, ..., N, m 2 =Nb 2 , where m is the width and height of image I, c is the number of color channels, b is the side length of each small block, I i is the i-th small block of image I, with dimensions b×b×c; the i-th small block I of the input i Flattened into a vector Where d = cb 2 , i = 1, 2, ..., N, for each vector V i Perform linear projection to generate projection embedding PE i :

[0018] PE i = V i × W PE (1)

[0019] in, is the parameter matrix, is the projection embedding corresponding to the i-th small block, de is the embedding dimension of the projection; the projection embedding of the entire face image I is

[0020] Step 1.2, introduce a category token embedding As a learning parameter, it is initialized to zero and concatenated with the projected embedding PE generated in step 1.1 to generate the extended embedding EE in the first dimension:

[0021] EE = [CT, PE] (2)

[0022] Embed the location As a learning parameter, it is initialized to zero and added to the expanded embedding to finally generate the projected embedding h 0 :

[0023] h 0 = dropout(EE + PoE, 0.1) (3)

[0024] Step 1.3: convert the final output h of step 1.2 into 0 The input is fed into an encoder consisting of a stack of L Transformer blocks, with the first Transformer block T 1 The input is the final projected embedding h from step 1.2 0 ; The last block T L The output of is the hidden state h L ;

[0025] Step 1.4: convert the final output h of step 1.3 into L Input into the feature pyramid network, and then use the multi-layer perceptron to fuse and transform the output of the feature pyramid network to generate a fixed-length feature vector F:

[0026] F = MLP (FPN (h L )) (4)

[0027] Step 1.5, assign different levels to the feature vector F generated in step 1.4, and find similar images through the assigned levels according to the similarity metric;

[0028] Step 1.6, traverse each feature vector F, and assign the level L to each image feature vector F according to step 1.5 ith, generate a hierarchical index graph, in which a greedy search is used to identify the nearest neighbors of each inner layer. The search starts from the top layer with the input network entry point, and then iterates to lower layers until the second lowest layer is reached. Finally, at the bottom layer of the network, the g neighbors closest to the query point are retrieved according to the distance. The similarity between the query image and the retrieved nearest neighbor is measured by calculating the Euclidean distance between the query image and the retrieved nearest neighbor. The deduplication efficiency DE is used to measure the effect of deduplication, as shown in the following formula (5); according to the deduplication efficiency DE, the threshold of similarity between the query image and the nearest neighbor is dynamically adjusted in advance. If the similarity between the retrieved image and the query image exceeds the preset threshold, the system will automatically delete these similar images; if the similarity is lower than the threshold, the image should be saved, and the feature vector of each accepted image is added to the feature database:

[0029] DE=(1-ε)×per+ε×(1-V dpre ) (5)

[0030] Where, per represents the percentage of deduplication, V dpre is the percentage drop in average precision caused by ViT training after deduplication. ε is a weighting factor between 0 and 1.

[0031] The specific process of step 1.3 is:

[0032] Step 1.3.1, embed the projection of the output of step 1.2 into h 0 Enter the first Transformer block T 1 Perform layer normalization in the output feature

[0033] Step 1.3.2: Output the feature l in step 1.3.1 0 Input multi-head self-attention layer, in the multi-head self-attention layer, l 0 The output through three different linear transformations is:

[0034] S t = l 0 ×W t (6)

[0035] in, Where t = {Q, K, V}, W t is the learned weight matrix for linear projection;

[0036] In S Q and S K Perform matrix multiplication between them to produce an output matrix S QK , the attention head size AS The square root of is normalized to:

[0037]

[0038] Then use the softmax function to calculate the attention weight A w :

[0039] A w = softmax(S QK ) (6)

[0040] S v With attention weight A w Perform calculations to generate attention weighted features F A for:

[0041] F A = A w ×S V (7)

[0042] In F A Apply a learning parameter W A The linear projection of the self-attention module is obtained S :

[0043] F S =F A ×W A (8)

[0044] Step 1.3.3, the Transformer block transforms the output F of step 1.3.2 S With input h 0 Add together to generate the residual connection F R :

[0045] F R = h 0 + F S (9)

[0046] Step 1.3.4, connect the residual F generated in step 1.3.3 R Using layer normalization, the output of this layer is l of the same dimension R , will l R Input to the multi-layer perceptron, output feature F MLP :

[0047] F MLP =DropOut(Linear 2 ,(GELU(Linear 1 ,(l R )) (10)

[0048] Among them, Linear 1 It is the first linear transformation layer in the multi-layer perceptron. GELU is the activation function. Linear 2 It is the second linear transformation layer in MLP;

[0049] Use residual connections to generate the output h of the first Transformer block 1 :

[0050] h 1 = F R + F MLP (11)

[0051] In the formula, is the output of the multi-layer perceptron, F R is the output of the first residual connection;

[0052] Step 1.3.5: transform the output h of the first Transformer block in step 1.3.4 into 1 Input it into the remaining L-1 Transformer blocks in turn, repeat steps 1.3.1 to 1.3.4, and get the output h of the last Transformer block L .

[0053] The specific process of step 1.5 is:

[0054] Step 1.5.1, calculate the Euclidean distance D(F,C) between the feature vector F of each image generated in step 1.4 and the average value C of all feature vectors, as shown in the following formula (12):

[0055]

[0056] Among them, F r and C r are the rth elements in vectors F and C respectively, and η is the length of the vector;

[0057] Step 1.5.2, calculate the upper bound ub and lower bound lb of the feature vector F according to the Euclidean distance D(F,C) obtained in step 1.5.1, where the lower bound lb is the minimum value of all Euclidean distances D(F,C), and the upper bound ub is calculated using the following formula (13):

[0058] ub=avg+f×σ (13)

[0059] Where f is the outlier factor, avg is the average value of the Euclidean distance, and σ is the standard deviation of the Euclidean distance. The distance r between each level is calculated using the following formula (14):

[0060]

[0061] The level L where the feature vector F of each image is located is calculated by the following formula (15): ith :

[0062]

[0063] The number of layers L is determined by the number of input feature vectors M per layer. num , the feature vector F of each image is assigned to a level L ith , L num The calculation process is as follows:

[0064]

[0065] The specific process of step 2 is:

[0066] Step 2.1, for the structured data in the railway tunnel construction specification, design the storage structure of the MySQL database and store the structured data directly into the MySQL database;

[0067] Step 2.2: For the construction tunnel face image and file unstructured data, first store them in the file storage system, and then store the metadata of the relevant files in the MySQL database design table.

[0068] The specific process of step 3 is:

[0069] Step 3.1: Since each log record has a timestamp, retrieve the addition, deletion and modification logs generated by the authorized user since the timestamp of the last stored data. Then, use the hash encryption algorithm to generate log hashes from these addition, deletion and modification logs, and finally encrypt and back up these log hashes.

[0070] Step 3.2: Store the log hash generated in step 3.1 together with the timestamp information of this log in the MySQL database table to ensure the confidentiality and traceability of the log data.

[0071] The specific process of step 4 is:

[0072] Step 4.1, generating a unique data record hash for each row of data records stored in the MySQL database in step 2.1;

[0073] Step 4.2, generating a hash for each file stored in step 2.2, and then storing the file in the file database, and recording the storage location of the file, the hash of the file, the log hash generated by the file database and the timestamp in the MySQL database, and generating a unique data record hash for each row of data records corresponding to the MySQL database;

[0074] Step 4.3, upload the structured data in step 2.1 and the file hash in the unstructured data in step 2.2, as well as the log hash, timestamp, uploader identity, upload time, and the previous block transaction ID related to the current transaction generated in step 3 to the Fabric blockchain. Each upload transaction will generate a unique block transaction ID;

[0075] Step 4.4, store the block transaction ID generated in step 4.3 into a row of data records corresponding to the MySQL database and create an index.

[0076] The specific process of step 5 is:

[0077] Regularly regenerate hashes for the MySQL data records of the structured data in step 2.1 and the file data in the unstructured data in step 2.2, and compare them with the corresponding hashes stored in the blockchain in step 4. If the hash comparison is inconsistent, there is tampering. For this tampering, use the backup data to quickly restore to the most recent consistent state of the data, then re-upload the restored data to the blockchain, and then immediately start the accountability process to find the user's specific tampering operation and execute step 6. If the hash comparison is consistent, the historical operation of the relevant transaction is normally traced and executed Step 7.

[0078] The specific process of step 6 is:

[0079] Step 6.1: For the tampered file data, use a difference comparison tool such as WinMerge to identify the tampered part;

[0080] Step 6.2: For the tampered image data, the improved IML-ViT method is used to quickly compare the differences.

[0081] The specific process of step 6.2 is:

[0082] Step 6.2.1, the image data to be tampered with Zero pad to Where h and w correspond to the height and width of the tampered image X, respectively, and H and W correspond to the height and width after padding;

[0083] Step 6.2.2: X obtained in step 6.2.1 p Passed to the Re-ViT encoder, the feature vector G of the output image e ;

[0084] Step 6.2.3, obtain a single output feature map G in step 6.2.2 e , a simple feature pyramid network is used, and convolution and deconvolution layers are used for upsampling and downsampling to obtain a multi-scale feature map F k :

[0085]

[0086] Among them, k is used to represent the multi-scale feature map F k Different scales of C k is the number of convolution stages, C s is the output channel dimension of each layer in SFPN;

[0087] Step 6.2.4, then use the lightweight MLP decoder in IML-ViT and concatenate all features together, fuse all layers and make the final prediction:

[0088]

[0089] Among them, W k and b k represents the weight matrix and bias vector of the linear transformation, P represents the predicted probability map of the tampered area; ⊙ represents the serial operation, and MLP represents the MLP module;

[0090] Step 6.2.5, Use dilation and erosion Mathematical morphological operations generate an edge mask M of the real mask image M corresponding to the tampered image * :

[0091]

[0092] Where B(λ) is a structural element that generates a (2λ+1)×(2λ+1) cross matrix, where only the λth column and the λth row have values ​​of 1, and the rest of the matrix contains 0s, and λ is the radius of the structural element;

[0093] For the true value mask M and the edge mask M * The image is zero-padded to H×W size, referred to as M p and M p * Then the final loss is calculated using the following formula (20):

[0094] L=L seg (P, M p ) +β·L edge (P*M p , M p *M p ) (20)

[0095] Among them, * represents the point-by-point product, L seg and L edge Both are binary cross entropy loss functions, and β is a hyperparameter that controls the balance between segmentation and edge detection losses;

[0096] Step 6.2.6, predict the predicted probability map P of the tampered area based on the model optimized in step 6.2.5, and find the tampered information.

[0097] The beneficial effects of the present invention are as follows:

[0098] 1. The present invention reduces the waste of storage space and improves the efficiency of data storage by identifying and removing duplicates of similar images.

[0099] 2. The present invention provides a highly secure data traceability solution, which significantly enhances data protection capabilities through encryption and blockchain technology.

[0100] 3. The present invention ensures the confidentiality and security of log data and prevents the leakage of sensitive information by encrypting and storing log information.

[0101] 4. The present invention utilizes the tamper-proof nature of blockchain to provide a reliable and undeniable storage environment for data, thereby enhancing the credibility of the data.

[0102] 5. The present invention optimizes data management and retrieval efficiency through database indexing and fast retrieval mechanisms, making data operations faster and more accurate. When data integrity is threatened, the present invention can quickly identify the problem and initiate the traceability and remediation process, effectively preventing the risk of data loss or tampering. The use of deep learning technology to detect and locate image tampering ensures the authenticity and integrity of the data. The implementation of the present invention does not rely on a specific hardware environment, has good flexibility and adaptability, and is suitable for a variety of application scenarios with data security and traceability requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0103] Figure 1 It is a schematic diagram of the overall structure of the railway construction quality data security management method based on blockchain of the present invention;

[0104] Figure 2 It is a schematic diagram of a similar construction quality image deduplication structure combining ViT and a hierarchical method proposed by the railway construction quality data security management method based on blockchain of the present invention;

[0105] Figure 3 It is a structural diagram of the accountability and traceability of railway tunnel construction data using database log information in the railway construction quality data security management method based on blockchain of the present invention;

[0106] FIG4( a ) is a schematic diagram of an improved image tampering localization structure including a residual attention module in the railway construction quality data security management method based on blockchain of the present invention;

[0107] Figure 4(b) is a schematic diagram of the improved residual connection structure of the multi-head attention mechanism in Transformer of Figure 4(a);

[0108] Figure 5 It is a structural diagram of transaction tracing of railway tunnel construction data on the blockchain in the railway construction quality data security management method based on the blockchain of the present invention. DETAILED DESCRIPTION

[0109] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0110] Example 1

[0111] The blockchain-based railway construction quality data security management method of the present invention adopts a comprehensive solution combining database management, data encryption, blockchain technology, hash verification, difference comparison tools and deep learning analysis to achieve data storage, encryption, verification, traceability and recovery.

[0112] Example 2

[0113] The present invention provides a railway construction quality data security management method based on blockchain, such as Figure 1 As shown, the specific steps include:

[0114] Step 1: Image data preprocessing: During the railway construction monitoring process, a large number of tunnel face images after blasting are collected through industrial cameras, and similar tunnel face images are preprocessed to reduce the weight. Innovatively, ViT is combined with the hierarchical method to perform image similarity inspection.

[0115] First, feature extraction is performed on the tunnel face image using the ViT model as a general feature extractor, with the last layer in the original ViT model, usually the multi-layer perceptron (MLP) head and category classification, removed. Figure 2 The dotted box on the left is the model for image feature extraction. After removing the MLP head classification, the feature pyramid network (FPN) is combined to extract image features and generate feature vectors. Next, the feature vectors are directly used for input, and the hierarchical method is used to organize data and query images. By comparing image features and setting similarity thresholds, similar face images are identified and eliminated. The specific operations are as follows:

[0116] Step 1.1: Input the tunnel face image Divide into N non-overlapping patches, Where i = 1, 2, ..., N, m 2 =Nb 2, where m is the width and height of image I, c = 3 is the number of color channels, b is the side length of each small block, I i It is the i-th small block divided by image I, and its dimension is b×b×c.

[0117] The i-th small block of input i Flattened into a vector Where d = cb 2 , i = 1, 2, ..., N, for each vector V i Perform linear projection to generate Projection Embedding (PE) i :

[0118] PE i = V i × W PE (1)

[0119] in, is the parameter matrix, is the projected embedding corresponding to the ith patch. de is the embedding dimension of the projection. The projected embedding corresponding to the entire input image is written as

[0120] Step 1.2: Introduce a Category Token As a learnable parameter, it is initialized to zero and concatenated with the projected embedding generated in step 1.1 to generate the extended embedding (Extensible Embedding) EE in the first dimension:

[0121] EE = [CT, PE] (2)

[0122] Positional Encoding It is included as a learnable parameter and initialized to zero and added to the extended embedding. Finally, the projected embedding (h 0 ):

[0123] h 0 = dropout(EE + PoE, 0.1) (3)

[0124] Among them, dropout is the dropout layer before the image is input to the Transformer encoder, h 0 is the input of the Transformer encoder.

[0125] Step 1.3: convert the final output h of step 1.2 into 0, is fed into an encoder consisting of a stack of L Transformer blocks. The first Transformer block T 1 The input is the final projected embedding h from step 1.2 0 The last block T L The output of is the hidden state h L .

[0126] Each Transformer block is mainly composed of two parts: a multi-head self-attention layer and an MLP block. Before the multi-head self-attention layer, layer normalization is first performed. The output of the self-attention layer is added to the input through a residual connection, and then layer normalization is performed again. Then it enters the MLP block, and the output of the MLP block is also added to the input through a residual connection, and the final layer normalization is performed.

[0127] Step 1.3.1, the first Transformer block T 1 The input is the final projected embedding of step 1.2 (i.e. h 0 = FE). Layer normalization is the first layer in a Transformer block, which takes as input h 0 , output

[0128]

[0129] Step 1.3.2: The input of the multi-head self-attention layer is the normalized output l of step 1.3.1. 0 , and finally get the output F of the multi-head self-attention module S .

[0130] In the multi-head self-attention layer, l 0 The output through three different linear transformations is:

[0131] S t = l 0 ×W t (4)

[0132] in Where t = {Q, K, V}. t is a learnable weight matrix for linear projection.

[0133] Next, in S Q and S K Perform matrix multiplication between them to produce an output matrix S QK , which is the attention head size A S The square root of is normalized to:

[0134]

[0135] Then use the softmax function to calculate the attention weight (A w ):

[0136] A w = softmax(S QK ) (6)

[0137] S v With attention weight A w Perform operations to generate attention weighted features (F A )for:

[0138] F A = A w ×S V (7)

[0139] Finally, in F A Apply a learnable parameter W A The linear projection of the self-attention module is obtained S :

[0140] F S =F A ×W A (8)

[0141] Step 1.3.3, the Transformer block transforms the output F of step 1.3.2 S With input h 0 Add together to generate the residual connection F R :

[0142] F R = h 0 + F S (9)

[0143] Step 1.3.4, connect the residual F generated in step 1.3.3 R Using layer normalization, the output of this layer is l of the same dimension R Next, R The output of the input to the MLP is F MLP :

[0144] F MLP =DropOut(Linear 2 ,(GELU(Linear 1 ,(l R )) (10)

[0145] Among them, Linear 1It is the first linear transformation layer in MLP. GELU (Gaussian Error Linear Units) is the activation function. 2 It is the second linear transformation layer in MLP.

[0146] Finally, a residual connection is used to produce the output h of the first Transformer block 1 :

[0147] h 1 = F R + F MLP (11)

[0148] In the formula, is the output of the MLP module, F R is the output of the first residual connection.

[0149] Step 1.3.5, Next, the output h of the first Transformer block in step 1.3.4 is 1 Input to the remaining L-1 Transformer blocks, and the output of the last Transformer block is h L .

[0150] Step 1.4, use the final output h of step 1.3 L , and input it into the feature pyramid network (FPN). Then use MLP to process the output of FPN, further fuse and transform these features to generate a fixed-length feature vector F:

[0151] F = MLP (FPN (h L )) (12)

[0152] Step 1.5, the feature vector F generated in step 1.4 is assigned to different levels. By assigning the levels, similar images can be quickly found based on the similarity measure.

[0153] The number of layers L is determined by the number of input feature vectors M per layer. num :

[0154]

[0155] Step 1.5.1, for each image feature vector F generated in step 1.4, calculate the distance between it and the average value C of all feature vectors. The Euclidean distance D(F,C) is calculated as:

[0156]

[0157] Among them, Fr and C r are the rth elements in vectors F and C respectively, and η is the length of the vector.

[0158] Step 1.5.2, for the feature vector F generated in step 1.4 and the Euclidean distance D(F,C) obtained in step 1.5.1, calculate the upper bound ub and lower bound lb of the feature vector. The lower bound lb is the minimum value of all Euclidean distances D(F,C).

[0159] ub=avg+f×σ (15)

[0160] Among them, the input f is set to a fixed value as the outlier factor, avg is the average value of the Euclidean distance, and σ is the standard deviation of the Euclidean distance. Next, the distance r between each level is calculated:

[0161]

[0162] Then calculate the level of the feature vector F of each image:

[0163]

[0164] The feature vector F of each image is assigned to a level L ith .

[0165] Step 1.6, traverse each feature vector F, and assign the level L to each image feature vector F according to step 1.5 ith , adding them to the empty set graph to generate a hierarchical index graph. The retrieval process is optimized by extracting the nearest neighbors for each feature vector at each layer and updating its neighbor list at the previous layer. In the hierarchical index graph, a greedy search is used to identify the nearest neighbors of each inner layer. The search starts from the top layer with the input network entry point and then iterates to lower layers until it reaches the second lowest layer. Finally, at the bottom layer of the network, it retrieves the g neighbors closest to the query point based on the distance. By calculating the query image F qu With the retrieved nearest neighbor F qg The Euclidean distance D(F qu ,F qg ):

[0166]

[0167] Among them, F qur and F qgr The vector F qu and F qg The rth element in , where η is the length of the vector.

[0168] Use the deduplication efficiency DE to measure the effect of deduplication:

[0169] DE=(1-ε)×per+ε×(1-V dpre ) (19)

[0170] Where, per represents the percentage of deduplication, V dpre is the percentage drop in average precision caused by ViT training after deduplication. ε is a weighting factor between 0 and 1.

[0171] Dynamically adjust the pre-determined query image F according to the deduplication efficiency DE qu With the retrieved nearest neighbor F qg If the similarity between the retrieved image and the query image exceeds the preset threshold, the system will automatically delete these similar images to avoid redundancy in the database. If the similarity is lower than the threshold, the image should be saved. And the feature vector of each accepted image is added to the feature database.

[0172] Step 2, data storage: After the face image data preprocessing in step 1, these face images and face point cloud data files, tunnel drilling rig drilling data table, overbreak and underbreak analysis results table, advanced geological drilling column chart, tunnel deepening blasthole field record table, geological sketch record table, railway tunnel construction specification three inspection table are stored. When performing database addition, deletion and modification operations, the database will generate specific log information.

[0173] Step 3, log security encryption: In order to ensure the security and integrity of the log information generated by the addition, deletion and modification operations of the database in step 2, step 3 introduces log security encryption measures.

[0174] Step 4: Data integrity assurance;

[0175] Step 5: Data integrity check;

[0176] Step 6: Accurately locate the tampered content: If the hash check in step 5 fails, there is tampering. The process of accurately locating the tampered content is as follows: Figure 3 First, find the corresponding log timestamp in the blockchain, find the corresponding log information based on the log timestamp, then re-hash the log information, and then compare the newly generated log hash with the log hash stored in the blockchain. If the comparison shows inconsistency, it indicates that the log may have been tampered with. At this time, the encrypted backup log data will be used for analysis to find the user's tampering operation on the database. In order to accurately locate the tampered content, two different methods are used.

[0177] Step 7: Transaction tracing.

[0178] Example 3

[0179] The specific process of step 2 is:

[0180] Step 2.1, for structured data such as the three-inspection table of railway tunnel construction specifications, design the storage structure of the MySQL database and store the structured data directly into the MySQL database.

[0181] The three inspection forms for railway tunnel construction specifications are designed with fields including project name, surrounding rock grade, project location, process name, construction quality acceptance standard name and number, inspection content, design requirements, on-site inspection situation, inspection structure, inspector, inspection date, and whether to agree to enter the next process.

[0182] Step 2.2: For the construction tunnel face image and file unstructured data, first store them in the file storage system. Then store the metadata of the relevant files in the MySQL database design table, and the fields include: file name, file hash, person in charge, upload time, file size, file type, and storage path.

[0183] Example 4

[0184] The specific process of step 3 is:

[0185] Step 3.1, first, each log record has a timestamp, and the authorized user is retrieved from the timestamp of the last stored data. Then, the log hash is generated from these logs using the hash encryption algorithm, and finally these log hashes are encrypted and backed up to ensure the security of the log content.

[0186] Step 3.2: Store the log hash generated in step 3.1 together with the timestamp information of this log in the MySQL database table to ensure the confidentiality and traceability of the log data.

[0187] Example 5

[0188] The specific process of step 4 is:

[0189] Step 4.1, for each row of data records stored in the MySQL database in step 2.1, a unique data record hash is generated.

[0190] Step 4.2, for each file stored in step 2.2, a hash is generated to ensure its integrity and uniqueness. First, the hash of the file is calculated to ensure its integrity, and then the file is stored in the file database, and the storage location of the file, the hash of the file, the log hash generated by the file database and the timestamp are recorded in the MySQL database, and a unique data record hash is generated for each row of data records corresponding to the MySQL database.

[0191] In step 4.3, whether it is structured data or unstructured data, upload the data record hash, the log hash generated in step 3, the timestamp, the uploader identity, the upload time, and the previous block transaction ID related to the current transaction to the Fabric blockchain. Each upload transaction will generate a unique block transaction ID.

[0192] Step 4.4: Store the block transaction ID generated in step 4.3 into a row of data records corresponding to the MySQL database and create an index.

[0193] Example 6

[0194] The specific process of step 5 is: regularly regenerate hashes for the MySQL data records of the structured data in 2.1 and the file data in the unstructured data in step 2.2, and compare them with the corresponding hashes stored in the blockchain in step 4. If the hash comparison is inconsistent, there is tampering. First, use the backup data to quickly restore to the most recent consistent state of the data, and then upload the restored data back to the blockchain. Next, immediately start the accountability process to find the user's specific tampering operations. If the hash comparison passes, the historical operation traceability of the relevant transaction can be carried out normally.

[0195] Example 7

[0196] The specific process of step 6 is:

[0197] Step 6.1: For the tampered file data, use a difference comparison tool such as WinMerge to intuitively display the differences between files and quickly identify the tampered parts.

[0198] Step 6.2: For tampered image data, the improved IML-ViT method is used to quickly compare the differences. Based on the ViT architecture, the basic framework of the residual module Re-ViT is integrated, and the skeleton structure ViT of the IML-ViT method is replaced to form the IML-ReViT framework.

[0199] Step 6.2.1, the image data to be tampered with Zero pad to Where h and w correspond to the height and width of the tampered image X, respectively, and H and W correspond to the height and width after padding. In the implementation, H=W=1024 is used as a constant.

[0200] Step 6.2.2: X obtained in step 6.2.1 p Passed to the Re-ViT encoder, the feature vector G of the output image e .

[0201] The ViT encoder consists of multiple Transformer encoders, each of which contains multiple attention layers and MLP layers. The Re-ViT encoder is an improvement on the multi-head attention mechanism inside the Transformer encoder in ViT.

[0202] First, for X p Perform a linear transformation to generate a query (Q n ), key (K n ) and value (V n ) vector, first calculate the dot product between the query and the key, scale it by the square root of q to prevent gradient vanishing (where q represents the dimension of the vector), and get the raw attention score vector S n :

[0203]

[0204] Convert these scores to the [0,1] interval through the softmax function to obtain the attention weight matrix A n :

[0205] A n =Softmax(S n ) (twenty one)

[0206] Aggregate the value matrix V using the attention weights n , and get the output feature X ne :

[0207] X ne =A n V n (twenty two)

[0208] The improved Re-ViT performs residual connection in the multi-head attention module of each Transformer in Figure 4(a), as indicated by the dotted line in Figure 4(b), which is transmitted from the previous multi-head attention layer to the current multi-head attention layer during the aggregation process.

[0209]

[0210] Among them, α is a learnable gating variable, α∈[0,1]. In order to obtain a balanced attention score S n After that, according to equation (20), the softmax function is applied to calculate the attention weight A required to obtain the new scaled dot product attention output n .

[0211] The MLP receives an input X ne And generate the output feature X of layer n n+1 :

[0212] X n+1 =MLP(X ne ) (twenty four)

[0213] Finally, the feature vector G of the image is generated from the MLP of the last Transformer encoder e .

[0214] Step 6.2.3, finally obtain a single output feature map G in step 6.2.2 e , using a simple feature pyramid network (SFPN). A series of convolution and deconvolution layers are used for upsampling and downsampling to obtain a multi-scale feature map F k :

[0215]

[0216] Among them, k is used to represent the multi-scale feature map F k Different scales of C k is the number of convolution stages, C s is the output channel dimension of each layer in SFPN.

[0217] Step 6.2.4, then use the lightweight MLP decoder in IML-ViT and concatenate all features together, fuse all layers and make the final prediction:

[0218]

[0219] Among them, W k and b k represents the weight matrix and bias vector of the linear transformation, P represents the predicted probability map of the tampered area; ⊙ represents the series operation, and MLP represents the MLP module.

[0220] Step 6.2.5, optimize the model. Use expansion and erosion Mathematical morphological operations generate an edge mask M of the real mask image M corresponding to the tampered image * :

[0221]

[0222] Where B(λ) is a structure element that generates a (2λ+1)×(2λ+1) cross matrix where only the λth column and λth row have values ​​of 1, and the rest of the matrix contains 0. λ is the radius of the structure element.

[0223] For the true value mask M and the edge mask M * The images are zero-padded to H×W size. They are referred to as Mp and M p * . Then use the following formula to calculate the final loss:

[0224] L=L seg (P, M p ) +β·L edge (P*M p , M p *M p ) (28)

[0225] Where * represents the dot-wise product, which masks the original image. seg and L edge Both are binary cross entropy loss functions, and β is a hyperparameter that controls the balance between segmentation and edge detection losses. By default, β=20 is set to guide the model to focus on edge regions. The entire model is optimized based on the calculated loss.

[0226] Step 6.2.6, predict the predicted probability map P of the tampered area based on the model optimized in step 6.2.5, and quickly find the inconsistency of the tampered data. Once the specific tampering information is found, the error can be corrected afterwards based on this information. The experimental results of some models are shown in Table 1 (F 1 is the harmonic mean of precision and recall).

[0227] Table 1 Comparative experimental results of some models

[0228] method Pre-trained models <![CDATA[F 1 (%)]]> RGB-N,CVPR18 ImageNet 40.8 SPAN,ECCV20 Privatesynthesizeddataset 38.2 Objectformer,CVPR22 Privatesynthesizeddataset 57.9 IML-ViT MAEonImageNet-1k 73.4 IML-ReViT (the present invention) MAEonImageNet-1k 73.6

[0229] Example 8

[0230] The specific process of step 7 is:

[0231] Use the transaction ID stored in the blockchain to trace each version of the transaction. The specific process is as follows Figure 5As shown. First, the system determines the block transaction ID to be traced and searches for it in the blockchain. After the integrity check is performed in step 5, the construction quality data is traced through the previous related block transaction ID stored in the database. Then the integrity check of step 5 is performed on the stored data corresponding to the previous block transaction ID. If the hash is inconsistent, it indicates that the data may have been tampered with. The system will start the fast traceability and recovery mechanism in step 6 to track and recover the tampered data. If the hash comparison is consistent, it will continue to search in the blockchain according to the previous block transaction ID of the current block transaction ID. By looping the above steps until the first version of the transaction is traced back, the complete transaction link information is obtained. Since each block of the blockchain generates the ID value of the previous transaction, a chain data structure is formed, starting from a transaction record, and tracing forward one by one through its recorded previous transaction ID. Through the chain search method, the entire data change process can be traced back, from the latest transaction to the initial state.

Claims

1. A railway construction quality data security management method based on blockchain, characterized by: The specific steps include: Step 1: Acquire the tunnel face image under construction, pre-process the tunnel face image, identify and eliminate similar images; Step 2, storing the structured data, file data and pre-processed construction images; Step 3, performing log security encryption on the log information generated by storing the construction quality data in step 2; Step 4, generating a file hash and a MySQL data record hash corresponding to the construction quality data stored in step 2; Step 5, performing integrity check on the construction quality data stored in step 2 to determine whether the construction quality data has been tampered with; Step 6, locating the tampered construction quality data; Step 7: Conduct transaction traceability for construction quality data that has not been tampered with.

2. The railway construction quality data security management method based on blockchain according to claim 1 is characterized by: The specific process of step 1 is as follows: Step 1.1: Image the face of the tunnel Divide into N non-overlapping small blocks Where i = 1, 2, ..., N, m 2 =Nb 2 , where m is the width and height of image I, c is the number of color channels, b is the side length of each small block, I i is the i-th small block of image I, with dimensions b×b×c; the i-th small block I of the input i Flattened into a vector Where d = cb 2 , i = 1, 2, ..., N, for each vector V i Perform linear projection to generate projection embedding PE i : PE i =V i ×W PE (1) in, is the parameter matrix, is the projection embedding corresponding to the i-th small block, de is the embedding dimension of the projection; the projection embedding of the entire face image I is Step 1.2, introduce a category token embedding As a learning parameter, it is initialized to zero and concatenated with the projected embedding PE generated in step 1.1 to generate the extended embedding EE in the first dimension: EE = [CT, PE] (2) Embed the location As a learning parameter, it is initialized to zero and added to the expanded embedding to finally generate the projected embedding h0: h0 = dropout(EE + PoE, 0.1) (3) Step 1.3: Input the final output h0 of step 1.2 into an encoder consisting of a stack of L Transformer blocks. The input of the first Transformer block T1 is the final projected embedding h0 of step 1.2; the last block T L The output of is the hidden state h L ; Step 1.4: convert the final output h of step 1.3 into L Input into the feature pyramid network, and then use the multi-layer perceptron to fuse and transform the output of the feature pyramid network to generate a fixed-length feature vector F: F=MLP(FPN(h L )) (4) Step 1.5, assign different levels to the feature vector F generated in step 1.4, and find similar images through the assigned levels according to the similarity metric; Step 1.6, traverse each feature vector F, and assign the level L to each image feature vector F according to step 1.5 ith , generate a hierarchical index graph, in which a greedy search is used to identify the nearest neighbors of each inner layer. The search starts from the top layer with the input network entry point, and then iterates to lower layers until the second lowest layer is reached. Finally, at the bottom layer of the network, the g neighbors closest to the query point are retrieved according to the distance. The similarity between the query image and the retrieved nearest neighbor is measured by calculating the Euclidean distance between the query image and the retrieved nearest neighbor. The deduplication efficiency DE is used to measure the deduplication effect, as shown in the following formula (5); the predetermined threshold is dynamically adjusted according to the deduplication efficiency DE. If the similarity between the retrieved image and the query image exceeds the preset threshold, the system will automatically delete these similar images; if the similarity is lower than the threshold, the image should be saved, and the feature vector of each accepted image is added to the feature database: DE=(1-ε)×per+ε×(1-V dpre ) (5) Where, per represents the percentage of deduplication, V dpre is the percentage drop in average precision caused by ViT training after deduplication, and ε is a weighting factor between 0 and 1.

3. The railway construction quality data security management method based on blockchain according to claim 2 is characterized in that: The specific process of step 1.3 is as follows: Step 1.3.1: Input the projection embedding h0 of the output of step 1.2 into the first Transformer block T1 for layer normalization, and output feature Step 1.3.2, input the feature l0 output in step 1.3.1 into the multi-head self-attention layer. In the multi-head self-attention layer, l0 is output through three different linear transformations: S t = l0×W t (6) in, Where t = {Q, K, V}, W t is the learned weight matrix for linear projection; In S Q and S K Perform matrix multiplication between them to produce an output matrix S QK , the attention head size A S The square root of is normalized to: Then use the softmax function to calculate the attention weight A w : A w = softmax(S QK ) (6) S v With attention weight A w Perform calculations to generate attention weighted features F A for: F A = A w ×S V (7) In F A Apply a learning parameter W A The linear projection of the self-attention module is obtained S : F S =F A ×W A (8) Step 1.3.3, the Transformer block transforms the output F of step 1.3.2 S Add to input h0 to generate residual connection F R : F R = h0 + F S (9) Step 1.3.4, connect the residual F generated in step 1.3.3 R Using layer normalization, the output of this layer is l of the same dimension R , will l R Input to the multi-layer perceptron, output feature F MLP : F MLP =DropOut(Linear2,(GELU(Linear1,(l R )) (10) Among them, Linear1 is the first linear transformation layer in the multi-layer perceptron, GELU is the activation function, and Linear2 is the second linear transformation layer in the MLP; The output h1 of the first Transformer block is produced using a residual connection: h1 = F R + F MLP (11) In the formula, is the output of the multi-layer perceptron, F R is the output of the first residual connection; Step 1.3.5: Input the output h1 of the first Transformer block in step 1.3.4 into the remaining L-1 Transformer blocks in sequence, and repeat steps 1.3.1 to 1.3.4 to obtain the output h1 of the last Transformer block. L .

4. The railway construction quality data security management method based on blockchain according to claim 3 is characterized by: The specific process of step 1.5 is as follows: Step 1.5.1, calculate the Euclidean distance D(F,C) between the feature vector F of each image generated in step 1.4 and the average value C of all feature vectors, as shown in the following formula (12): Among them, F r and C r are the rth elements in vectors F and C respectively, and η is the length of the vector; Step 1.5.2, calculate the upper bound ub and lower bound lb of the feature vector F according to the Euclidean distance D(F,C) obtained in step 1.5.1, where the lower bound lb is the minimum value of all Euclidean distances D(F,C), and the upper bound ub is calculated using the following formula (13): ub=avg+f×σ (13) Where f is the outlier factor, avg is the average value of the Euclidean distance, and σ is the standard deviation of the Euclidean distance. The distance r between each level is calculated by the following formula (14): The level L where the feature vector F of each image is located is calculated by the following formula (15): ith : The number of layers L is determined by the number of input feature vectors M per layer. num , the feature vector F of each image is assigned to a level L ith , L num The calculation process is as follows:

5. The railway construction quality data security management method based on blockchain according to claim 4 is characterized in that: The specific process of step 2 is: Step 2.1, for the structured data in the railway tunnel construction specification, design the storage structure of the MySQL database and store the structured data directly into the MySQL database; Step 2.2: For the construction tunnel face image and file unstructured data, first store them in the file storage system, and then store the metadata of the relevant files in the MySQL database design table.

6. The railway construction quality data security management method based on blockchain according to claim 5 is characterized by: The specific process of step 3 is as follows: Step 3.1: Since each log record has a timestamp, retrieve the addition, deletion and modification logs generated by the authorized user since the timestamp of the last stored data. Then, use the hash encryption algorithm to generate log hashes from these addition, deletion and modification logs, and finally encrypt and back up these log hashes. Step 3.2: Store the log hash generated in step 3.1 together with the timestamp information of this log in the MySQL database table to ensure the confidentiality and traceability of the log data.

7. The railway construction quality data security management method based on blockchain according to claim 6 is characterized by: The specific process of step 4 is as follows: Step 4.1, generating a unique data record hash for each row of data records stored in the MySQL database in step 2.1; Step 4.2, generating a file hash for each file stored in step 2.2, and then storing the file in the file database, and recording the storage location of the file, the hash of the file, the log hash generated by the file database and the timestamp in the MySQL database, and generating a unique data record hash for each row of data records corresponding to the MySQL database; Step 4.3, upload the MySQL data record hash of the structured data in step 2.1 and the file hash of the unstructured data in step 2.2, as well as the log hash, timestamp, uploader identity, upload time, and the previous block transaction ID related to the current transaction generated in step 3 to the Fabric blockchain. Each upload transaction will generate a unique block transaction ID; Step 4.4, store the block transaction ID generated in step 4.3 into a row of data records corresponding to the MySQL database and create an index.

8. The railway construction quality data security management method based on blockchain according to claim 7 is characterized by: The specific process of step 5 is as follows: Regularly regenerate hashes for the MySQL data records of the structured data in step 2.1 and the file data in the unstructured data in step 2.2, and compare them with the corresponding hashes stored in the blockchain in step 4. If the hash comparison is inconsistent, there is tampering. For this tampering behavior, use the backup data to quickly restore to the most recent consistent state of the data, then re-upload the restored data to the blockchain, and then immediately start the accountability process to find the user's specific tampering operation and execute step 6; If the hash comparison is consistent, the historical operation traceability of the relevant transaction will be carried out normally and step 7 will be executed.

9. The railway construction quality data security management method based on blockchain according to claim 8 is characterized by: The specific process of step 6 is as follows: Step 6.1: For the tampered file data, use a difference comparison tool such as WinMerge to identify the tampered part; Step 6.2: For the tampered image data, the improved IML-ViT method is used to quickly compare the differences.

10. The railway construction quality data security management method based on blockchain according to claim 9 is characterized in that: The specific process of step 6.2 is as follows: Step 6.2.1, the image data to be tampered with Zero pad to Where h and w correspond to the height and width of the tampered image X, respectively, and H and W correspond to the height and width after padding; Step 6.2.2: X obtained in step 6.2.1 p Passed to the Re-ViT encoder, the feature vector G of the output image e ; Step 6.2.3, obtain a single output feature map G in step 6.2.2 e , a simple feature pyramid network is used, and convolution and deconvolution layers are used for upsampling and downsampling to obtain a multi-scale feature map F k : Among them, k is used to represent the multi-scale feature map F k Different scales of C k is the number of convolution stages, C s is the output channel dimension of each layer in SFPN; Step 6.2.4, then use the lightweight MLP decoder in IML-ViT and concatenate all features together, fuse all layers and make the final prediction: Among them, W k and b k represents the weight matrix and bias vector of the linear transformation, P represents the predicted probability map of the tampered area; ⊙ represents the serial operation, and MLP represents the MLP module; Step 6.2.5, Use dilation and erosion Mathematical morphological operations generate an edge mask M of the real mask image M corresponding to the tampered image * : Where B(λ) is a structural element that generates a (2λ+1)×(2λ+1) cross matrix, where only the λth column and the λth row have values ​​of 1, and the rest of the matrix contains 0s, and λ is the radius of the structural element; For the true value mask M and the edge mask M * The image is zero-padded to H×W size, referred to as M p and M p * Then the final loss is calculated using the following formula (20): L=L seg (P, M p ) +β·L edge (P*M p , M p *M p ) (20) Among them, * represents the point-by-point product, L seg and L edge Both are binary cross entropy loss functions, and β is a hyperparameter that controls the balance between segmentation and edge detection losses; Step 6.2.6, predict the predicted probability map P of the tampered area based on the model optimized in step 6.2.5, and find the tampered information.