A block data archiving method, device and medium for a blockchain
By building archiving smart contracts on the blockchain and using an asymmetric cryptographic public-private key signing mechanism, the lack of standardization and traceability in the blockchain data archiving process is solved, and the security and transparency of data archiving are achieved.
Patent Information
- Application Number
- CN202311324476.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-12
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-10-12
AI Technical Summary
Existing blockchain data archiving solutions lack standardization and are not traceable, posing a risk of data loss or leakage and failing to guarantee the traceability of archiving activities.
By constructing an archiving smart contract on the blockchain and utilizing an asymmetric encryption public-private key signature mechanism, a standardized archiving process for block data is achieved, and each operation step is recorded on the blockchain to ensure traceability of the behavior.
It achieves standardization and traceability of blockchain data archiving, avoids the risk of data loss or leakage, and ensures the transparency and security of the archiving process.
Smart Images

Figure CN117312237B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchains, and in particular to a block data archiving method for a blockchain, a device and a medium. BACKGROUND
[0002] In recent years, with the development of blockchain technology, blockchain systems are increasingly widely used in the field of transactions. As the running time of the blockchain increases, the data stored by each node on the blockchain will linearly increase, which will result in an increasingly large storage space occupied by the blockchain data of each node in the blockchain system, thereby causing a sharp increase in the cost of storing data online.
[0003] In order to avoid the large space occupied by the blockchain data, it is necessary to periodically archive the blockchain data to transfer the online storage of the nodes to offline, thereby reducing the cost of storing data. The existing data archiving scheme does not have a standardized and automated process that can trace the archiving action, and therefore there is a risk of loss or leakage in the data archiving process, and the behavior in the archiving process cannot be traced. Therefore, how to perform a standardized data archiving scheme to avoid the risk of data loss or leakage and ensure that the archiving behavior is traceable has become a technical problem to be solved. SUMMARY
[0004] The embodiments of the present application provide a block data archiving method for a blockchain, a device and a medium, to solve the technical problem of how to perform a standardized data archiving scheme to avoid the risk of data loss or leakage and ensure that the archiving behavior is traceable.
[0005] In a first aspect, the embodiments of the present application provide a block data archiving method for a blockchain, characterized in that the method comprises: determining a block start number and a block end number corresponding to to-be-archived block data, and based on the block start number and the block end number, constructing a to-be-executed archiving application through a private key of a to-be-archived blockchain node corresponding to the to-be-archived block data; publishing the to-be-executed archiving application on a chain, and a preset archiving smart contract in the blockchain audits the to-be-executed archiving application and publishes an archiving audit result; in a case where it is determined that the archiving audit result is an audit pass, the to-be-archived blockchain node packages the to-be-archived block data to generate a to-be-archived block data file, and uploads the to-be-archived block data file to a preset storage area; after receiving a message notification of successful uploading returned by the preset storage area, the to-be-archived blockchain node constructs a successful archiving notification based on an archiving application transaction Hash corresponding to the to-be-executed archiving application and a storage address of the to-be-archived block data file contained in the message notification, and publishes the successful archiving notification; wherein the archiving application transaction Hash is a transaction Hash returned by the blockchain for the to-be-executed archiving application after publishing the to-be-executed archiving application on the chain.
[0006] In an implementation form of the present application, before determining the block start number and the block end number corresponding to the block data to be archived, the method further comprises: deploying a block chain and defining asymmetric encryption public and private keys of each block of the block chain node; constructing an archiving smart contract and writing the archiving smart contract into the block chain; and running the block chain to automatically deploy the archiving smart contract.
[0007] In an implementation form of the present application, the method further comprises: in the case of needing to restore the data to be archived, constructing a to-be-executed restoration application based on the storage address of the block data file to be archived by using the private key of the block chain node to be archived; publishing the to-be-executed restoration application on the chain, and auditing the to-be-executed restoration application by the archiving smart contract and publishing a restoration audit result; in the case of determining that the restoration audit result is an audit pass, requesting the block data file to be archived from the preset storage area based on the storage address by the block chain node to be archived; and after receiving the block data file to be archived returned by the preset storage area, restoring the block corresponding to the block data to be archived based on the block data file to be archived by the block chain node to be archived.
[0008] In an implementation form of the present application, after the block chain node to be archived restores the block corresponding to the block data to be archived based on the block data file to be archived, the method further comprises: constructing a successful restoration notification by the private key of the block chain node to be archived based on the restoration application transaction Hash corresponding to the to-be-executed restoration application; wherein the restoration application transaction Hash is a transaction Hash returned by the block chain for the to-be-executed restoration application after publishing the to-be-executed restoration application on the chain; and publishing the successful restoration notification.
[0009] In an implementation form of the present application, after publishing the successful restoration notification, the method further comprises: returning the restoration notification transaction Hash to the block node to be archived by the block chain; and in the case of needing to query whether the data to be archived is successfully restored, querying whether the data to be archived is successfully restored by the archiving smart contract based on the restoration notification transaction Hash.
[0010] In an implementation form of the present application, the preset archiving smart contract in the block chain audits the to-be-executed archiving application, specifically comprising: reading the public key of the block chain node to be archived; analyzing the to-be-executed archiving application based on the public key to determine whether the private key signature in the to-be-executed archiving application is the private key signature corresponding to the block chain node to be archived; in the case of determining that the private key signature in the to-be-executed archiving application is the private key signature corresponding to the block chain node to be archived, issuing an archiving audit result of audit pass; and in the case of determining that the private key signature in the to-be-executed archiving application is not the private key signature corresponding to the block chain node to be archived, filtering the to-be-executed archiving application.
[0011] In an implementation form of the present application, the archiving smart contract audits the to-be-executed restoration application, specifically including: reading the public key of the to-be-archived blockchain node; parsing the to-be-executed restoration application based on the public key to determine whether the private key signature in the to-be-executed restoration application is the private key signature corresponding to the to-be-archived blockchain node; in the case where the private key signature in the to-be-executed restoration application is determined to be the private key signature corresponding to the to-be-archived blockchain node, issuing a restoration audit result of passing the audit; in the case where the private key signature in the to-be-executed restoration application is determined not to be the private key signature corresponding to the to-be-archived blockchain node, filtering the to-be-executed restoration application.
[0012] In an implementation form of the present application, after the success archiving notification is issued, the method further includes: the blockchain returns the archiving notification transaction Hash to the to-be-archived block node; in the case where it is necessary to query whether the to-be-archived data is successfully archived, the to-be-archived data is queried through the archiving smart contract based on the archiving notification transaction Hash to determine whether the to-be-archived data is successfully archived.
[0013] In a second aspect, the embodiments of the present application further provide a block data archiving device for a blockchain, characterized in that the device comprises: at least one processor; and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: determine the block start number and the block end number corresponding to the to-be-archived block data, and based on the block start number and the block end number, construct a to-be-executed archiving application through the private key of the to-be-archived blockchain node corresponding to the to-be-archived block data; publish the to-be-executed archiving application on a chain, and a preset archiving smart contract in the blockchain audits the to-be-executed archiving application and publishes an archiving audit result; in the case where the archiving audit result is determined to pass the audit, the to-be-archived blockchain node packages the to-be-archived block data to generate a to-be-archived block data file, and uploads the to-be-archived block data file to a preset storage area; after receiving a message notification of successful uploading returned by the preset storage area, the to-be-archived blockchain node constructs a success archiving notification based on the archiving application transaction Hash corresponding to the to-be-executed archiving application and the storage address of the to-be-archived block data file contained in the message notification, and issues the success archiving notification; wherein the archiving application transaction Hash is a transaction Hash returned by the blockchain for the to-be-executed archiving application after the to-be-executed archiving application is published on a chain.
[0014] In a third aspect, the embodiments of the present application further provide a non-volatile computer storage medium for block data archiving of a blockchain, which stores computer executable instructions, characterized in that the computer executable instructions are configured to: determine a block start number and a block end number corresponding to the to-be-archived block data, and based on the block start number and the block end number, construct a to-be-executed archiving application through a private key of a to-be-archived blockchain node corresponding to the to-be-archived block data; publish the to-be-executed archiving application on a chain, and a preset archiving smart contract in the blockchain audits the to-be-executed archiving application and publishes an archiving audit result; in a case where it is determined that the archiving audit result is an audit pass, the to-be-archived blockchain node packages the to-be-archived block data to generate a to-be-archived block data file, and uploads the to-be-archived block data file to a preset storage area; after receiving a message notification of successful uploading returned by the preset storage area, the to-be-archived blockchain node constructs a successful archiving notification based on an archiving application transaction Hash corresponding to the to-be-executed archiving application and a storage address of the to-be-archived block data file contained in the message notification, and publishes the successful archiving notification; wherein the archiving application transaction Hash is a transaction Hash returned by the blockchain for the to-be-executed archiving application after the to-be-executed archiving application is published on the chain.
[0015] The method, device and medium for block data archiving of a blockchain provided by the embodiments of the present application perform archiving operations through a smart contract, conform to the original definition of the blockchain, and each action needs to be recorded on a chain, thereby ensuring traceability of behaviors. BRIEF DESCRIPTION OF DRAWINGS
[0016] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:
[0017] Figure 1 A flowchart of a method for block data archiving of a blockchain is provided for the embodiments of the present application;
[0018] Figure 2 An internal structure schematic diagram of a device for block data archiving of a blockchain is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described below in conjunction with the embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0020] The embodiment of the present application provides a block data archiving method for a block chain, equipment and medium, to solve the following technical problems: how to perform a standardized data archiving scheme to avoid data loss or leakage risk and ensure that the archiving behavior is traceable.
[0021] The technical solutions provided by the embodiment of the present application are described in detail below with reference to the drawings.
[0022] Figure 1 A block data archiving method for a block chain is provided in the embodiment of the present application. As shown in the figure, Figure 1 The block data archiving method for a block chain provided by the embodiment of the present application specifically includes the following steps:
[0023] Step 101, determine the block start number and the block end number corresponding to the to-be-archived block data, and based on the block start number and the block end number, construct a to-be-executed archiving application through the private key of the to-be-archived block chain node corresponding to the to-be-archived block data.
[0024] In an embodiment of the present application, to implement the block data archiving for a block chain, some preparation work needs to be done on the block chain first.
[0025] Specifically, deploy the block chain, and define the asymmetric encryption public and private keys of each block of the block chain node; construct an archiving smart contract, and write the archiving smart contract into the block chain; and run the block chain to automatically deploy the archiving smart contract.
[0026] It should be noted that in the block chain genesis file, the bytecode of the smart contract for archiving the block chain is written, so that when the block chain is started for the first time, the contract will be automatically deployed and archived.
[0027] In an embodiment of the present application, in the case that the to-be-archived block data needs to be archived, the block start number and the block end number corresponding to the to-be-archived block data need to be determined first.
[0028] Further, based on the block start number and the block end number, a to-be-executed archiving application is constructed through the private key of the to-be-archived block chain node corresponding to the to-be-archived block data. The private key of the to-be-archived block chain node is used here for signature processing on the block start number and the block end number.
[0029] Step 102, publish the to-be-executed archiving application on the chain, and the preset archiving smart contract in the block chain audits the to-be-executed archiving application and publishes an archiving audit result.
[0030] In an embodiment of the present application, after the to-be-executed archiving application is constructed, the to-be-executed archiving application is published on the chain.
[0031] Further, after the to-be-executed archiving application is published on the chain, the preset archiving smart contract in the blockchain audits the to-be-executed archiving application.
[0032] Specifically, the public key of the to-be-archived blockchain node is read; the to-be-executed archiving application is parsed based on the public key to determine whether the private key signature in the to-be-executed archiving application is the private key signature corresponding to the to-be-archived blockchain node; in the case where the private key signature in the to-be-executed archiving application is the private key signature corresponding to the to-be-archived blockchain node, the archiving audit result of passing the audit is issued; in the case where the private key signature in the to-be-executed archiving application is not the private key signature corresponding to the to-be-archived blockchain node, the to-be-executed archiving application is filtered.
[0033] Further, the archiving smart contract publishes the archiving audit result.
[0034] Step 103, in the case where the archiving audit result is passing the audit, the to-be-archived blockchain node packages the to-be-archived block data to generate a to-be-archived block data file, and uploads the to-be-archived block data file to a preset storage area.
[0035] It should be noted that the preset storage area can be a local server of the node or a remote storage.
[0036] In an embodiment of the present application, after the to-be-archived block data file is uploaded to the preset storage area, the to-be-archived blockchain node is notified of the upload success message returned by the preset storage area.
[0037] Step 104, after receiving the upload success message returned by the preset storage area, the to-be-archived blockchain node constructs a successful archiving notification based on the archiving application transaction Hash corresponding to the to-be-executed archiving application and the storage address of the to-be-archived block data file contained in the message notification, and publishes the successful archiving notification.
[0038] After the to-be-archived blockchain node receives the upload success message returned by the preset storage area, a successful archiving notification is constructed based on the archiving application transaction Hash corresponding to the to-be-executed archiving application and the storage address of the to-be-archived block data file contained in the message notification.
[0039] It should be noted that the archiving application transaction Hash is the transaction Hash returned by the blockchain for the to-be-executed archiving application after the to-be-executed archiving application is published on the chain.
[0040] In an embodiment of the present application, after the success archiving notification is published, the method further comprises: the blockchain returns the archiving notification transaction Hash to the to-be-archived block node; in the case of needing to query whether the to-be-archived data is successfully archived, the to-be-archived data is queried based on the archiving notification transaction Hash through the archiving smart contract to determine whether the to-be-archived data is successfully archived.
[0041] Further, in the case of needing to restore the to-be-archived data, a to-be-executed restoration application is constructed based on the storage address of the to-be-archived block data file through the private key of the to-be-archived block chain node; the to-be-executed restoration application is published on the chain, the archiving smart contract audits the to-be-executed restoration application, and publishes a restoration audit result; in the case of determining that the restoration audit result is an audit pass, the to-be-archived block chain node requests the to-be-archived block data file from the preset storage area based on the storage address; after receiving the to-be-archived block data file returned by the preset storage area, the to-be-archived block chain node restores the block corresponding to the to-be-archived block data based on the to-be-archived block data file.
[0042] In an embodiment of the present application, the archiving smart contract audits the to-be-executed restoration application, specifically comprising: reading the public key of the to-be-archived block chain node; based on the public key, the to-be-executed restoration application is parsed to determine whether the private key signature in the to-be-executed restoration application is the private key signature corresponding to the to-be-archived block chain node; in the case of determining that the private key signature in the to-be-executed restoration application is the private key signature corresponding to the to-be-archived block chain node, the restoration audit result of the audit pass is issued; in the case of determining that the private key signature in the to-be-executed restoration application is not the private key signature corresponding to the to-be-archived block chain node, the to-be-executed restoration application is filtered.
[0043] Further, the to-be-archived block chain node constructs a success restoration notification based on the restoration application transaction Hash corresponding to the to-be-executed restoration application through the private key of the to-be-archived block chain node; wherein the restoration application transaction Hash is the transaction Hash returned by the blockchain for the to-be-executed restoration application after the to-be-executed restoration application is published on the chain; the success restoration notification is published.
[0044] Further, the blockchain returns the restoration notification transaction Hash to the to-be-archived block node; in the case of needing to query whether the to-be-archived data is successfully restored, the to-be-archived data is queried based on the restoration notification transaction Hash through the archiving smart contract to determine whether the to-be-archived data is successfully restored.
[0045] The above is a method embodiment of the present application. Based on the same inventive concept, the present application also provides a block data archiving device for a blockchain, the structure of which is shown in Figure 2 .
[0046] Figure 2A block data archiving device internal structure diagram for a blockchain is provided for an embodiment of the present application. As shown in Figure 2 The device includes:
[0047] at least one processor 201;
[0048] and a memory 202 in communication connection with the at least one processor;
[0049] The memory 202 stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor 201 to enable the at least one processor 201 to:
[0050] determine a block start number and a block end number corresponding to the block data to be archived, and based on the block start number and the block end number, construct an archive execution application through a private key of a block data to be archived node corresponding to the block data to be archived;
[0051] publish the archive execution application on a chain, and a preset archive smart contract in the blockchain audits the archive execution application and publishes an archive audit result;
[0052] In a case where it is determined that the archive audit result is an audit pass, the block data to be archived node packages the block data to be archived to generate a block data to be archived file, and uploads the block data to be archived file to a preset storage area;
[0053] After receiving a message notification of successful uploading returned by the preset storage area, the block data to be archived node constructs a successful archiving notification based on an archive application transaction Hash corresponding to the archive execution application and a storage address of the block data to be archived file contained in the message notification, and publishes the successful archiving notification; wherein the archive application transaction Hash is a transaction Hash returned by the blockchain for the archive execution application after the archive execution application is published on the chain.
[0054] Some embodiments of the present application provide a non-volatile computer storage medium for block data archiving of a blockchain corresponding to Figure 1 The computer executable instructions are set to:
[0055] determine a block start number and a block end number corresponding to the block data to be archived, and based on the block start number and the block end number, construct an archive execution application through a private key of a block data to be archived node corresponding to the block data to be archived;
[0056] publish the archive execution application on a chain, and a preset archive smart contract in the blockchain audits the archive execution application and publishes an archive audit result;
[0057] In a case where it is determined that the archiving review result is a review pass, the to-be-archived blockchain node packages the to-be-archived block data to generate a to-be-archived block data file, and uploads the to-be-archived block data file to a preset storage area;
[0058] After receiving the message notification returned by the preset storage area that the uploading is successful, the to-be-archived blockchain node constructs a successful archiving notification based on the archiving application transaction Hash corresponding to the to-be-executed archiving application and the storage address of the to-be-archived block data file contained in the message notification, and publishes the successful archiving notification. The archiving application transaction Hash is a transaction Hash returned by the blockchain for the to-be-executed archiving application after the to-be-executed archiving application is published on the chain.
[0059] Each of the embodiments in the present application is described in a progressive manner, and the same and similar parts of each of the embodiments can be referred to each other. Each of the embodiments mainly describes the differences from other embodiments. In particular, for the Internet of Things device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.
[0060] The system and medium provided by the embodiments of the present application are one-to-one corresponding with the method, and therefore, the system and medium also have similar beneficial technical effects as the method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the system and medium will not be described here.
[0061] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.
[0062] The present application is described with reference to flowcharts and / or block diagrams according to the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks Figure 1 one flow or multiple flows and / or blocks
[0063] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0064] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions that are executed on the computer or other programmable apparatus provide steps for implementing the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0065] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0066] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory, etc. The memory is an example of computer readable media.
[0067] Computer readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology for storing information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.
[0068] It is also to be noted that the terms "comprising", "including", and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0069] The above description is merely illustrative of the application, and not restrictive. Various modifications and changes can become apparent to those skilled in the art. Incorporating any modification, equivalent substitution, improvement, etc. within the spirit and principle of the application, shall be included in the scope of the claims of the application.
Claims
1. A method for archiving block data of a blockchain, characterized in that, The method comprises: determining the block start number and the block end number corresponding to the to-be-archived block data, and constructing a to-be-executed archiving application based on the block start number and the block end number and a private key of a to-be-archived block chain node corresponding to the to-be-archived block data; publishing the to-be-executed archiving application on a chain, and auditing the to-be-executed archiving application by a preset archiving smart contract in a block chain and publishing an archiving audit result; in a case where it is determined that the archiving audit result is passed, packaging the to-be-archived block data by the to-be-archived block chain node to generate a to-be-archived block data file, and uploading the to-be-archived block data file to a preset storage area; after receiving a message notification of successful uploading returned by the preset storage area, constructing a successful archiving notification based on an archiving application transaction Hash corresponding to the to-be-executed archiving application and a storage address of the to-be-archived block data file contained in the message notification, and publishing the successful archiving notification; wherein the archiving application transaction Hash is a transaction Hash returned by the block chain for the to-be-executed archiving application after publishing the to-be-executed archiving application on a chain; the method further comprises: in a case where it is necessary to restore the to-be-archived block data, constructing a to-be-executed restoration application based on the storage address of the to-be-archived block data file and a private key of the to-be-archived block chain node; publishing the to-be-executed restoration application on a chain, auditing the to-be-executed restoration application by the archiving smart contract, and publishing a restoration audit result; in a case where it is determined that the restoration audit result is passed, requesting the to-be-archived block data file from the preset storage area based on the storage address by the to-be-archived block chain node; after receiving the to-be-archived block data file returned by the preset storage area, restoring the block corresponding to the to-be-archived block data based on the to-be-archived block data file by the to-be-archived block chain node; after the to-be-archived block chain node restores the block corresponding to the to-be-archived block data based on the to-be-archived block data file, the method further comprises: constructing a successful restoration notification based on a restoration application transaction Hash corresponding to the to-be-executed restoration application and a private key of the to-be-archived block chain node; wherein the restoration application transaction Hash is a transaction Hash returned by the block chain for the to-be-executed restoration application after publishing the to-be-executed restoration application on a chain; publishing the successful restoration notification. 2.The method of archiving block data for a blockchain according to claim 1, wherein, before determining the block start number and the block end number corresponding to the to-be-archived block data, the method further comprises: deploying a block chain and defining asymmetric encryption public and private keys of each block of the block chain node; constructing an archiving smart contract and writing the archiving smart contract into the block chain; running the block chain to automatically deploy the archiving smart contract. 3.The method of archiving block data for a blockchain according to claim 1, wherein, after publishing the successful restoration notification, the method further comprises: the block chain returns a restoration notification transaction Hash to the to-be-archived block chain node; In a case of needing to query whether the to-be-archived block data is successfully restored, the archiving smart contract is queried based on the restoration notification transaction Hash to determine whether the to-be-archived block data is successfully restored. 4.The method of archiving block data for a blockchain according to claim 1, wherein, The preset archiving smart contract in the blockchain audits the to-be-executed archiving application, specifically including: reading a public key of the to-be-archived blockchain node; analyzing the to-be-executed archiving application based on the public key to determine whether a private key signature in the to-be-executed archiving application is a private key signature corresponding to the to-be-archived blockchain node; in a case of determining that the private key signature in the to-be-executed archiving application is the private key signature corresponding to the to-be-archived blockchain node, issuing an archiving audit result of passing the audit; in a case of determining that the private key signature in the to-be-executed archiving application is not the private key signature corresponding to the to-be-archived blockchain node, filtering the to-be-executed archiving application. 5.The method of archiving block data for a blockchain according to claim 1, wherein, The archiving smart contract audits the to-be-executed restoration application, specifically including: reading a public key of the to-be-archived blockchain node; analyzing the to-be-executed restoration application based on the public key to determine whether a private key signature in the to-be-executed restoration application is a private key signature corresponding to the to-be-archived blockchain node; in a case of determining that the private key signature in the to-be-executed restoration application is the private key signature corresponding to the to-be-archived blockchain node, issuing a restoration audit result of passing the audit; in a case of determining that the private key signature in the to-be-executed restoration application is not the private key signature corresponding to the to-be-archived blockchain node, filtering the to-be-executed restoration application.
6. The method of claim 1, wherein, After the successful archiving notification is published, the method further includes: the blockchain returns the archiving notification transaction Hash to the to-be-archived blockchain node; in a case of needing to query whether the to-be-archived block data is successfully archived, the archiving smart contract is queried based on the archiving notification transaction Hash to determine whether the to-be-archived block data is successfully archived. 7.A block data archiving device for a blockchain, characterized by, The device includes: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform: a block data archiving method for a blockchain according to any one of claims 1-6. 8.A non-transitory computer storage medium storing computer-executable instructions for block data archiving for a blockchain, the computer-executable instructions comprising: The computer executable instructions, when executed, implement a block data archiving method for a blockchain according to any one of claims 1-6.
Citation Information
Patent Citations
Transaction management method and device based on block chain, storage medium and electronic equipment
CN115660676A
Data archive
US20210342291A1
Cited By
Office knowledge base-oriented cloud document duplicate removal archiving and tracing management method and system
CN122173448A