CN113641649B - Data acquisition method, device, equipment and storage medium - Google Patents

Data acquisition method, device, equipment and storage medium Download PDF

Info

Publication number
CN113641649B
CN113641649B CN202111209427.9A CN202111209427A CN113641649B CN 113641649 B CN113641649 B CN 113641649B CN 202111209427 A CN202111209427 A CN 202111209427A CN 113641649 B CN113641649 B CN 113641649B
Authority
CN
China
Prior art keywords
data
file
target file
target
blockchain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111209427.9A
Other languages
Chinese (zh)
Other versions
CN113641649A (en
Inventor
匡立中
邱炜伟
吴志强
黄方蕾
郭颂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202111209427.9A priority Critical patent/CN113641649B/en
Publication of CN113641649A publication Critical patent/CN113641649A/en
Application granted granted Critical
Publication of CN113641649B publication Critical patent/CN113641649B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/134Distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Bioethics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data acquisition method, a data acquisition device, data acquisition equipment and a storage medium, and belongs to the technical field of block chains. The method is applied to a block chain system and comprises the following steps: receiving a first data acquisition transaction sent by a first device for requesting to acquire a plurality of data; acquiring a plurality of data, and storing n data into a target file in a storage system when n data in the plurality of data are acquired, wherein n is a positive integer smaller than the number of the data of the plurality of data; after the plurality of data are stored in the target file, the file identification of the target file and the number of the data in the target file are sent to the first equipment; receiving a second data acquisition transaction sent by second equipment, wherein the second data acquisition transaction carries a file identifier and a data index; acquiring data indicated by the data index from the target file identified by the file identification as target data; and sending the target data to the second device. According to the method and the device, the memory overflow can be avoided when the batch data in the block chain system is obtained.

Description

Data acquisition method, device, equipment and storage medium
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a data acquisition method, apparatus, device, and storage medium.
Background
In the application scenario of the blockchain technology, a large amount of blockchain data or account data is often acquired. For example, account addresses of all blockchain accounts on a blockchain need to be obtained, or full state data of some intelligent contract on a blockchain needs to be obtained.
At present, when a block chain system receives a batch data acquisition transaction sent by a client, traversal of a database can be performed through an iterator to acquire batch data, and the acquired batch data is loaded into a memory and then directly returned to the client.
However, if the amount of data acquired by the blockchain system is too large, the memory will be exhausted after all the acquired data are loaded into the memory, so that the blockchain system is directly down and cannot normally return the data to the client.
Disclosure of Invention
The application provides a data acquisition method, a data acquisition device, data acquisition equipment and a storage medium, which can avoid memory overflow when batch data in a block chain system is acquired. The technical scheme is as follows:
in a first aspect, a data acquisition method is provided, which is applied to a block chain system, and the method includes:
receiving a first data acquisition transaction sent by a first device, wherein the first data acquisition transaction is used for requesting to acquire a plurality of data;
acquiring the plurality of data, and storing n data into a target file in a storage system when n data in the plurality of data are acquired, wherein n is a positive integer smaller than the number of the data of the plurality of data;
after the plurality of data are stored in the target file, the file identification of the target file and the number of the data in the target file are sent to the first equipment;
receiving a second data acquisition transaction sent by a second device, wherein the second data acquisition transaction carries the file identifier and the data index;
acquiring data indicated by the data index from the target file identified by the file identification as target data;
and sending the target data to the second equipment.
In the application, after receiving a first data acquisition transaction sent by a first device, a blockchain system acquires a plurality of data requested to be acquired by the first data acquisition transaction. And when acquiring n data in the plurality of data, the block chain system stores the n data into a target file in the storage system, wherein n is a positive integer smaller than the number of the data of the plurality of data. That is, in the process of acquiring the plurality of data, the blockchain system loads the plurality of data into the memory every time n data are acquired, so as to store the plurality of data into the target file in the storage system. Therefore, the data are loaded into the memory in batches instead of simultaneously loading the data into the memory, so that the memory pressure is reduced, the memory overflow can be effectively avoided, and the system safety is improved. And after the block chain system stores the data into the target file, the file identification of the target file and the number of the data in the target file are sent to the first equipment. And then, after receiving a second data acquisition transaction which is sent by the second equipment and carries the file identifier and the data index, the blockchain system acquires the data indicated by the data index from the target file identified by the file identifier as target data, and then sends the target data to the second equipment. In this case, the second device may obtain part of the data in the target file by sending a second data acquisition transaction to the blockchain system once. If the second device wants to acquire all the data in the target file, the second device may send multiple second data acquisition transactions to the blockchain system to read the data in the target file in a segmented manner, and finally read all the data in the target file. Thus, the acquisition of batch data in the block chain system is realized.
Optionally, before the acquiring the plurality of data, the method further includes:
if the total data size of the plurality of data is larger than or equal to a preset data size, creating the target file in the storage system, wherein the preset data size is smaller than the maximum storable data size of the memory of the block chain system;
and taking the transaction hash of the first data acquisition transaction as the file identifier of the target file, or taking the transaction hash of the first data acquisition transaction and the account address of the blockchain account of the first device as the file identifier of the target file.
Optionally, before storing the n data into a target file in a storage system each time the n data of the plurality of data are acquired, the method further includes:
and if the total data size of the plurality of data is larger than or equal to a preset data size, rounding a numerical value obtained by dividing the preset data size by the average data size of the plurality of data downwards to obtain the n, wherein the preset data size is smaller than the maximum storable data size of the memory of the block chain system.
Optionally, the file identification comprises a transaction hash of the first data acquisition transaction and an account address of a blockchain account of the first device;
before the obtaining the data indicated by the data index from the target file identified by the file identifier as target data, the method further includes:
and if the account address of the blockchain account of the second device is the same as the account address in the file identifier, executing the step of acquiring the data indicated by the data index from the target file identified by the file identifier as target data.
Optionally, the method further comprises:
after the plurality of data are stored in the target file, generating verification information of the target file;
before the obtaining the data indicated by the data index from the target file identified by the file identifier as target data, the method further includes:
acquiring the target file identified by the file identification from the storage system;
verifying the obtained target file according to the verification information;
and after the acquired target file passes the verification, executing the step of acquiring the data indicated by the data index from the target file identified by the file identification as target data.
Optionally, the verification information includes a file hash of the target file;
after the generating of the verification information of the target file, the method further includes:
storing the file identification and the verification information to a world state database;
and generating block hash in the block chain data according to the account data in the world state database.
Optionally, the method further comprises:
after receiving a data deletion request carrying the file identifier, deleting the target file identified by the file identifier in the storage system; and/or the presence of a gas in the gas,
and after the plurality of data are all stored in the target file, deleting the target file in the storage system at intervals of preset duration.
In a second aspect, a data acquisition apparatus is provided, which is applied to a blockchain system, and the apparatus includes:
the device comprises a first receiving module, a second receiving module and a third receiving module, wherein the first receiving module is used for receiving a first data acquisition transaction sent by first equipment, and the first data acquisition transaction is used for requesting to acquire a plurality of data;
the first storage module is used for acquiring the plurality of data, and storing n data into a target file in a storage system when n data in the plurality of data are acquired, wherein n is a positive integer smaller than the number of the data in the plurality of data;
the first sending module is used for sending the file identifier of the target file and the number of data in the target file to the first equipment after the plurality of data are all stored in the target file;
the second receiving module is used for receiving a second data acquisition transaction sent by second equipment, wherein the second data acquisition transaction carries the file identifier and the data index;
a first obtaining module, configured to obtain, from a target file identified by the file identifier, data indicated by the data index as target data;
and the second sending module is used for sending the target data to the second equipment.
Optionally, the apparatus further comprises:
a creating module, configured to create the target file in the storage system if a total data size of the multiple data is greater than or equal to a preset data size, where the preset data size is smaller than a maximum storable data size of a memory of the block chain system;
and the setting module is used for taking the transaction hash of the first data acquisition transaction as the file identifier of the target file, or taking the transaction hash of the first data acquisition transaction and the account address of the block chain account of the first device as the file identifier of the target file.
Optionally, the apparatus further comprises:
and the calculation module is configured to, if the total data size of the plurality of data is greater than or equal to a preset data size, round a numerical value obtained by dividing the preset data size by the average data size of the plurality of data downward to obtain the n, where the preset data size is smaller than a maximum storable data size of the memory of the block chain system.
Optionally, the file identification comprises a transaction hash of the first data acquisition transaction and an account address of a blockchain account of the first device; the device further comprises:
and the triggering module is used for triggering the first obtaining module to obtain the data indicated by the data index from the target file identified by the file identification as target data if the account address of the block chain account of the second device is the same as the account address in the file identification.
Optionally, the apparatus further comprises:
the first generation module is used for generating verification information of the target file after the plurality of data are stored in the target file;
the device further comprises:
the second acquisition module is used for acquiring the target file identified by the file identification from the storage system;
the verification module is used for verifying the acquired target file according to the verification information;
and the triggering module is used for triggering the first obtaining module to obtain the data indicated by the data index from the target file identified by the file identification as target data after the obtained target file passes the verification.
Optionally, the verification information includes a file hash of the target file; the device further comprises:
the second storage module is used for storing the file identification and the verification information to a world state database;
and the second generation module is used for generating the block hash in the block chain data according to the account data in the world state database.
Optionally, the apparatus further comprises:
the deleting module is used for deleting the target file identified by the file identification in the storage system after receiving the data deleting request carrying the file identification; and/or deleting the target file in the storage system at preset time intervals after the plurality of data are stored in the target file.
In a third aspect, a computer device is provided, the computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the computer program, when executed by the processor, implementing the data acquisition method described above.
In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program that, when executed by a processor, implements the data acquisition method described above.
In a fifth aspect, a computer program product comprising instructions is provided, which when run on a computer, causes the computer to perform the steps of the data acquisition method described above.
It is to be understood that, for the beneficial effects of the second aspect, the third aspect, the fourth aspect and the fifth aspect, reference may be made to the description of the first aspect, and details are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a blockchain system according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a block chain according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a data acquisition system provided by an embodiment of the present application;
fig. 4 is a flowchart of a data acquisition method provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of a storage system provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data acquisition apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that reference to "a plurality" in this application means two or more. In the description of the present application, "/" means "or" unless otherwise stated, for example, a/B may mean a or B; "and/or" herein is only an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, for the convenience of clearly describing the technical solutions of the present application, the terms "first", "second", and the like are used to distinguish the same items or similar items having substantially the same functions and actions. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
Before explaining the embodiments of the present application, the related contents of the block chain will be described.
Fig. 1 is a schematic structural diagram of a blockchain system according to an embodiment of the present disclosure.
Referring to fig. 1, a blockchain system 100 refers to a system for data sharing between nodes, and a plurality of nodes 101 may be included in the blockchain system 100. Each node 101 may receive input information while operating normally and maintain shared data within the blockchain system 100 based on the received input information. In order to ensure information intercommunication in the blockchain system 100, there may be an information connection between each node 101 in the blockchain system 100, and information transmission between the nodes 101 may be performed through the information connection. For example, when an input message is received by any node 101 in the blockchain system 100, other nodes 101 in the blockchain system 100 acquire the input message according to the consensus algorithm, and store the input message as data in the shared data, so that the data stored in all nodes 101 in the blockchain system 100 are consistent.
Each node 101 in the blockchain system 100 stores one identical blockchain. Fig. 2 is taken as an example to describe a possible structure of the blockchain, but in practical applications, the structure of the blockchain may also be different according to different scenarios, and this is not limited in this embodiment of the present invention.
Referring to fig. 2, a block chain is composed of a plurality of blocks, and a starting block includes a block header and a block body. As an example, the block header stores an input information characteristic value, a version number, a timestamp, and a difficulty value, and the block body stores input information; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the input information in the block is ensured.
The blockchain system 100 has computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, etc. The blockchain system 100 is a distributed shared ledger and database, and has the characteristics of decentralization, non-tampering, whole-course trace-keeping, traceability, collective maintenance, public transparency and the like. The characteristics ensure that the block chain is shared openly, real and complete, safe and reliable.
Before explaining the embodiments of the present application in detail, an application scenario of the embodiments of the present application will be described.
The data acquisition method provided by the embodiment of the application is applied to a scene needing to acquire a large amount of data from a block chain system. For example, it may be applied in scenarios where a large amount of blockchain data or account data needs to be obtained from a blockchain system. For example, in a case where account addresses of all blockchain accounts on a blockchain need to be acquired, or in a case where full-volume status data of a certain intelligent contract on the blockchain needs to be acquired, the data acquisition method provided by the embodiment of the present application may be used to acquire related data in the blockchain system.
Fig. 3 is a schematic diagram of a data acquisition system provided in an embodiment of the present application, and referring to fig. 3, the data acquisition system includes: device 301 and blockchain system 302.
The device 301 may be a desktop computer, a laptop computer, a network server, a palmtop computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device, which is not limited in this embodiment of the present application. The blockchain system 302 may be the blockchain system 100 described above in the embodiments of fig. 1-2. The device 301 and the blockchain system 302 may communicate through a wired connection or a wireless connection.
The device 301 and the blockchain system 302 may perform a data acquisition method described in the embodiment of fig. 4 below to achieve acquisition of relevant data in the blockchain system 302 by the device 301.
The data acquisition method provided in the embodiments of the present application is explained in detail below.
Fig. 4 is a flowchart of a data acquisition method according to an embodiment of the present application. Referring to fig. 4, the method includes the following steps.
Step 401: the first device sends a first data acquisition transaction to the blockchain system, the first data acquisition transaction requesting acquisition of a plurality of data.
The plurality of data may be blockchain data or account data in a blockchain system. For example, the plurality of data may be account addresses of all blockchain accounts on the blockchain, or the plurality of data may be full-scale status data of a certain intelligent contract on the blockchain.
Step 402: the block chain system acquires the plurality of data after receiving a first data acquisition transaction sent by the first device.
After receiving the first data acquisition transaction, the blockchain system may acquire a plurality of data requested to be acquired by the first data acquisition transaction. For example, the blockchain system may obtain the plurality of data through iterator traversal, and of course, the blockchain system may also obtain the plurality of data through other ways, which is not limited in this embodiment of the present application.
Further, before the block chain system acquires the data, it may be determined whether a total data size of the data is greater than or equal to a predetermined data size.
The preset data size may be preset, and the preset data size is smaller than the maximum data size that can be stored in the memory of the blockchain system, that is, the preset data size may be the data size that can be normally stored in the memory of the blockchain system. For example, the preset data size may be 50MB (megabyte).
If the total data size of the plurality of data is greater than or equal to the preset data size, it is indicated that the block chain system will likely cause memory exhaustion after the plurality of data are simultaneously loaded into the memory, and in order to avoid this problem, the block chain system does not simultaneously load the plurality of data into the memory when acquiring the plurality of data, but performs the following step 403 to load the plurality of data into the memory in batches, so as to avoid memory overflow and improve system security.
If the total data size of the plurality of data is smaller than the preset data size, it is indicated that the memory cannot be exhausted after the block chain system loads the plurality of data into the memory at the same time. In this case, the blockchain system may not perform the following step 403 when acquiring the plurality of data, but load the acquired plurality of data into the memory at the same time, so as to directly return the plurality of data in the memory to the first device. Of course, when the blockchain system acquires the plurality of data, the following step 403 may be optionally performed to batch load the plurality of data into the memory, so as to ensure that the memory does not overflow, and thus ensure the security of the system.
Step 403: and the block chain system stores the n data into a target file in the storage system when acquiring the n data in the plurality of data.
In this case, the blockchain system loads the n data into the memory every time the n data in the plurality of data are acquired, so as to store the n data in the memory to the target file in the storage system. That is, in the process of acquiring the plurality of data, the blockchain system loads the plurality of data into the memory every time n data are acquired, so as to store the plurality of data into the target file in the storage system. Therefore, the data are loaded into the memory in batches instead of simultaneously loading the data into the memory, so that the memory pressure is reduced, the memory overflow can be effectively avoided, and the system safety is improved.
n is a positive integer smaller than the number of data of the plurality of data. The total data size of the n data should be smaller than the preset data size, so that the memory overflow is not caused when the n data are loaded into the memory.
Illustratively, n may be a numerical value set in advance. For example, n may be set to 1. In this case, in the process of acquiring the plurality of data, the blockchain system loads the acquired data into the memory every time one of the plurality of data is acquired, and then stores the data in the memory into the target file in the storage system.
Alternatively, n may be a numerical value set according to a preset data size. For example, in a case that a total data size of the plurality of data is greater than or equal to a preset data size, in order to ensure that the total data size of the n data is smaller than the preset data size, a value obtained by dividing the preset data size by an average data size of the plurality of data may be rounded down to obtain n.
For example, the preset data size is 50MB, the plurality of data includes 10 data, and the data size of each data is 10MB, that is, the total data size of the 10 data is 100MB, and the average data size of the 10 data is 10 MB. If the block chain system can determine that the total data size of 100MB of the 10 data is greater than the preset data size of 50MB, the value obtained by dividing the preset data size of 50MB by the average data size of 10MB of the 10 data is rounded down, and n is 5. Thus, in the process of acquiring the 10 data, the blockchain system loads the 5 acquired data into the memory every time 5 data of the 10 data are acquired, and then stores the 5 data in the memory into the target file in the storage system. In this case, the blockchain system loads the 10 data into the memory in two batches, so that the memory overflow can be effectively avoided.
For another example, the preset data size is 25MB, the plurality of data includes 100 data, and the data size of each data is 1MB, that is, the total data size of the 100 data is 100MB, and the average data size of the 100 data is 1 MB. The block chain system may determine that the total data size 100MB of the 100 data is greater than the preset data size 25MB, and then divide the preset data size 25MB by the average data size 1MB of the 100 data to obtain a value of n being 25 by rounding down. Thus, in the process of acquiring the 100 data, the blockchain system loads the 25 acquired data into the memory every time 25 data of the 100 data are acquired, and then stores the 25 data in the memory to the target file in the storage system. In this case, the blockchain system loads the 100 data into the memory in four batches, so that the memory overflow can be effectively avoided.
The storage system is a system for storing files, which is exclusively added to the blockchain system. For example, the storage system may be a file system or a database, and the embodiment of the present application is not limited thereto. In a possible manner, the architecture of the storage system may be as shown in fig. 5, the blockchain system may store the data in the storage system in a file manner, the file name may be directly set as a file identifier, and the file name may be customized according to requirements, for example, the transaction hash of the current data acquisition transaction may be obtained, or the transaction hash of the current data acquisition transaction may be spliced with the account address of the blockchain account. The blockchain system may store multiple data acquired each time a data acquisition transaction is received separately as a single file. For example, a file system may be directly used as a storage system for storage, in which case, the acquired data are all directly stored in one file of the disk. Alternatively, a database may be used as the storage system for storage, for example, a kv (key-value) database may be used for storage, where data 1 in file 1 may be stored with "file 1-1" as a key, and data 3 in file 2 may be stored with "file 2-3" as a key.
Further, before the blockchain system executes step 403, a target file may be created in the storage system, and then the transaction hash of the first data acquisition transaction may be used as the file identifier of the target file, or the transaction hash of the first data acquisition transaction and the account address of the blockchain account of the first device may be used as the file identifier of the target file, that is, the transaction hash of the first data acquisition transaction and the account address of the blockchain account of the first device are spliced and then used as the file identifier of the target file, and of course, other information may also be used as the file identifier of the target file, which is not limited in the embodiment of the present application.
The file identification of the target file is used for uniquely identifying the target file, and the file identification of the target file is stored corresponding to the file storage path of the target file, so that other subsequent devices can acquire the plurality of data from the target file according to the file identification.
It should be noted that, if the file identifier of the target file includes the account address of the blockchain account of the first device, it may be ensured that only the first device may access or delete the target file in the following, so that the security of the target file may be improved. If the file identifier of the target file does not include the account address of the blockchain account of the first device, the target file can be accessed or deleted by the subsequent devices holding the file identifier, so that the use flexibility of the target file can be improved.
Step 404: and after the block chain system stores the data into the target file, the file identification of the target file and the number of the data in the target file are sent to the first equipment.
The file identifier of the target file and the number of data in the target file are sent to the first device, so that the subsequent first device can conveniently acquire one or more data in the target file from the block chain system according to the file identifier of the target file and the number of data in the target file, namely, the data in the target file is read in a segmented manner.
Further, after the block chain system stores all the data in the target file, the security of the target file is ensured in order to avoid tampering of the target file, and verification information of the target file can be generated. The verification information of the target file is information for verifying the target file, for example, the verification information of the target file may be a file hash of the target file, and the like, which is not limited in this embodiment of the application. If data needs to be acquired from the target file subsequently, the target file can be verified by using the verification information, and after the verification is passed, the data is acquired from the target file, so that the correctness of the acquired data is ensured.
After the blockchain system generates the verification information of the target file, the file identification and the verification information of the target file can be stored in the world state database, and then the blockchain system can generate the blockchain data according to the account data in the world state database. Since the block hash is generally generated according to the current transaction data and the world state data, for example, the block hash may include the current transaction hash and the world state hash, in the embodiment of the present application, the file identification and the verification information of the target file are written into the world state database, and the file information is actually incorporated into the calculation process of the block hash, so that it can be ensured that the target file is not tampered.
After receiving the file identifier of the target file and the number of data in the target file sent by the blockchain system, the first device may send a second data acquisition transaction to the blockchain system if it is necessary to acquire data in the target file, so as to read the data in the target file in segments, as described below.
Step 405: and the second equipment sends a second data acquisition transaction to the blockchain system, wherein the second data acquisition transaction carries the file identifier and the data index.
The second data acquisition transaction is for requesting acquisition of data indicated by the data index from the target file identified by the file identification. The data index may be determined according to the number of data in the target file, and generally includes a start data index and an end data index for indicating that the data from item to item in the target file are to be acquired. For example, the start data index in the data index is 2, the end data index is 3, that is, the data index is "2-3", which is used to indicate that the items 2 to 3 in the target file are to be obtained.
The second device may be the same device as the first device or may be a different device. If the second device is a different device from the first device, after receiving the file identifier of the target file and the number of data in the target file sent by the blockchain system, the first device may send the file identifier and the number of data to the second device, so that the second device may request to acquire one or more data in the target file from the blockchain system.
Step 406: and after receiving a second data acquisition transaction sent by the second equipment, the blockchain system acquires the data indicated by the data index from the target file identified by the file identifier as target data.
After receiving the second data acquisition transaction, the blockchain system may first acquire, from the storage system, a target file identified by a file identifier carried in the second data acquisition transaction, and then acquire, from the acquired target file, data indicated by a data index carried in the second data acquisition transaction as target data.
Since the file identifier is stored in correspondence with the file storage path, when the blockchain system acquires the target file identified by the file identifier carried in the second data acquisition transaction from the storage system, the corresponding file storage path may be acquired according to the file identifier, and then the corresponding target file is acquired from the file storage path in the storage system.
Further, before the blockchain system acquires the data indicated by the data index carried by the second data acquisition transaction from the acquired target file as the target data, the blockchain system may also verify the acquired target file, and after the acquired target file passes the verification, acquire the data indicated by the data index carried by the second data acquisition transaction from the acquired target file as the target data.
When the block chain system verifies the acquired target file, corresponding verification information may be acquired according to the file identifier, for example, corresponding verification information may be acquired from a world state database according to the file identifier, and then the acquired target file is verified according to the verification information. Assuming that the verification information is a file hash, the blockchain system may calculate a file hash of the obtained target file as a first hash value, and use the file hash in the verification information as a second hash value; if the first hash value is the same as the second hash value, determining that the obtained target file passes verification, namely that the target file is not tampered; and if the first hash value is different from the second hash value, determining that the obtained target file fails to be verified, namely the target file is tampered.
In some embodiments, the file identification of the target file comprises an account address of a blockchain account of the first device. In this case, the blockchain system only allows the first device to retrieve data from the target file. Therefore, in this case, before the blockchain system acquires the data indicated by the data index carried in the second data acquisition transaction from the acquired target file as the target data, it may also be determined whether the account address of the blockchain account of the second device is the same as the account address in the file identifier. If the account address of the blockchain account of the second device is the same as the account address in the file identifier, it is indicated that the second device and the first device are the same device, that is, the second device is the device that starts to send the data acquisition transaction to create the target file, the blockchain system allows the second device to acquire the data in the target file, and at this time, the blockchain system may acquire, from the acquired target file, the data indicated by the data index carried in the second data acquisition transaction as the target data, so as to subsequently return the target data to the second device. If the account address of the blockchain account of the second device is different from the account address in the file identifier, it indicates that the second device is not the same device as the first device, that is, the second device is not the device that initially sends the data acquisition transaction to create the target file, the blockchain system does not allow the second device to acquire the data in the target file, and at this time, the blockchain system may end the operation.
In other embodiments, the file identification of the target file does not include an account address of the blockchain account of the first device. In this case, the blockchain system allows any device holding the file identification to obtain data from the target file. Thus, in this case, the blockchain system may directly acquire, from the acquired target file, data indicated by the data index carried by the second data acquisition transaction as target data.
Step 407: the blockchain system sends the target data to the second device.
In this case, the second device may obtain part of the data in the target file by sending a second data acquisition transaction to the blockchain system once. If the second device wants to acquire all the data in the target file, the second device may send multiple second data acquisition transactions to the blockchain system to read the data in the target file in a segmented manner, and finally read all the data in the target file. Thus, the acquisition of batch data in the block chain system is realized.
Optionally, to reduce data storage pressure, the blockchain system may also delete target files in the storage system.
As an example, the blockchain system may set an expiration time of the target file, and automatically delete the target file after a certain time, that is, after the blockchain system stores all the plurality of data into the target file, the target file in the storage system is deleted at a preset time interval, where the preset time may be set in advance.
And/or, as another example, the user may instruct the blockchain system to delete the target file, that is, after the blockchain system receives the data deletion request carrying the file identifier, the target file identified by the file identifier in the storage system is deleted.
In this case, if the file identifier does not include the account address of the blockchain account of the first device, the blockchain system allows any device holding the file identifier to delete the target file, that is, after the blockchain system receives the data deletion request carrying the file identifier, the target file identified by the file identifier in the storage system may be directly deleted. If the file identifier includes an account address of the blockchain account of the first device, the blockchain system only allows the first device to delete the target file, that is, after the blockchain system receives the data deletion request carrying the file identifier, it may first determine whether the account address of the blockchain account of the device that sent the data deletion request is the same as the account address in the file identifier. If the account address of the blockchain account of the device sending the data deletion request is the same as the account address in the file identifier, which indicates that the device sending the data deletion request is the first device, the blockchain system allows the device sending the data deletion request to delete the target file, and at this time, the blockchain system may delete the target file identified by the file identifier in the storage system. If the account address of the blockchain account of the device sending the data deletion request is different from the account address in the file identifier, which indicates that the device sending the data deletion request is not the first device, the blockchain system does not allow the device sending the data deletion request to delete the target file, and at this time, the blockchain system may end the operation.
It should be noted that, in the embodiment of the present application, for the device side, no additional design is added, and the bulk data in the blockchain system can be acquired by sending a data acquisition transaction to the blockchain system. In the embodiment of the application, the blockchain system is designed to originally support the acquisition of batch data, so that the design burden of the equipment side is reduced, and the use is convenient.
For ease of understanding, the above data acquisition process is exemplified below, and may include the following steps (1) to (9):
(1) five items of data exist in the blockchain system, namely 'aa', 'ac', 'bd', 'bg', 'es'. Device a, in order to acquire these five items of data in the blockchain system, sends a first data acquisition transaction to the blockchain system.
(2) After receiving a first data acquisition transaction sent by the device a, the blockchain system determines that the total data size of the five items of data requested to be acquired by the first data acquisition transaction exceeds the preset data size, creates a target file in the storage system, and sets a file identifier of the target file as a transaction hash of the first data acquisition transaction and an account address of a blockchain account of the device a, that is, "the transaction hash-device a account address" is used as a file identifier of the target file and is also used as a file name of the target file.
(3) The blockchain system obtains the five items of data through iterator traversal, and stores the items of data to a target file in the storage system every time one item of data is obtained.
(4) After the block chain system stores all the five data into the target file, the iterator is released, the file hash of the target file is used as verification information of the target file, and the file name and the file hash of the target file are recorded in the world state database for use in subsequent block hash calculation, so that the target file can be prevented from being tampered.
(5) The block chain system returns the file identifier of the target file and the number of data obtained in the traversal (i.e., the number of data in the target file) to the device a. Device a may read the data in the target file using the file identification segment, as described below.
(6) After the device a receives the file identifier and the data number sent by the blockchain system, if data in the target file needs to be acquired, a data index is determined according to the data number, and then a second data acquisition transaction carrying the file identifier and the data index is sent to the blockchain system. For example, the second data acquisition transaction may carry a file identifier "transaction hash-device a account address" and a data index "2-3", where the data index "2-3" is used to indicate that the items 2 to 3 in the target file are acquired.
(7) After the blockchain system receives a second data acquisition transaction sent by the device A, because the account address of the blockchain account of the device A is the same as the account address in the file identifier transaction hash-device A account address, the blockchain system acquires a target file identified by the file identifier transaction hash-device A account address from the storage system, then acquires verification information corresponding to the file identifier transaction hash-device A account address from the world state database, verifies the acquired target file by using the verification information, and acquires items 2 to 3 in the target file and returns the items to the device A after the target file passes the verification.
(8) The device a may send multiple second data acquisition transactions to the blockchain system to read the data in the target file in segments, and finally complete reading of the five items of data in the target file. After the device a finishes reading five items of data in the target file, a data deletion request carrying a file identifier "transaction hash-device a account address" may be sent to the blockchain system.
(9) After the blockchain system receives the data deletion request sent by the device a, since the account address of the blockchain account of the device a is the same as the account address in the file identifier "transaction hash-device a account address", the blockchain system can delete the target file identified by the file identifier "transaction hash-device a account address" in the storage system, so as to reduce the amount of blockchain data.
For other devices, if the other devices want to access or delete the target file, the account address of the blockchain account of the other devices is not consistent with the account address recorded in the file identifier of the target file, so that the request of the other devices is rejected, and thus, the use safety of the target file can be improved.
In this embodiment of the application, after receiving a first data acquisition transaction sent by a first device, a blockchain system acquires a plurality of data requested to be acquired by the first data acquisition transaction. And when acquiring n data in the plurality of data, the block chain system stores the n data into a target file in the storage system, wherein n is a positive integer smaller than the number of the data of the plurality of data. That is, in the process of acquiring the plurality of data, the blockchain system loads the plurality of data into the memory every time n data are acquired, so as to store the plurality of data into the target file in the storage system. Therefore, the data are loaded into the memory in batches instead of simultaneously loading the data into the memory, so that the memory pressure is reduced, the memory overflow can be effectively avoided, and the system safety is improved. And after the block chain system stores the data into the target file, the file identification of the target file and the number of the data in the target file are sent to the first equipment. And then, after receiving a second data acquisition transaction which is sent by the second equipment and carries the file identifier and the data index, the blockchain system acquires the data indicated by the data index from the target file identified by the file identifier as target data, and then sends the target data to the second equipment. In this case, the second device may obtain part of the data in the target file by sending a second data acquisition transaction to the blockchain system once. If the second device wants to acquire all the data in the target file, the second device may send multiple second data acquisition transactions to the blockchain system to read the data in the target file in a segmented manner, and finally read all the data in the target file. Thus, the acquisition of batch data in the block chain system is realized.
Fig. 6 is a schematic structural diagram of a data acquisition apparatus according to an embodiment of the present application. The apparatus may be implemented by software, hardware or a combination of both as part or all of a computer device, which may be the computer device shown in fig. 7 below, which may implement the blockchain system of the embodiments of fig. 1-2 above. Referring to fig. 6, the apparatus includes: the device comprises a first receiving module 601, a first storing module 602, a first sending module 603, a second receiving module 604, a first obtaining module 605 and a second sending module 606.
A first receiving module 601, configured to receive a first data acquisition transaction sent by a first device, where the first data acquisition transaction is used to request to acquire multiple data;
a first storage module 602, configured to obtain a plurality of data, and store n pieces of data in a target file in a storage system each time n pieces of data in the plurality of data are obtained, where n is a positive integer smaller than the number of the data in the plurality of data;
the first sending module 603 is configured to send the file identifier of the target file and the number of data in the target file to the first device after the plurality of data are all stored in the target file;
a second receiving module 604, configured to receive a second data acquisition transaction sent by a second device, where the second data acquisition transaction carries a file identifier and a data index;
a first obtaining module 605, configured to obtain, as target data, data indicated by the data index from the target file identified by the file identifier;
a second sending module 606, configured to send the target data to the second device.
Optionally, the apparatus further comprises:
the creating module is used for creating a target file in the storage system if the total data size of the plurality of data is larger than or equal to the preset data size, wherein the preset data size is smaller than the maximum storable data size of the memory of the block chain system;
the setting module is used for taking the transaction hash of the first data acquisition transaction as the file identifier of the target file, or taking the transaction hash of the first data acquisition transaction and the account address of the block chain account of the first device as the file identifier of the target file.
Optionally, the apparatus further comprises:
and the calculation module is used for rounding down a numerical value obtained by dividing the size of the preset data by the average data size of the plurality of data to obtain n if the total data size of the plurality of data is larger than or equal to the size of the preset data, wherein the size of the preset data is smaller than the maximum storable data size of the memory of the block chain system.
Optionally, the file identification comprises a transaction hash of the first data acquisition transaction and an account address of a blockchain account of the first device; the device also includes:
the triggering module is configured to trigger the first obtaining module 605 to obtain, as the target data, the data indicated by the data index from the target file identified by the file identifier if the account address of the blockchain account of the second device is the same as the account address in the file identifier.
Optionally, the apparatus further comprises:
the first generation module is used for generating verification information of the target file after the plurality of data are stored in the target file;
the device also includes:
the second acquisition module is used for acquiring the target file identified by the file identification from the storage system;
the verification module is used for verifying the acquired target file according to the verification information;
and the triggering module is configured to trigger the first obtaining module 605 to obtain, as the target data, the data indicated by the data index from the target file identified by the file identifier after the obtained target file passes verification.
Optionally, the verification information includes a file hash of the target file; the device also includes:
the second storage module is used for storing the file identification and the verification information to a world state database;
and the second generation module is used for generating the block hash in the block chain data according to the account data in the world state database.
Optionally, the apparatus further comprises:
the deleting module is used for deleting the target file identified by the file identification in the storage system after receiving the data deleting request carrying the file identification; and/or deleting the target file in the storage system at preset time intervals after the plurality of data are stored in the target file.
In the embodiment of the application, after a first data acquisition transaction sent by a first device is received, a plurality of data requested to be acquired by the first data acquisition transaction are acquired. And storing the n data into a target file in a storage system every time when the n data in the plurality of data are acquired, wherein n is a positive integer smaller than the number of the data of the plurality of data. That is, in the process of acquiring the plurality of data, the plurality of data are loaded into the memory every time n data are acquired, so as to be stored in the target file in the storage system. Therefore, the data are loaded into the memory in batches instead of simultaneously loading the data into the memory, so that the memory pressure is reduced, the memory overflow can be effectively avoided, and the system safety is improved. And after the plurality of data are all stored in the target file, the file identification of the target file and the number of the data in the target file are sent to the first equipment. And then, after receiving a second data acquisition transaction which is sent by the second equipment and carries the file identifier and the data index, acquiring data indicated by the data index from a target file identified by the file identifier as target data, and then sending the target data to the second equipment. In this case, the second device may acquire part of the data in the target file by sending the second data acquisition transaction once. If the second device wants to acquire all the data in the target file, the second device may send multiple second data acquisition transactions to read the data in the target file in a segmented manner, and finally read all the data in the target file. Thus, the acquisition of batch data is realized.
It should be noted that: in the data acquisition apparatus provided in the above embodiment, only the division of the above functional modules is used for illustration when data is acquired, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules to complete all or part of the above described functions.
Each functional unit and module in the above embodiments may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present application.
The data acquisition device and the data acquisition method provided by the embodiments belong to the same concept, and the specific working processes and technical effects brought by the units and modules in the embodiments can be referred to in the embodiments of the methods, which are not described herein again.
Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 7, the computer device 7 includes: a processor 70, a memory 71 and a computer program 72 stored in the memory 71 and executable on the processor 70, the processor 70 implementing the operations performed by the blockchain system in the data acquisition method in the above embodiments when executing the computer program 72.
The computer device 7 may be a server cluster comprising a plurality of servers, in particular a blockchain system. Those skilled in the art will appreciate that fig. 7 is only an example of the computer device 7, and does not constitute a limitation to the computer device 7, and may include more or less components than those shown, or combine some components, or different components, such as input and output devices, network access devices, etc.
The Processor 70 may be a Central Processing Unit (CPU), and the Processor 70 may also be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor.
The storage 71 may in some embodiments be an internal storage unit of the computer device 7, such as a hard disk or a memory of the computer device 7. The memory 71 may also be an external storage device of the computer device 7 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 7. Further, the memory 71 may also include both an internal storage unit of the computer device 7 and an external storage device. The memory 71 is used for storing an operating system, an application program, a Boot Loader (Boot Loader), data, and other programs. The memory 71 may also be used to temporarily store data that has been output or is to be output.
An embodiment of the present application further provides a computer device, where the computer device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application also provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
The embodiments of the present application provide a computer program product, which when run on a computer causes the computer to perform the steps of the above-described method embodiments.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above method embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the above method embodiments. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or apparatus capable of carrying computer program code to a photographing apparatus/terminal device, a recording medium, computer Memory, ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, optical data storage device, etc. The computer-readable storage medium referred to herein may be a non-volatile storage medium, in other words, a non-transitory storage medium.
It should be understood that all or part of the steps for implementing the above embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented in software, may 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. The computer instructions may be stored in the computer-readable storage medium described above.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/computer device and method may be implemented in other ways. For example, the above-described apparatus/computer device embodiments are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (9)

1. A data acquisition method is applied to a block chain system, and comprises the following steps:
receiving a first data acquisition transaction sent by a first device, wherein the first data acquisition transaction is used for requesting to acquire a plurality of data, and the plurality of data are blockchain data or account data in the blockchain system;
acquiring the plurality of data, loading the n data into a memory of the block chain system when acquiring n data of the plurality of data, and storing the n data in the memory of the block chain system to a target file in a storage system, wherein n is a positive integer smaller than the number of the data of the plurality of data;
after the plurality of data are stored in the target file, sending a file identifier of the target file and the number of the data in the target file to the first device, wherein the file identifier comprises a transaction hash of the first data acquisition transaction and an account address of a block chain account of the first device;
receiving a second data acquisition transaction sent by a second device, wherein the second data acquisition transaction carries the file identifier and the data index;
if the account address of the blockchain account of the second device is the same as the account address in the file identifier, acquiring data indicated by the data index from a target file identified by the file identifier as target data;
and sending the target data to the second equipment.
2. The method of claim 1, wherein prior to said obtaining said plurality of data, further comprising:
and if the total data size of the plurality of data is larger than or equal to a preset data size, creating the target file in the storage system, wherein the preset data size is smaller than the maximum data size which can be stored in the memory of the block chain system.
3. The method of claim 1, wherein before storing the n data to a target file in a storage system each time the n data of the plurality of data are acquired, further comprising:
and if the total data size of the plurality of data is larger than or equal to a preset data size, rounding a numerical value obtained by dividing the preset data size by the average data size of the plurality of data downwards to obtain the n, wherein the preset data size is smaller than the maximum storable data size of the memory of the block chain system.
4. The method of any of claims 1-3, wherein the method further comprises:
after the plurality of data are stored in the target file, generating verification information of the target file;
before the obtaining the data indicated by the data index from the target file identified by the file identifier as target data, the method further includes:
acquiring the target file identified by the file identification from the storage system;
verifying the obtained target file according to the verification information;
and after the acquired target file passes the verification, executing the step of acquiring the data indicated by the data index from the target file identified by the file identification as target data.
5. The method of claim 4, wherein the verification information includes a file hash of the target file;
after the generating of the verification information of the target file, the method further includes:
storing the file identification and the verification information to a world state database;
and generating block hash in the block chain data according to the account data in the world state database.
6. The method of any of claims 1-3, wherein the method further comprises:
after receiving a data deletion request carrying the file identifier, deleting the target file identified by the file identifier in the storage system; and/or the presence of a gas in the gas,
and after the plurality of data are all stored in the target file, deleting the target file in the storage system at intervals of preset duration.
7. A data acquisition apparatus, applied to a blockchain system, the apparatus comprising:
the device comprises a first receiving module, a second receiving module and a third receiving module, wherein the first receiving module is used for receiving a first data acquisition transaction sent by first equipment, the first data acquisition transaction is used for requesting to acquire a plurality of data, and the plurality of data are blockchain data or account data in the blockchain system;
the first storage module is used for acquiring the plurality of data, loading the n data into the memory of the blockchain system when acquiring n data of the plurality of data, and storing the n data in the memory of the blockchain system to a target file in the storage system, wherein n is a positive integer;
a first sending module, configured to send a file identifier of the target file and the number of data in the target file to the first device after the plurality of data are all stored in the target file, where the file identifier includes a transaction hash of the first data acquisition transaction and an account address of a blockchain account of the first device;
the second receiving module is used for receiving a second data acquisition transaction sent by second equipment, wherein the second data acquisition transaction carries the file identifier and the data index;
a first obtaining module, configured to obtain, as target data, data indicated by the data index from a target file identified by the file identifier if an account address of a blockchain account of the second device is the same as an account address in the file identifier;
and the second sending module is used for sending the target data to the second equipment.
8. A computer device, characterized in that the computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, which computer program, when executed by the processor, implements the method according to any of claims 1 to 6.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 6.
CN202111209427.9A 2021-10-18 2021-10-18 Data acquisition method, device, equipment and storage medium Active CN113641649B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111209427.9A CN113641649B (en) 2021-10-18 2021-10-18 Data acquisition method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111209427.9A CN113641649B (en) 2021-10-18 2021-10-18 Data acquisition method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113641649A CN113641649A (en) 2021-11-12
CN113641649B true CN113641649B (en) 2022-02-18

Family

ID=78427313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111209427.9A Active CN113641649B (en) 2021-10-18 2021-10-18 Data acquisition method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113641649B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110162570A (en) * 2019-04-17 2019-08-23 阿里巴巴集团控股有限公司 The gradation acquisition methods and device of block chain data
CN111382458A (en) * 2018-12-28 2020-07-07 富泰华工业(深圳)有限公司 Data batch sealing method and device and computer storage medium
CN111694839A (en) * 2020-04-28 2020-09-22 平安科技(深圳)有限公司 Time series index construction method and device based on big data and computer equipment
CN112115281A (en) * 2020-09-17 2020-12-22 杭州海康威视数字技术股份有限公司 Data retrieval method, device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111382458A (en) * 2018-12-28 2020-07-07 富泰华工业(深圳)有限公司 Data batch sealing method and device and computer storage medium
CN110162570A (en) * 2019-04-17 2019-08-23 阿里巴巴集团控股有限公司 The gradation acquisition methods and device of block chain data
CN111694839A (en) * 2020-04-28 2020-09-22 平安科技(深圳)有限公司 Time series index construction method and device based on big data and computer equipment
CN112115281A (en) * 2020-09-17 2020-12-22 杭州海康威视数字技术股份有限公司 Data retrieval method, device and storage medium

Also Published As

Publication number Publication date
CN113641649A (en) 2021-11-12

Similar Documents

Publication Publication Date Title
CN109831487B (en) Fragmented file verification method and terminal equipment
US20210160053A1 (en) Merkle tree construction methods and apparatuses and simplified payment verification methods and apparatuses
US20210027289A1 (en) Asset transaction method, storage medium, and computer device
CN111163182B (en) Block chain-based device registration method and apparatus, electronic device, and storage medium
US11108547B2 (en) Methods and apparatuses for reading blockchain data
CN111444196B (en) Method, device and equipment for generating Hash of global state in block chain type account book
CN112685391B (en) Service data migration method and device, computer equipment and storage medium
CN106776795B (en) Data writing method and device based on Hbase database
CN111177257A (en) Data storage and access method, device and equipment of block chain
CN111444192A (en) Method, device and equipment for generating Hash of global state in block chain type account book
CN116578746A (en) Object de-duplication method and device
CN111444216A (en) Data block deleting method based on centralized block chain type account book
CN112291321B (en) Service processing method, device and system
CN113641649B (en) Data acquisition method, device, equipment and storage medium
CN110519287B (en) Information management method and related equipment
CN113051622B (en) Index construction method, device, equipment and storage medium
CN111444194B (en) Method, device and equipment for clearing indexes in block chain type account book
CN115221559A (en) Data account access authorization method and device
CN109725856B (en) Shared node management method and device, electronic equipment and storage medium
CN113806309A (en) Metadata deleting method, system, terminal and storage medium based on distributed lock
CN107704557B (en) Processing method and device for operating mutually exclusive data, computer equipment and storage medium
CN111625502A (en) Data reading method and device, storage medium and electronic device
CN112800130A (en) Data uplink method, system, device, equipment and storage medium
CN116700628B (en) Block chain data processing method, device, computer equipment and storage medium
CN112507028B (en) Data storage method, device, equipment and storage medium

Legal Events

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