Method, apparatus, device, and medium for creating business archiving nodes and processing data

By creating a new type of business archive node in the blockchain network, only storing blockchain account status information related to business needs, the problem of high storage resource consumption of archive nodes is solved, and an efficient and economical storage solution is achieved.

CN115174599BActive Publication Date: 2025-06-13DATAA ROBOTICS (CHENGDU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210523933.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-13
Publication Date
2025-06-13
Estimated Expiration
2042-05-13

AI Technical Summary

Technical Problem

On the premise of meeting the blockchain account status data query needs, how to reduce the storage resource consumption of archive nodes and reduce storage costs.

Method used

By creating a new type of business archive node in the blockchain network, the node only stores the account status information of blockchain accounts at each block height related to business needs, achieving lightweight data storage.

Benefits of technology

It achieves a significant reduction in storage resource consumption and storage costs while meeting business needs. Since the business archive node has the ability to rearchive, it can flexibly respond to business changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115174599B_ABST
    Figure CN115174599B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method, apparatus, device, and medium for creating a service archiving node and processing data. In the embodiments of the present application, a new type of service archiving node can be created in the blockchain network, which can not only meet the query requirements of account status data of each blockchain account in some business scenarios, but also, since the service archiving node is a lightweight archiving node, can greatly reduce the consumption of storage resources brought by using the archiving node and reduce the storage cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular, to a method, apparatus, device, and medium for creating a business archive node and processing data. Background Art

[0002] The blockchain network introduces different types of nodes such as full nodes, lightweight nodes, and archive nodes to meet different business requirements. Specifically, a full node has the following functions: storing complete blockchain data and having the ability to independently verify to confirm the validity of transactions. A lightweight node has the following functions: storing block header data. An archive node has the following functions: storing all the data retained in the full node, and additionally storing the account status data of each blockchain account at each block height. The account status data includes, for example, but is not limited to: the statement of the account, balance, nonce, code hash, and storage root, etc.

[0003] In practical applications, several archive nodes are usually added to the blockchain network to meet the query requirements of the account status data of each blockchain account in some business scenarios. However, the data storage of the archive node is large, and the more archive nodes are added, the more storage resources are consumed, and the storage cost is relatively high. Therefore, on the premise of meeting the query requirements of the account status data, how to reduce the consumption of storage resources has become an urgent technical problem to be solved. Summary of the Invention

[0004] Multiple aspects of the present application provide a method, apparatus, device, and medium for creating a business archive node and processing data, so as to reduce the consumption of storage resources on the premise of meeting the query requirements of the account status data.

[0005] An embodiment of the present application provides a method for creating a business archive node, including: determining at least one first blockchain account associated with business requirements from all blockchain accounts on the blockchain network; controlling any blockchain node in the blockchain network to repeatedly execute the following steps to create the blockchain node as a business archive node: in response to the current block height of the blockchain, obtaining the account status information of each of the at least one first blockchain account at the current block height; saving the account status information of each of the at least one first blockchain account at the current block height to a database.

[0006] An embodiment of the present application further provides a data processing method, including: in response to the current block height of the blockchain, obtaining the account status information of at least one first blockchain account at the current block height, where the first blockchain account is a blockchain account on the blockchain network that has a relevance to the business requirements; and saving the account status information of at least one first blockchain account at the current block height into a database.

[0007] An embodiment of the present application further provides a business archiving node creation device, including: a determination module, configured to determine at least one first blockchain account that has a relevance to the business requirements from all the blockchain accounts on the blockchain network; and a control module, configured to control any blockchain node in the blockchain network to repeatedly execute the following steps to create the blockchain node as a business archiving node: in response to the current block height of the blockchain, obtaining the account status information of at least one first blockchain account at the current block height; and saving the account status information of at least one first blockchain account at the current block height into a database.

[0008] An embodiment of the present application further provides a data processing device, including: an obtaining module, configured to obtain the account status information of at least one first blockchain account at the current block height in response to the current block height of the blockchain, where the first blockchain account is a blockchain account on the blockchain network that has a relevance to the business requirements; and a saving module, configured to save the account status information of at least one first blockchain account at the current block height into a database.

[0009] An embodiment of the present application further provides a computer device, including: a memory and a processor; the memory is configured to store a computer program; the processor is coupled to the memory and configured to execute the computer program to perform the steps in the business archiving node creation method or the data processing method.

[0010] An embodiment of the present application further provides a computer storage medium storing a computer program, which, when executed by a processor, causes the processor to be able to implement the steps in the business archiving node creation method or the data processing method.

[0011] In the embodiment of the present application, a new type of business archiving node can be created in the blockchain network, which can not only meet the query requirements of some business scenarios for the account status data of each blockchain account, but also, since the business archiving node is a lightweight archiving node, can greatly reduce the consumption of storage resources brought by using the archiving node and reduce the storage cost. Description of the Drawings

[0012] The accompanying drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0013] Figure 1 is an architecture diagram of a blockchain network provided by the present application;

[0014] Figure 2 is a flowchart of a method for creating a business archiving node provided by an embodiment of the present application;

[0015] Figure 3 is a state tree corresponding to an exemplary block;

[0016] Figure 4 is a flowchart of a data processing method provided by an embodiment of the present application;

[0017] Figure 5 is a schematic structural diagram of a business archiving node creation device provided by an embodiment of the present application;

[0018] Figure 6 is a schematic structural diagram of a data processing device provided by an embodiment of the present application;

[0019] Figure 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed Embodiments

[0020] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0021] On the premise of meeting the query requirements of account status data, how to reduce the consumption of storage resources has become an urgent technical problem to be solved. For this reason, the embodiments of the present application provide a method, device, equipment, and medium for creating a business archiving node and processing data. In the embodiments of the present application, a new type of business archiving node can be created in the blockchain network, which can not only meet the query requirements of the account status data of each blockchain account in some business scenarios, but also, since the business archiving node is a lightweight archiving node, can greatly reduce the consumption of storage resources caused by using the archiving node and reduce the storage cost.

[0022] First, some terms related to the embodiments of the present application are introduced:

[0023] Blockchain Account: Uniquely identifies a user's identity in a blockchain network. Taking Ethereum as an example, blockchain accounts can be divided into externally owned accounts and contract accounts. The account status information of an externally owned account includes, for example, but is not limited to: account identifier (also known as the account address), balance, and nonce. The account status information of a contract account includes, for example, but is not limited to: the account identifier of the smart contract, balance, nonce, code, and storage root, etc.

[0024] Business Archival Node: Refers to a blockchain node with a data storage capacity greater than that of a full node but less than that of an archival node. In the embodiments of the present application, compared with a full node, the business archival node additionally stores the account status information of blockchain accounts involved in business requirements at each block height according to business requirements. Compared with an archival node, the business archival node is a lightweight archival node, which reduces the consumption of storage resources and storage costs on the premise of meeting the query requirements of the account status data required for business needs.

[0025] Block Height: Refers to the serial number of the block added to the blockchain, which can be used as the unique identifier of the block, indicating the position of the block in the blockchain. The block height starts from 0, for example. The current block height refers to the serial number of the newly added block currently on the blockchain; the historical block height refers to the serial number of the existing block whose addition time to the blockchain is earlier than that of the new block, that is, the appearance time of the historical block height is earlier than the current block height.

[0026] State Tree: Refers to an MPT (Merkle Patricia Trie) that records the account status information of blockchain accounts. Each leaf node in the state tree represents a blockchain account. For the state tree, each node basically contains a key-value mapping, where the key is the blockchain account, and the value is the account status information including the account's statement, balance, nonce, code, and storage root, etc. The state tree needs to be updated frequently: the account balance and the account's nonce often change. More importantly, new accounts are frequently inserted, and the stored keys are also often inserted and deleted.

[0027] P2P (Peer-to-peer networking) Network: Also known as a peer-to-peer network or a point-to-point network. The participants in the network share a part of their hardware resources (such as processing power, storage capacity, network connection ability, and printers, etc.). These shared resources provide services and content through the network and can be directly accessed by other peer nodes without going through an intermediate entity.

[0028] Smart contract: A computer protocol designed to spread, verify, or execute contracts in an information-based manner. Smart contracts allow for trusted transactions without a third party, and these transactions are traceable and irreversible. Essentially, the working principle of these automated contracts is similar to the if-then statements of other computer programs. Smart contracts simply interact with real-world assets in this way. When a pre-programmed condition is triggered, the smart contract executes the corresponding contract terms.

[0029] The following will detail the technical solutions provided by each embodiment of this application in conjunction with the accompanying drawings.

[0030] Figure 1 This is an architecture diagram of a blockchain network provided by this application. As Figure 1 shown, the blockchain network may include multiple blockchain nodes, and these blockchain nodes together form a blockchain network, which is a P2P network. Among them, the blockchain nodes can be terminal devices or servers, and the status of each blockchain node in the blockchain network is equal, and each blockchain node jointly maintains a blockchain.

[0031] In the embodiments of this application, the type of the blockchain network is not limited. For example, it can be a public blockchain, a private blockchain, a consortium blockchain, a permissioned blockchain, etc. Among them, the public blockchain has the characteristic of public deployment, and anyone can participate at will; the private blockchain has the characteristic of private deployment and is restricted to be used within a certain organization; both the consortium blockchain and the permissioned blockchain have the characteristic of private deployment and are jointly used by multiple organizations and institutions, and have an access and permission management mechanism.

[0032] In the embodiments of this application, the blockchain network includes, for example, but is not limited to: the Ethereum network.

[0033] Among them, the terminal device can be hardware or software. When the terminal device is hardware, the terminal device is, for example, a mobile phone, a tablet computer, a desktop computer, a wearable smart device, a smart home device, etc. When the terminal device is software, it can be installed in the above-listed hardware devices. At this time, the terminal device is, for example, multiple software modules or a single software module, etc., and the embodiments of this application do not limit this. The server can be hardware or software. When the server is hardware, the server is a single server or a distributed server cluster composed of multiple servers. When the server is software, it can be multiple software modules or a single software module, etc., and the embodiments of this application do not limit this.

[0034] It should be understood that Figure 1The blockchain nodes in it are only schematic. In actual applications, any number of blockchain nodes can be deployed according to actual needs.

[0035] Figure 2 The flowchart of a method for creating a business archiving node provided by an embodiment of this application. This method can be executed by a business archiving node creation device, which can be implemented in a software and / or hardware manner and is generally integrated in a blockchain node. As Figure 2 shown, this method may include the following steps:

[0036] 201. Determine at least one first blockchain account associated with business requirements from all blockchain accounts on the blockchain network; control any blockchain node in the blockchain network to repeatedly execute steps 202 to 203 to create the blockchain node as a business archiving node.

[0037] 202. In response to the current block height of the blockchain, obtain the account status information of each of the at least one first blockchain account at the current block height.

[0038] 203. Save the account status information of each of the at least one first blockchain account at the current block height to the database.

[0039] In the embodiment of this application, different business requirements require different blockchain accounts to participate. Therefore, determine at least one blockchain account associated with business requirements from all blockchain accounts on the blockchain network, and determine the at least one blockchain account associated with business requirements as at least one first blockchain account. Among them, the number of first blockchain accounts can be one or more.

[0040] In this embodiment, any blockchain node can be selected from the blockchain network for function expansion to make the blockchain node a business archiving node. In actual applications, a blockchain node can be randomly selected from each blockchain node for function expansion. It is also possible to select a blockchain node with good resource usage, good load status, or good communication quality from each blockchain node according to the resource usage, load status, or communication quality of each blockchain node for function expansion.

[0041] In specific implementation, for the blockchain node selected for function expansion, whenever the block height of the blockchain is updated, that is, a new block is added to the blockchain, obtain the account status information of each of the first blockchain accounts at the current block height, and save the account status information of each of the at least one first blockchain account at the current block height to the database to facilitate the query of the account status data of the blockchain accounts involved in meeting business requirements.

[0042] The technical solution provided by the embodiments of the present application can create a new type of business archiving node in the blockchain network, which can not only meet the query requirements of the account status data of each blockchain account in some business scenarios, but also, since the business archiving node is a lightweight archiving node, can greatly reduce the consumption of storage resources caused by using the archiving node and reduce the storage cost.

[0043] In practical applications, when the blockchain is at the current block height, if only the account status information of the blockchain accounts associated with the business requirements at the current block height is retained in the database, some business failures may be caused. Therefore, further optionally, in order to ensure the availability and reliability of the services provided by the blockchain network, the business archiving node can also: in response to the current block height of the blockchain, obtain the account status information of at least one second blockchain account at the current block height respectively, where the second blockchain accounts have no association with the business requirements, and save the account status information of at least one second blockchain account at the current block height respectively to the database.

[0044] It should be noted that when the blockchain is at the current block height, although the account status information of all blockchain accounts at the current block height is saved in the database at the same time, however, the account status information of the blockchain accounts that are not relevant to the business requirements at the current block height is only temporarily saved in the database and will be deleted from the database as appropriate later.

[0045] Therefore, further optionally, the business archiving node can also, in response to the current block height of the blockchain, select a target historical block height from each historical block height that appeared earlier than the current block height on the blockchain and satisfies the preset archiving threshold condition with the current block height; delete the account status information of at least one second blockchain account at the target historical block height that has been saved in the database.

[0046] In this embodiment, the preset archiving threshold condition is determined according to the actual situation, for example, it is 5 block numbers or 8 block numbers. Specifically, for example, if the preset archiving threshold condition is M block numbers, where M is a positive integer. When the current block height on the blockchain is N + M, delete the account status information of at least one second blockchain account at the block height N on the blockchain that has been saved in the database, where N is a positive integer.

[0047] It should be noted that using the preset archiving threshold condition to restrict the deletion time of the account status information of the second blockchain account at the target historical block height in the database can ensure the stability of blockchain generation.

[0048] In practical applications, although the second blockchain account is determined based on its relevance to business requirements, due to the complexity of the blockchain network, the account status information of the second blockchain account may be required during the block generation process. Therefore, optionally, the state tree can be combined to accurately identify whether the account status information of the second blockchain account in the database can be deleted, so as to further ensure the availability and reliability of the services provided by the blockchain network. Specifically, an optional implementation method for deleting the account status information of at least one second blockchain account saved in the database at the target historical block height is as follows: for any second blockchain account, determine whether the node corresponding to the second blockchain account in the state tree corresponding to the target historical block height is referenced by the state tree corresponding to the current block height; if not, delete the account status information of the second blockchain account saved in the database at the target historical block height; if so, retain the account status information of the second blockchain account saved in the database at the target historical block height.

[0049] Specifically, each block corresponds to a state tree, and the leaf nodes of the state tree of each block represent a blockchain account. By analyzing the node information of the state trees corresponding to each block, it is possible to determine whether there is a reference relationship between the nodes of different state trees.

[0050] See Figure 3 As shown, account a is a first blockchain account, and account b is a second blockchain account. Taking M as 1, when the currently added block on the blockchain is block N, originally, the account status information of account b in block N - 1 in the database needs to be deleted. However, since there is a node in the state tree of block N that references the node corresponding to account b in the state tree of block N - 1 ( Figure 3 the corresponding nodes in are connected by lines indicating a reference relationship), there is no need to delete the account status information of account b in block N - 1 in the database.

[0051] In some embodiments, the business archiving node can also receive an account status information restoration instruction, which is used to indicate to restore in the database the account status information of the deleted second blockchain account at each historical block height; in response to the account status information restoration instruction, sequentially execute the transactions related to the deleted second blockchain account in each block on the blockchain to obtain the account status information of the deleted second blockchain account at each historical block height; and re - save the obtained account status information of the deleted second blockchain account at each historical block height to the database.

[0052] In this embodiment, the business archiving node also has the ability to re-archive, enabling the account status information of blockchain accounts that have been deleted from the database to be restored to the database again to meet the flexible and changeable business requirements and further ensure the availability and reliability of the services provided by the blockchain network.

[0053] For example, when the currently added block on the blockchain is block N, the account status information of account b under blocks 1 to N-1 has been deleted from the database. If there is a need to restore the account status information of account b under blocks 1 to N-1 in the database at this time, the transaction data recorded in each of blocks 1 to N-1 can be obtained, and the corresponding transaction data can be re-executed to re-obtain the account status information of account b under blocks 1 to N-1, and the re-obtained account status information of account b under blocks 1 to N-1 can be stored in the database to achieve the re-archiving of the account status information of account b under blocks 1 to N-1 in the database.

[0054] Figure 4 It is a flowchart of a data processing method provided by an embodiment of this application. This method can be executed by a data processing device, which can be implemented in a software and / or hardware manner and is generally integrated in a blockchain node. As Figure 4 shown, this method may include the following steps:

[0055] 401. In response to the current block height of the blockchain, obtain the account status information of at least one first blockchain account respectively at the current block height, where the first blockchain account is a blockchain account on the blockchain network that has a relevance to the business requirements.

[0056] 402. Save the account status information of at least one first blockchain account respectively at the current block height to the database.

[0057] Further optionally, the above method may further include: in response to the current block height of the blockchain, obtain the account status information of at least one second blockchain account respectively at the current block height, where the second blockchain account has no relevance to the business requirements, and save the account status information of at least one second blockchain account respectively at the current block height to the database.

[0058] Further optionally, the above method may further include: in response to the current block height of the blockchain, select, from each historical block height that appears earlier than the current block height on the blockchain, a target historical block height that meets a preset archiving threshold condition; delete the account status information of at least one second blockchain account respectively at the target historical block height that has been saved in the database.

[0059] Further optionally, deleting the account status information of at least one second blockchain account saved in the database at the target historical block height includes: for any second blockchain account, determining whether the node corresponding to the second blockchain account in the state tree corresponding to the target historical block height is referenced by the state tree corresponding to the current block height; if not, deleting the account status information of the second blockchain account saved in the database at the target historical block height; if so, retaining the account status information of the second blockchain account saved in the database at the target historical block height.

[0060] Further optionally, the above method further includes: receiving an account status information restoration instruction, which is used to instruct to restore in the database the account status information of the deleted second blockchain account at each historical block height; in response to the account status information restoration instruction, sequentially execute the transactions related to the deleted second blockchain account in each block on the blockchain to obtain the account status information of the deleted second blockchain account at each historical block height; and save the obtained account status information of the deleted second blockchain account at each historical block height back to the database.

[0061] The technical solution provided by the embodiments of the present application can create a new type of business archiving node in the blockchain network, which can not only meet the query requirements of the account status data of each blockchain account in some business scenarios, but also, since the business archiving node is a lightweight archiving node, can greatly reduce the consumption of storage resources caused by using the archiving node and reduce the storage cost.

[0062] Figure 5 It is a schematic structural diagram of a device for creating a business archiving node provided by an embodiment of the present application. Refer to Figure 5 The device may include:

[0063] A determination module 51, configured to determine at least one first blockchain account associated with the business requirements from all blockchain accounts on the blockchain network;

[0064] A control module 52, configured to control any blockchain node in the blockchain network to repeatedly execute the following steps to create the blockchain node as a business archiving node: in response to the current block height of the blockchain, obtain the account status information of at least one first blockchain account at the current block height; and save the account status information of at least one first blockchain account at the current block height to the database.

[0065] Further optionally, the control module 52 is further configured to control any blockchain node in the blockchain network to perform the following steps: in response to the current block height of the blockchain, obtain the account status information of at least one second blockchain account at the current block height, where the second blockchain account has no relevance to the service requirement, and save the account status information of at least one second blockchain account at the current block height to the database.

[0066] Further optionally, the control module 52 is further configured to control any blockchain node in the blockchain network to perform the following steps: in response to the current block height of the blockchain, select a target historical block height that meets a preset archiving threshold condition with the current block height from each historical block height that appeared earlier than the current block height on the blockchain; delete the account status information of at least one second blockchain account at the target historical block height that has been saved in the database.

[0067] Further optionally, deleting the account status information of at least one second blockchain account at the target historical block height that has been saved in the database includes: for any second blockchain account, determining whether the node corresponding to the second blockchain account in the state tree corresponding to the target historical block height is referenced by the state tree corresponding to the current block height; if not, then delete the account status information of the second blockchain account at the target historical block height that has been saved in the database; if so, then retain the account status information of the second blockchain account at the target historical block height that has been saved in the database.

[0068] Further optionally, the control module 52 is further configured to control any blockchain node in the blockchain network to perform the following steps: receive an account status information restoration instruction, where the account status information restoration instruction is used to indicate to restore in the database the account status information of the deleted second blockchain account at each historical block height; in response to the account status information restoration instruction, sequentially execute the transactions related to the deleted second blockchain account in each block on the blockchain to obtain the account status information of the deleted second blockchain account at each historical block height; save the obtained account status information of the deleted second blockchain account at each historical block height back to the database.

[0069] Figure 5 The specific manners in which each module and unit of the shown service archiving node creation device perform operations have been described in detail in the embodiments of the service archiving node creation method, and will not be elaborated here.

[0070] Figure 6 It is a schematic structural diagram of a data processing device provided by an embodiment of the present application. Refer to Figure 6 and this device may include:

[0071] An acquisition module 61, configured to acquire the account status information of at least one first blockchain account at the current block height of the blockchain in response to the current block height of the blockchain, where the first blockchain account is a blockchain account on the blockchain network that has a relevance to business requirements;

[0072] A storage module 62, configured to store the account status information of at least one first blockchain account at the current block height in a database.

[0073] Further optionally, the acquisition module 61 is further configured to acquire the account status information of at least one second blockchain account at the current block height of the blockchain in response to the current block height of the blockchain, where the second blockchain account has no relevance to business requirements, and store the account status information of at least one second blockchain account at the current block height in the database.

[0074] Further optionally, the above device further includes: a deletion module, configured to select, in response to the current block height of the blockchain, a target historical block height that satisfies a preset archiving threshold condition with the current block height from each historical block height that appeared earlier than the current block height on the blockchain; and delete the account status information of at least one second blockchain account at the target historical block height that has been stored in the database.

[0075] Further optionally, when the deletion module deletes the account status information of at least one second blockchain account at the target historical block height that has been stored in the database, it specifically is configured to: for any second blockchain account, determine whether the node corresponding to the second blockchain account in the state tree corresponding to the target historical block height is referenced by the state tree corresponding to the current block height; if not, delete the account status information of the second blockchain account at the target historical block height that has been stored in the database; if so, retain the account status information of the second blockchain account at the target historical block height that has been stored in the database.

[0076] Further optionally, the above device further includes: a restoration module, configured to receive an account status information restoration instruction, where the account status information restoration instruction is used to indicate restoring the account status information of the deleted second blockchain account at each historical block height in the database; in response to the account status information restoration instruction, sequentially execute the transactions related to the deleted second blockchain account in each block on the blockchain to obtain the account status information of the deleted second blockchain account at each historical block height; and store the obtained account status information of the deleted second blockchain account at each historical block height back in the database.

[0077] Figure 6The specific ways in which each module and unit of the data processing device shown perform operations have been described in detail in the embodiments of the method for creating a business archiving node, and will not be elaborated here.

[0078] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can also be executed by different devices as the execution subject. For example, the execution subject of steps 301 to 302 can be device A; for another example, the execution subject of step 301 can be device A, and the execution subject of step 302 can be device B; and so on.

[0079] In addition, in some of the processes described in the above embodiments and the accompanying drawings, there are multiple operations that appear in a specific order. However, it should be clearly understood that these operations can be executed not in the order in which they appear in this document or in parallel. The operation numbers such as 301 and 302 are only used to distinguish different operations, and the numbers themselves do not represent any execution order. In addition, these processes can include more or fewer operations, and these operations can be executed in order or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit that "first" and "second" are of different types.

[0080] Figure 7 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. As Figure 7 shown, the computer device includes: a memory 71 and a processor 72;

[0081] The memory 71 is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of these data include instructions for any application program or method for operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc.

[0082] The memory 71 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk or an optical disk.

[0083] A processor 72, coupled to a memory 71, is configured to execute a computer program in the memory 71 for: determining at least one first blockchain account associated with a business requirement from all blockchain accounts on a blockchain network; controlling any blockchain node in the blockchain network to repeatedly execute the following steps to cause the blockchain node to create a business archiving node: in response to a current block height of the blockchain, obtaining account status information of each of the at least one first blockchain account at the current block height; saving the account status information of each of the at least one first blockchain account at the current block height to a database; or,

[0084] A processor 72, coupled to a memory 71, is configured to execute a computer program in the memory 71 for: in response to a current block height of the blockchain, obtaining account status information of each of at least one first blockchain account at the current block height, where the first blockchain account is a blockchain account associated with a business requirement on the blockchain network; saving the account status information of each of the at least one first blockchain account at the current block height to a database.

[0085] Further, as Figure 7 shown, the computer device further includes: a communication component 73, a display 74, a power supply component 75, an audio component 76, and other components. Figure 7 Only some components are schematically shown, and it does not mean that the computer device only includes Figure 7 the components shown. Additionally, Figure 7 the components within the dashed box in Figure 7 are optional components, rather than mandatory components, and specifically depend on the product form of the computer device. The computer device of this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, or an IOT device, or can also be a server device such as a conventional server, a cloud server, or a server array. If the computer device of this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, or a smart phone, it may include Figure 7 the components within the dashed box in

[0086] For the detailed implementation process of the processor performing each action, reference can be made to the relevant description in the foregoing method embodiment, and details are not described herein again.

[0087] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed, it can implement each step that can be executed by a computer device in the foregoing method embodiment.

[0088] Correspondingly, an embodiment of the present application further provides a computer program product, including computer programs / instructions, which, when executed by a processor, cause the processor to be able to implement the steps executable by a computer device in the above method embodiments.

[0089] The above communication component is configured to facilitate communication between the device where the communication component is located and other devices in a wired or wireless manner. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0090] The above display includes a screen, and the screen can include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operations.

[0091] The above power supply component provides power for various components of the device where the power supply component is located. The power supply component can include a power management system, one or more power supplies, and other components associated with generating, managing and distributing power for the device where the power supply component is located.

[0092] The above audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), which is configured to receive external audio signals when the device where the audio component is located is in an operation mode, such as a call mode, a recording mode and a voice recognition mode. The received audio signals can be further stored in the memory or sent via the communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals.

[0093] 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 take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take 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.) that contain computer-usable program code.

[0094] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0095] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0097] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0098] The memory may include non-permanent memory in the computer-readable medium, random access memory (RAM), and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.

[0099] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0100] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0101] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for creating a business archiving node, characterized in that, it includes: determining at least one first blockchain account associated with business requirements from all blockchain accounts on the blockchain network; controlling any blockchain node in the blockchain network to repeatedly execute the following steps to create the blockchain node as a business archiving node, where the business archiving node is a lightweight archiving node, and the business archiving node stores all data retained in the full node, and the full node stores complete blockchain data: in response to the current block height of the blockchain, obtaining the account status information of each of the at least one first blockchain account at the current block height; the account status information includes at least one of the following: statement, balance, nonce, code hash, and storage root; saving the account status information of each of the at least one first blockchain account at the current block height to a database; in response to the current block height of the blockchain, obtaining the account status information of each of at least one second blockchain account at the current block height, where the second blockchain account has no association with the business requirements, and saving the account status information of each of the at least one second blockchain account at the current block height to the database; in response to the current block height of the blockchain, selecting a target historical block height that meets a preset archiving threshold condition with the current block height from each historical block height that appeared earlier than the current block height on the blockchain; deleting the account status information of each of the at least one second blockchain account at the target historical block height that has been saved in the database; wherein, deleting the account status information of each of the at least one second blockchain account at the target historical block height that has been saved in the database includes: for any second blockchain account, determining whether the node corresponding to the second blockchain account in the state tree corresponding to the target historical block height is referenced by the state tree corresponding to the current block height; if not, deleting the account status information of the second blockchain account at the target historical block height that has been saved in the database; if so, retaining the account status information of the second blockchain account at the target historical block height that has been saved in the database.

2. The method according to claim 1, characterized in that, it further includes: receiving an account status information restoration instruction for instructing to restore in the database the account status information of the second blockchain account that has been deleted at each historical block height; responding to the account status information restoration instruction, sequentially executing the transactions related to the deleted second blockchain account in each block on the blockchain to obtain the account status information of the deleted second blockchain account at each historical block height; re-saving the obtained account status information of the deleted second blockchain account at each historical block height to the database.

3. A data processing method, characterized in that, Applied to a business archiving node, the business archiving node is a lightweight archiving node that stores all data retained in the full node, and the full node stores complete blockchain data. The method includes: In response to the current block height of the blockchain, obtain the account status information of at least one first blockchain account at the current block height. The first blockchain account is a blockchain account on the blockchain network that has a relevance to business requirements; the account status information includes at least one of the following: statement, balance, nonce, code hash, and storage root; Save the account status information of at least one first blockchain account at the current block height to a database; In response to the current block height of the blockchain, obtain the account status information of at least one second blockchain account at the current block height. The second blockchain account has no relevance to the business requirements, and save the account status information of at least one second blockchain account at the current block height to the database; In response to the current block height of the blockchain, select a target historical block height that meets a preset archiving threshold condition with the current block height from each historical block height that appeared earlier than the current block height on the blockchain; delete the account status information of at least one second blockchain account at the target historical block height that has been saved in the database; Wherein, deleting the account status information of at least one second blockchain account at the target historical block height that has been saved in the database includes: For any second blockchain account, determine whether the node corresponding to the second blockchain account in the state tree corresponding to the target historical block height is referenced by the state tree corresponding to the current block height; If not, delete the account status information of the second blockchain account at the target historical block height that has been saved in the database; If so, retain the account status information of the second blockchain account at the target historical block height that has been saved in the database.

4. A business archiving node creation device Characterized in that Applied to a business archiving node, the business archiving node is a lightweight archiving node that stores all data retained in the full node, and the full node stores complete blockchain data. The device includes: A determination module for determining at least one first blockchain account that has a relevance to business requirements from all blockchain accounts on the blockchain network; the account status information includes at least one of the following: statement, balance, nonce, code hash, and storage root; A control module, configured to control any blockchain node in the blockchain network to repeatedly execute the following steps to create the blockchain node as a business archiving node: In response to the current block height of the blockchain, obtain the account status information of at least one first blockchain account at the current block height; save the account status information of at least one first blockchain account at the current block height to a database; in response to the current block height of the blockchain, obtain the account status information of at least one second blockchain account at the current block height, where the second blockchain account has no relevance to the business requirements, and save the account status information of at least one second blockchain account at the current block height to the database; in response to the current block height of the blockchain, select a target historical block height that meets a preset archiving threshold condition from each historical block height that appeared earlier than the current block height on the blockchain; delete the account status information of at least one second blockchain account at the target historical block height that has been saved in the database. Wherein, deleting the account status information of at least one second blockchain account at the target historical block height that has been saved in the database includes: For any second blockchain account, determine whether the node corresponding to the second blockchain account in the state tree corresponding to the target historical block height is referenced by the state tree corresponding to the current block height; If not, delete the account status information of the second blockchain account at the target historical block height that has been saved in the database; If so, retain the account status information of the second blockchain account at the target historical block height that has been saved in the database.

5. A data processing device Characterized in that It is applied to a business archiving node, the business archiving node is a lightweight archiving node, the business archiving node stores all data retained in a full node, the full node stores complete blockchain data, and the device includes: An acquisition module, configured to, in response to the current block height of the blockchain, obtain the account status information of at least one first blockchain account at the current block height, where the first blockchain account is a blockchain account on the blockchain network that has relevance to the business requirements; the account status information includes at least one of the following: statement, balance, nonce, code hash, and storage root; A saving module, configured to save the account status information of at least one first blockchain account at the current block height to a database; in response to the current block height of the blockchain, obtain the account status information of at least one second blockchain account at the current block height, where the second blockchain account has no relevance to the business requirements, and save the account status information of at least one second blockchain account at the current block height to the database; A deletion module, configured to, in response to a current block height of the blockchain, select, from each historical block height that appears earlier than the current block height on the blockchain, a target historical block height that meets a preset archiving threshold condition; and delete the account status information of each of the at least one second blockchain account saved in the database at the target historical block height. Wherein, deleting the account status information of each of the at least one second blockchain account saved in the database at the target historical block height includes: For any second blockchain account, determining whether a node corresponding to the second blockchain account in the state tree corresponding to the target historical block height is referenced by the state tree corresponding to the current block height; If not, deleting the account status information of the second blockchain account saved in the database at the target historical block height; If so, retaining the account status information of the second blockchain account saved in the database at the target historical block height.

6. A computer device Characterized in that it includes: a memory and a processor; The memory is configured to store a computer program; The processor is coupled to the memory and is configured to execute the computer program to perform the steps in the method according to any one of claims 1-3.

7. A computer storage medium storing a computer program Characterized in that when the computer program is executed by a processor, it causes the processor to be able to implement the steps in the method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Information processing method and device and storage medium

    CN110264217A

  • Data processing method in blockchain system and related equipment

    CN112291376A