CN112632619A - Cross-link certificate storage method and device, terminal equipment and storage medium - Google Patents

Cross-link certificate storage method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN112632619A
CN112632619A CN202011618442.4A CN202011618442A CN112632619A CN 112632619 A CN112632619 A CN 112632619A CN 202011618442 A CN202011618442 A CN 202011618442A CN 112632619 A CN112632619 A CN 112632619A
Authority
CN
China
Prior art keywords
chain
cross
transaction
hash
hashes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011618442.4A
Other languages
Chinese (zh)
Inventor
邱炜伟
李伟
蔡亮
汪小益
匡立中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202011618442.4A priority Critical patent/CN112632619A/en
Publication of CN112632619A publication Critical patent/CN112632619A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes

Abstract

The application is applicable to the technical field of block chains, and particularly relates to a cross-chain evidence storing method and device, terminal equipment and a storage medium. According to the method, N transaction hashes to be subjected to chain crossing of the sub-chain certificate storage are obtained, the chain crossing transaction hashes are determined according to the N transaction hashes to be subjected to chain crossing, the chain crossing transaction hashes are sent to the main chain, the transaction hashes of the certificate storage are converted into the chain crossing transaction hashes, the chain crossing transaction hashes are transferred from the sub-chain to the main chain in a chain crossing mode, the transaction hashes of the certificate storage on the sub-chain are not exposed, and protection of user privacy in the chain crossing certificate storage is facilitated.

Description

Cross-link certificate storage method and device, terminal equipment and storage medium
Technical Field
The present application belongs to the technical field of block chains, and in particular, to a cross-chain evidence storing method, device, terminal device, and storage medium.
Background
At present, in order to ensure the authenticity and integrity of document data and contract equivalent data, the hash corresponding to the data needs to be stored on a block chain. In order to ensure the reliability of the certified information in the blockchain, it is necessary to certify the certified information in the blockchain to another more authoritative blockchain, i.e., to store the certificate across the chains. However, directly transferring the information stored with the certificate to another blockchain across the chain exposes the specific content of the information stored with the certificate, which is not beneficial to protecting the privacy of the user.
Disclosure of Invention
The embodiment of the application provides a cross-link certificate storing method, a cross-link certificate storing device, a terminal device and a storage medium, and can solve the problem that privacy of a user is revealed by an existing cross-link certificate storing method.
In a first aspect, an embodiment of the present application provides a cross-chain evidence storing method, where the cross-chain evidence storing method is applied to a cross-chain evidence storing device, where the cross-chain evidence storing device connects a main chain and a sub chain, and the cross-block chain evidence storing method includes:
acquiring N transaction hashes to be subjected to chain crossing of the sub-chain certificate, wherein N is an integer larger than zero;
determining cross-chain transaction hash according to the N transaction hashes to be cross-chain;
sending the cross-chain transaction hash to the backbone.
And opening and configuring the nodes deployed in the target block chain host according to the node configuration parameters.
In a second aspect, an embodiment of the present application provides a cross-chain evidence storing device, where the cross-chain evidence storing device connects a main chain and a sub chain, and the cross-block chain evidence storing device includes:
the hash acquisition module is used for acquiring N transaction hashes to be subjected to chain crossing and stored on the sub chain, wherein N is an integer larger than zero;
the Hash determining module is used for determining cross-chain transaction Hash according to the N transaction Hash to be cross-chain;
and the cross-chain evidence storing module is used for sending the cross-chain transaction hash to the main chain.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor, when executing the computer program, implements the cross-chain credentialing method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the cross-chain evidence storing method according to the first aspect is implemented.
In a fifth aspect, an embodiment of the present application provides a computer program product, which when running on a terminal device, causes the terminal device to execute the cross-link evidence storing method according to the first aspect.
Compared with the prior art, the embodiment of the application has the advantages that: the N transaction hashes of waiting to stride the chain that this application obtained deposit certificate on the subchain, and the transaction hashes of waiting to stride the chain according to N, confirms that the chain transaction is hash, will stride chain transaction hashes and send to the main chain, realizes that the transaction hashes of depositing the certificate change into and stride chain transaction hashes to will stride chain transaction hashes and stride the chain from the subchain and shift to the main chain, the transaction hashes of depositing the certificate on the unexposed subchain is favorable to striding the chain and deposit user's privacy's protection in the certificate.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a cross-link evidence storing method provided in a first embodiment of the present application;
FIG. 2 is a schematic diagram illustrating an interaction relationship between a main chain and a child chain according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a cross-link evidence storing method provided in the second embodiment of the present application;
FIG. 4 is a schematic diagram of the construction of a Mercker tree according to the second embodiment of the present application;
fig. 5 is a schematic flowchart of a cross-link evidence storing method provided in the third embodiment of the present application;
fig. 6 is a schematic structural diagram of a cross-chain evidence storing device according to a fourth embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal device according to a fifth embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The cross-link evidence storing method provided by the embodiment of the application can be applied to terminal devices such as a palm computer, a desktop computer, a notebook computer, a super-mobile personal computer (UMPC), a netbook, a cloud server, a Personal Digital Assistant (PDA) and the like, and the embodiment of the application does not limit the specific types of the terminal devices.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
In order to explain the technical means of the present application, the following description will be given by way of specific examples.
Referring to fig. 1, which is a schematic flow chart of a cross-chain evidence storing method provided in an embodiment of the present application, the cross-chain evidence storing method may be used in a cross-chain evidence storing device, the cross-chain evidence storing device connects a main chain and a sub chain, the cross-chain evidence storing device may run in the sub chain and serve as a cross-chain gateway of the sub chain, and the cross-chain evidence storing method includes the following steps:
step S101, N transaction hashes to be crossed and stored on the sub-chain are obtained.
The N is an integer greater than zero, the transaction hash to be subjected to cross-link storage may be a hash value of a transaction requiring cross-link storage, the hash value is a storage certificate of the transaction requiring cross-link storage on the sub-chain, and whether the transaction requires cross-link storage can be determined according to a transaction type.
For example, for a production link, the main chain a is used to comprehensively store the certificate of the whole production link, the transaction of the certificate stored on the sub-chain B includes the sales record of the production link and the sales record of the non-production link, and the transaction of the certificate stored on the sub-chain B by the sales record in the production link is the transaction requiring cross-link certificate storage.
Optionally, the obtaining N transaction hashes to be cross-linked for the child chain certificate includes:
monitoring M blocks of the subchain, wherein M is an integer greater than or equal to 1;
acquiring a transaction list of M blocks in a preset time;
determining all transaction hashes of the evidence stored in each of the M blocks according to the transaction list;
detecting whether the certificate storing type is cross-chain certificate storing transaction hash in all transaction hashes of the certificate storing on the M blocks;
and if the type of the certificate stored on the block is detected to be the cross-chain certificate stored transaction hash, determining the transaction hash to be the cross-chain transaction hash of the certificate stored on the block, and obtaining N to-be-cross-chain transaction hashes of the certificates stored on the M blocks.
If one block exists in the sub-chain, acquiring N transaction hashes to be subjected to chain crossing for certificate storage on the sub-chain is the transaction hash to be subjected to chain crossing for certificate storage in the block, and since the transaction hashes in the block are not all the transaction hashes to be subjected to chain crossing, all the transaction hashes for certificate storage on the block need to be detected, the type of the certificate storage in all the transaction hashes is determined to be the transaction hash for the chain crossing certificate storage, and the transaction hash is taken as the transaction hash to be subjected to chain crossing; if a plurality of blocks exist in the sub-chain, the evidence storing type in all the transaction hashes of each block is determined to be the transaction hash of cross-chain evidence storing.
The preset time may be set according to a requirement, and the preset time may refer to a time point corresponding to the preset time traced from the current time point forward to the current time point, for example, the preset time may be from the time point generated by the block to the current time point; the transaction list may refer to table data including all transaction hashes within a preset time, and extracting the transaction hashes in the table data determines all transaction hashes for storing the certificate on the block.
Optionally, after determining all transaction hashes of the restitution of each of the M blocks according to the transaction list, the method further includes:
analyzing the transaction list, and determining the certificate storage types corresponding to all transaction hashes of the certificates stored on the M blocks;
correspondingly, if it is detected that the certificate storage type is the transaction hash of the chain-crossing certificate storage, determining that the transaction hash is the transaction hash of the certificate to be chain-crossing on the block, and obtaining N transaction hashes to be chain-crossing of the certificates stored on the M blocks includes:
the certificate storage type of each block is transaction hash of cross-link certificate storage, a target transaction list is formed, and M target transaction lists are determined;
and obtaining N transaction hashes to be bridged stored on the M blocks according to the M target transaction lists.
For the transaction list of a block, the transaction list further includes a deposit type of each transaction hash in all transaction hashes deposited on the block, and the transaction list is analyzed to determine a deposit type corresponding to each transaction hash. And (3) setting the evidence storing type of the evidence stored on each block as cross-link evidence storing transaction hash to form a target transaction list, so that M blocks can determine M target transaction lists, and the evidence storing types of all the transaction hash in the target transaction lists are cross-link evidence storing.
Step S102, determining cross-chain transaction hash according to the N transaction hashes to be cross-chain.
The cross-chain transaction may refer to a transaction generated when N transaction hashes to be cross-chain forwarded to the main chain from the sub-chain, and the cross-chain transaction hash may refer to a hash value corresponding to the transaction, and the hash value may be calculated according to the N transaction hashes to be cross-chain.
For example, N transaction hashes to be linked are combined into one file, and a hash value calculated for the file is a cross-link transaction hash.
Step S103, sending the cross-chain transaction hash to the main chain.
In a chain crossing scenario, a main chain a exists to record the deposit evidence information of all the sub-chains, for example, as shown in fig. 2, the present disclosure provides an interactive relationship diagram of the main chain and the sub-chains, all the sub-chains include a sub-chain B, a sub-chain C, and a sub-chain D, where the sub-chain B is responsible for the deposit evidence of raw material purchase, the sub-chain C is responsible for the deposit evidence of order management, the sub-chain D is responsible for the deposit evidence of sales record, the main chain a is responsible for the deposit evidence of raw material purchase, order management, and sales record, and all the sub-chains B, the sub-chain C, and the sub-chain D need to transfer their own deposit evidence to the main chain a.
Optionally, determining the cross-chain transaction hash according to the N transaction hashes to be cross-chain includes:
determining M cross-chain transaction hashes according to the N transaction hashes to be cross-chain stored on the M blocks;
accordingly, sending the cross-chain transaction hash to the backbone includes:
sending the M cross-chain transaction hashes to the backbone.
If a block exists in the sub-chain, determining that the transaction hash with the cross-chain certificate storage type in all transaction hashes with certificates stored in the block is N transaction hashes to be cross-chain; if a plurality of blocks exist in the sub-chain, the transaction hash combination of cross-chain storage of the storage certificate types in all transaction hashes stored in each block in the plurality of blocks forms N transaction hashes to be cross-chain stored.
If the production link is taken as an example, the whole process is simplified as follows: the method comprises the steps of chaining records of raw material purchase in a production link to a sub-chain B for storing certificates, chaining records of order management in the production link to a sub-chain C for storing certificates, chaining sales records to a sub-chain D for storing certificates, wherein all information of chaining is transaction hash, then the sub-chain B, the sub-chain C and the sub-chain D use the method to enable transaction hash of the certificates stored on a block chain of the sub-chain B, the sub-chain C and the sub-chain D, and the transaction hash is forwarded to a main chain A in a chain crossing mode to achieve double certificate storage or supervision and avoid leakage of information of the sub-chain certificates stored.
According to the embodiment of the application, N transaction hashes to be subjected to chain crossing for certificate storage on the sub chain are obtained, the chain crossing transaction hashes are determined according to the N transaction hashes to be subjected to chain crossing, the chain crossing transaction hashes are sent to the main chain, the transaction hashes to be subjected to certificate storage are converted into the chain crossing transaction hashes, the chain crossing transaction hashes are transferred to the main chain from the sub chain, the transaction hashes to be subjected to certificate storage on the sub chain are not exposed, and the protection of user privacy in the chain crossing certificate storage is facilitated.
Referring to fig. 3, which is a schematic flow chart of a cross-chain evidence storing method provided in the second embodiment of the present application, the cross-chain evidence storing method may be used in a cross-chain evidence storing device, the cross-chain evidence storing device connects a main chain and a sub chain, and the cross-chain evidence storing device may run in the sub chain and serve as a cross-chain gateway of the sub chain, as shown in fig. 3, the cross-chain evidence storing method may include the following steps:
step S301, N transaction hashes to be crossed and stored on the sub-chain are obtained.
The content of step S301 is the same as that of step S101, and reference may be made to the description of step S101, which is not repeated herein.
Step S302, according to N transaction hashes to be crossed, a Merck tree is constructed.
The Merck tree is a binary tree or a multi-branch tree and comprises leaf nodes, intermediate nodes and a root node, wherein each node in the leaf nodes comprises a transaction hash to be crossed with a chain, each node in the intermediate nodes is formed by hashes of 2 sub-nodes below the node, the root node is formed by hashes of 2 sub-nodes below the node, and the root node represents the top end or the root of the Merck tree. For example, as shown in fig. 4, the construction diagram of a merkel tree provided in embodiment two of the present application is shown, where 4 transaction hashes to be cross-linked are h1, h2, h3, and h4, h1, h2, h3, and h4 constitute 4 leaf nodes, h1 and h2 are combined to form h12 to form an intermediate node, h3 and h4 are combined to form h34 to form an intermediate node, and two intermediate nodes h12 and h34 are combined to form a root node.
When N transaction hashes to be bridged belong to one block of a block chain, only one Mercker tree is constructed, and if the N transaction hashes to be bridged belong to M blocks of the block chain, one Mercker tree, namely M Mercker trees, is determined according to the transaction hashes to be bridged of each block.
Step S303, according to the Mercker tree, cross-chain transaction hash is determined.
The cross-chain transaction hash may be a hash value determined according to the constructed tacle tree, and the hash value may be a hash value corresponding to a root node of the tacle tree or a hash value corresponding to an intermediate node.
When N transaction hashes to be subjected to chain crossing belong to one block of a block chain, only one Mercker tree is constructed, one chain-crossing transaction hash is determined, if the N transaction hashes to be subjected to chain crossing correspond to M blocks of the block chain, one Mercker tree, namely M Mercker trees, is determined according to the transaction hashes to be subjected to chain crossing of each block, and then the M chain-crossing transaction hashes can be determined.
Step S304, send the cross-chain transaction hash to the main chain.
The content of step S304 is the same as that of step S103, and reference may be made to the description of step S103, which is not repeated herein.
For example, the cross-chain credentialing process is as follows:
the chain-crossing evidence storing method is used for 4 sub-chains, namely a sub-chain B, a sub-chain C and a sub-chain D, a main chain A is respectively connected with the sub-chain B, the sub-chain C and the sub-chain D through a chain-crossing evidence storing device, and evidence storing systems are respectively deployed on the main chain A, the sub-chain B, the sub-chain C and the sub-chain D and can be a system capable of storing the evidence on a single chain of block blocks, wherein the main chain A serves as the main chain evidence storing system and needs to record information of the evidence stored on other sub-chains, a user can store the evidence on each sub-chain according to the requirement of the user, and the sub-chains are not interfered with each other.
The cross-link evidence storing device is used for continuously monitoring transaction hashes of the cross-link evidence to be stored on each sub-chain, processing the transaction hashes and then forwarding the processed transaction hashes to the main chain a, wherein the processing refers to determining the cross-link transaction hashes in step S303.
Optionally, the cross-chain evidence storing method further includes:
acquiring a query instruction aiming at a target file;
according to the query instruction, acquiring a first hash corresponding to the target file from the sub-chain and a target transaction list to which the first hash belongs, and acquiring a cross-chain transaction hash corresponding to the target file from the main chain;
acquiring other hashes in a target transaction list to which the first hash belongs, wherein the other hashes are hashes in the target list except the first hash;
constructing a Merck tree according to the first hash and other hashes, and determining a target cross-chain transaction hash;
detecting whether the hash of the target file is the same as the first hash, and detecting whether the cross-chain transaction hash corresponding to the target file is the same as the target cross-chain transaction hash;
and if the hash of the target file is the same as the first hash and the cross-chain transaction hash corresponding to the target file is the same as the target cross-chain transaction hash, determining that the target file is not tampered.
For example, the user's inquiry process for the deposit certificate is as follows:
when a user stores a house renting contract on the sub-chain B, the hash of the house renting contract is placed in a transaction Tx1 sent by the user, the sub-chain B transfers the value of the transaction Tx1 processed by the transaction Tx 2, h3 and h4 to the main chain A for storing the certificate, and when the user needs to inquire the certificate, if the sub-chain B can search the hash h1 corresponding to the certificate storing transaction Tx1, the sub-chain B certificate storing hash h1 can be used for proving the authenticity of the house renting contract.
A Simple Payment Verification (SPV) is constructed through the transaction Tx1 and other transactions in the sub-chain B, namely, the sub-chain B takes h2, h3, h4 and h1 to calculate the value of a root node of a Mercker tree, the value of the root node is compared with the value of the certificate on the main chain A, and the certificate on the main chain A can further prove the authenticity of the renting contract.
According to the method and the device, the Mercker tree is constructed for the N transaction hashes to be subjected to chain crossing, the chain crossing transaction hashes are determined, the transaction hashes in the sub chains can be effectively subjected to privacy processing, and the transaction hashes of the sub chains are prevented from being leaked.
Referring to fig. 5, which is a schematic flow chart of a cross-chain evidence storing method provided in the third embodiment of the present application, the cross-chain evidence storing method may be used in a cross-chain evidence storing device, the cross-chain evidence storing device connects a main chain and a sub chain, and the cross-chain evidence storing device may run in the sub chain and serve as a cross-chain gateway of the sub chain, as shown in fig. 5, the cross-chain evidence storing method may include the following steps:
step S501, N transaction hashes to be crossed and stored on the sub-chain are obtained.
The content of step S501 is the same as that of step S101, and reference may be made to the description of step S101, which is not repeated herein.
Step S502, constructing the Mercker tree according to the N transaction hashes to be crossed.
The content of step S501 is the same as that of step S302, and reference may be made to the description of step S302, which is not repeated herein.
Step S503, determining that the hash value corresponding to the root of the mercker tree is a cross-chain transaction hash.
In order to reduce the amount of data stored as much as possible, the hash value corresponding to the root node (i.e., the root) of the mercker tree is used as a cross-chain transaction hash, that is, a cross-chain transaction hash is generated according to the transaction hash to be cross-chain of a block.
Step S504, send the cross-chain transaction hash to the main chain.
The content of step S504 is the same as that of step S103, and reference may be made to the description of step S103, which is not repeated herein.
According to the method and the device, the hash value corresponding to the root node of the Mercker tree is used as the cross-link transaction hash, the data volume of the transaction hash in the sub-chain is compressed to the maximum extent and then sent to the main chain for storing the certificate, and the method and the device can be suitable for a scene with large data volume and cross-link certificate storage.
Corresponding to the cross-chain evidence storing method in the foregoing embodiment, fig. 6 shows a structural block diagram of a cross-chain evidence storing device provided in the fourth embodiment of the present application, and for convenience of description, only the relevant portions of the embodiment of the present application are shown.
The chain crossing evidence storing device connects the main chain and the sub chain, referring to fig. 6, and comprises:
the hash acquisition module 61 is configured to acquire N transaction hashes to be subjected to chain crossing, where N is an integer greater than zero, of the certificates stored in the child chain;
a hash determining module 62, configured to determine a cross-chain transaction hash according to the N transaction hashes to be cross-chain;
and the cross-chain evidence storing module 63 is used for sending the cross-chain transaction hash to the main chain.
Optionally, the hash determining module 62 includes:
the building unit is used for building the Mercker tree according to the N transaction hashes to be subjected to chain crossing;
and the first cross-chain hash determining unit is used for determining the cross-chain transaction hash according to the Mercker tree.
Optionally, the first cross-chain hash determining unit is specifically configured to:
and determining the hash value corresponding to the root of the Mercker tree as cross-chain transaction hash.
Optionally, the hash obtaining module 61 includes:
the monitoring unit is used for monitoring M blocks of the sub-chain, wherein M is an integer greater than or equal to 1;
the list acquisition unit is used for acquiring a transaction list of M blocks in a preset time;
the hash acquisition unit is used for determining all transaction hashes of the certificate stored in each block of the M blocks according to the transaction list;
the type detection unit is used for detecting whether the certificate storage type is cross-link certificate storage transaction hash in all transaction hashes of the certificate storage on the M blocks;
and the to-be-cross-chain hash determining unit is used for determining the transaction hash as the to-be-cross-chain transaction hash of the certificate stored on the block if the certificate storage type is detected to be the cross-chain transaction hash of the certificate stored on the block, so as to obtain N to-be-cross-chain transaction hashes of the certificates stored on the M blocks.
Optionally, the cross-chain evidence storing device further includes:
the type determining unit is used for analyzing the transaction list after determining all transaction hashes of the certificate stored in each block of the M blocks according to the transaction list, and determining the certificate storage types corresponding to all transaction hashes of the certificates stored in the M blocks;
correspondingly, the to-be-bridged hash determination unit is specifically configured to:
the certificate storage type of each block is transaction hash of cross-link certificate storage, a target transaction list is formed, and M target transaction lists are determined;
and obtaining N transaction hashes to be bridged stored on the M blocks according to the M target transaction lists.
Optionally, the cross-chain evidence storing device further includes:
the instruction acquisition module is used for acquiring a query instruction aiming at the target file;
the query hash acquisition module is used for acquiring a first hash corresponding to the target file and a target transaction list to which the first hash belongs from the sub-chain according to the query instruction, and acquiring a cross-chain transaction hash corresponding to the target file from the main chain;
the other hash acquisition module is used for acquiring other hashes in the target transaction list to which the first hash belongs, wherein the other hashes are hashes in the target list except the first hash;
the target hash determining module is used for constructing a Mercker tree according to the first hash and other hashes and determining a target cross-chain transaction hash;
the hash detection module is used for detecting whether the hash of the target file is the same as the first hash and whether the cross-chain transaction hash corresponding to the target file is the same as the target cross-chain transaction hash;
and the result determining module is used for determining that the target file is not tampered if the hash of the target file is the same as the first hash and the cross-chain transaction hash corresponding to the target file is the same as the target cross-chain transaction hash.
Optionally, the hash determining module 62 includes:
the second cross-chain hash determining unit is used for determining M cross-chain transaction hashes according to the N transaction hashes to be cross-chain stored on the M blocks;
correspondingly, the cross-chain evidence storing module 63 is specifically configured to:
sending the M cross-chain transaction hashes to the backbone.
It should be noted that, because the contents of information interaction, execution process, and the like between the modules are based on the same concept as that of the embodiment of the method of the present application, specific functions and technical effects thereof may be specifically referred to a part of the embodiment of the method, and details are not described here.
Fig. 7 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present application. As shown in fig. 7, the terminal device 7 of this embodiment includes: m processors 70 (only one shown in fig. 7), a memory 71, and a computer program 72 stored in the memory 71 and operable on the M processors 70, the steps in any of the various cross-chain forensic method embodiments described above being implemented by the processor 70 executing the computer program 72.
The terminal device may include, but is not limited to, a processor 70, a memory 71. Those skilled in the art will appreciate that fig. 7 is only an example of the terminal device 7, and does not constitute a limitation to the terminal device 7, and may include more or less components than those shown, or combine some components, or different components, for example, and may further include input/output devices, network access devices, and the like.
The Processor 70 may be a Central Processing Unit (CPU), and the Processor 70 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 71 may in some embodiments be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may also be an external storage device of the terminal device 7 in other embodiments, such as a plug-in hard disk provided on the terminal device 7, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 71 may also include both an internal storage unit of the terminal device 7 and an external storage device. The memory 71 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of a computer program. The memory 71 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the above-mentioned apparatus may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method of the embodiments described above can be implemented by a computer program, which can be stored in a computer readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code, recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, and software distribution media. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
When the computer program product runs on the terminal device, the steps in the method embodiments can be implemented when the terminal device executes the computer program product.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A cross-chain evidence storing method is applied to a cross-chain evidence storing device, wherein the cross-chain evidence storing device is connected with a main chain and a sub chain, and the cross-block chain evidence storing method comprises the following steps:
acquiring N transaction hashes to be subjected to chain crossing of the sub-chain certificate, wherein N is an integer larger than zero;
determining cross-chain transaction hash according to the N transaction hashes to be cross-chain;
sending the cross-chain transaction hash to the backbone.
2. The cross-chain credentialing method of claim 1, wherein said determining a cross-chain transaction hash from the N transaction hashes to be cross-chain comprises:
constructing a Merck tree according to the N transaction hashes to be subjected to chain crossing;
determining the cross-chain transaction hash according to the Mercker tree.
3. The cross-chain evidence-preserving method of claim 2, wherein the determining the cross-chain transaction hash according to the merkel tree comprises:
and determining a hash value corresponding to the root of the Mercker tree as the cross-chain transaction hash.
4. The cross-chain evidence storing method of claim 2, wherein the obtaining N transaction hashes to be cross-chain for evidence storage on the child chain comprises:
monitoring M blocks of the subchain, wherein M is an integer greater than or equal to 1;
acquiring a transaction list of the M blocks within a preset time;
determining all transaction hashes of each block restitution certificate in the M blocks according to the transaction list;
detecting whether the evidence storing type is cross-chain evidence storing transaction hash in all transaction hashes of evidence storing on each block in the M blocks;
and if the type of the certificate stored on the block is the cross-chain certificate stored transaction hash, determining the transaction hash as the to-be-cross-chain transaction hash of the certificate stored on the block, and obtaining N to-be-cross-chain transaction hashes of the certificates stored on the M blocks.
5. The cross-link credentialing method of claim 4, after said determining all transaction hashes for each of said M blocks for credentialing according to said transaction list, further comprising:
analyzing the transaction list, and determining the certificate storage types corresponding to all transaction hashes of the certificates stored on the M blocks;
correspondingly, if it is detected that the certificate storage type is the transaction hash of the cross-chain certificate storage, determining that the transaction hash is the transaction hash of the certificate to be cross-chain of the certificate storage on the block, and obtaining N transaction hashes to be cross-chain of the certificate storage on the M blocks includes:
the certificate storage type of each block is transaction hash of cross-link certificate storage, a target transaction list is formed, and M target transaction lists are determined;
and obtaining N transaction hashes to be subjected to cross-chaining, which are stored on the M blocks, according to the M target transaction lists.
6. The cross-chain credentialing method of claim 5, further comprising:
acquiring a query instruction aiming at a target file;
according to the query instruction, acquiring a first hash corresponding to the target file from the sub-chain and a target transaction list to which the first hash belongs, and acquiring a cross-chain transaction hash corresponding to the target file from the main chain;
acquiring other hashes in a target transaction list to which the first hash belongs, wherein the other hashes are hashes in the target list except the first hash;
constructing a Merck tree according to the first hash and the other hashes, and determining a target cross-chain transaction hash;
detecting whether the hash of the target file is the same as the first hash, and detecting whether the cross-chain transaction hash corresponding to the target file is the same as the target cross-chain transaction hash;
and if the hash of the target file is the same as the first hash, and the cross-chain transaction hash corresponding to the target file is the same as the target cross-chain transaction hash, determining that the target file is not tampered.
7. The cross-chain credentialing method of any one of claims 4 to 6, wherein said determining a cross-chain transaction hash from the N transaction hashes to be cross-chain comprises:
determining M cross-chain transaction hashes according to the N to-be-cross-chain transaction hashes stored on the M blocks;
accordingly, the sending the cross-chain transaction hash to the backbone comprises:
sending the M cross-chain transaction hashes to the master chain.
8. A cross-chain evidence storing device is characterized in that the cross-chain evidence storing device is connected with a main chain and a sub-chain, and the cross-block chain evidence storing device comprises:
the hash acquisition module is used for acquiring N transaction hashes to be subjected to chain crossing and stored on the sub chain, wherein N is an integer larger than zero;
the Hash determining module is used for determining cross-chain transaction Hash according to the N transaction Hash to be cross-chain;
and the cross-chain evidence storing module is used for sending the cross-chain transaction hash to the main chain.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the cross-chain credentialing method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the cross-chain credentialing method according to any one of claims 1 to 7.
CN202011618442.4A 2020-12-30 2020-12-30 Cross-link certificate storage method and device, terminal equipment and storage medium Pending CN112632619A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011618442.4A CN112632619A (en) 2020-12-30 2020-12-30 Cross-link certificate storage method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011618442.4A CN112632619A (en) 2020-12-30 2020-12-30 Cross-link certificate storage method and device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112632619A true CN112632619A (en) 2021-04-09

Family

ID=75287188

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011618442.4A Pending CN112632619A (en) 2020-12-30 2020-12-30 Cross-link certificate storage method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112632619A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113743944A (en) * 2021-11-04 2021-12-03 中国信息通信研究院 Cross-chain message reliable transmission method and device and electronic equipment
CN114499872A (en) * 2021-12-24 2022-05-13 山东浪潮工业互联网产业股份有限公司 Industrial internet-based star fire chain cross-linking method and equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113743944A (en) * 2021-11-04 2021-12-03 中国信息通信研究院 Cross-chain message reliable transmission method and device and electronic equipment
CN113743944B (en) * 2021-11-04 2022-03-29 中国信息通信研究院 Cross-chain message reliable transmission method and device and electronic equipment
CN114499872A (en) * 2021-12-24 2022-05-13 山东浪潮工业互联网产业股份有限公司 Industrial internet-based star fire chain cross-linking method and equipment

Similar Documents

Publication Publication Date Title
Majeed et al. Blockchain for IoT-based smart cities: Recent advances, requirements, and future challenges
CN109815657B (en) Identity authentication method and device based on alliance chain, computer readable storage medium and terminal equipment
US10768919B2 (en) Package installation on a host file system using a container
CN106503053B (en) UTXO querying method and device
EP3639465A1 (en) Improved hardware security module management
CN112632619A (en) Cross-link certificate storage method and device, terminal equipment and storage medium
CN110875850B (en) Firmware upgrading method and system, readable storage medium and terminal equipment
CN112163412A (en) Data verification method and device, electronic equipment and storage medium
CN111310242B (en) Method and device for generating device fingerprint, storage medium and electronic device
CN112799763A (en) Function management method, management device, terminal equipment and readable storage medium
CN112819464A (en) Intelligent contract processing method, processing device, terminal equipment and storage medium
CN111309801A (en) Method and device for fragmenting alliance chain
CN112650627A (en) Data recovery method and device of intelligent contract, terminal equipment and storage medium
CN112948105B (en) Gradient transmission method, gradient transmission device and parameter server
CN112669036B (en) Account management method, system, server and medium
US20230359774A1 (en) Method for data communication and electronic device
CN110349025B (en) Method and device for preventing loss of contract assets based on non-cost transaction output
EP4213467A1 (en) Method for real-time data communication, electronic device, and system
US20230289337A1 (en) Trustless omnichain communication protocol platforms
US20230230080A1 (en) Storing and retrieving data associated with an asset
KR102256361B1 (en) Apparatus and method for accessing control of data and system using the same
WO2022140948A1 (en) Account management method and system, and server and medium
CN110933155A (en) Novel block chain
CN112631642A (en) Intelligent contract upgrading method and device, block chain node and storage medium
WO2021097621A1 (en) Incremental package generation method and device, and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination