Fire-fighting equipment-oriented data storage method and device

Through the data proof storage method for fire-fighting equipment, blockchain technology is used to store the operating data and operation records of fire-fighting equipment on the off-chain server, and an untamperable storage block is created on the blockchain, which solves the problem of poor immutability of fire-fighting equipment data records and difficulty in retaining all operating data, realizing data security and integrity.

CN119865307AActive Publication Date: 2025-04-22ZHONGAN IND INTERNET (CHENGDU) CO LTD

Patent Information

Application Number
CN202510355035.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-04-22
Estimated Expiration
2045-03-25

AI Technical Summary

Technical Problem

The data recording method of existing fire-fighting equipment has the problem that data recording is poorly unchangeable and it is difficult to retain and store all operating data of the fire-fighting equipment.

Method used

Using a data proof-keeping method for fire-fighting equipment, a public and private key is generated by obtaining the operation data and operation records of the fire-fighting equipment, the operation data, operation records and public keys are formed into a first data pair, and the operation records are hashed to generate the original hash code. The second pair of data is stored in the off-chain server, and the original hash code is encrypted using the public key to generate the operation ciphertext. The group operation under the generator and random steps is used to generate the storage block identifier, create the storage block on the blockchain, and store the operation ciphertext into the storage block.

Benefits of technology

It realizes the storage of all operating data of the fire-fighting equipment, and ensures the immutability of operation records through the immutable characteristics of the blockchain, solving the problem that data storage results are easily modified in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865307A_ABST
    Figure CN119865307A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data storage, in particular to a data storage method and device for fire fighting equipment. The method comprises the following steps: acquiring operation data and operation records of fire fighting equipment, generating a public key and a private key, and forming a first data pair by the operation data, the operation records and the public key; performing hash processing on the operation record in the first data pair to obtain an original hash code H, and recombining the original hash code H and the first data pair into a second data pair; storing the second data pair into an off-chain server, and encrypting an original hash code in the second data pair by using a public key to obtain an operation ciphertext; generating a storage block identifier by utilizing the generator and the group operation under the random step number; and creating a storage block on the block chain according to the storage block identifier, and storing the operation ciphertext into the storage block. Data storage is carried out by adopting an on-chain and off-chain combined storage mode, all operation data of the fire-fighting equipment can be stored, and the non-modifiability of the operation record of the fire-fighting equipment is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data evidence storage, and in particular to a data evidence storage method for fire-fighting equipment. Background Art

[0002] Firefighting equipment plays a very important role in fire prevention and control. With the continuous development of Internet of Things technology, firefighting equipment has begun to become diversified and intelligent, such as intelligent smoke sensing systems, automatic fire extinguishing sprinklers, etc. These devices have a large number of sensors. The sensing accuracy of these sensors is not only affected by the performance of the sensors themselves, but also by the degree of standardization of the use and maintenance by the users. When a fire occurs, the firefighting equipment may not work. During the investigation, the responsibility for equipment failure is often attributed to the equipment manufacturer. This practice ignores the impact of irregular use factors on equipment performance. Therefore, whether it is the division of equipment responsibility or the tracing of the cause of the fire, data should be recorded at all stages of the use of firefighting equipment.

[0003] Regarding the data recording of the use process of fire-fighting equipment, the existing methods mainly record the use process through database storage or manual recording. These two methods have a common problem, that is, the immutability of the recorded results is poor. The reason for the poor immutability of manual recording is obvious. As long as you have the record book or the way to obtain the record book, you can change the recorded results. For database-type recording methods, the results can be changed by brute force cracking the database administrator account password and SQL injection. Both methods have the possibility of data tampering. In addition, fire-fighting equipment will generate a large amount of operation data. Due to storage performance reasons, the existing technology can only store part of the data and cannot retain all the characteristics of the operation data. Summary of the invention

[0004] To this end, the present invention provides a data storage method for fire-fighting equipment, which helps to solve the problems of existing data recording methods for fire-fighting equipment, such as poor immutability of data records and difficulty in retaining and storing all operating data of fire-fighting equipment.

[0005] In a first aspect, the present invention provides a data evidence storage method for fire-fighting equipment, comprising: Acquire operation data and operation records of fire-fighting equipment, generate a public key and a private key, and form a first data pair with the operation data, operation records and public key; Performing hash processing on the operation record in the first data pair to obtain an original hash code H, and recombining the original hash code H and the first data pair into a second data pair; The second data pair is stored in the off-chain server, and the original hash code H in the second data pair is encrypted using the public key to obtain the operation ciphertext; Generate storage block identifiers using generators and group operations under random steps; A storage block is created on the blockchain according to the storage block identifier, and the operation ciphertext is stored in the storage block.

[0006] Furthermore, the acquisition of the operation data and operation records of the fire-fighting equipment, and the generation of a public key and a private key, and the combination of the operation data, the operation records and the public key into a first data pair, includes: Collecting operation data of fire-fighting equipment, wherein the operation data includes external environment data and equipment data; Generate the public key pk and private key sk for data encryption and decryption based on the preset asymmetric algorithm; Record the user's operation data on the fire-fighting equipment in real time to obtain the operation record R, which includes the user's operation A, the operation time T and the equipment identification code containing the manufacturer's information; The operation data, the public key pk and the operation record R within a preset time period are combined to obtain a first data pair (data, pk, R).

[0007] Further, the generating of the storage block identifier by using the group operation under the generator and the random step number includes: Get the generator g and group operation G set by the fire equipment generator; Generate an initial data block b0 and determine the identifier of the initial data block b0 ; By logo As the starting point, a group operation G with a random number of steps is performed through the generator g to generate a storage block identifier .

[0008] Furthermore, creating a storage block on the blockchain according to the storage block identifier and storing the operation ciphertext in the storage block includes: Creating a storage block for storing the operation ciphertext on the blockchain according to the storage block identifier, connecting the storage block with the previous storage block in a linked list to form a storage chain, and recording the time when the storage blocks are connected; After the storage block is created, the operation ciphertext is uploaded to the blockchain and stored in the corresponding storage block.

[0009] Furthermore, the data evidence storage method also includes: Randomly select n storage blocks in the storage chain, perform maximum step group operations on storage block identifiers corresponding to the randomly selected n storage blocks, and determine whether the maximum step group operation results of the n storage blocks are all equal; If they are equal, it is determined that the data storage is correct; if they are not equal, it is determined that the data storage is incorrect.

[0010] Furthermore, the data evidence storage method also includes: Extract the operation ciphertext from the specified storage block on the blockchain, decrypt the operation ciphertext using the private key, obtain the corresponding original hash code, and use the original hash code as the data verification hash code H'; According to the data verification hash code H', the original hash code is matched in the off-chain server. If the corresponding original hash code H can be matched, the operation ciphertext in the storage block is considered correct. If the corresponding original hash code H cannot be matched, the operation ciphertext in the storage block is considered incorrect.

[0011] Furthermore, the data evidence storage method also includes: According to the query time period t specified by the user, the storage blocks on the blockchain are retrieved to obtain the storage block group within the query time period t; Verify the storage correctness and data correctness of the storage block group. If the verification fails, generate a failure certificate and issue it to the user; If the verification is passed, the operation ciphertext stored in each storage block in the storage block group is decrypted using the private key to obtain the corresponding original hash code H, and the corresponding second data pair is queried in the off-chain server according to the original hash code H; Extract the operation record R from the second data pair, and use the hash function in the hands of the fire equipment manufacturer to calculate the secondary hash code of the operation record ; For the secondary hash code A consistency comparison is performed with the original hash code H. If they are consistent, it is determined that the user operation corresponding to the operation record R within the query time period t is credible, and a certificate of authentication is issued to the user. If they are inconsistent, a certificate of authentication failure is issued to the user.

[0012] In a second aspect, the present application provides a data evidence storage device for fire-fighting equipment, comprising: A data acquisition module, used to obtain operation data and operation records of fire-fighting equipment, and generate a public key and a private key, and form a first data pair with the operation data, operation records and public key; a data reorganization module, performing hash processing on the operation record in the first data pair to obtain an original hash code H, and reorganizing the original hash code H and the first data pair into a second data pair; The off-chain storage module is used to store the second data pair in the off-chain server, and encrypt the original hash code H in the second data pair using the public key to obtain the operation ciphertext; An identification generation module, used for generating a storage block identification by using a generator and a group operation under a random step number; The on-chain storage module is used to create a storage block on the blockchain according to the storage block identifier, and store the operation ciphertext into the storage block.

[0013] Furthermore, the data evidence storage device further includes a data verification module, which includes a storage verification unit and a data checking unit; wherein, The storage verification unit is used to randomly extract n storage blocks in the storage chain, and perform maximum step group operations on the storage block identifiers corresponding to the randomly extracted n storage blocks, and determine whether the maximum step group operation results of the n storage blocks are all equal. If they are equal, it is determined that the data storage is correct; if they are not equal, it is determined that the data storage is incorrect; The data verification unit is used to extract the operation ciphertext from the specified storage block on the blockchain, decrypt the operation ciphertext using the private key, obtain the corresponding original hash code, and use the original hash code as the data verification hash code H', and perform original hash code matching in the off-chain server based on the data verification hash code H'. If the corresponding original hash code H can be matched, the operation ciphertext in the storage block is considered correct. If the corresponding original hash code H cannot be matched, the operation ciphertext in the storage block is considered incorrect.

[0014] Furthermore, the data evidence storage device further includes an evidence generation module, which is used to generate evidence of the credibility of user operations, specifically including: According to the query time period t specified by the user, the storage blocks on the blockchain are retrieved to obtain the storage block group within the query time period t; Verify the storage correctness and data correctness of the storage block group. If the verification fails, generate a failure certificate and issue it to the user; If the verification is passed, the operation ciphertext stored in each storage block in the storage block group is decrypted using the private key to obtain the corresponding original hash code H, and the corresponding second data pair is queried in the off-chain server according to the original hash code H; Extract the operation record R from the second data pair, and use the hash function in the hands of the fire equipment manufacturer to calculate the secondary hash code of the operation record ; For the secondary hash code A consistency comparison is performed with the original hash code H. If they are consistent, it is determined that the user operation corresponding to the operation record R within the query time period t is credible, and a certificate of authentication is issued to the user. If they are inconsistent, a certificate of authentication failure is issued to the user.

[0015] The beneficial effects of the present invention are reflected in that the present invention performs data notarization through the joint storage of on-chain and off-chain, stores the complete operation data and operation records of the fire-fighting equipment in the off-chain server, and stores the original hash code corresponding to the operation record as data proof in the block of the blockchain. All operation data of the fire-fighting equipment can be stored, and the unchangeability of the operation records of the fire-fighting equipment is guaranteed by the characteristics of the blockchain, thus solving the problem in the prior art that the data storage results of the fire-fighting equipment are easily modified. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flow chart of a data evidence storage method for fire-fighting equipment provided by the present invention; Figure 2 is a schematic diagram of a first data pair combination flow chart of the present invention; Figure 3 It is a schematic diagram of the storage block identification generation process of the present invention; Figure 4 It is a schematic diagram of the operation ciphertext storage process of the present invention; Figure 5 This is a module diagram of a data storage device for fire-fighting equipment provided by the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0018] At present, the data recording results of fire-fighting equipment are not easily modifiable. The reason for the poor immutability of manual records is obvious. As long as you have the record book or the way to obtain the record book, you can change the recorded results. However, the data cannot be verified after being changed. In addition, the manual recording method is inefficient. When faced with a large amount of fire-fighting data, it is impossible to fully record all the operating data of fire-fighting equipment, and it is difficult to trace the faults of fire-fighting equipment. At the same time, when using a database to record data, when the outside world brute-forces the database permissions or obtains the database account password, it can also modify the recorded data, and the data security cannot be truly guaranteed.

[0019] In view of this, the present invention proposes a data storage method and device for fire-fighting equipment, which is used to solve the technical problems existing in the above-mentioned existing fire-fighting equipment operation data recording method. The detailed implementation process of the present invention is shown in the following embodiments.

[0020] Embodiment 1: Reference Figure 1 As shown, this embodiment provides a data evidence storage method for fire-fighting equipment, which includes the following steps: S1: Obtaining operation data and operation records of fire-fighting equipment, and generating a public key and a private key, and combining the operation data, operation records and public key into a first data pair; S2: Perform hash processing on the operation record in the first data pair to obtain an original hash code H, and reassemble the original hash code H and the first data pair into a second data pair; S3: storing the second data pair in the off-chain server, and encrypting the original hash code H in the second data pair using the public key to obtain the operation ciphertext; S4: Generate a storage block identifier using a generator and a group operation under a random number of steps; S5: Create a storage block on the blockchain according to the storage block identifier, and store the operation ciphertext into the storage block.

[0021] Further, in the embodiment of the present invention, referring to Figure 2 As shown, in step S1, the operation data and operation records of the fire-fighting equipment are obtained, and a public key and a private key are generated, and the operation data, operation records and public key are combined into a first data pair, including but not limited to the following sub-steps: S11: Collecting the operation data of the fire fighting equipment, wherein the operation data includes external environment data and equipment data. The external environment data includes environmental data such as temperature, smoke concentration and humidity. The equipment data includes data such as current, voltage and water pressure when the fire fighting equipment is working.

[0022] S12: Generate a public key pk and a private key sk for data encryption and decryption according to a preset asymmetric algorithm.

[0023] Among them, the asymmetric encryption algorithm can adopt existing algorithms, such as RSA algorithm, DSA algorithm, ECC algorithm and DH algorithm, which can be selected according to actual conditions, and the embodiments of the present invention will not be described in detail here.

[0024] S13: Record the user's operation data on the fire-fighting equipment in real time to obtain the operation record R. The operation record R includes the user's operation A, the operation time T and the equipment identification code containing the manufacturer's information.

[0025] S14: Combine the operation data, the public key pk and the operation record R within a preset time period to obtain a first data pair (data, pk, R).

[0026] Specifically, in one embodiment, when recording the user's operation data of fire-fighting equipment in real time, the user's operation can be perceived through sensors or data acquisition devices, such as collecting and recording the user's operation video or operation picture through an image sensor, and recording the user's operation time and the fire-fighting equipment information operated and other data through a computer terminal.

[0027] The embodiment of the present invention can facilitate subsequent operation tracing and troubleshooting of fire-fighting equipment by collecting operation data of fire-fighting equipment and operation data of users using fire-fighting equipment within a preset time period.

[0028] Specifically, in one embodiment, the process of performing hash processing on the operation record in the first data pair in step S2 to obtain the original hash code H specifically includes: performing hash processing on the operation record R in the first data pair (data, pk, R) using a preset hash function provided by the fire-fighting equipment manufacturer, and calculating the corresponding original hash code H.

[0029] Among them, the hash function is also called a hash function, which can change an input of any length to obtain an output of a fixed length. This fixed-length output is called the hash of the original message or message mapping. The preset hash function of the embodiment of the present invention can adopt existing hash functions such as MD5, SHA-1, SHA-256 and CRC32, or other hash functions that can calculate the hash value of data. The specific selection is based on the actual situation, and the embodiment of the present invention will not be repeated here.

[0030] Specifically, after the original hash code H is calculated, the original hash code H and the first data pair (data, pk, R) are recombined into a second data pair, and the second data pair is specifically represented as (data, pk, H, R).

[0031] Specifically, in one embodiment, in step S3 of the present invention, the second data pair (data, pk, H, R) is stored in the off-chain server, which can retain all the characteristics of the operating data, realize the storage of complete equipment operating data of the fire-fighting equipment, and provide data support for subsequent data tracing, data verification and other processes, thereby solving the problem that the existing data recording method is easily affected by the equipment storage performance and cannot retain all the operating data.

[0032] Further, in the embodiment of the present invention, referring to Figure 3 As shown, the group operation under the generator and the random step number in step S4 generates the storage block identifier, including but not limited to the following sub-steps: S41: Obtain the generator g and group operation G set by the fire equipment manufacturer. The generator g and group operation G are usually set by the manufacturer. Generator is a mathematical term. The elements in the group can be generated by the product of the minimum number of group elements. This group of group elements is called the generator of the group, and the number of generators is the rank of the finite group. Generator refers to all group elements that can be obtained by performing group operations on one or more elements, and the group operation G refers to the operation of the non-empty set group G, such as "multiplication" operation, "addition" operation, etc.

[0033] S42: Generate an initial data block b0 and determine the identifier of the initial data block b0 Among them, the logo It can be designed to be composed entirely of numbers, and the initial data block b0 is an empty data block and does not store any information.

[0034] S43: With logo As the starting point, a group operation G with a random number of steps is performed through the generator g to generate a storage block identifier The number of random steps is limited to a maximum value K.

[0035] The first storage is marked Generate storage block identifiers as a starting point The second storage is marked Generates a storage block ID for the starting point And so on, in the subsequent storage process, the previous storage block identifier is used as the starting point, and a new storage block identifier is obtained by performing a group operation G with a random number of steps through the generator g.

[0036] The embodiment of the present invention generates storage block identifiers by sequentially generating primitives and group operations, which facilitates sequential construction of a storage chain on a blockchain and ensures that the data storage order on the chain is consistent with the storage order of an off-chain server.

[0037] Further, in the embodiment of the present invention, referring to Figure 4 As shown, in step S5, a storage block is created on the blockchain according to the storage block identifier, and the operation ciphertext is stored in the storage block, including but not limited to the following sub-steps: S51: Create a storage block for storing the operation ciphertext on the blockchain according to the storage block identifier, connect the storage block with the previous storage block in the form of a linked list to form a storage chain, and record the time when the storage blocks are connected.

[0038] S52: After the storage block is created, the operation ciphertext is uploaded to the blockchain and stored in the corresponding storage block.

[0039] The embodiment of the present invention can utilize the tamper-proof property of blockchain to improve the unchangeability of operation ciphertext by storing the operation ciphertext in a storage block on the blockchain, thereby realizing the secure storage of data on the chain.

[0040] Furthermore, in one embodiment, the data storage method of the embodiment of the present invention further includes verifying the correctness of the data storage, specifically: N storage blocks are randomly selected from the storage chain, and maximum step group operations are performed on storage block identifiers corresponding to the randomly selected n storage blocks, and it is determined whether the maximum step group operation results of the n storage blocks are all equal.

[0041] If they are equal, it is determined that the data is stored correctly and the storage chain has not been illegally modified. If they are not equal, it is determined that the data is stored incorrectly, and a data anomaly prompt can be issued to the user.

[0042] The embodiment of the present invention verifies the correctness of data storage by randomly extracting storage blocks, thereby ensuring that the on-chain data has not been illegally tampered with, improving the security of on-chain data storage, and solving the problem that the data storage results of existing fire-fighting equipment are easily modified and have low security.

[0043] Furthermore, in one embodiment, the data evidence storage method of the embodiment of the present invention further includes verifying the correctness of the data, specifically: Extract the operation ciphertext from the specified storage block on the blockchain, decrypt the operation ciphertext using the private key, obtain the corresponding original hash code, and use the original hash code as the data verification hash code H'.

[0044] According to the data verification hash code H', the original hash code is matched in the off-chain server. If the corresponding original hash code H can be matched, the operation ciphertext in the storage block is considered correct. If the corresponding original hash code H cannot be matched, the operation ciphertext in the storage block is considered incorrect.

[0045] The embodiment of the present invention obtains the original hash code from the on-chain storage block and performs data matching in the off-chain server, thereby ensuring that the data in the off-chain server corresponds to the operation ciphertext stored in the on-chain server.

[0046] In addition, the operation record R in the second data pair (data, pk, H, R) in the off-chain server can also be verified based on the operation ciphertext in the on-chain storage block to see if it has been tampered with. Specifically, the operation ciphertext E is first decrypted to obtain the original hash code H stored on the chain. Then, the hash code of the operation record R is calculated using the preset hash function provided by the fire equipment manufacturer, i.e., the data verification hash code. The original hash code is compared with the data verification hash code for consistency. Based on the comparison result, it can be determined whether the operation record R stored in the off-chain server is correct. If the two are consistent, it means that the operation record R has not been changed. If they are inconsistent, it means that the operation record R has been changed.

[0047] Furthermore, in one embodiment, the data evidence storage method of the embodiment of the present invention proposes a user operation authentication mechanism to authenticate the user's operation record and generate corresponding credentials for the division of responsibilities after the fire and the tracing of the cause of the fire. The specific process of evidence generation is as follows: According to the query time period t specified by the user, the storage blocks on the blockchain are retrieved to obtain the storage block group within the query time period t. The storage block group specifically refers to a series of storage blocks ( ,..., ).

[0048] The storage correctness and data correctness of the storage block group are verified. If the verification fails, a failure certificate is generated and issued to the user. The storage correctness and data correctness verification process of the storage block group is implemented with reference to the data storage correctness verification process and the data correctness verification process in the above embodiment, and this embodiment will not be repeated here.

[0049] If the verification passes, the private key is used to decrypt the operation ciphertext stored in each storage block in the storage block group to obtain the corresponding original hash code H, and the corresponding second data pair (data, pk, H, R) is queried in the off-chain server based on the original hash code H.

[0050] Extract the operation record R from the second data pair (data, pk, H, R), and use the hash function in the hands of the fire equipment manufacturer to calculate the secondary hash code of the operation record ; Secondary hash code A consistency comparison is performed with the original hash code H. If they are consistent, it is determined that the user operation corresponding to the operation record R within the query time period t is credible, and a certificate of authentication is issued to the user. If they are inconsistent, a certificate of authentication failure is issued to the user.

[0051] The embodiment of the present invention can prove the credibility of user operations by authenticating the user's operation records within a specified query time period, realize the traceability of fire-fighting equipment operation data, and solve the problem of lack of credible authentication of user operations in the prior art.

[0052] The embodiment of the present invention performs data notarization by means of on-chain and off-chain joint storage, stores the complete operating data and operation records of the fire-fighting equipment in the off-chain server, and stores the original hash code corresponding to the operation record as data proof in the block of the blockchain. It can store all the operating data of the fire-fighting equipment, and the unchangeability of the operation records of the fire-fighting equipment is guaranteed by the characteristics of the blockchain, thus solving the problem in the prior art that the storage results of the fire-fighting equipment data are easily modified.

[0053] Example 2 Reference Figure 5 As shown, based on the above embodiment 1, the embodiment of the present invention further provides a data evidence storage device for fire fighting equipment, the device comprising: A data acquisition module, used to obtain operation data and operation records of fire-fighting equipment, and generate a public key and a private key, and form a first data pair with the operation data, operation records and public key; a data reorganization module, performing hash processing on the operation record in the first data pair to obtain an original hash code H, and reorganizing the original hash code H and the first data pair into a second data pair; The off-chain storage module is used to store the second data pair in the off-chain server, and encrypt the original hash code H in the second data pair using the public key to obtain the operation ciphertext; An identification generation module, used for generating a storage block identification by using a generator and a group operation under a random step number; The on-chain storage module is used to create a storage block on the blockchain according to the storage block identifier, and store the operation ciphertext into the storage block.

[0054] Furthermore, the data evidence storage device of the embodiment of the present invention further includes a data verification module, which includes a storage verification unit and a data checking unit. The storage verification unit is responsible for verifying the correctness of data storage. Specifically, n storage blocks are randomly selected from the storage chain, and the storage block identifiers corresponding to the randomly selected n storage blocks are respectively subjected to the maximum step group operation, and it is determined whether the maximum step group operation results of the n storage blocks are equal. If they are equal, it is determined that the data storage is correct. If they are not equal, it is determined that the data storage is incorrect. The storage verification unit can ensure that the storage chain has not been illegally modified.

[0055] The data verification unit is responsible for verifying the correctness of the data. Specifically, it extracts the operation ciphertext from the storage block specified on the blockchain, decrypts the operation ciphertext with the private key, obtains the corresponding original hash code, and uses the original hash code as the data verification hash code H', and matches the original hash code in the off-chain server based on the data verification hash code H'. If the corresponding original hash code H can be matched, the operation ciphertext in the storage block is considered correct. If the corresponding original hash code H cannot be matched, the operation ciphertext in the storage block is considered incorrect. The data verification unit can ensure that the data in the off-chain server corresponds to the operation ciphertext stored in the on-chain server.

[0056] Furthermore, the data evidence storage device of the embodiment of the present invention further includes an evidence generation module, which is used to generate evidence of the credibility of user operations, specifically including: According to the query time period t specified by the user, the storage blocks on the blockchain are retrieved to obtain the storage block group within the query time period t; Verify the storage correctness and data correctness of the storage block group. If the verification fails, generate a failure certificate and issue it to the user; If the verification is passed, the operation ciphertext stored in each storage block in the storage block group is decrypted using the private key to obtain the corresponding original hash code H, and the corresponding second data pair (data, pk, H, R) is queried in the off-chain server according to the original hash code H; Extract the operation record R from the second data pair (data, pk, H, R), and use the hash function in the hands of the fire equipment manufacturer to calculate the secondary hash code of the operation record ; For the secondary hash code A consistency comparison is performed with the original hash code H. If they are consistent, it is determined that the user operation corresponding to the operation record R within the query time period t is credible, and a certificate of authentication is issued to the user. If they are inconsistent, a certificate of authentication failure is issued to the user.

[0057] In addition, in other embodiments of the present invention, when performing trusted authentication on data operations, the specific operation data in the second data pair (data, pk, H, R) can also be analyzed to determine how to check the operation behavior in the user operation record according to the preset operation standard, and determine whether the user operation meets the preset operation standard, and then determine whether the user operation violates the regulations, etc., thereby further improving the credibility of the user operation authentication.

[0058] The data evidence storage device provided by the embodiment of the present invention adopts a storage method based on blockchain, and in order to improve storage performance, the form of joint storage on the chain and off the chain is adopted to store the complete device operation data in the off-chain storage server, and the proof of the data is stored in the on-chain block. For the on-chain storage that is open to all participants, the corresponding storage block identifier is generated by the group operation G under the generator g and the random step number, and the storage blocks are connected in the form of a linked list according to the time when the storage blocks were generated, so that the information such as the generation time of the storage blocks can be traced back.

[0059] In addition, for the correctness verification of on-chain storage, the embodiment of the present invention randomly extracts n storage blocks from a storage chain, performs a maximum step group operation on the identifiers of the extracted storage blocks, and determines whether the identifiers of the storage blocks are equal after the operation is completed. If they are equal, it is considered that the storage is correct and the storage chain has not been illegally modified. For data correctness verification, the embodiment of the present invention extracts the ciphertext data in the specified storage block, that is, the operation ciphertext, decrypts the operation ciphertext with a private key to obtain the original hash code H, and searches the off-chain server for a matching original hash code H. If so, the data is considered correct. In addition, the embodiment of the present invention also authenticates the user's operation records and generates corresponding credentials for the division of responsibilities after a fire and tracing the cause of the fire, further reducing the impact of irregular use factors on device performance.

[0060] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A data evidence storage method for fire-fighting equipment, characterized in that: include: Acquire operation data and operation records of fire-fighting equipment, generate a public key and a private key, and form a first data pair with the operation data, operation records and public key; Performing hash processing on the operation record in the first data pair to obtain an original hash code H, and recombining the original hash code H and the first data pair into a second data pair; The second data pair is stored in the off-chain server, and the original hash code H in the second data pair is encrypted using the public key to obtain the operation ciphertext; Generate storage block identifiers using generators and group operations under random steps; A storage block is created on the blockchain according to the storage block identifier, and the operation ciphertext is stored in the storage block.

2. The data storage method for fire-fighting equipment according to claim 1 is characterized in that: The obtaining of the operation data and operation records of the fire-fighting equipment, and generating a public key and a private key, and combining the operation data, the operation records and the public key into a first data pair, comprises: Collecting operation data of fire-fighting equipment, wherein the operation data includes external environment data and equipment data; Generate the public key pk and private key sk for data encryption and decryption based on the preset asymmetric algorithm; Record the user's operation data on the fire-fighting equipment in real time to obtain the operation record R, which includes the user's operation A, the operation time T and the equipment identification code containing the manufacturer's information; The operation data, the public key pk and the operation record R within a preset time period are combined to obtain a first data pair (data, pk, R).

3. The data storage method for fire-fighting equipment according to claim 1 is characterized in that: The method of generating a storage block identifier by using a group operation under a generator and a random number of steps includes: Get the generator g and group operation G set by the fire equipment generator; Generate an initial data block b0 and determine the identifier of the initial data block b0 ; By logo As the starting point, a group operation G with a random number of steps is performed through the generator g to generate a storage block identifier .

4. The data evidence storage method for fire-fighting equipment according to claim 1 is characterized in that: The step of creating a storage block on the blockchain according to the storage block identifier and storing the operation ciphertext in the storage block includes: Creating a storage block for storing the operation ciphertext on the blockchain according to the storage block identifier, connecting the storage block with the previous storage block in a linked list to form a storage chain, and recording the time when the storage blocks are connected; After the storage block is created, the operation ciphertext is uploaded to the blockchain and stored in the corresponding storage block.

5. The data storage method for fire-fighting equipment according to claim 1 is characterized in that: Also includes: Randomly select n storage blocks in the storage chain, perform maximum step group operations on storage block identifiers corresponding to the randomly selected n storage blocks, and determine whether the maximum step group operation results of the n storage blocks are all equal; If they are equal, it is determined that the data storage is correct; if they are not equal, it is determined that the data storage is incorrect.

6. The data storage method for fire-fighting equipment according to claim 1 is characterized in that: Also includes: Extract the operation ciphertext from the specified storage block on the blockchain, decrypt the operation ciphertext using the private key, obtain the corresponding original hash code, and use the original hash code as the data verification hash code H'; According to the data verification hash code H', the original hash code is matched in the off-chain server. If the corresponding original hash code H can be matched, the operation ciphertext in the storage block is considered correct. If the corresponding original hash code H cannot be matched, the operation ciphertext in the storage block is considered incorrect.

7. The data storage method for fire-fighting equipment according to claim 1 is characterized in that: Also includes: According to the query time period t specified by the user, the storage blocks on the blockchain are retrieved to obtain the storage block group within the query time period t; Verify the storage correctness and data correctness of the storage block group. If the verification fails, generate a failure certificate and issue it to the user; If the verification is passed, the operation ciphertext stored in each storage block in the storage block group is decrypted using the private key to obtain the corresponding original hash code H, and the corresponding second data pair is queried in the off-chain server according to the original hash code H; Extract the operation record R from the second data pair, and use the hash function in the hands of the fire equipment manufacturer to calculate the secondary hash code of the operation record ; For the secondary hash code A consistency comparison is performed with the original hash code H. If they are consistent, it is determined that the user operation corresponding to the operation record R within the query time period t is credible, and a certificate of authentication is issued to the user. If they are inconsistent, a certificate of authentication failure is issued to the user.

8. A data evidence storage device for fire-fighting equipment, characterized in that: include: A data acquisition module, used to obtain operation data and operation records of fire-fighting equipment, and generate a public key and a private key, and form a first data pair with the operation data, operation records and public key; a data reorganization module, performing hash processing on the operation record in the first data pair to obtain an original hash code H, and reorganizing the original hash code H and the first data pair into a second data pair; The off-chain storage module is used to store the second data pair in the off-chain server, and encrypt the original hash code H in the second data pair using the public key to obtain the operation ciphertext; An identification generation module, used for generating a storage block identification by using a generator and a group operation under a random step number; The on-chain storage module is used to create a storage block on the blockchain according to the storage block identifier, and store the operation ciphertext into the storage block.

9. The data storage device for fire-fighting equipment according to claim 8 is characterized in that: It also includes a data verification module, which includes a storage verification unit and a data checking unit; wherein, The storage verification unit is used to randomly select n storage blocks in the storage chain, and perform maximum step group operations on the storage block identifiers corresponding to the randomly selected n storage blocks, and determine whether the maximum step group operation results of the n storage blocks are all equal. If they are equal, it is determined that the data storage is correct; if they are not equal, it is determined that the data storage is incorrect; The data verification unit is used to extract the operation ciphertext from the specified storage block on the blockchain, decrypt the operation ciphertext using the private key, obtain the corresponding original hash code, and use the original hash code as the data verification hash code H', and perform original hash code matching in the off-chain server based on the data verification hash code H'. If the corresponding original hash code H can be matched, the operation ciphertext in the storage block is considered correct. If the corresponding original hash code H cannot be matched, the operation ciphertext in the storage block is considered incorrect.

10. The data evidence storage device for fire fighting equipment according to claim 8, characterized in that: It also includes a proof generation module, which is used to generate proof of the credibility of user operations, specifically including: According to the query time period t specified by the user, the storage blocks on the blockchain are retrieved to obtain the storage block group within the query time period t; Verify the storage correctness and data correctness of the storage block group. If the verification fails, generate a failure certificate and issue it to the user; If the verification is passed, the operation ciphertext stored in each storage block in the storage block group is decrypted using the private key to obtain the corresponding original hash code H, and the corresponding second data pair is queried in the off-chain server according to the original hash code H; Extract the operation record R from the second data pair, and use the hash function in the hands of the fire equipment manufacturer to calculate the secondary hash code of the operation record ; For the secondary hash code A consistency comparison is performed with the original hash code H. If they are consistent, it is determined that the user operation corresponding to the operation record R within the query time period t is credible, and a certificate of authentication is issued to the user. If they are inconsistent, a certificate of authentication failure is issued to the user.

Citation Information

Patent Citations

  • Electronic evidence obtaining device and method based on block chain in Internet-of-Vehicles environment

    CN111464980A

  • Big data supervision method based on block chain technology

    CN114900534A

  • Data storage method and device, computer equipment and storage medium

    CN115374467A

  • Block chain-based data security sharing method, system and device, and medium

    CN117195309A

  • Cross-alliance chain-oriented privacy protection data element transaction auditing method

    CN118940312A

Cited By

  • Block chain-based blood safety whole-course tracing system and method

    CN120895187A