Data processing method and device based on block chain, equipment, medium and product

By introducing index cache devices and multi-level storage devices into the blockchain, dynamically separate the hot and cold data of block data, solving the problem of high cost of block data storage in the blockchain, and achieving efficient and economical data management.

CN120045119APending Publication Date: 2025-05-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311587414.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

How to optimize the storage of block data in blockchain, reduce storage costs, and deal with the storage challenges of huge data volumes.

Method used

By introducing an index cache device, a first storage device and a second storage device in the blockchain, the index cache device is used to dynamically detect the used capacity. When the capacity exceeds the upper limit, the index information is separated according to the degree of access to the block data, and the block data with low access frequency is migrated from the high-performance storage device to the low-performance storage device.

Benefits of technology

The optimization of blockchain data storage is achieved, which reduces storage costs and ensures data access performance. By dynamically managing hot and cold data, it avoids the delay and risks caused by manual intervention and large-scale data migration in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045119A_ABST
    Figure CN120045119A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and device based on a block chain, equipment, a medium and a product. The block chain is associated with an index cache device, first storage equipment and second storage equipment, and the storage performance of the first storage equipment is higher than that of the second storage equipment; the method comprises the following steps: if the used capacity of an index cache device exceeds the upper limit of the capacity, separating first index information and second index information from index information stored in the index cache device according to the accessed degree of block data on a block chain, the accessed degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information; and deleting the first index information in the index cache device, deleting the block data corresponding to the first index information from the first storage device, and adding the block data corresponding to the first index information into the second storage device. By adopting the method and the device, the storage of the block data in the block chain can be optimized, and the storage cost of the block data in the block chain is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and in particular, to the field of blockchain technologies. Specifically, it relates to a blockchain-based data processing method, a blockchain-based data processing device, a computer device, a computer-readable storage medium, and a computer program product. Background Art

[0002] As a decentralized distributed ledger, blockchain is widely used in various business scenarios due to its characteristics of being publicly transparent and tamper-proof. The amount of data in the block data of the blockchain is huge, especially for some large blockchain networks. A large blockchain network refers to a blockchain network that can process more blockchain transactions per unit time. More blockchain transactions mean more block data. The huge amount of block data in the blockchain poses a challenge to the storage of block data in the blockchain. Therefore, how to optimize the storage of block data in the blockchain and save the storage cost of block data in the blockchain has become a research hotspot in current blockchain technologies. Summary of the Invention

[0003] Embodiments of this application provide a blockchain-based data processing method, device, equipment, medium, and product, which can optimize the storage of block data in the blockchain and save the storage cost of block data in the blockchain.

[0004] On the one hand, embodiments of this application provide a blockchain-based data processing method. The blockchain is associated with an index cache device, a first storage device, and a second storage device. Both the first storage device and the second storage device are used to store block data on the blockchain, and the storage performance of the first storage device is higher than that of the second storage device. The index cache device is used to store index information corresponding to the block data on the blockchain. The blockchain-based data processing method includes:

[0005] Obtain the used capacity of the index cache device;

[0006] If the used capacity exceeds the capacity limit, then separate first index information and second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain. The access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information. The access degree of the block data refers to the possibility of the block data being accessed;

[0007] Delete the first index information from the index cache device, delete the block data corresponding to the first index information from the first storage device, and add the block data corresponding to the first index information to the second storage device.

[0008] Accordingly, an embodiment of the present application provides a blockchain-based data processing device. The blockchain is associated with an index cache device, a first storage device, and a second storage device. Both the first storage device and the second storage device are used to store block data on the blockchain, and the storage performance of the first storage device is higher than that of the second storage device. The index cache device is used to store index information corresponding to the block data on the blockchain. The blockchain-based data processing device includes:

[0009] An acquisition unit, configured to acquire the used capacity of the index cache device;

[0010] A processing unit, configured to, if the used capacity exceeds the capacity limit, separate first index information and second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain. The access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information. The access degree of the block data refers to the possibility of the block data being accessed;

[0011] The processing unit is further configured to delete the first index information from the index cache device, delete the block data corresponding to the first index information from the first storage device, and add the block data corresponding to the first index information to the second storage device.

[0012] In one implementation, the processing unit is further configured to perform the following steps:

[0013] If the target block data in the second storage device is queried, add the index information corresponding to the target block data to the index cache device;

[0014] And, delete the target block data from the second storage device, and add the target block data to the first storage device.

[0015] In one implementation, when the acquisition unit is configured to acquire the used capacity of the index cache device, it is specifically configured to perform any one of the following:

[0016] When new block data is added to the blockchain, acquire the used capacity of the index cache device;

[0017] The index cache device separates index information according to an index separation period. If the index separation time corresponding to the current index separation period is reached, acquire the used capacity of the index cache device.

[0018] In one implementation, when the processing unit is configured to separate first index information and second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain, it is specifically configured to perform the following steps:

[0019] Obtain the storage method of the index information in the index cache device, and store the block data on the blockchain in the index cache device in the order corresponding to the access degree;

[0020] Determine an index information separation strategy matching the storage method according to the storage method of the index information in the index cache device;

[0021] Separate the first index information and the second index information from the index information stored in the index cache device according to the matching index information separation strategy.

[0022] In one implementation, the storage method of the index information in the index cache device includes a first storage method, and the first storage method means that the index information stored in the index cache device is sequentially stored in the index cache device in the order of the access degree of the corresponding block data from low to high; the index information separation strategy matching the first storage method is the first index information separation strategy;

[0023] The processing unit, when separating the first index information and the second index information from the index information stored in the index cache device according to the first index information separation strategy, is specifically used to perform the following steps:

[0024] Determine the head index information arranged before the target position in the index information stored in the index cache device as the first index information, and determine the tail index information arranged at and after the target position as the second index information.

[0025] In one implementation, the index cache device includes N index cache sub-spaces, each index cache sub-space is used to cache at least one index information, and N is an integer greater than 1; the storage method of the index information in the index cache device includes a second storage method, and the second storage method means that the index information stored in the index cache device is sequentially stored in the N index cache sub-spaces in the order of the access degree of the corresponding block data from low to high; the index information separation strategy matching the second storage method is the second index information separation strategy;

[0026] The processing unit, when separating the first index information and the second index information from the index information stored in the index cache device according to the second index information separation strategy, is specifically used to perform the following steps:

[0027] Determine the index information stored in the K index cache sub-spaces that preferentially store index information among the N index cache sub-spaces as the first index information, and determine the index information stored in the remaining N - K index cache sub-spaces as the second index information, where K is an integer less than or equal to N.

[0028] In one implementation, the obtaining unit is further used to perform the following steps:

[0029] Obtain the newly added block data in the blockchain, and generate index information corresponding to the newly added block data according to the hash information corresponding to the newly added block data;

[0030] The processing unit is further configured to perform the following steps:

[0031] If the used capacity of the index cache device does not exceed the capacity limit, add the index information corresponding to the newly added block data to the index cache device, and add the newly added block data to the first storage device;

[0032] If the used capacity of the index cache device exceeds the capacity limit, after separating the index information in the index cache device, add the index information corresponding to the newly added block data to the index cache device, and add the newly added block data to the first storage device.

[0033] In one implementation, the blockchain is further associated with a data cache device; the processing unit is further configured to perform the following steps:

[0034] Add the newly added block data to the data cache device;

[0035] Add the storage location information of the newly added block data to the index cache device, and the storage location information of the newly added block data is used to indicate that the newly added block data is stored in the data cache device and the first storage device.

[0036] In one implementation, the data cache device releases the storage space according to the cache release period; the processing unit is further configured to perform the following steps:

[0037] After adding the newly added block data to the data cache device, if the data cache device reaches the cache release time corresponding to the current cache release period, release the storage space of the data storage device;

[0038] Update the storage location information of the newly added block data in the index cache device, and the updated storage location information is used to indicate that the newly added block data is stored in the first storage device.

[0039] In one implementation, the processing unit is further configured to perform the following steps:

[0040] In response to a block data query request, generate reference index information corresponding to the reference hash information according to the reference hash information of the reference block data to be queried in the request;

[0041] Query the reference index information in the index cache device;

[0042] If the reference index information is queried in the index cache device, query and return the reference block data corresponding to the reference index information in the first storage device;

[0043] If the reference index information is not found in the index cache device, query in the second storage device and return the reference block data corresponding to the reference index information.

[0044] In one implementation, the blockchain is further associated with a data cache device; the index cache device further stores storage location information corresponding to the block data, and the storage location information indicates that the storage location of the corresponding block data is the data cache device or the first storage device; the processing unit is further configured to perform the following steps:

[0045] If the reference index information is found in the index cache device, obtain the storage location information corresponding to the reference index information;

[0046] If the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in both the data cache device and the first storage device, query in the data cache device and the first storage device and return the reference block data corresponding to the reference index information;

[0047] If the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in the first storage device, query in the first storage device and return the reference block data corresponding to the reference index information.

[0048] Correspondingly, an embodiment of the present application provides a computer device, which includes:

[0049] A processor, adapted to implement a computer program;

[0050] A computer-readable storage medium storing a computer program, the computer program being adapted to be loaded and executed by the processor to perform the above-mentioned blockchain-based data processing method.

[0051] Correspondingly, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when read and executed by a processor of a computer device, causes the computer device to perform the above-mentioned blockchain-based data processing method.

[0052] Correspondingly, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the above-mentioned blockchain-based data processing method.

[0053] In the embodiments of the present application, an index caching device associated with a blockchain can be used to store index information corresponding to block data on the blockchain. When the used capacity of the index caching device exceeds the capacity limit, it can trigger the separation of first index information and second index information from the index information stored in the index caching device according to the access degree of the block data on the blockchain. The access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information. The access degree of the block data refers to the possibility of the block data being accessed. Then, the first index information can be deleted from the index caching device, the block data corresponding to the first index information can be deleted from the first storage device, and the block data corresponding to the first index information can be added to the second storage device. The storage performance of the first storage device is higher than that of the second storage device. That is to say, when the used capacity of the index caching device exceeds the capacity limit, it can automatically separate the block data with a high access possibility and the block data with a low access possibility in the blockchain. The block data with a high access possibility can be stored in the first storage device with high storage performance, and the block data with a low access possibility can be stored in the second storage device with low storage performance, rather than storing all the block data in the first storage device with high storage performance. The storage cost of a database with high storage performance is relatively high. Therefore, by separating and storing the block data with different access possibilities, the storage of the block data in the blockchain can be optimized, and the storage cost of the block data in the blockchain can be saved. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

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

[0056] Figure 2 is a schematic diagram of the structure of a blockchain provided by an embodiment of the present application;

[0057] Figure 3 is a schematic diagram of the structure of a block generation process provided by an embodiment of the present application;

[0058] Figure 4 is a schematic diagram of the architecture of a data processing system provided by an embodiment of the present application;

[0059] Figure 5 is a schematic diagram of the process of cold and hot separation of block data provided by an embodiment of the present application;

[0060] Figure 6 is a schematic flowchart of a block data query process provided by an embodiment of the present application;

[0061] Figure 7 is a schematic flowchart of a data processing method based on a blockchain provided by an embodiment of the present application;

[0062] Figure 8 is a schematic diagram of a separation method of index information provided by an embodiment of the present application;

[0063] Figure 9 is a schematic diagram of another separation method of index information provided by an embodiment of the present application;

[0064] Figure 10 is a schematic flowchart of a writing process for adding block data provided by an embodiment of the present application;

[0065] Figure 11 is a schematic flowchart of another data processing method based on a blockchain provided by an embodiment of the present application;

[0066] Figure 12 is a schematic flowchart of another block data query process provided by an embodiment of the present application;

[0067] Figure 13 is a schematic structural diagram of a data processing device based on a blockchain provided by an embodiment of the present application;

[0068] Figure 14 is a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners

[0069] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0070] In order to be able to more clearly understand the technical solutions provided by the embodiments of the present application, some key terms involved in the technical solutions provided by the embodiments of the present application are introduced here first:

[0071] (1) Blockchain network:

[0072] A blockchain network is a peer-to-peer connected network. Each blockchain node in the peer-to-peer connection is called a peer node. The blockchain network is based on a specific type of network protocol, enabling peer nodes not to require a central node to maintain the network state. Each peer node maintains the node state of the entire network and its connection state with adjacent nodes through broadcast interactions with adjacent nodes.

[0073] The blockchain network can be understood as Figure 1 The data sharing system 10 shown in the figure. The data sharing system 10 refers to a system used for data sharing between blockchain nodes. This data sharing system may include multiple (multiple can include two or more) blockchain nodes 101. The multiple blockchain nodes 101 can refer to each client, terminal device, or server in the data sharing system. When each blockchain node 101 is operating normally, it can receive input information (for example, a blockchain transaction) and maintain the shared data within the data sharing system based on the received input information. To ensure information interconnection within the data sharing system, there can be information connections between each blockchain node in the data sharing system, and information can be transmitted between blockchain nodes through the above information connections. For example, when any blockchain node in the data sharing system receives input information, other nodes in the data sharing system obtain the input information according to the consensus algorithm and store the input information as data in the shared data, so that the data stored on all blockchain nodes in the data sharing system is consistent.

[0074] For each blockchain node in the data sharing system, it has a corresponding node identifier, and each blockchain node in the data sharing system can store the node identifiers of other blockchain nodes in the data sharing system, so as to broadcast the generated block to other blockchain nodes in the data sharing system based on the node identifiers of other blockchain nodes in the future. Each blockchain node can maintain a node identifier list as shown in Table 1 below, and store the node name and node identifier corresponding to each other in the node identifier list. Among them, the node identifier can be an IP (Internet Protocol) address and any other information that can be used to identify the blockchain node. Table 1 only uses the IP address as an example for illustration:

[0075] Table 1

[0076] Node Name Node Identifier Node 1 111.111.111.111 Node 2 222.222.222.222 … … Node N NNN.NNN.NNN.NNN

[0077] (2) Blockchain:

[0078] Each blockchain node in the blockchain network stores an identical blockchain. Blockchain is a distributed ledger technology in the field of information technology, generally composed of consensus, transaction blocks and state data storage, cryptographic identity security, etc. Since the ledger is stored distributively and the blocks are consensus-based, it has features such as being tamper-proof, traceable, and jointly maintained. A blockchain consists of multiple blocks. Refer to Figure 2 the blockchain structure shown. A blockchain consists of multiple blocks. The genesis block in the blockchain includes a block header and a block body. The input information feature value, version number, timestamp, and difficulty value are stored in the block header of the genesis block. The input information (i.e., transaction) is stored in the block body of the genesis block; the next block of the genesis block uses the genesis block as its parent block. The next block also includes a block header and a block body. In addition to storing the input information feature value, version number, timestamp, and difficulty value of the current block, the block header of the next block also stores the block header feature value of the parent block, and so on, making the block data stored in each block in the blockchain associated with the block data stored in its parent block, ensuring the security of the input information in the block. In the embodiments of the present application, the block data on the blockchain refers to the complete block information including the block header and the block body.

[0079] When generating each block in the blockchain, refer to Figure 3 the block generation process shown. When the blockchain node where the blockchain is located receives the input information, it verifies the input information. After the verification is completed, it stores the input information in the transaction pool and updates the hash tree used to record the input information; then, it updates the timestamp to the time when the input information is received and tries different random numbers, and performs the eigenvalue calculation multiple times so that the calculated eigenvalue can satisfy the following formula:

[0080] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET

[0081] where SHA256 (Secure Hash Algorithm 256, a secure hash algorithm) is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header feature value of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time of the updated timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, and this eigenvalue threshold can be determined according to nbits.

[0082] In this way, when a random number that satisfies the above formula is calculated, the information can be stored correspondingly to generate a block header and a block body, thereby obtaining the current block. Subsequently, the blockchain node where the blockchain is located sends the newly generated block to other blockchain nodes in the data sharing system according to the node identifiers of other blockchain nodes in the data sharing system. Other blockchain nodes verify the newly generated block and add the newly generated block to the blockchain they store after the verification is completed.

[0083] (3) Data cold and hot separation:

[0084] Data cold and hot separation is a data management strategy aimed at optimizing data storage and access efficiency. The data cold and hot separation strategy can divide data into two or more different levels, each level having different access requirements and storage characteristics. In the embodiment of the present application, the block data on the blockchain can be divided into two levels, one level is hot data (HotData), and the other level is cold data (Cold Data).

[0085] Generally, hot data refers to data that is frequently accessed and crucial to the system performance. Such data is usually stored in high-performance storage devices, which can provide fast access and response, but are accompanied by relatively high storage costs. In the embodiment of the present application, hot data specifically refers to block data with a high degree of access in the blockchain. A high degree of access can be understood as a high possibility of being accessed. The block data with a high degree of access can include at least one of the following: block data that has been accessed recently (the access in the embodiment of the present application specifically refers to query) and block data that has been newly generated. Generally, cold data refers to data that is not frequently accessed or has relatively low performance requirements. Such data is usually stored in low-performance storage devices, such as hard disk drives (HDD) or cloud storage. Low-performance storage devices have slower access and response speeds, but the storage costs are not high. In the embodiment of the present application, cold data specifically refers to block data with a low degree of access in the blockchain. A low degree of access can be understood as a low possibility of being accessed. The block data with a low degree of access can include at least one of the following: block data that has not been accessed recently and block data with a long generation time.

[0086] Based on the introduction of the above key terms, it can be known that the block data on the blockchain can be subjected to data cold and hot separation. The separated hot data is stored in a storage device with high storage performance, and the separated cold data is stored in a storage device with low storage performance. The storage performance of a storage device refers to the performance of the storage device in terms of data storage speed and data access (data access specifically refers to data query) speed, etc. And usually, the storage performance of a storage device is positively correlated with the storage cost of the storage device. A storage device with high storage performance refers to a storage device with fast data storage speed and fast data query speed. Storing the hot data on the blockchain in a storage device with high storage performance can keep the data query efficiency of the hot data on the blockchain at a relatively high level; while a storage device with low storage performance refers to a storage device with slow data storage speed and slow data query speed, and the storage cost of a storage device with low storage performance is relatively low. Storing the cold data on the blockchain in a storage device with low storage performance can reduce the storage cost of the block data on the blockchain.

[0087] When performing data cold and hot separation on the block data on the blockchain, if manual separation is carried out with time as the dimension, manually dividing the block data on the blockchain into hot data and cold data and storing them on different storage devices, the following problems may exist: First, the method of manual data cold and hot separation requires a large amount of manual intervention and maintenance because the usage pattern of block data may change over time, which increases the management cost and potential error risk; Second, the migration of block data usually takes a certain amount of time, which may lead to delays in accessing block data, especially during large-scale block data migration. Even if there is a power outage during the migration process, it may lead to situations such as loss of block data; Third, some solutions may sacrifice access performance in the pursuit of storage cost savings, resulting in a long response time when accessing hot data.

[0088] Based on this, an embodiment of the present application proposes a blockchain-based data processing method. The blockchain-based data processing method provides an index caching device. The index caching device can be used to store index information corresponding to block data on the blockchain, and can also dynamically detect the capacity of the index caching device. When it is monitored that the used capacity of the index caching device exceeds the capacity upper limit, the index caching device can be triggered to automatically identify and separate the index information of hot and cold data. The data processing method provided by the embodiment of the present application can achieve: First, reduce the manual intervention maintenance cost. The embodiment of the present application can dynamically detect the access pattern of block data, automatically identify hot and cold data, and automatically execute the block data migration operation without manual intervention, which reduces the management cost and potential error risk; Second, the automated data management and migration mechanism in the embodiment of the present application can immediately respond to changes in the block data access pattern. Therefore, data cold and hot separation no longer requires large-scale block data migration, but is dynamically adjusted according to real-time needs, which reduces the latency when accessing block data and reduces the risk of block data loss caused by power outages and other situations; Third, the embodiment of the present application can achieve an intelligent balance between access performance and storage cost. It can store hot data in high-performance storage devices to reduce the response time when accessing hot data and improve the access efficiency of hot data. At the same time, cold data can be moved to more economical storage devices to save storage costs. That is to say, the blockchain-based data processing method provided by the embodiment of the present application can simultaneously provide the access performance of block data on the blockchain and the storage economy of block data on the blockchain.

[0089] In addition, the blockchain-based data processing method provided by the embodiment of the present application also supports the warming up of cold data. The warming up of cold data means that when cold data is accessed again, it can be considered that the possibility of the cold data being accessed has increased, and the cold data can be re-stored in a storage device with high storage performance to improve the access performance for future access to the cold data. This helps to manage cold data without affecting the access performance.

[0090] The blockchain-based data processing method provided by the embodiment of the present application can be applied to any business scenario that requires block data storage and block data query. For example, it can be applied to a vehicle driving scenario that requires block data storage and block data query, and an artificial intelligence scenario that requires block data storage and block data query, and so on. Among them:

[0091] A vehicle driving scenario refers to a business scenario in which a vehicle travels with a driver's operation (i.e., an active driving scenario) or without a driver's operation (i.e., an autonomous driving scenario). In a vehicle driving scenario, blockchain can be used to store vehicle driving data (for example, vehicle driving data can include driving routes, driving times, distances, fuel consumption, vehicle speeds, etc.). The on-vehicle terminal in the vehicle can upload the collected vehicle driving data to the blockchain for storage. When storing vehicle driving data on the blockchain, cold data and hot data in the vehicle driving data can be automatically identified and separated. The separated hot data can be stored in a storage device with high storage performance and high storage cost, which can improve the access efficiency of the hot data in the vehicle driving data. The separated cold data can be stored in a storage device with low storage performance and low storage cost, which can reduce the storage cost of the cold data in the vehicle driving data.

[0092] An artificial intelligence scenario refers to a business scenario in which data is processed by artificial intelligence based on artificial intelligence models (such as machine learning models, deep learning models, etc.). In an artificial intelligence scenario, blockchain can be used to store artificial intelligence data (for example, artificial intelligence data can include raw data, intermediate results during the artificial intelligence processing of raw data, and artificial intelligence processing results of raw data, etc.). The computer device deploying the artificial intelligence model can upload the artificial intelligence data to the blockchain for storage. When storing artificial intelligence data on the blockchain, cold data and hot data can be automatically identified and separated. The separated hot data can be stored in a storage device with high storage performance and high storage cost, which can improve the access efficiency of the hot data in the artificial intelligence data. The separated cold data can be stored in a storage device with low storage performance and low storage cost, which can reduce the storage cost of the cold data in the artificial intelligence data.

[0093] Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable machines to have the functions of perception, reasoning, and decision-making.

[0094] In addition, the collection and processing of relevant data in the embodiments of the present application should strictly comply with the requirements of relevant laws and regulations. To obtain personal information, the informed consent of the individual subject (or a legal basis for information acquisition) must be obtained, and subsequent data use and processing behaviors should be carried out within the scope authorized by laws and regulations and the individual information subject. For example, when the embodiments of the present application are applied to specific products or technologies, such as obtaining block data, the permission or consent of the owner of the block data needs to be obtained, and the collection, use, and processing of relevant data (such as the storage and access of block data) need to comply with the relevant laws, regulations, and standards of the relevant region.

[0095] The following describes the data processing system provided in the embodiments of the present application with reference to the accompanying drawings. The data processing system is suitable for implementing the blockchain-based data processing method provided in the embodiments of the present application.

[0096] As Figure 4 shown, the data processing system may include a data query device 401 and a data processing device 402. The embodiments of the present application do not limit the connection manner between the data query device 401 and the data processing device 402. For example, a direct communication connection may be established between the data query device 401 and the data processing device 402 through wired communication, or an indirect communication connection may be established between the data query device 401 and the data processing device 402 through wireless communication. Among them:

[0097] (1) Data query device 401:

[0098] The data query device 401 may be a terminal device used by the data query object. The data query object may request to query block data on the blockchain through the data query device 401. Specifically, a block data query client may run in the data query device 401. The data query object may input the information to be queried (for example, the information to be queried may be the hash information corresponding to the block data or the hash information corresponding to the transaction data, etc.) in the block data query client. The block data query client may generate a block data query request according to the information to be queried and send the block data query request to the data processing device 402 through the data query device 401. The embodiments of the present application do not limit the type of the block data query client. For example, the block data query client may include, but is not limited to, any one of the following: a block data query application, a block data query applet, a block data query software, and a block data query browser.

[0099] (2) Data processing device 402:

[0100] The data processing device 402 may be a blockchain node in a blockchain network. The blockchain node may be a terminal device or a server. First, the architecture of the data processing device 402 will be introduced below. Based on the architecture of the data processing device 402, the functions of the data processing device 402 will be introduced.

[0101] As Figure 4 shown, the data processing device 402 may include a data temporary storage layer, a data scheduling and management layer, and a hot and cold data storage layer. Among them:

[0102] ① Data temporary storage layer: The data temporary storage layer may include a data cache device and an index cache device. Among them: The data cache device may be used to store the block data generated in the most recent period. For example, the data cache device may be used to store the block data generated in the most recent day. When the specified time point has passed, the data cache device will automatically be cleared; that is to say, the data cache device may release the storage space according to the cache release period (for example, the cache release period may be one day). The data cache device may store the block data generated within the current cache release period. When the cache release time point of the current cache release period is reached, the memory space of the data cache device may be cleared. It can be seen that the block data stored in the data cache device is the latest generated block data in the blockchain. As the block data on the blockchain (for example, Figure 4 the blockchain shown including block data 1 - block data X) is continuously generated, the block data stored in the data cache device can be continuously updated.

[0103] The index cache device may be used to store the index information corresponding to the block data on the blockchain. For example, Figure 4 the index cache device shown contains three groups of index information, and each group of index information contains M index information, where M is an integer greater than 1; the index information corresponding to any block data can be used to uniquely identify the corresponding block data. The index cache device may be a data structure for quickly and efficiently querying index information. The embodiment of the present application does not limit the type of the index cache device. For example, the index cache device may be a cuckoo filter; the cuckoo filter is a fast and efficient data structure for data lookup and query. It is usually used to solve the set membership check problem. The cuckoo filter combines the concept of cuckoo hashing and the idea of bloom filter, and has the advantages of efficient data lookup and less memory space occupation. The index information in the cuckoo filter may be, for example, cuckoo hashing.

[0104] ② Data scheduling and management layer: The data scheduling and management layer may include a data cold and hot separation strategy module, a data query module, and a data warming module. Among them: The data cold and hot separation strategy module can set the capacity threshold of the index cache device (in the embodiments of the present application, the capacity threshold can also be referred to as the upper capacity limit). When the data cache amount in the index cache device (in the embodiments of the present application, the data cache amount in the index cache device can also be referred to as the used capacity of the index cache device) reaches the set capacity threshold, data cold and hot separation can be triggered. After the trigger, the infrequently used cold data (i.e., the cold data with a low access degree) can be written into the cold data storage device, the frequently used hot data (i.e., the hot data with a high access degree) can be written into the hot data storage device, and the index information corresponding to the infrequently used cold data can also be triggered to be deleted from the index cache device. Thus, the index information stored in the index cache device can be the index information corresponding to the hot data.

[0105] When the data query module receives a block data query request, the data query module can first query the index information in the index cache device. If the block data currently requested to be queried is hot data, its index information exists in the index cache device, and the storage location of the block data currently requested to be queried can be located (for example, the block data currently requested to be queried can be stored in the hot data storage device or the data cache device). Then, the data query module queries and returns the corresponding block data from the data cache device or the hot data storage device; if the block data currently requested to be queried is cold data, its index information is not in the index cache device, and the corresponding block data can be automatically queried and returned from the cold data storage device.

[0106] The data warming module can be used to detect the access situation of cold data. When the cold data is accessed again, the data warming module can trigger a warming operation. After the trigger, the warming operation refers to re-storing the index information corresponding to the cold data into the index cache device and re-storing the cold data into the hot data storage device to improve the future access performance of the cold data.

[0107] ③ Cold and hot data storage layer: The cold and hot data storage layer may include a hot data storage device and a cold data storage device. Among them: The hot data storage device can be used to store hot data, and a high-performance database or storage engine can be used. Although it requires a relatively high storage cost, it can improve the query response speed and the query efficiency of block data when querying block data. The cold data storage device can be used to store cold data, and inexpensive storage devices or cloud storage can be used. Since the possibility of cold data being accessed is relatively low and the requirement for query response speed is not high, storage devices with low storage costs can be used to save the overall storage cost of block data.

[0108] Based on the architecture of the data processing device 402, the data processing device 402 can have the following functions: the data processing device 402 can be used to automatically separate cold data and hot data in the block data and store the cold data and hot data separately; the data processing device 402 can also be used to process the block data query requests from the data query device 401; the data processing device 402 can also be used to perform a warming-up operation on the cold data after the cold data is accessed.

[0109] It can be understood that Figure 4 The data processing system of the illustrated embodiment is to more clearly illustrate the technical solution of the embodiment of the present application and does not constitute a limitation on the technical solution provided by the embodiment of the present application. Those skilled in the art know that with the evolution of the system architecture and the emergence of new business scenarios, the technical solution provided by the embodiment of the present application is equally applicable to similar technical problems.

[0110] Based on Figure 4 The data processing flow in the embodiment of the present application based on the illustrated data processing system can include a block data cold and hot separation process and a block data query process. Among them:

[0111] (1) Block data cold and hot separation process:

[0112] As Figure 5 shown, the block data cold and hot separation process can include: the data cold and hot separation policy module can dynamically detect the capacity of the index cache device, and the dynamic detection can include any one of the following: detecting the capacity of the index cache device once every time a new block data is generated on the blockchain, and regularly detecting the capacity of the index cache device according to the index separation period. Taking the case of detecting the capacity of the index cache device once every time a new block data is generated on the blockchain as an example, when a new block data is generated on the blockchain, the new block data can be written into the data cache device for storage. When the used capacity of the index cache device exceeds the capacity upper limit, the data cold and hot separation policy module can separate the index information corresponding to the hot data and the index information corresponding to the cold data from the index information stored in the index cache device; the data cold and hot separation policy module can delete the index information corresponding to the cold data from the index cache device, delete the cold data from the hot data storage device, and add the cold data to the cold data storage device; then, the index information corresponding to the new block data can be written into the index cache device (specifically, it can be written to the tail of the index cache device) for storage, and the new block data can be added to the hot data storage device for storage. When the used capacity of the index cache device does not exceed the capacity upper limit, the index information corresponding to the new block data can be directly written into the index cache device (specifically, it can be written to the tail of the index cache device) for storage, and the new block data can be added to the hot data storage device for storage.

[0113] (2) Block data query process:

[0114] As Figure 6 shown, the block data query process may include: when receiving a query request for reference block data sent by the data query device 401, the data query module may query the index information corresponding to the reference block data in the index cache device; if the index information corresponding to the reference block data is found in the index cache device, it may indicate that the reference block data is hot data, and the data query module may further obtain the storage location of the reference block data in the index cache device (for example, the reference block data may be stored in the data cache device or the hot data storage device), so as to query and return the reference block data to the data query device 401 based on the storage location of the reference block data; if the index information corresponding to the reference block data is not found in the index cache device, it may indicate that the reference block data is cold data, and the data query module may further query and return the reference block data to the data query device 401 in the cold data storage device. Moreover, the data warming module may add the index information corresponding to the reference block data to the index cache device, delete the reference block data from the cold data storage device, and add it to the hot data storage device.

[0115] Based on the above block data cold and hot separation process, it can be seen that the block data with a high access possibility is stored in the hot data storage device with high query performance, and the block data with a low access possibility is stored in the cold data storage device with low storage cost, which can reduce the storage cost of block data on the premise of ensuring that hot data can be quickly queried. Based on the above block data query process, it can be seen that the index cache device provides an intelligent hot data index, which can quickly locate the storage location of the data block to be queried, and can further improve the data query efficiency.

[0116] Based on the above introduction of the data processing system, the data processing method based on blockchain provided by the embodiments of the present application will be introduced in detail below with reference to the accompanying drawings.

[0117] The embodiments of the present application provide a data processing method based on blockchain, and this data processing method based on blockchain details the cold and hot separation process of block data. This data processing method based on blockchain can be executed by a computer device, and the computer device may be, for example, the data processing device 402 in the data processing system as Figure 4 shown above. As Figure 7 shown, this data processing method based on blockchain may include but is not limited to the following steps S701 - step S703:

[0118] S701, obtain the used capacity of the index cache device.

[0119] When storing block data on a blockchain, the blockchain can be associated with an index cache device, a data cache device, a first storage device, and a second storage device. Among them:

[0120] The index cache device can be used to store the index information corresponding to the block data on the blockchain; the index information corresponding to the block data can be determined according to the hash information of the block data. The hash information of the block data can be directly determined as the index information corresponding to the block data, or the hash information of the block data can be calculated to obtain the index information corresponding to the block data. For example, when the index cache device is a cuckoo filter, the index information corresponding to the block data can be obtained by calculating the hash information of the block data using the cuckoo hash algorithm. The data cache device can be used to store the recently generated block data on the blockchain. For example, it can be used to store the block data generated in the most recent day.

[0121] Both the first storage device and the second storage device can be used to store the block data on the blockchain, and the storage performance of the first storage device is higher than that of the second storage device. Specifically, the storage performance of the first storage device being higher than that of the second storage device can refer to: both the data storage speed and the data query speed of the first storage device are higher than those of the second storage device. Further, the first storage device can be a hot data storage device and can be used to store the hot data with a high degree of access in the block data, and the second storage device can be a cold data storage device and can be used to store the cold data with a low degree of access in the block data.

[0122] The degree of access of the block data refers to the possibility of the block data being accessed, and the possibility of being accessed is related to the generation time of the block data and the recent access situation of the block data. For example, the recently generated block data can be considered as block data with a high possibility of being accessed, that is, the recently generated block data can be hot data with a high degree of access. On the contrary, the block data with a long generation time can be considered as block data with a low possibility of being accessed, that is, the block data with a long generation time can be cold data with a low degree of access; another example is that the block data that has been accessed recently can be considered as block data with a high possibility of being accessed, that is, the block data that has been accessed recently can be hot data with a high degree of access. On the contrary, the block data that has not been accessed recently can be considered as block data with a low possibility of being accessed, that is, the block data that has not been accessed recently can be cold data with a low degree of access.

[0123] The computer device can dynamically detect the capacity of the index cache device. When the used capacity of the index cache device exceeds the capacity upper limit, it triggers the separation of index information. Among them, the separation of index information means: among the index information stored in the index cache device, separating the index information corresponding to the block data with a low access degree and the index information corresponding to the block data with a high access degree, deleting the index information corresponding to the block data with a low access degree in the index cache device, deleting the block data with a low access degree in the first storage device, and adding the block data with a low access degree in the second storage device, so as to ensure that the index information stored in the index cache device is the index information corresponding to the block data with a high access degree, the block data with a high access degree is stored in the first storage device, and the block data with a low access degree is stored in the second storage device. The dynamic detection can include any one of the following: First, when new block data is added to the blockchain, the capacity of the index cache device can be detected. That is to say, when new block data is added to the blockchain, the used capacity of the index cache device can be obtained. Second, the index cache device can perform index information separation according to the index separation period. If the index separation time corresponding to the current index separation period is reached, the capacity of the index cache device can be detected. That is to say, if the index separation time corresponding to the current index separation period is reached, the capacity of the index cache device can be detected, and the used capacity of the index cache device can be obtained.

[0124] S702, if the used capacity exceeds the capacity upper limit, then according to the access degree of the block data on the blockchain, separate the first index information and the second index information in the index information stored in the index cache device, and the access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information.

[0125] If the used capacity of the index cache device exceeds the capacity upper limit, index information separation can be performed. Specifically, it can include separating the first index information and the second index information in the index information stored in the index cache device according to the access degree of the block data on the blockchain, and the access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information.

[0126] Specifically, the block data on the blockchain can be stored in the index cache device in the order corresponding to the access degree. The way of separating index information is related to the storage method of index information in the index cache device. The storage method of index information in the index cache device can be obtained, and according to the storage method of index information in the index cache device, an index information separation strategy matching the storage method can be determined. Then, according to the matching index information separation strategy, the first index information and the second index information can be separated from the index information stored in the index cache device. The following respectively introduces different ways of separating index information in different storage methods of index information in the index cache device:

[0127] (1) The storage method of index information in the index cache device includes the first storage method:

[0128] The storage method of index information in the index cache device may include the first storage method. The first storage method means that the index information stored in the index cache device is sequentially stored in the index cache device in the order of the access degree of the corresponding block data from low to high. That is to say, the index information at the head of the index cache device is the index information corresponding to the block data with a low access degree, and the index information at the tail of the index cache device is the index information corresponding to the block data with a high access degree.

[0129] In the first storage method, the index information separation strategy matching the first storage method is the first index information separation strategy. The process of separating the first index information and the second index information from the index information stored in the index cache device according to the first index information separation strategy may include: determining the head index information arranged before the target position in the index information stored in the index cache device as the first index information, and determining the tail index information arranged at and after the target position as the second index information. As Figure 8 shown, after the index cache device stores 8000 index information and reaches the capacity limit, the target position is the 4000th position. The head index information arranged before the 4001st position, that is, the head index information arranged at the 1st position - the 4000th position, can be determined as the first index information; the tail index information arranged at and after the 4001st position, that is, the tail index information arranged at the 4001st position - the 8000th position, can be determined as the second index information.

[0130] (2) The storage method of index information in the index cache device includes the second storage method:

[0131] The storage method of index information in the index cache device may include a second storage method, which means that the index cache device may include N index cache sub-spaces, each index cache sub-space is used to cache at least one index information, N is an integer greater than 1. The index information stored in the index cache device may be sequentially stored into the N index cache sub-spaces in the order of the access degree of the corresponding block data from low to high. That is to say, the index information stored in the index cache sub-space where the index information is preferentially stored in the index cache device is the index information corresponding to the block data with a low access degree, and the index information stored in the index cache sub-space where the index information is stored later in the index cache device is the index information corresponding to the block data with a high access degree.

[0132] In the second storage method, the index information separation strategy matching the second storage method is the second index information separation strategy. According to the second index information separation strategy, the process of separating the first index information and the second index information from the index information stored in the index cache device may include: the index information stored in the K index cache sub-spaces that preferentially store index information among the multiple index cache sub-spaces may be determined as the first index information, and the index information stored in the remaining N-K index cache sub-spaces may be determined as the second index information, where K is an integer less than or equal to N. As Figure 9 shown, the index cache device includes 40 index cache sub-spaces, each index cache sub-space can store 200 index information. After the index cache device stores 8000 index information and reaches the capacity limit, the header index information stored in the 20 index cache sub-spaces that preferentially store index information, that is, the 1st to the 20th index cache sub-spaces, may be determined as the first index information; the tail index information stored in the remaining 20 index cache sub-spaces, that is, the 21st to the 40th index cache sub-spaces, may be determined as the second index information.

[0133] It can be seen from the above two index information separation methods that the embodiments of the present application can achieve batch separation of index information corresponding to hot and cold data, and can improve the separation efficiency of hot and cold data.

[0134] S703, delete the first index information in the index cache device, delete the block data corresponding to the first index information from the first storage device, and add the block data corresponding to the first index information to the second storage device.

[0135] For each newly added block of data on the blockchain, the block data can be stored in the data cache device and the first storage device, and the index information corresponding to the block data can be stored in the index cache device. After separating the first index information and the second index information from the index information stored in the index cache device, the first index information can be deleted from the index cache device, the block data corresponding to the first index information can be deleted from the first storage device, and the block data corresponding to the first index information can be added to the second storage device. Thus, the block data on the blockchain realizes data cold and hot separation. The hot data with a high access degree (i.e., the block data corresponding to the second index information) is stored in the first storage device with high storage performance, and the cold data with a low access degree (i.e., the block data corresponding to the first index information) is stored in the second storage device with low storage performance.

[0136] As described above, the computer device supports the warming up of cold data, that is, the accessed cold data can be considered to have a higher access degree and can be re-added to the first storage device with high storage performance, and the corresponding index information can be re-added to the index cache device, which is beneficial to improving the efficiency of its future re-access. That is to say, if the target block data in the second storage device is queried, the index information corresponding to the target block data can be added to the index cache device, and at the same time, the target block data can be deleted from the second storage device and added to the first storage device.

[0137] The above steps S701 - S703 introduce the content of the computer device dynamically detecting the capacity of the index cache device and dynamically triggering the separation of index information. In addition to the index information separation process, when new block data is generated on the blockchain, the computer device can also execute the process of writing new block data. The process of writing new block data can be described as follows: When new block data (i.e., newly added block data) is generated in the blockchain, the newly added block data can first be written into the data cache device, the purpose of which is to facilitate quick query and ensure that the recently generated block data can be quickly detected and queried; at the same time, the index information corresponding to the newly added block data can be written into the tail of the index cache device for index information management; meanwhile, the newly added block data can also be written into the first storage device.

[0138] That is to say, as Figure 10 shown, on the blockchain (for example, Figure 10The newly added block data of the blockchain containing block data 1 - block data X shown is written in three copies: The first copy is the data cache device, and the complete block data will be cached in the data cache device. The main purpose of storing it is to ensure fast query speed of the newly added block data. Moreover, the data cache device will only store block data for a recent period (for example, the most recent day). When the specified time point has passed, the data cache device will automatically be emptied. The second copy is the index cache device. The main purpose of storing it in the index cache device is that it can automatically filter out infrequently used cold data, and when querying data, directly using the index for query will also be faster. The third copy is the first storage device, which has high storage performance and can improve data query speed and migration speed, etc.

[0139] It should be noted that the index information separation process and the newly added block data writing process are not two separate processes. The index information separation process and the newly added block data process are combined with each other. Specifically: When new block data is generated on the blockchain, first, the newly added block data in the blockchain can be obtained, and the newly added block data can be added to the data cache device. The index information corresponding to the newly added block data can be generated based on the hash information corresponding to the newly added block data. Second, the capacity of the index cache device can be detected. If the used capacity of the index cache device does not exceed the capacity limit, the index information corresponding to the newly added block data can be added to the index cache device, and the newly added block data can be added to the first storage device. The storage location information of the newly added block data can also be added to the index cache device. The storage location information of the newly added block data can be used to indicate that the newly added block data is stored in the data cache device and the first storage device. If the used capacity of the index cache device exceeds the capacity limit, the index cache device can be triggered to perform index information separation. After the index cache device performs index information separation, the index information corresponding to the newly added block data can be added to the index cache device, and the newly added block data can be added to the first storage device. The storage location information of the newly added block data can also be added to the index cache device. The storage location information of the newly added block data can be used to indicate that the newly added block data is stored in the data cache device and the first storage device.

[0140] In addition, the data cache device can release the storage space according to the cache release cycle. If the newly added block data is added to the data cache device and the data cache device reaches the cache release time corresponding to the current cache release cycle, the storage space of the data storage device will be released. In this case, the storage location information of the newly added block data can be updated in the index cache device. The updated storage location information can be used to indicate that the newly added block data is stored in the first storage device.

[0141] In summary, steps S701 - S703 mainly introduce the index information separation process and the process of writing new block data. The index information separation process and the process of writing new block data can be seen in the following pseudo - code 1:

[0142] Pseudo - code 1

[0143]

[0144]

[0145] In the embodiments of the present application, for the block data on the blockchain, the index cache device is used to dynamically control the cold - hot separation of data, which has the following advantages in actual production: First, the hot data on the blockchain is stored in the data cache device and the hot data storage device with high storage performance, which can quickly respond to query requests, reduce query time delay, and improve data access performance; Second, by moving the cold data that is not frequently accessed on the blockchain to the cold data storage device with low storage cost, the usage cost of high - performance storage resources can be reduced, enabling it to be more used for storing the hot data commonly used on the blockchain; Third, by dynamically controlling the distribution of data, large - scale data situations can be better handled, avoiding over - resource occupation and performance degradation. It is more secure than the traditional method of migrating data according to the time dimension, with a lower probability of data loss, and improves the stability of the system. In summary, by using the index cache device to dynamically control the cold - hot separation of block data on the blockchain, high - performance, high - efficiency, and low - cost data management can be achieved in a changing blockchain data environment.

[0146] The embodiments of the present application provide a blockchain - based data processing method, and the block data query process of this blockchain - based data processing method. This blockchain - based data processing method can be executed by a computer device, and the computer device can be, for example, the data processing device 402 in the data processing system shown above Figure 4 as shown. As Figure 11 shown, this blockchain - based data processing method may include but is not limited to the following steps S1101 - S1104:

[0147] S1101, in response to a block data query request, generate reference index information corresponding to the reference hash information according to the reference hash information of the reference block data to be queried according to the request.

[0148] The block data query process can support block queries and transaction queries. Among them, a block query means that a data query object can initiate a data query request based on the reference hash information of the reference block data to be queried, and the block data query request can carry the reference hash information of the reference block data to be queried; in this case, in response to the block data query request, the computer device can directly generate reference index information corresponding to the reference hash information according to the reference hash information of the reference block data to be queried. A transaction query means that a data query object can initiate a data query request based on the transaction hash information of the transaction data to be queried, and the block data query request can carry the transaction hash information of the transaction data to be queried; in this case, in response to the block data query request, generating reference index information corresponding to the reference hash information according to the reference hash information of the reference block data to be queried can include: determining the reference block data to which the transaction data to be queried belongs according to the transaction hash information of the transaction data to be queried, and generating reference index information corresponding to the reference hash information according to the reference hash information of the reference block data.

[0149] Further, generating reference index information corresponding to the reference hash information according to the reference hash information of the reference block data can include any one of the following: First, the reference hash information can be directly determined as the reference index information corresponding to the reference hash information; Second, the reference hash information can be calculated (for example, when the index cache device is a cuckoo filter, the cuckoo hashing algorithm can be used to calculate the reference hash information) to obtain the reference index information corresponding to the reference hash information.

[0150] After obtaining the reference index information corresponding to the reference block data to be queried, the following will be combined with Figure 12 and Step S1102 - Step S1104 to introduce the query process of the reference block data.

[0151] S1102, query the reference index information in the index cache device.

[0152] After obtaining the reference index information corresponding to the reference block data to be queried, the reference index information can be queried in the index cache device. If the reference index information is queried in the index cache device, then further, the storage location information corresponding to the reference index information can be obtained. The storage location information corresponding to the reference index information can be used to indicate that the reference block data is stored in the first storage device, or the storage location information of the reference block data can be used to indicate that the reference block data is stored in the data cache device and the first storage device.

[0153] S1103, if the reference index information is queried in the index cache device, then query and return the reference block data corresponding to the reference index information in the first storage device.

[0154] If the reference index information is found in the index cache device, the storage location information corresponding to the reference index information can be obtained. If the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in both the data cache device and the first storage device, the reference block data corresponding to the reference index information can be queried and returned in the data cache device and the first storage device; querying and returning the reference block data corresponding to the reference index information in the data cache device and the first storage device means querying the reference block data corresponding to the reference index information in both the data cache device and the first storage device simultaneously, and the first-found reference block data is returned; querying simultaneously in the data cache device and the first storage device can improve the query response speed. If the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in the first storage device, the reference block data corresponding to the reference index information can be queried and returned in the first storage device.

[0155] S1104. If the reference index information is not found in the index cache device, query and return the reference block data corresponding to the reference index information in the second storage device.

[0156] If the reference index information is not found in the index cache device, it can be indicated that the reference block information is cold data, and the reference block data corresponding to the reference index information can be queried and returned in the second storage device.

[0157] Based on the above steps S1101 - S1104, the block data query process can be referred to the following pseudocode 2:

[0158] Pseudocode 2

[0159]

[0160]

[0161] In the embodiments of the present application, for the block data on the blockchain, the index caching device is used to dynamically control the cold and hot data separation, which has the following advantages in actual production: First, the hot data on the blockchain is stored in the data caching device and the hot data storage device with high storage performance, which can quickly respond to query requests, reduce query time delay, and improve data access performance; Second, by moving the cold data that is not frequently accessed on the blockchain to the cold data storage device with low storage cost, the usage cost of high-performance storage resources can be reduced, and it can be used more for storing the hot data commonly used on the blockchain; Third, by dynamically controlling the distribution of data, large-scale data situations can be better handled, avoiding over-occupation of resources and performance degradation. Compared with the traditional method of migrating data according to the time dimension, it has higher security and lower probability of data loss, and improves the stability of the system. In summary, by dynamically controlling the cold and hot data separation of the block data on the blockchain through the index caching device, high-performance, high-efficiency, and low-cost data management can be achieved in the ever-changing blockchain data environment.

[0162] The method of the embodiments of the present application is described in detail above. To facilitate better implementation of the above solutions of the embodiments of the present application, correspondingly, the devices of the embodiments of the present application are provided below.

[0163] Please refer to Figure 13 , Figure 13 which is a schematic structural diagram of a blockchain-based data processing device provided by the embodiments of the present application. The blockchain-based data processing device can be set in the computer device provided by the embodiments of the present application, and the computer device can be the data processing device 402 in the data processing system shown above Figure 4 shown. Figure 13 The blockchain-based data processing device shown above can be a computer program running in a computer device, and the data processing device can be used to execute Figure 7 or Figure 11 shown in the method embodiments. The blockchain is associated with an index caching device, a first storage device, and a second storage device; both the first storage device and the second storage device are used to store the block data on the blockchain, and the storage performance of the first storage device is higher than that of the second storage device; the index caching device is used to store the index information corresponding to the block data on the blockchain. Please refer to Figure 13 , the blockchain-based data processing device can include the following units:

[0164] An obtaining unit 1301, configured to obtain the used capacity of the index caching device;

[0165] The processing unit 1302 is configured to, if the used capacity exceeds the capacity upper limit, separate first index information and second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain, where the access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information; the access degree of the block data refers to the possibility of the block data being accessed.

[0166] The processing unit 1302 is further configured to delete the first index information from the index cache device, delete the block data corresponding to the first index information from the first storage device, and add the block data corresponding to the first index information to the second storage device.

[0167] In one implementation, the processing unit 1302 is further configured to perform the following steps:

[0168] If the target block data in the second storage device is queried, add the index information corresponding to the target block data to the index cache device;

[0169] And, delete the target block data from the second storage device, and add the target block data to the first storage device.

[0170] In one implementation, when the obtaining unit 1301 is configured to obtain the used capacity of the index cache device, it is specifically configured to perform any one of the following:

[0171] When new block data is added to the blockchain, obtain the used capacity of the index cache device;

[0172] The index cache device separates index information according to the index separation period. If the index separation time corresponding to the current index separation period is reached, obtain the used capacity of the index cache device.

[0173] In one implementation, when the processing unit 1302 is configured to separate first index information and second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain, it is specifically configured to perform the following steps:

[0174] Obtain the storage mode of the index information in the index cache device, and store the block data on the blockchain in the index cache device in the order of the corresponding access degree;

[0175] Determine an index information separation strategy matching the storage mode according to the storage mode of the index information in the index cache device;

[0176] Separate first index information and second index information from the index information stored in the index cache device according to the matching index information separation strategy.

[0177] In one implementation, the storage method of the index information in the index cache device includes a first storage method, which means that the index information stored in the index cache device is sequentially stored in the index cache device in the order of the access degree of the corresponding block data from low to high; the index information separation strategy matching the first storage method is the first index information separation strategy;

[0178] The processing unit 1302 is configured to, when separating the first index information and the second index information from the index information stored in the index cache device according to the first index information separation strategy, specifically perform the following steps:

[0179] Determine the head index information arranged before the target position among the index information stored in the index cache device as the first index information, and determine the tail index information arranged at and after the target position as the second index information.

[0180] In one implementation, the index cache device includes N index cache sub-spaces, each index cache sub-space is used to cache at least one index information, and N is an integer greater than 1; the storage method of the index information in the index cache device includes a second storage method, which means that the index information stored in the index cache device is sequentially stored in the N index cache sub-spaces in the order of the access degree of the corresponding block data from low to high; the index information separation strategy matching the second storage method is the second index information separation strategy;

[0181] The processing unit 1302 is configured to, when separating the first index information and the second index information from the index information stored in the index cache device according to the second index information separation strategy, specifically perform the following steps:

[0182] Determine the index information stored in the K index cache sub-spaces that preferentially store index information among the N index cache sub-spaces as the first index information, and determine the index information stored in the remaining N - K index cache sub-spaces as the second index information, where K is an integer less than or equal to N.

[0183] In one implementation, the obtaining unit 1301 is further configured to perform the following steps:

[0184] Obtain the newly added block data in the blockchain, and generate the index information corresponding to the newly added block data according to the hash information corresponding to the newly added block data;

[0185] The processing unit 1302 is further configured to perform the following steps:

[0186] If the used capacity of the index cache device does not exceed the capacity limit, add the index information corresponding to the newly added block data to the index cache device, and add the newly added block data to the first storage device;

[0187] If the used capacity of the index cache device exceeds the capacity limit, after separating the index information in the index cache device, add the index information corresponding to the newly added block data to the index cache device, and add the newly added block data to the first storage device.

[0188] In one implementation, the blockchain is also associated with a data cache device; the processing unit 1302 is further configured to perform the following steps:

[0189] Add the newly added block data to the data cache device;

[0190] Add the storage location information of the newly added block data in the index cache device, and the storage location information of the newly added block data is used to indicate that the newly added block data is stored in the data cache device and the first storage device.

[0191] In one implementation, the data cache device releases the storage space according to the cache release period; the processing unit 1302 is further configured to perform the following steps:

[0192] After adding the newly added block data to the data cache device, if the data cache device reaches the cache release time corresponding to the current cache release period, release the storage space of the data storage device;

[0193] Update the storage location information of the newly added block data in the index cache device, and the updated storage location information is used to indicate that the newly added block data is stored in the first storage device.

[0194] In one implementation, the processing unit 1302 is further configured to perform the following steps:

[0195] In response to a block data query request, generate reference index information corresponding to the reference hash information according to the reference hash information of the reference block data to be queried in the request;

[0196] Query the reference index information in the index cache device;

[0197] If the reference index information is queried in the index cache device, query and return the reference block data corresponding to the reference index information in the first storage device;

[0198] If the reference index information is not queried in the index cache device, query and return the reference block data corresponding to the reference index information in the second storage device.

[0199] In one implementation, the blockchain is also associated with a data caching device; the index caching device further stores storage location information corresponding to the block data, and the storage location information indicates that the storage location of the corresponding block data is the data caching device or the first storage device; the processing unit 1302 is further configured to perform the following steps:

[0200] If the reference index information is found in the index caching device, obtain the storage location information corresponding to the reference index information;

[0201] If the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in both the data caching device and the first storage device, query and return the reference block data corresponding to the reference index information in the data caching device and the first storage device;

[0202] If the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in the first storage device, query and return the reference block data corresponding to the reference index information in the first storage device.

[0203] According to another embodiment of the present application, Figure 13 Each unit in the data processing device based on the blockchain shown can be separately or entirely combined into one or several other units to form, or some of the units can be further split into multiple smaller units with functional division to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above units are divided based on logical functions. In practical applications, the function of one unit can also be realized by multiple units, or the functions of multiple units can be realized by one unit. In other embodiments of the present application, the data processing device based on the blockchain may also include other units. In practical applications, these functions can also be assisted by other units and can be realized by the cooperation of multiple units.

[0204] According to another embodiment of the present application, it can be achieved by running a computer program capable of executing the steps involved in part or all of the methods shown in Figure 7 or Figure 11 shown on a general computing device such as a computer including processing elements and storage elements such as a central processing unit (CPU), a random access storage medium (RAM), and a read-only storage medium (ROM), to construct the data processing device based on the blockchain shown in Figure 13 and to implement the data processing method based on the blockchain of the embodiments of the present application. The computer program can be recorded on, for example, a computer-readable storage medium, loaded into the above computing device through the computer-readable storage medium, and run therein.

[0205] In the embodiments of the present application, the index cache device associated with the blockchain can be used to store the index information corresponding to the block data on the blockchain. When the used capacity of the index cache device exceeds the capacity limit, it can trigger the separation of the first index information and the second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain. The access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information. The access degree of the block data refers to the possibility of the block data being accessed. Then, the first index information can be deleted from the index cache device, the block data corresponding to the first index information can be deleted from the first storage device, and the block data corresponding to the first index information can be added to the second storage device. The storage performance of the first storage device is higher than that of the second storage device. That is to say, when the used capacity of the index cache device exceeds the capacity limit, it can automatically separate the block data with a high access possibility and the block data with a low access possibility in the blockchain. The block data with a high access possibility can be stored in the first storage device with high storage performance, and the block data with a low access possibility can be stored in the second storage device with low storage performance, rather than storing all the block data in the first storage device with high storage performance. The storage cost of the database with high storage performance is relatively high. Therefore, by separating and storing the block data with different access possibilities, the storage of the block data in the blockchain can be optimized, and the storage cost of the block data in the blockchain can be saved.

[0206] Based on the above method and apparatus embodiments, the embodiments of the present application provide a computer device. Please refer to Figure 14 , Figure 14 which is a schematic structural diagram of a computer device provided by the embodiments of the present application. Figure 14 The computer device shown at least includes a processor 1401, an input interface 1402, an output interface 1403, and a computer-readable storage medium 1404. Among them, the processor 1401, the input interface 1402, the output interface 1403, and the computer-readable storage medium 1404 can be connected by a bus or other means.

[0207] The computer-readable storage medium 1404 can be stored in the memory of the computer device. The computer-readable storage medium 1404 is used to store a computer program. The computer program includes computer instructions. The processor 1401 is used to execute the computer program stored in the computer-readable storage medium 1404. The processor 1401 (or CPU (Central Processing Unit, central processor)) is the computing core and control core of the computer device, and is suitable for implementing the computer program. Specifically, it is suitable for loading and executing the computer program to implement the corresponding method flow or corresponding function.

[0208] An embodiment of the present application further provides a computer-readable storage medium (Memory). A computer-readable storage medium is a memory device in a computer device for storing programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and, of course, the extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the computer device. And, a computer program suitable for being loaded and executed by a processor is also stored in this storage space. It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory (Non-Volatile Memory), such as at least one disk memory; optionally, it can also be at least one computer-readable storage medium located far from the aforementioned processor.

[0209] The computer device can be the data processing device 402 in the data processing system shown above Figure 4 ; the blockchain is associated with an index cache device, a first storage device, and a second storage device; both the first storage device and the second storage device are used to store block data on the blockchain, and the storage performance of the first storage device is higher than that of the second storage device; the index cache device is used to store index information corresponding to the block data on the blockchain. In a specific implementation, the processor 1401 can load and execute the computer program stored in the computer-readable storage medium 1404 to implement the relevant Figure 7 or Figure 11 corresponding steps in the data processing method based on the blockchain shown above. In a specific implementation, the computer program in the computer-readable storage medium 1404 is loaded and executed by the processor 1401 to perform the following steps:

[0210] Obtain the used capacity of the index cache device;

[0211] If the used capacity exceeds the capacity limit, then separate the first index information and the second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain. The access degree of the block data corresponding to the first index information is lower than the access degree of the block data corresponding to the second index information; the access degree of the block data refers to the possibility of the block data being accessed;

[0212] Delete the first index information in the index cache device, delete the block data corresponding to the first index information from the first storage device, and add the block data corresponding to the first index information to the second storage device.

[0213] In one implementation, the computer program in the computer-readable storage medium 1404 is loaded and further used by the processor 1401 to perform the following steps:

[0214] If the target block data in the second storage device is queried, the index information corresponding to the target block data is added to the index cache device;

[0215] In addition, the target block data is deleted from the second storage device, and the target block data is added to the first storage device.

[0216] In one implementation, when the computer program in the computer-readable storage medium 1404 is loaded and executed by the processor 1401 to obtain the used capacity of the index cache device, it is specifically used to execute any one of the following:

[0217] When new block data is added to the blockchain, obtain the used capacity of the index cache device;

[0218] The index cache device separates index information according to the index separation period. If the index separation time corresponding to the current index separation period is reached, obtain the used capacity of the index cache device.

[0219] In one implementation, when the computer program in the computer-readable storage medium 1404 is loaded and executed by the processor 1401 to separate the first index information and the second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain, it is specifically used to execute the following steps:

[0220] Obtain the storage method of the index information in the index cache device. The block data on the blockchain is stored in the index cache device in the order of the corresponding access degree;

[0221] According to the storage method of the index information in the index cache device, determine the index information separation strategy matching the storage method;

[0222] According to the matching index information separation strategy, separate the first index information and the second index information from the index information stored in the index cache device.

[0223] In one implementation, the storage method of the index information in the index cache device includes a first storage method. The first storage method means that the index information stored in the index cache device is sequentially stored in the index cache device in the order of the access degree of the corresponding block data from low to high; the index information separation strategy matching the first storage method is the first index information separation strategy;

[0224] When the computer program in the computer-readable storage medium 1404 is loaded and executed by the processor 1401 to separate the first index information and the second index information from the index information stored in the index cache device according to the first index information separation strategy, it is specifically used to execute the following steps:

[0225] Among the index information stored in the index cache device, the head index information arranged before the target position is determined as the first index information, and the tail index information arranged at and after the target position is determined as the second index information.

[0226] In one implementation, the index cache device includes N index cache sub-spaces, each index cache sub-space is used to cache at least one index information, and N is an integer greater than 1; the storage method of the index information in the index cache device includes a second storage method, and the second storage method means that: the index information stored in the index cache device is sequentially stored into the N index cache sub-spaces in the order of the access degree of the corresponding block data from low to high; the index information separation strategy matching the second storage method is the second index information separation strategy;

[0227] When the computer program in the computer-readable storage medium 1404 is loaded and executed by the processor 1401 to separate the first index information and the second index information from the index information stored in the index cache device according to the second index information separation strategy, it is specifically used to execute the following steps:

[0228] Among the N index cache sub-spaces, the index information stored in the K index cache sub-spaces that preferentially store index information is determined as the first index information, and the index information stored in the remaining N - K index cache sub-spaces is determined as the second index information, where K is an integer less than or equal to N.

[0229] In one implementation, the computer program in the computer-readable storage medium 1404 is loaded and executed by the processor 1401 and is further used to execute the following steps:

[0230] Obtain the newly added block data in the blockchain, and generate the index information corresponding to the newly added block data according to the hash information corresponding to the newly added block data;

[0231] If the used capacity of the index cache device does not exceed the capacity limit, add the index information corresponding to the newly added block data to the index cache device, and add the newly added block data to the first storage device;

[0232] If the used capacity of the index cache device exceeds the capacity limit, after separating the index information in the index cache device, add the index information corresponding to the newly added block data to the index cache device, and add the newly added block data to the first storage device.

[0233] In one implementation, the blockchain is further associated with a data cache device; the computer program in the computer-readable storage medium 1404 is loaded and executed by the processor 1401 and is further used to execute the following steps:

[0234] Add the newly added block data to the data cache device;

[0235] Add the storage location information of the newly added block data to the index cache device. The storage location information of the newly added block data is used to indicate that the newly added block data is stored in the data cache device and the first storage device.

[0236] In one implementation, the data cache device releases the storage space according to the cache release period; the computer program in the computer-readable storage medium 1404 is loaded by the processor 1401 and is further used to execute the following steps:

[0237] After adding the newly added block data to the data cache device, if the data cache device reaches the cache release time corresponding to the current cache release period, release the storage space of the data storage device;

[0238] Update the storage location information of the newly added block data in the index cache device. The updated storage location information is used to indicate that the newly added block data is stored in the first storage device.

[0239] In one implementation, the computer program in the computer-readable storage medium 1404 is loaded by the processor 1401 and is further used to execute the following steps:

[0240] In response to a block data query request, generate reference index information corresponding to the reference hash information of the reference block data to be queried according to the request;

[0241] Query the reference index information in the index cache device;

[0242] If the reference index information is queried in the index cache device, query and return the reference block data corresponding to the reference index information in the first storage device;

[0243] If the reference index information is not queried in the index cache device, query and return the reference block data corresponding to the reference index information in the second storage device.

[0244] In one implementation, the blockchain is further associated with a data cache device; the index cache device further stores the storage location information corresponding to the block data, and the storage location information indicates that the storage location of the corresponding block data is the data cache device or the first storage device; the computer program in the computer-readable storage medium 1404 is loaded by the processor 1401 and is further used to execute the following steps:

[0245] If the reference index information is queried in the index cache device, obtain the storage location information corresponding to the reference index information;

[0246] If the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in both the data cache device and the first storage device, query and return the reference block data corresponding to the reference index information in the data cache device and the first storage device;

[0247] If the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in the first storage device, query and return the reference block data corresponding to the reference index information in the first storage device.

[0248] In the embodiments of the present application, the index cache device associated with the blockchain can be used to store the index information corresponding to the block data on the blockchain. When the used capacity of the index cache device exceeds the capacity limit, it can be triggered to separate the first index information and the second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain. The access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information. The access degree of the block data refers to the possibility of the block data being accessed. Then, the first index information can be deleted from the index cache device, the block data corresponding to the first index information can be deleted from the first storage device, and the block data corresponding to the first index information can be added to the second storage device. The storage performance of the first storage device is higher than that of the second storage device. That is to say, when the used capacity of the index cache device exceeds the capacity limit, the block data with a high access possibility and the block data with a low access possibility in the blockchain can be automatically separated. The block data with a high access possibility can be stored in the first storage device with high storage performance, and the block data with a low access possibility can be stored in the second storage device with low storage performance, rather than storing all the block data in the first storage device with high storage performance. The storage cost of the database with high storage performance is relatively high. Therefore, by separating and storing the block data with different access possibilities, the storage of the block data in the blockchain can be optimized, and the storage cost of the block data in the blockchain can be saved.

[0249] The embodiments of the present application further provide a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned data processing method based on the blockchain.

[0250] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0251] In the embodiments of this application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the functions of that module or unit.

[0252] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state disk (SSD)), etc.

[0253] As mentioned above, the above are only the specific implementation manners of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims

1. A data processing method based on blockchain, characterized in that, the blockchain is associated with an index cache device, a first storage device, and a second storage device; both the first storage device and the second storage device are used to store block data on the blockchain, and the storage performance of the first storage device is higher than that of the second storage device; the index cache device is used to store index information corresponding to the block data on the blockchain; the method includes: Obtaining the used capacity of the index cache device; If the used capacity exceeds the capacity limit, then according to the access degree of the block data on the blockchain, separate first index information and second index information from the index information stored in the index cache device, where the access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information; the access degree of the block data refers to the possibility of the block data being accessed; Delete the first index information in the index cache device, delete the block data corresponding to the first index information from the first storage device, and add the block data corresponding to the first index information to the second storage device.

2. The method according to claim 1, characterized in that, the method further includes: If the target block data in the second storage device is queried, add the index information corresponding to the target block data to the index cache device; and, Delete the target block data from the second storage device and add the target block data to the first storage device.

3. The method according to claim 1 or 2, characterized in that, the obtaining of the used capacity of the index cache device includes any one of the following: When new block data is added to the blockchain, obtain the used capacity of the index cache device; The index cache device separates index information according to an index separation period. If the index separation time corresponding to the current index separation period is reached, obtain the used capacity of the index cache device.

4. The method according to claim 1 or 2, characterized in that, the separating of the first index information and the second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain includes: Obtain the storage method of the index information in the index cache device, and the block data on the blockchain is stored in the index cache device in the order of the corresponding access degree; Determine an index information separation strategy matching the storage method according to the storage method of the index information in the index cache device; Separate the first index information and the second index information from the index information stored in the index cache device according to the matching index information separation strategy.

5. The method according to claim 4, characterized in that, The storage method of the index information in the index cache device includes a first storage method, and the first storage method means that the index information stored in the index cache device is sequentially stored in the index cache device in the order of the access degree of the corresponding block data from low to high; The index information separation strategy matching the first storage method is the first index information separation strategy; According to the first index information separation strategy, the process of separating the first index information and the second index information from the index information stored in the index cache device includes: Determining the head index information arranged before the target position in the index information stored in the index cache device as the first index information, and determining the tail index information arranged at and after the target position as the second index information.

6. The method according to claim 4, wherein, the index cache device includes N index cache sub-spaces, each index cache sub-space is used to cache at least one index information, and N is an integer greater than 1; the storage method of the index information in the index cache device includes a second storage method, and the second storage method means that the index information stored in the index cache device is sequentially stored in the N index cache sub-spaces in the order of the access degree of the corresponding block data from low to high; The index information separation strategy matching the second storage method is the second index information separation strategy; According to the second index information separation strategy, the process of separating the first index information and the second index information from the index information stored in the index cache device includes: Determining the index information stored in the K index cache sub-spaces that preferentially store index information among the N index cache sub-spaces as the first index information, and determining the index information stored in the remaining N - K index cache sub-spaces as the second index information, where K is an integer less than or equal to N.

7. The method according to claim 1 or 2, wherein, the method further includes: Obtaining the newly added block data in the blockchain, and generating the index information corresponding to the newly added block data according to the hash information corresponding to the newly added block data; If the used capacity of the index cache device does not exceed the capacity limit, adding the index information corresponding to the newly added block data to the index cache device, and adding the newly added block data to the first storage device; If the used capacity of the index cache device exceeds the capacity limit, after separating the index information in the index cache device, adding the index information corresponding to the newly added block data to the index cache device, and adding the newly added block data to the first storage device.

8. The method according to claim 7, wherein, the blockchain is further associated with a data cache device; the method further includes: Adding the newly added block data to the data cache device; Add the storage location information of the newly added block data to the index cache device, where the storage location information of the newly added block data is used to indicate that the newly added block data is stored in the data cache device and the first storage device.

9. The method according to claim 8, wherein, the data cache device releases the storage space according to a cache release cycle; the method further includes: after adding the newly added block data to the data cache device, if the data cache device reaches the cache release time corresponding to the current cache release cycle, release the storage space of the data storage device; update the storage location information of the newly added block data in the index cache device, and the updated storage location information is used to indicate that the newly added block data is stored in the first storage device.

10. The method according to claim 1 or 2, wherein, the method further includes: in response to a block data query request, generate reference index information corresponding to the reference hash information of the reference block data to be queried according to the request; query the reference index information in the index cache device; if the reference index information is found in the index cache device, query and return the reference block data corresponding to the reference index information in the first storage device; if the reference index information is not found in the index cache device, query and return the reference block data corresponding to the reference index information in the second storage device.

11. The method according to claim 10, wherein, the blockchain is further associated with a data cache device; the index cache device further stores the storage location information corresponding to the block data, and the storage location information indicates that the storage location of the corresponding block data is the data cache device or the first storage device; the method further includes: if the reference index information is found in the index cache device, obtain the storage location information corresponding to the reference index information; if the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in both the data cache device and the first storage device, query and return the reference block data corresponding to the reference index information in the data cache device and the first storage device; if the storage location information corresponding to the reference index information indicates that the reference block data corresponding to the reference index information is stored in the first storage device, query and return the reference block data corresponding to the reference index information in the first storage device.

12. A blockchain-based data processing device, wherein, the blockchain is associated with an index cache device, a first storage device, and a second storage device; both the first storage device and the second storage device are used to store the block data on the blockchain, and the storage performance of the first storage device is higher than that of the second storage device; the index cache device is used to store the index information corresponding to the block data on the blockchain; the device includes: An acquisition unit, configured to acquire the used capacity of the index cache device; A processing unit, configured to, if the used capacity exceeds the capacity upper limit, separate first index information and second index information from the index information stored in the index cache device according to the access degree of the block data on the blockchain, where the access degree of the block data corresponding to the first index information is lower than that of the block data corresponding to the second index information; the access degree of the block data refers to the possibility of the block data being accessed; The processing unit is further configured to delete the first index information in the index cache device, delete the block data corresponding to the first index information from the first storage device, and add the block data corresponding to the first index information to the second storage device.

13. A computer device Characterized in that The computer device includes: A processor, adapted to implement a computer program; A computer-readable storage medium storing a computer program, the computer program being adapted to be loaded and executed by the processor to perform the blockchain-based data processing method according to any one of claims 1-11.

14. A computer-readable storage medium Characterized in that The computer-readable storage medium stores a computer program, the computer program being adapted to be loaded and executed by a processor to perform the blockchain-based data processing method according to any one of claims 1-11.

15. A computer program product Characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the blockchain-based data processing method according to any one of claims 1-11.