CN111159196A - Block chain data storage and acquisition method and device based on fragmentation - Google Patents

Block chain data storage and acquisition method and device based on fragmentation Download PDF

Info

Publication number
CN111159196A
CN111159196A CN201911413891.2A CN201911413891A CN111159196A CN 111159196 A CN111159196 A CN 111159196A CN 201911413891 A CN201911413891 A CN 201911413891A CN 111159196 A CN111159196 A CN 111159196A
Authority
CN
China
Prior art keywords
target
service data
attribute
target service
data
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.)
Pending
Application number
CN201911413891.2A
Other languages
Chinese (zh)
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.)
Beijing Aimo Ruice Technology Co Ltd
Beijing Ai Morui Strategic Technology Co Ltd
Original Assignee
Beijing Aimo Ruice 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 Beijing Aimo Ruice Technology Co Ltd filed Critical Beijing Aimo Ruice Technology Co Ltd
Priority to CN201911413891.2A priority Critical patent/CN111159196A/en
Publication of CN111159196A publication Critical patent/CN111159196A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a fragment-based block chain data storage and acquisition method and device. The method comprises the following steps: determining a target service data identifier and a target attribute of received target service data to be stored; recording the corresponding relation between the target service data identification and the target attribute, and determining a target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment; and recording the target service data in a block corresponding to the target fragment so as to obtain the target service data corresponding to the target service data identifier on the block corresponding to the target attribute based on the corresponding relation. Therefore, the data volume needing to be traversed when the data is queried can be reduced, and the query efficiency is improved.

Description

Block chain data storage and acquisition method and device based on fragmentation
Technical Field
The invention relates to the technical field of computers, in particular to a block chain data storage and acquisition method and device based on fragmentation.
Background
The block chain technology, also called as distributed book technology, is an internet database technology, and is characterized in that centralization and openness are realized, and everyone can participate in database recording.
If we assume the database as a book, the reading and writing of the database can be regarded as an accounting behavior, the principle of the block chain technology is to find the person with the fastest accounting speed in a period of time, the person accounts, and then the page of information of the book is sent to other owners in the whole system. This is equivalent to changing all records in the database and sending to every other node in the whole network, so the block chain technique is also called distributed ledger (distributed ledger).
When a user acquires data information at any node in a block chain, if all nodes are not traversed, the acquired data may be tampered. This results in a waste of computer resources if all nodes are traversed. Therefore, how to improve the efficiency of data query in the blockchain becomes the focus of attention.
Disclosure of Invention
Based on the above problem, embodiments of the present invention provide a method and an apparatus for storing and acquiring block chain data based on fragmentation.
In a first aspect, a fragmentation-based blockchain data storage method is provided. Applied to a blockchain node, the method comprising: determining a target service data identifier and a target attribute of received target service data to be stored; recording the corresponding relation between the target service data identification and the target attribute, and determining a target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment; and recording the target service data in a block corresponding to the target fragment so as to obtain the target service data corresponding to the target service data identifier on the block corresponding to the target attribute based on the corresponding relation.
In an optional implementation, the target service data identifier includes a hash value of the target service data, and the target attribute includes one or more of a data size of the target service data, a data type of the target service data, or a user attribute corresponding to the target service data.
In an alternative implementation, the step of determining the target attribute of the received target service data to be stored includes: if the target attribute comprises the data type of the target service data, analyzing the received target service data to be stored to obtain the data type of the target service data; if the target attribute comprises the user attribute of the target service data, analyzing a packet header of a received data packet carrying the target service data to be stored to obtain a user identifier of the target service data, and determining the user attribute of the target service data based on a predetermined corresponding relation between the user identifier and the user attribute; and if the target attribute comprises the data volume of the target service data, counting the received target service data to be stored to obtain the data type of the target service data.
In an optional implementation, the step of recording the correspondence between the target service data identifier and the target attribute includes: a first corresponding relation database is established in advance; and recording the corresponding relation between the target service data identification and the target attribute in the first corresponding relation database.
In an optional implementation, the correspondence between the attributes and the fragments is a correspondence between the levels of the attributes and the fragments; the step of determining the target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment comprises the following steps: determining a target level corresponding to the target attribute; and determining the target fragment corresponding to the target level based on the corresponding relation between the level of the attribute and the fragment.
In a second aspect, a method for acquiring block chain data based on structuring is provided. Applied to a blockchain node, the method comprising: receiving a data acquisition request, wherein the acquisition request comprises a data identifier, and the acquisition request is used for requesting target service data corresponding to the data identifier; determining a target attribute based on the corresponding relation between the recorded data identification and the attribute; determining a target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment; and acquiring the target service data in the block corresponding to the target fragment in the block chain.
In a third aspect, a partition-based blockchain data storage device is provided. Applied to a blockchain node, the apparatus comprising: the first determining unit is used for determining the target service data identifier and the target attribute of the received target service data to be stored; the first recording unit is used for recording the corresponding relation between the target service data identifier and the target attribute, and the second determining unit is used for determining the target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment; the second recording unit is configured to record the target service data in a block corresponding to the target fragment, so as to obtain the target service data corresponding to the target service data identifier on the block corresponding to the target attribute based on the correspondence.
In a fourth aspect, a block chain data acquisition device based on structuring is provided. Applied to a blockchain node, the apparatus comprising: a receiving unit, configured to receive a data acquisition request, where the data acquisition request includes a data identifier, and the acquisition request is used to request target service data corresponding to the data identifier; the first determining unit is used for determining the target attribute based on the corresponding relation between the recorded data identification and the attribute; the second determining unit is used for determining the target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment; an obtaining unit, configured to obtain the target service data in a block corresponding to the target fragment in the block chain.
In a fifth aspect, embodiments of the present specification provide a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method steps of the first aspect when executing the program.
In a sixth aspect, embodiments of the present specification provide a blockchain network comprising a plurality of blockchain nodes and a plurality of user equipments, wherein the blockchain nodes are configured to implement the method steps of the first aspect.
In a seventh aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when being executed by a processor, carries out the method steps of the first aspect described above.
In an eighth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method steps of the first aspect described above.
The embodiment of the invention provides a fragment-based block chain data storage and acquisition method and device. Determining a data identifier and a block height identifier of received target service data to be stored, wherein the block height identifier is used for indicating the position of the block in the block chain; establishing a data index in a local database based on the data identifier and the block height identifier; and recording the target service data in the block corresponding to the block height identifier so as to obtain the target service data on the block corresponding to the block height identifier based on the local database. Therefore, the data volume needing to be traversed when the data is queried can be reduced, and the query efficiency is improved.
Drawings
FIG. 1 illustrates an exemplary architecture for applying embodiments provided herein;
fig. 2 is a flowchart of a partition-based blockchain data storage method according to an embodiment of the present invention;
fig. 3 is a flowchart of a fragment-based blockchain data acquisition method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a partition-based blockchain data storage device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a partition-based blockchain data acquisition apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a computer device provided in an embodiment of the present specification;
fig. 7 shows a schematic structural diagram of a computer device provided in an embodiment of the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a fragment-based block chain data storage and acquisition method and device. Fig. 1 shows an exemplary architecture to which embodiments provided herein apply.
As shown in fig. 1, the exemplary architecture may include one or more user equipments 101 and one or more blockchain nodes 102, and when there are a plurality of blockchain nodes 102 and user equipments 101, a blockchain network is formed, where the blockchain nodes in the blockchain network may include storage nodes and out-blocking nodes. User equipment 101 may be configured to interact with a blockchain node 102, for example, user equipment 101 sends service data to the blockchain node; the block chain link point stores the service data in a block chain; user equipment 101 may also send a query request to the block chaining point, requesting data in the block chain.
It should be noted that the architecture of this embodiment is not limited to implement other functions, for example, the user equipment 101 may also be used as a block link node.
For the purpose of facilitating understanding of the embodiments of the present invention, the following description will be further explained with reference to specific embodiments, which are not to be construed as limiting the embodiments of the present invention.
Fig. 2 is a schematic flow chart of a fragment-based block chain data storage method according to the present invention. As shown in fig. 2, when applied to a block chain node (e.g., block chain node 102 shown in fig. 1), the method may specifically include the following steps:
s210, determining a target service data identifier and a target attribute of received target service data to be stored;
the target service data identification may include a hash value of the target service data. For example, the target service data may be a transaction, the transaction includes data of multiple transaction roll-out addresses, multiple transaction roll-in addresses, a transaction object, and the like, and the target service data identifier corresponding to the transaction may be a hash value of the transaction. The hash value may be a hash value recorded in a header portion of a block in a tile.
The target attribute may include one or more of a data amount of the target service data, a data type of the target service data, or a user attribute corresponding to the target service data.
The target data is mainly used for classifying the service data so as to segment all the service data. When data is read, the data can be read according to the fragments, and the reading efficiency is high.
The target traffic data may come from the user equipment.
S220, recording the corresponding relation between the target service data identification and the target attribute, and determining a target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment;
when receiving new service data each time, the blockchain node may store a service data identifier corresponding to the new service data and a target attribute corresponding to the new service data in the local database. So that when a data acquisition request is received, the target attribute can be determined according to the local database and the target service data identifier in the data acquisition request.
And S230, recording the target service data in the block corresponding to the target fragment so as to obtain the target service data corresponding to the target service data identifier on the block corresponding to the target attribute based on the corresponding relationship.
After the local database is updated, the service data in the established time period can be periodically verified, packaged and stamped, and then uplink is carried out.
In the embodiment of the present application, the chunks are fragmented, each chunk may correspond to one fragment identifier, and each fragment only stores service data corresponding to the fragment identifier. Therefore, all the service data can be divided into a plurality of groups in the block chain in time, and the data can be traversed according to the groups when being acquired, so that the data storage efficiency is improved.
In some embodiments, different target attributes may correspond to different acquisition modes. As an example, the determining of the target attribute of the received target service data to be stored in step S210 may specifically be implemented by the following steps:
step 1.1), if the target attribute comprises the data type of the target service data, analyzing the received target service data to be stored to obtain the data type of the target service data;
the data type of the service data is generally recorded in a data structure carrying the service data, and the data structure may be analyzed to obtain the data type of the service data.
Step 1.2), if the target attribute comprises the user attribute of the target service data, analyzing the packet header of a received data packet carrying the target service data to be stored to obtain the user identifier of the target service data, and determining the user attribute of the target service data based on the corresponding relation between the predetermined user identifier and the user attribute;
for the information such as the user attribute, the information is usually recorded in a packet header of a data structure carrying the service data, and the packet header may be parsed to obtain the user attribute. The user attribute may include information such as a user name, a user rating, or user authority.
Step 1.3), if the target attribute comprises the data volume of the target service data, counting the received target service data to be stored to obtain the data type of the target service data.
The data volume of the service data can be directly obtained by counting the service data. Of course, the data volume of the service data may also be obtained by analysis.
In some embodiments, the corresponding relationship may be recorded in a local database, and as an example, the recording of the corresponding relationship between the target service data identifier and the target attribute in step S220 may specifically be implemented by the following steps:
step 2.1), a first corresponding relation database is established in advance;
and 2.2) recording the corresponding relation between the target service data identification and the target attribute in a first corresponding relation database.
In some embodiments, different attributes may correspond to different levels, and the correspondence between the attributes and the levels may be predetermined. As one example. The corresponding relation between the attribute and the fragment is the corresponding relation between the level of the attribute and the fragment; in the step S220, based on the correspondence between the attribute determined by preselection and the segment, determining the target segment corresponding to the target attribute may specifically be implemented by the following steps:
step 3.1), determining a target level corresponding to the target attribute;
and 3.2) determining the target fragment corresponding to the target level based on the corresponding relation between the level of the attribute and the fragment.
Fig. 3 is a schematic flow chart of a method for acquiring block chain data based on structuring according to the present invention. As shown in fig. 3, when applied to a block chain node (e.g., block chain node 102 shown in fig. 1), the method may specifically include the following steps:
step S310, receiving a data acquisition request, wherein the data acquisition request comprises a data identifier, and the acquisition request is used for requesting target service data corresponding to the data identifier;
the acquisition request may be triggered by the user equipment for the user. For example, a user may trigger a query for data in a blockchain through a client in a user device. A plurality of data identifications, such as hash values of the data, storage addresses of the data, and accounts to which the data belong, may be recorded in the user equipment.
The user may select or enter a data identification in the user device to trigger a data acquisition request.
Step S320, determining a target attribute based on the corresponding relation between the recorded data identification and the attribute;
in conjunction with the foregoing embodiment shown in fig. 2, the local database of the blockchain node may be used to store the corresponding relationship between the data identifier and the attribute. The block link point may update the local database each time new traffic data is received.
After receiving the acquisition request sent by the user equipment, the blockchain node may determine the target attribute based on the local database.
Step S330, determining target fragments corresponding to the target attributes based on the corresponding relation between the pre-selected determined attributes and the fragments;
with reference to the foregoing embodiment shown in fig. 2, after determining the target attribute, the target segment may be obtained.
Step S340, obtaining target service data in the block corresponding to the target fragment in the block chain.
After the target fragment is determined, all the blocks corresponding to the target fragment may be traversed, so as to obtain the target service data. After the target service data is obtained, the target service data may be returned to the client.
Fig. 4 is a schematic structural diagram of a partition-based blockchain data storage device according to the present invention. As shown in fig. 4, when applied to a blockchain node (e.g., the blockchain node 102 shown in fig. 1), the apparatus may specifically include the following steps:
a first determining unit 401, configured to determine a target service data identifier and a target attribute of received target service data to be stored;
a first recording unit 402, configured to record a corresponding relationship between the target service data identifier and the target attribute;
a second determining unit 403, configured to determine, based on a correspondence between pre-selected determined attributes and segments, a target segment corresponding to the target attribute;
a second recording unit 404, configured to record the target service data in a block corresponding to the target fragment, so as to obtain, on the block corresponding to the target attribute, the target service data corresponding to the target service data identifier based on the correspondence.
In some embodiments, the target service data identifier includes a hash value of the target service data, and the target attribute includes one or more of a data size of the target service data, a data type of the target service data, or a user attribute corresponding to the target service data.
In some embodiments, the first determining unit 401 is specifically configured to:
if the target attribute comprises the data type of the target service data, analyzing the received target service data to be stored to obtain the data type of the target service data;
if the target attribute comprises the user attribute of the target service data, analyzing a packet header of a received data packet carrying the target service data to be stored to obtain a user identifier of the target service data, and determining the user attribute of the target service data based on a predetermined corresponding relation between the user identifier and the user attribute;
and if the target attribute comprises the data volume of the target service data, counting the received target service data to be stored to obtain the data type of the target service data.
In some embodiments, the first recording unit 402 is specifically configured to:
a first corresponding relation database is established in advance;
and recording the corresponding relation between the target service data identification and the target attribute in the first corresponding relation database.
In some embodiments, the correspondence between the attribute and the segment is a correspondence between a level of the attribute and the segment; the second determining unit 403 is specifically configured to:
determining a target level corresponding to the target attribute;
and determining the target fragment corresponding to the target level based on the corresponding relation between the level of the attribute and the fragment.
It can be understood that the partition-based blockchain data storage device of the present embodiment corresponds to the method embodiment shown in fig. 2, and therefore, the above description about the method embodiment shown in fig. 2 is also applicable to the device of the present embodiment, and is not repeated herein.
Fig. 5 is a schematic structural diagram of a block chain data acquisition apparatus based on a structure according to the present invention. As shown in fig. 5, when applied to a blockchain node (e.g., the blockchain node 102 shown in fig. 1), the apparatus may specifically include the following steps:
a receiving unit 501, configured to receive a data obtaining request, where the obtaining request includes a data identifier, and the obtaining request is used to request target service data corresponding to the data identifier;
a first determining unit 502, configured to determine a target attribute based on a corresponding relationship between the recorded data identifier and the attribute;
a second determining unit 503, configured to determine, based on a correspondence between a preselected determined attribute and a segment, a target segment corresponding to the target attribute;
an obtaining unit 504, configured to obtain the target service data in a block corresponding to the target segment in the block chain.
It can be understood that the slice-based blockchain data acquisition apparatus of the present embodiment corresponds to the method embodiment shown in fig. 3, and therefore, the above description about the method embodiment shown in fig. 3 is also applicable to the apparatus of the present embodiment, and is not repeated herein.
Fig. 6 shows a schematic structural diagram of a computer device provided in an embodiment of the present specification, where the computer device may include: a processor 610, a memory 620, an input/output interface 630, a communication interface 640, and a bus 650. Wherein the processor 610, memory 620, input/output interface 630, and communication interface 640 are communicatively coupled to each other within the device via a bus 650. The processor 610 is configured to execute executable modules stored in the memory 620, such as computer programs corresponding to the method embodiments shown in fig. 2.
Fig. 7 is a schematic structural diagram of a computer device provided in an embodiment of the present specification, where the computer device may include: processor 710, memory 720, input/output interface 730, communication interface 740, and bus 750. Wherein processor 710, memory 720, input/output interface 730, and communication interface 740 are communicatively coupled to each other within the device via bus 750. Processor 710 is configured to execute executable modules stored in memory 720, such as computer programs corresponding to the method embodiments shown in fig. 3.
As for the above fig. 6 or fig. 7, the processor may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute the relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory may be implemented in the form of a ROM (Read Only Memory), a RAM (Random access Memory), a static storage device, a dynamic storage device, or the like. The memory may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory and called by the processor to be executed.
The input/output interface is used for connecting the input/output module to realize information input and output. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface is used for connecting a communication module (not shown in the figure) to realize the communication interaction of the equipment and other equipment. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
A bus includes a path that transfers information between the various components of the device, such as the processor, memory, input/output interfaces, and communication interfaces.
It should be noted that although the above-described device shows only a processor, a memory, an input/output interface, a communication interface and a bus, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.
Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. 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 invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, a software module executed by a processor, or a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only illustrative of the present invention and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the scope of the present invention should be included in the scope of the present invention.

Claims (10)

1. A fragment-based blockchain data storage method is applied to blockchain nodes, and the method comprises the following steps:
determining a target service data identifier and a target attribute of received target service data to be stored;
recording the corresponding relation between the target service data identification and the target attribute, and determining a target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment;
and recording the target service data in a block corresponding to the target fragment so as to obtain the target service data corresponding to the target service data identifier on the block corresponding to the target attribute based on the corresponding relation.
2. The method of claim 1, wherein the target service data identifier comprises a hash value of the target service data, and wherein the target attribute comprises one or more of a data size of the target service data, a data type of the target service data, or a user attribute corresponding to the target service data.
3. The method of claim 2, wherein the step of determining the target attribute of the received target service data to be stored comprises:
if the target attribute comprises the data type of the target service data, analyzing the received target service data to be stored to obtain the data type of the target service data;
if the target attribute comprises the user attribute of the target service data, analyzing a packet header of a received data packet carrying the target service data to be stored to obtain a user identifier of the target service data, and determining the user attribute of the target service data based on a predetermined corresponding relation between the user identifier and the user attribute;
and if the target attribute comprises the data volume of the target service data, counting the received target service data to be stored to obtain the data type of the target service data.
4. The method according to claim 1, wherein the step of recording the correspondence between the target service data identifier and the target attribute comprises:
a first corresponding relation database is established in advance;
and recording the corresponding relation between the target service data identification and the target attribute in the first corresponding relation database.
5. The method according to claim 1, wherein the correspondence between the attributes and the segments is a correspondence between the level of the attribute and the segment; the step of determining the target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment comprises the following steps:
determining a target level corresponding to the target attribute;
and determining the target fragment corresponding to the target level based on the corresponding relation between the level of the attribute and the fragment.
6. A block chain data acquisition method based on structuralization is applied to a block chain node, and the method comprises the following steps:
receiving a data acquisition request, wherein the acquisition request comprises a data identifier, and the acquisition request is used for requesting target service data corresponding to the data identifier;
determining a target attribute based on the corresponding relation between the recorded data identification and the attribute;
determining a target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment;
and acquiring the target service data in the block corresponding to the target fragment in the block chain.
7. A partition-based blockchain data storage device, for use in a blockchain node, the device comprising:
the first determining unit is used for determining the target service data identifier and the target attribute of the received target service data to be stored;
the first recording unit is used for recording the corresponding relation between the target service data identifier and the target attribute;
the second determining unit is used for determining the target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment;
and the second recording unit is used for recording the target service data in the block corresponding to the target fragment so as to obtain the target service data corresponding to the target service data identifier on the block corresponding to the target attribute based on the corresponding relationship.
8. An apparatus for acquiring data of a blockchain based on a structure, the apparatus being applied to a blockchain node, the apparatus comprising:
a receiving unit, configured to receive a data acquisition request, where the data acquisition request includes a data identifier, and the acquisition request is used to request target service data corresponding to the data identifier;
the first determining unit is used for determining the target attribute based on the corresponding relation between the recorded data identification and the attribute;
the second determining unit is used for determining the target fragment corresponding to the target attribute based on the corresponding relation between the attribute determined by preselection and the fragment;
an obtaining unit, configured to obtain the target service data in a block corresponding to the target fragment in the block chain.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 6 when executing the program.
10. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the method of any of claims 1-6.
CN201911413891.2A 2019-12-31 2019-12-31 Block chain data storage and acquisition method and device based on fragmentation Pending CN111159196A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911413891.2A CN111159196A (en) 2019-12-31 2019-12-31 Block chain data storage and acquisition method and device based on fragmentation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911413891.2A CN111159196A (en) 2019-12-31 2019-12-31 Block chain data storage and acquisition method and device based on fragmentation

Publications (1)

Publication Number Publication Date
CN111159196A true CN111159196A (en) 2020-05-15

Family

ID=70559967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911413891.2A Pending CN111159196A (en) 2019-12-31 2019-12-31 Block chain data storage and acquisition method and device based on fragmentation

Country Status (1)

Country Link
CN (1) CN111159196A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111339566A (en) * 2020-05-19 2020-06-26 卓尔智联(武汉)研究院有限公司 Block summarization method, device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111339566A (en) * 2020-05-19 2020-06-26 卓尔智联(武汉)研究院有限公司 Block summarization method, device, computer equipment and storage medium
CN111339566B (en) * 2020-05-19 2020-10-23 卓尔智联(武汉)研究院有限公司 Block summarization method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108156006B (en) Buried point data reporting method and device and electronic equipment
CN110781372B (en) Method and device for optimizing website, computer equipment and storage medium
CN109670091B (en) Metadata intelligent maintenance method and device based on data standard
CN109561117A (en) Collecting method and device
CN110519263B (en) Anti-swipe method, device, apparatus, and computer-readable storage medium
CN111163072A (en) Method and device for determining characteristic value in machine learning model and electronic equipment
CN106301975A (en) A kind of data detection method and device thereof
CN112286706B (en) Remote and rapid acquisition method for application information of android application and related equipment
CN104503983A (en) Method and device for providing website certification data for search engine
CN111159196A (en) Block chain data storage and acquisition method and device based on fragmentation
CN111177269A (en) Block chain data storage and acquisition method and device based on structuralization
CN113536240A (en) Method and device for using admission ticket by combining NFT (network File transfer)
CN114625407A (en) Method, system, equipment and storage medium for implementing AB experiment
CN111078711A (en) Block chain data storage and acquisition method and device based on data index
CN113839948A (en) DNS tunnel traffic detection method and device, electronic equipment and storage medium
CN108629610B (en) Method and device for determining popularization information exposure
CN107193825B (en) Page statistical method and device
CN106445935B (en) Misjudgment processing method and device for click data
WO2014173129A1 (en) Mobile terminal flow identification method and apparatus
CN114595244B (en) Method and device for aggregating crash data, electronic equipment and storage medium
CN113157048B (en) Behavior data analysis method based on multi-terminal time axis and related components
CN109960922B (en) Method and device for identifying newly activated equipment
CN110674190B (en) Statistical method and device for file system tasks and server
CN111831668A (en) Outdoor space detection data storage method and device based on block chain
JP6787846B2 (en) Suspected location estimation device and suspected location estimation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200515