A blockchain data dynamic archiving method and system based on a BaaS platform
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INFORMATION CENT OF YUNNAN POWER GRID CO LTD
- Filing Date
- 2022-09-01
- Publication Date
- 2026-08-07
AI Technical Summary
[0003]然而现有部署在边缘设备上的区块链,运行过程中产生大量的历史数据,因此容易导致运行设备的存储耗尽,进而容易使系统发生崩溃
Smart Images

Figure CN115481083B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology, specifically relating to a method and system for dynamic archiving of blockchain data based on a BaaS platform. Background Technology
[0002] With the deepening of the national industrial internet, "Internet+" action plan, cloud computing and big data strategy, various industries are accelerating the construction of smart IoT systems and promoting the construction of massive edge computing and cloud interaction.
[0003] However, existing blockchains deployed on edge devices generate a large amount of historical data during operation, which can easily lead to storage exhaustion of the running devices and thus cause the system to crash.
[0004] The information disclosed in this background section is intended only to enhance the understanding of the overall background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0005] This invention aims to reduce the storage pressure on edge blockchain nodes and provides a method and system for dynamic archiving of blockchain data based on the BaaS platform.
[0006] In a first aspect, embodiments of the present invention provide a method for dynamic archiving of blockchain data based on a BaaS platform, including performing the following steps on the BaaS platform:
[0007] Send a node data query request to at least one blockchain node;
[0008] Receive node data returned by the blockchain node based on the node data query request, and verify the received node data;
[0009] In response to successful verification, the node data sent by each blockchain node is merged and persistently archived.
[0010] Optionally, the following steps may also be performed on the BaaS platform: selecting the blockchain to be archived based on the blockchain's identifier.
[0011] Optionally, verifying the received node data includes: verifying whether the data of each node is consistent; and / or verifying whether the signature in the node data is valid.
[0012] Optionally, the method further includes performing the following steps on the BaaS platform: obtaining and storing the current maximum block height, and associating it with the node data persistently stored on the BaaS platform; and sending the node data corresponding to the current maximum block height to each blockchain node, so that each blockchain node deletes the node data corresponding to the maximum block height.
[0013] Optionally, the BaaS platform is located in the cloud.
[0014] Optionally, the blockchain node may also perform the following steps: receiving a node data query request from the BaaS platform and sending blockchain node data to the BaaS platform based on the node data query request.
[0015] Optionally, the blockchain node may also perform the following steps: receiving node data corresponding to the current maximum block height sent by the BaaS platform, and deleting node data that is lower than the maximum block height.
[0016] Optionally, it further includes: in response to the storage capacity of the first blockchain node exceeding a preset storage capacity threshold, the first blockchain node sends a data archiving request to the BaaS platform, wherein the data archiving request includes the data of the first blockchain node; the BaaS platform archives and stores the data of the first blockchain node based on the data archiving request sent by the first blockchain node; in response to the completion of archiving and storage, the BaaS platform sends a storage completion instruction to the first blockchain node to delete the data of the first blockchain node.
[0017] Optionally, the process may also include the following steps performed on the BaaS platform: obtaining the node information of the blockchain based on the blockchain's identifier; querying the latest stored block data and block height, and verifying the latest block data and block height in the main chain; after successful verification, restoring the blockchain data from block zero to the queried block height based on the blockchain node information, the blockchain data, and the block height; after successful data restoration, the BaaS platform sends a node data query request to each blockchain node; receiving the node data returned by each blockchain node and verifying the consistency of all node data; if the consistency verification of the node data passes, the blockchain data restoration is successful.
[0018] Secondly, embodiments of the present invention provide a blockchain data dynamic archiving system based on a BaaS platform, including a BaaS platform and blockchain nodes, wherein the BaaS platform and the blockchain nodes are bidirectionally connected, and the BaaS platform includes a request sending module, a verification module, and a data storage module; wherein, the request sending module is configured to send node data query requests to at least one blockchain node; the verification module is configured to receive node data returned by the blockchain node based on the node data query request, and verify the received node data; the data storage module is configured to, in response to successful verification, merge the node data sent by each blockchain node and persistently archive and save it. Attached Figure Description
[0019] Figure 1 A flowchart of a blockchain data dynamic archiving method based on a BaaS platform provided by an embodiment of the present invention is shown;
[0020] Figure 2 A flowchart of another method for dynamic archiving of blockchain data based on a BaaS platform provided by an embodiment of the present invention is shown;
[0021] Figure 3 The flowchart illustrates another method for dynamic archiving of blockchain data based on a BaaS platform provided by an embodiment of the present invention.
[0022] Figure 4 This illustration shows a schematic diagram of the structure of a blockchain data dynamic archiving system based on a BaaS platform provided by an embodiment of the present invention;
[0023] Figure 5 A schematic block diagram of an example electronic device that can be used to implement embodiments of the present invention is shown. Detailed Implementation
[0024] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms "an," "a," or "the," etc., do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms "comprising," "including," etc., mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. The terms "connected," "linked," etc., are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up," "down," "left," "right," etc., are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0026] It's important to note that blockchain is a chain-like data structure that combines data blocks sequentially according to time. A blockchain is essentially blocks plus a chain. A block can be broadly divided into two parts: a header and a body. The header typically includes the hash value of the previous block (parent hash), a timestamp, and other information. The body contains the block's own information. The entire blockchain system can include the following technical characteristics:
[0027] (1) Peer-to-peer transmission: All nodes in the blockchain are connected through a peer-to-peer network. Unlike the centralized network model, all nodes in the peer-to-peer network are equal in status and share some computing resources and transmit information through specific software protocols.
[0028] (2) Distributed data storage: As a distributed ledger, all participating nodes in the blockchain system will have a complete copy of the ledger information. Whether the information of a ledger has been tampered with can be compared with the ledger copy information of other nodes.
[0029] (3) Consensus mechanism: All blockchain nodes maintain their own block ledgers and can collect newly generated transaction information in the blockchain within a certain period of time and store it in their own block ledgers. If the block information added by all nodes in the entire network during this period is consistent and jointly verified and recognized by all nodes, the process of verifying and recognizing the block information stored in this block through all nodes is called the consensus mechanism. It is achieved through a distributed consensus algorithm.
[0030] For example, companies in the power grid and water conservancy sectors currently adopt a cloud-edge collaborative architecture. The core idea is to deploy some data processing, analysis, and related business functions from the cloud to the edge layer closer to the data source, thereby reducing data processing latency and alleviating resource pressure on the cloud platform. With the deepening of the national industrial internet, "Internet+" action plan, and cloud computing and big data strategies, various industries are accelerating the construction of smart IoT systems and promoting massive edge-to-cloud interaction. The proposed cloud-edge collaborative technology provides a solution to these problems. Its core idea is to deploy some data processing, analysis, and related applications to the edge layer closer to the data source, thereby reducing data processing latency and alleviating resource pressure on the cloud platform. Blockchain, as an emerging technology, has characteristics such as decentralization, time-series data, collective maintenance, programmability, and security and trustworthiness, making it very suitable for scenarios with high security requirements, such as transaction data consensus and transmission. However, existing blockchains deployed on edge devices face significant storage pressure on these devices due to the large amount of data generated during blockchain system operation.
[0031] To address at least one of the aforementioned technical problems, embodiments of the present invention provide a method and system for dynamic archiving of blockchain data based on a BaaS platform. The method and system for dynamic archiving of blockchain data based on a BaaS platform provided by the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0032] It should be noted that the executing entity of the blockchain data dynamic archiving method based on the BaaS platform in this application embodiment is a device for blockchain data dynamic archiving based on the BaaS platform. This device can be applied to any computer device so that the computer device can perform the blockchain data dynamic archiving function based on the BaaS platform. The computer device can be a personal computer (PC), edge device, mobile device, server, etc. The mobile device can be, for example, a mobile phone, tablet computer, personal digital assistant, wearable device, in-vehicle device, or other hardware device with various operating systems, touch screens, and / or displays.
[0033] Figure 1 A flowchart illustrating a method for dynamic archiving of blockchain data based on a BaaS platform, as provided in this embodiment of the invention, is shown below. Figure 1 As shown, the method for dynamic archiving of blockchain data based on the BaaS platform includes performing the following steps on the BaaS platform:
[0034] S101, Send a node data query request to at least one blockchain node.
[0035] BaaS platforms are hosted in the cloud. BaaS (Blockchain as a Service) refers to embedding a blockchain framework into a cloud computing platform. Leveraging the deployment and management advantages of cloud service infrastructure, it provides developers with a convenient, high-performance blockchain ecosystem and supporting services, enabling business expansion and operational support. A BaaS platform can build a main chain, primarily storing data blocks uploaded by blockchain nodes to the BaaS platform for verification and validation during data recovery.
[0036] The number of blockchain nodes can be selected according to the situation; there can be one or more, and no specific limit is set here.
[0037] S102. Receive node data returned by the blockchain node based on the node data query request, and verify the received node data.
[0038] Node data includes, but is not limited to, structured data, algorithm contract data, edge result data, metering basic data, and unstructured data. Unstructured data includes all formats of office documents, text, images, HTML, various reports, images, and audio / video information, etc.
[0039] In some embodiments, the BaaS platform verifies all received blockchain node data, specifically including: verifying whether the received blockchain node data is consistent; and / or verifying whether the signatures in the received blockchain node data are valid. If the verification passes, the next step is performed; if the verification fails, the BaaS platform sends an archiving failure message.
[0040] S103. In response to successful verification, merge the node data sent by each blockchain node and persistently archive and save it.
[0041] In this embodiment, a node data query request is sent to at least one blockchain node through the BaaS platform. The BaaS platform receives the blockchain node data returned by each blockchain node based on the node data query request, and verifies the received blockchain node data. After the verification is successful, the BaaS platform merges the node data sent by each blockchain node and persistently saves it. This realizes the uploading of data in the edge blockchain to the cloud for archiving and storage, thereby solving the storage pressure on edge devices and realizing the lightweight deployment of edge blockchain.
[0042] Figure 2 A flowchart of another method for dynamic archiving of blockchain data based on a BaaS platform provided in this embodiment of the invention is shown below. Figure 2As shown, before the S101 and BaaS platforms send node data query request instructions to at least one blockchain node, the following steps are also included:
[0043] S100. Select the blockchain to be archived based on the blockchain identifier.
[0044] When there are multiple blockchains, each blockchain is assigned a corresponding identifier. The BaaS platform can then select the blockchain whose node data needs to be archived to cloud storage based on the blockchain identifier.
[0045] Continue to refer to Figure 2 S103, in response to successful verification, after merging the node data sent by each blockchain node and persistently archiving it, it also includes:
[0046] S104. Obtain and store the current maximum block height, and associate it with the node data persistently stored on the Bass platform.
[0047] S105. Send the node data corresponding to the current maximum block height to each blockchain node, so that each blockchain node will delete the node data corresponding to the maximum block height.
[0048] In this embodiment, since the BaaS platform sends the node data of the currently stored maximum block height to each blockchain node, so that each blockchain node deletes the node data below the maximum block height, the storage pressure of edge devices can be further reduced, and a lightweight deployment of edge blockchain can be achieved.
[0049] Optionally, the method for dynamic archiving of blockchain data based on the BaaS platform also includes performing the following steps on the blockchain node:
[0050] Receive node data query requests from the BaaS platform and send blockchain node data to the BaaS platform based on the node data query requests.
[0051] In this embodiment, each blockchain node receives a node data query request sent by the BaaS platform. Based on the node data query request, each blockchain node sends its own data to the BaaS platform, so that the BaaS platform can merge the node data sent by all blockchain nodes and persist it.
[0052] In this implementation, since the blockchain nodes send blockchain node data to the BaaS platform based on node data query requests, the BaaS platform merges the node data sent by each blockchain node and persists it. Therefore, the storage pressure on edge devices can be further reduced, and a lightweight deployment of edge blockchain can be achieved.
[0053] Optionally, the method also includes performing the following steps on the blockchain node: receiving node data corresponding to the current maximum block height sent by the BaaS platform, and deleting node data corresponding to a height lower than the maximum block height.
[0054] In this process, at least one blockchain node receives the maximum block height node data currently stored from the BaaS platform, and at least one blockchain node deletes node data that is lower than the maximum block height.
[0055] In this embodiment, the blockchain node receives the maximum block height node data currently stored from the BaaS platform. The blockchain node deletes node data that is lower than the maximum block height, which can further reduce the storage pressure on edge devices and realize the lightweight deployment of edge blockchain.
[0056] Figure 3 A flowchart of yet another method for dynamic archiving of blockchain data based on a BaaS platform is shown, such as... Figure 3 As shown, the methods for dynamic archiving of blockchain data based on the BaaS platform include:
[0057] ①The BaaS platform selects the blockchains to be archived based on their identifiers.
[0058] ②The BaaS platform sends node data query requests to at least one blockchain node.
[0059] ③ The blockchain node sends the blockchain node data to the BaaS platform based on the node data query request.
[0060] Optionally, when data is uploaded from blockchain nodes to the cloud-based BaaS platform, the data needs to be compressed and encrypted. Compressing and encrypting the data reduces network bandwidth usage during data transmission, improves archiving rates, and prevents data from being tampered with or intercepted during network transmission. ④ The BaaS platform receives blockchain node data returned by each blockchain node based on node data query requests and verifies the received blockchain node data.
[0061] ⑤ After the verification is successful, the BaaS platform merges the node data sent by each blockchain node and saves it persistently.
[0062] ⑥ After the data is persistently saved, the BaaS platform stores the current maximum block height and associates it with the node data persistently saved on the BaaS platform; the BaaS platform sends the currently stored maximum block height node data to each blockchain node.
[0063] ⑦ Each blockchain node will delete or prune node data that is below the maximum block height.
[0064] In this embodiment, by archiving and storing node data in the edge blockchain system and trimming the blockchain node data, the storage pressure on edge devices is reduced, and a lightweight deployment of the edge blockchain is achieved.
[0065] Optionally, the blockchain data dynamic archiving method based on the BaaS platform further includes: in response to the storage capacity of the first blockchain node exceeding a preset storage capacity threshold, the first blockchain node sends a data archiving request to the BaaS platform, wherein the data archiving request includes the data of the first blockchain node; the BaaS platform archives and stores the data of the first blockchain node based on the data archiving request sent by the first blockchain node; in response to the completion of archiving and storage, the BaaS platform sends a storage completion instruction to the first blockchain node to delete the data of the first blockchain node.
[0066] In this embodiment, archiving and trimming operations can be performed on the node data of a specific blockchain.
[0067] Optionally, the blockchain data dynamic archiving method based on the BaaS platform also includes performing the following steps on the BaaS platform: obtaining the blockchain node information according to the blockchain identifier; querying the latest stored block data and block height, and verifying the latest block data and block height in the main chain; after successful verification, restoring the blockchain data from block zero to the queried block height based on the blockchain node information, blockchain data, and block height; after successful data restoration, the Bass platform sends node data query requests to each blockchain node; receiving the node data returned by each blockchain node and verifying the consistency of all node data; if the consistency verification of the node data passes, the blockchain data restoration is successful.
[0068] In this implementation, the BaaS platform queries the latest stored block data and block height, and then verifies these data on the main chain. Once verified, the blockchain is restored from block zero to the queried block height based on the blockchain node information, blockchain data, and block height. This establishes a blockchain node data recovery mechanism, ensuring the stable operation of the blockchain system and preventing irreversible data loss due to pruning or attacks during operation.
[0069] Figure 4This invention provides a schematic diagram of a blockchain data dynamic archiving system based on a BaaS platform. The BaaS-based system includes a BaaS platform 701 and a blockchain node 702, with bidirectional communication between the BaaS platform and the blockchain node. The BaaS platform includes a request sending module 7011, a verification module 7012, and a data storage module 7013.
[0070] The request sending module 7011 is configured to send node data query requests to at least one blockchain node.
[0071] The verification module 7012 is configured to receive blockchain node data returned by each blockchain node based on the node data query request, and to verify the received blockchain node data.
[0072] The data storage module 7013 is configured to merge the node data sent by each blockchain node after the verification is passed, and then persistently save it.
[0073] Figure 4 As shown, blockchain node 702 includes a request receiving module 7021 and a deletion module 7022; wherein,
[0074] The request receiving module 7021 is configured to receive node data query requests sent by the BaaS platform 701. The query request contains the node data of the current maximum block height sent by the BaaS platform 701.
[0075] The deletion module 7022 is configured to delete node data that is below the maximum block height.
[0076] According to embodiments of the present invention, this application also provides an electronic device and a readable storage medium.
[0077] Figure 5 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0078] like Figure 5As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0079] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0080] The computing unit 801 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as methods for dynamic archiving and recovery of blockchain data based on a BaaS platform. For example, in some embodiments, methods for dynamic archiving and recovery of blockchain data based on a BaaS platform can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the methods for dynamic archiving and recovery of blockchain data based on a BaaS platform described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured by any other suitable means (e.g., by means of firmware) to execute a method for dynamic archiving and recovery of blockchain data based on a BaaS platform.
[0081] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0082] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0083] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0084] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0085] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0086] Cloud computing refers to a technology system that enables access to a shared pool of physical or virtual resources via a network. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for applications such as artificial intelligence and blockchain, as well as for model training.
[0087] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0088] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0089] It is understood that the above embodiments are merely exemplary implementations used to illustrate the principles of the present invention, and the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.
Claims
1. A method for dynamic archiving of blockchain data based on a BaaS platform, characterized in that, This includes performing the following steps on the BaaS platform: Send a node data query request to at least one blockchain node, wherein the node data includes structured data, algorithm contract data, edge result data, metering basic data and unstructured data, and the unstructured data includes office documents, text, pictures, HTML, various reports, images and audio / video information in all formats; Receive node data returned by the blockchain node based on the node data query request, and verify the received node data; In response to successful verification, the node data sent by each blockchain node is merged and persistently archived. The verification of the received node data includes: verifying whether the data of each node is consistent; and / or verifying whether the signature in the node data is valid; This also includes performing the following steps on the BaaS platform: obtaining and storing the current maximum block height, and associating it with the node data persistently stored on the BaaS platform; sending the node data corresponding to the current maximum block height to each blockchain node, so that each blockchain node deletes the node data corresponding to the maximum block height; Specifically, when the node data is uploaded from the blockchain node to the cloud BaaS platform, the node data is compressed and encrypted.
2. The method for dynamic archiving of blockchain data based on a BaaS platform according to claim 1, characterized in that, This also includes performing the following steps on the BaaS platform: Select the blockchain to be archived based on its identifier.
3. The method for dynamic archiving of blockchain data based on a BaaS platform according to any one of claims 1-2, characterized in that, The BaaS platform is located in the cloud.
4. The method for dynamic archiving of blockchain data based on a BaaS platform according to claim 1, characterized in that, It also includes performing the following steps on the blockchain node: Receive node data query requests from the BaaS platform, and send blockchain node data to the BaaS platform based on the node data query requests.
5. The method for dynamic archiving of blockchain data based on a BaaS platform according to claim 1, characterized in that, It also includes performing the following steps on the blockchain node: Receive node data corresponding to the current maximum block height sent by the BaaS platform, and delete node data that is lower than the maximum block height.
6. The method for dynamic archiving of blockchain data based on a BaaS platform according to claim 1, characterized in that, Also includes: In response to the storage capacity of the first blockchain node exceeding a preset storage capacity threshold, the first blockchain node sends a data archiving request to the BaaS platform, wherein the data archiving request contains the data of the first blockchain node; The BaaS platform archives and stores the data of the first blockchain node based on the data archiving request sent by the first blockchain node. In response to the completion of archive storage, the BaaS platform sends a storage completion instruction to the first blockchain node to delete the data on the first blockchain node.
7. The method for dynamic archiving of blockchain data based on a BaaS platform according to claim 1, characterized in that, This also includes performing the following steps on the BaaS platform: Obtain the node information of the blockchain based on the blockchain's identifier; Query the latest stored block data and block height, and verify the latest block data and block height in the main chain; After the verification is successful, the blockchain is restored from the zeroth block to the queried block height based on the blockchain node information, the blockchain data, and the block height. After the data recovery is successful, the BaaS platform sends node data query requests to each blockchain node; Receive node data returned by each of the blockchain nodes and verify the consistency of all node data; if the consistency verification of the node data passes, the blockchain data is successfully restored.
8. A blockchain data dynamic archiving system based on a BaaS platform, characterized in that, It includes a BaaS platform and blockchain nodes, with the BaaS platform and blockchain nodes having a bidirectional communication connection. The BaaS platform includes a request sending module, a verification module, and a data storage module; wherein, The request sending module is configured to send node data query requests to at least one blockchain node. The node data includes structured data, algorithm contract data, edge result data, metering basic data, and unstructured data. The unstructured data includes office documents, text, images, HTML, various reports, images, and audio / video information in all formats. The verification module is configured to receive node data returned by the blockchain node based on the node data query request, and to verify the received node data. The data storage module is configured to merge the node data sent by each blockchain node in response to successful verification, and persistently archive and save it. The verification module is configured to verify whether the data of each node is consistent; and / or verify whether the signature in the node data is valid. This also includes performing the following steps on the BaaS platform: obtaining and storing the current maximum block height, and associating it with the node data persistently stored on the BaaS platform; sending the node data corresponding to the current maximum block height to each blockchain node, so that each blockchain node deletes the node data corresponding to the maximum block height; Specifically, when the node data is uploaded from the blockchain node to the cloud BaaS platform, the node data is compressed and encrypted.
Citation Information
Patent Citations
Blockchain data archiving method and device
CN112380166A