CN111737729A - Evaluation data storage method and system based on service data block chain - Google Patents

Evaluation data storage method and system based on service data block chain Download PDF

Info

Publication number
CN111737729A
CN111737729A CN202010271034.XA CN202010271034A CN111737729A CN 111737729 A CN111737729 A CN 111737729A CN 202010271034 A CN202010271034 A CN 202010271034A CN 111737729 A CN111737729 A CN 111737729A
Authority
CN
China
Prior art keywords
user
data
evaluation
tree
information
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
CN202010271034.XA
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 Ruice Technology Co Ltd
Original Assignee
Beijing 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 Ruice Technology Co Ltd filed Critical Beijing Ruice Technology Co Ltd
Priority to CN202010271034.XA priority Critical patent/CN111737729A/en
Publication of CN111737729A publication Critical patent/CN111737729A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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
    • G06F16/2246Trees, e.g. B+trees
    • 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
    • G06F16/2255Hash tables
    • 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/2455Query execution
    • 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
    • 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
    • G06F21/6227Protecting 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 where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Accounting & Taxation (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Computational Linguistics (AREA)
  • Development Economics (AREA)
  • Computing Systems (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses an evaluation data storage method and system based on a service data block chain, wherein the method is applied to the evaluation data storage system of the service data block chain and comprises the following steps: an evaluation block chain node receives an evaluation client side and sends a user evaluation operation data uplink request; storing user evaluation data through a chain structure and a tree structure; the chain structure is used for storing user evaluation operation data, and the tree structure is used for storing state data after user evaluation operation; the tree structure comprises a state tree and a relation tree, the state tree is used for storing the overall state of the user evaluation operation data, the overall state is the overall state after the user evaluation operation, and the relation tree is used for storing the incidence relation between the overall states after the user evaluation operation. According to the method and the device, the user can evaluate the uplink of the operation data, and the mode of chain storage and tree storage is adopted, so that the query efficiency of the evaluation operation data is improved.

Description

Evaluation data storage method and system based on service data block chain
Technical Field
The invention relates to the technical field of internet big data, and discloses an evaluation data storage method and system based on a service data block chain.
Background
Currently, the blockchain technology is a distributed stored ledger that uses technologies such as encryption algorithm and consensus mechanism. With the use of blockchain technology, more and more internet data is stored on the blockchain.
In the existing block chain, only transaction data can be stored, wherein the transaction data comprises a transfer party address, a receiving party address and a transfer amount; for various service data (such as evidence storage data, traceability data, financial data, travel data, search data, self-media data, investigation data, advertisement data, recruitment data, community data, question and answer data, e-commerce data, knowledge payment data, shared bicycle data, life service data, house renting data, voting data, OTO data (also called online to offline data), evaluation data, praise data, social data, internet appointment data and other internet related data), not only the data per se but also the association relationship between the data on the block chain need to be expressed.
Therefore, how to store the evaluation data on the block chain becomes an urgent problem to be solved.
The foregoing description is merely for convenience in understanding and is not to be construed as limiting the prior art to the present application.
Disclosure of Invention
Based on the above problems, the present application provides an evaluation data storage method and system based on a service data block chain, where the method stores user evaluation operation data on the service block chain to implement uplink of the user evaluation operation data.
The first aspect of the application discloses an evaluation data storage method based on a service data block chain, which is applied to an evaluation data storage system of the service data block chain, wherein the evaluation data storage system of the service data block chain comprises a plurality of evaluation block chain nodes; the method comprises the following steps:
an evaluation block chain node receives an evaluation client side and sends a user evaluation operation data uplink request;
storing user evaluation data through a chain structure and a tree structure; the user evaluation data comprises user evaluation operation data and state data after the user evaluation operation, the chain structure is used for storing the user evaluation operation data, and the tree structure is used for storing the state data after the user evaluation operation; the tree structure comprises a state tree and a relation tree, the state tree is used for storing the overall state of user evaluation operation data, the overall state is the overall state after the user evaluation operation, and the relation tree is used for storing the incidence relation between the overall states after the user evaluation operation; the chain type structure is a chain type storage structure of a block;
and sending the operation data uplink response of the user to the evaluation client.
In one possible implementation, the user evaluation operation data includes one or more of a timestamp, an operation user address, an operated address, an operation type, a value of an operation, a credit address, a signature of the user on the user evaluation operation data, and a hash value of the user evaluation operation data; wherein,
the evaluation data operation type comprises operation on evaluation data and operation on integration by a user, and the operated address comprises an operation address on the evaluation data and an address of the user operating other evaluation data.
In one possible implementation, the state tree stores user-evaluation operational data global states including one or more of user information, evaluation data, and point data.
In a possible implementation manner, the association stored in the relationship tree includes an association of user evaluation operation data and user information; wherein, one user evaluation operation data information corresponds to one or more user information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between the user information and the integral information; wherein, one user information corresponds to one or more integral information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between user evaluation operation data information and integral information; wherein, one user evaluation operation data information corresponds to one or more integral information.
In a possible implementation manner, the tree structure employs a database supporting attribute query or a KV database, where the database supporting attribute query includes a relational database and an in-memory database.
In one possible embodiment, any one of the user information, the user evaluation operation data, the point information, the user evaluation operation data-user information, the user information-point information, and the user evaluation operation data-point information is organized into an MPT tree or a mercker tree; wherein,
the root of any Tree is stored in the block header, the MPT Tree is a Merck Tree variation of a Tree structure fused with a prefix Tree, and the Merck Tree is a Merkle Patricia Tree Tree.
In one example, leaf nodes in the relational tree store a tree root of a relational sub-tree, values of leaf nodes of the relational sub-tree store one or more of user information-score information, entity information-user information, and entity information-score information; or
And the value of the leaf node in the relational tree stores one or more of user information-integral information, entity information-user information and entity information-integral information in an array or hash table mode.
In one example, any one of the user information, the entity information, the point information, the user information-point information, the entity information-user information and the entity information-point information is stored in a database supporting attribute query in a form of a data table, so that a user can query according to an attribute field in the data table; one kind of information corresponds to one kind of data table, any line in any kind of data table corresponds to one piece of information, and one kind of information comprises a plurality of lines of information.
The second aspect of the application discloses an evaluation data storage system based on a service data block chain, wherein the evaluation data storage system of the service data block chain comprises a plurality of evaluation block chain nodes; the evaluation block link point comprises a receiving unit, a processing unit and a sending unit; wherein,
the receiving unit is used for receiving a user evaluation operation data uplink request sent by an evaluation client;
the processing unit stores user evaluation data through a chain structure and a tree structure; the user evaluation data comprises user evaluation operation data and state data after the user evaluation operation, the chain structure is used for storing the user evaluation operation data, and the tree structure is used for storing the state data after the user evaluation operation; the tree structure comprises a state tree and a relation tree, the state tree is used for storing the overall state of user evaluation operation data, the overall state is the overall state after the user evaluation operation, and the relation tree is used for storing the incidence relation between the overall states after the user evaluation operation; the chain type structure is a chain type storage structure of a block;
and the sending unit is used for sending the uplink response of the operation data of the user to the evaluation client.
In one possible implementation, the user evaluation operation data includes one or more of a timestamp, an operation user address, an operated address, an operation type, a value of an operation, a credit address, a signature of the user on the user evaluation operation data, and a hash value of the user evaluation operation data; wherein,
the evaluation data operation type comprises operation on evaluation data and operation on integration by a user, and the operated address comprises an operation address on the evaluation data and an address of the user operating other evaluation data.
In one possible implementation, the state tree stores user-evaluation operational data global states including one or more of user information, evaluation data, and point data.
In a possible implementation manner, the association stored in the relationship tree includes an association of user evaluation operation data and user information; wherein, one user evaluation operation data information corresponds to one or more user information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between the user information and the integral information; wherein, one user information corresponds to one or more integral information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between user evaluation operation data information and integral information; wherein, one user evaluation operation data information corresponds to one or more integral information.
In a possible implementation manner, the tree structure employs a database supporting attribute query or a KV database, where the database supporting attribute query includes a relational database and an in-memory database.
In one possible embodiment, any one of the user information, the user evaluation operation data, the point information, the user evaluation operation data-user information, the user information-point information, and the user evaluation operation data-point information is organized into an MPT tree or a mercker tree; wherein,
the root of any Tree is stored in the block header, the MPT Tree is a Merck Tree variation of a Tree structure fused with a prefix Tree, and the Merck Tree is a Merkle Patricia Tree Tree.
A third aspect of the present application provides a computer-readable storage medium, which stores computer instructions, and when the computer instructions are executed by a processor, the computer instructions implement any one of the above-mentioned technical solutions.
A fourth aspect of the present application provides an electronic device, which includes a processor configured to execute any one of the above technical solutions.
The method comprises the steps that user evaluation operation data are stored in a service data block chain, and the uplink of the user evaluation operation data is achieved; meanwhile, the business data block chain adopts a chain storage mode and a tree storage mode, so that the query of the operation data evaluated by the user is facilitated, and the query efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, 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 invention, 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 flow chart illustrating an evaluation data storage method based on a service data block chain according to the present application;
FIG. 2 is a block diagram illustrating a business data block chaining system according to the present application;
fig. 3 is a schematic diagram of an evaluation data storage structure based on a service data block chain according to the present application;
fig. 4 is a block header structure diagram in a service data block chain system according to the present disclosure.
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 terms "first" and "second" in this application are used for convenience of understanding only, and are not to be construed as sequential or limiting in any way.
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.
Blockchains are generally divided into three types: public chain (Public Blockchain), private chain (PrivateBlockchain) and alliance chain (Consortium Blockchain). In addition, there are various types of combinations, such as private chain + federation chain, federation chain + public chain, and other different combinations. The most decentralized of these is the public chain. The public chain is represented by bitcoin and ether house, and the participators joining the public chain can read the data record on the chain, participate in transaction, compete for accounting right of new blocks, and the like.
Furthermore, each participant (i.e., node) is free to join and leave the network and perform related operations. Private chains are the opposite, with the network's write rights controlled by an organization or organization and the data read rights specified by the organization. Briefly, a private chain can be a weakly centralized system with strictly limited and few participating nodes. This type of blockchain is more suitable for use within a particular establishment.
Based on the basic characteristics of a blockchain, a blockchain is usually composed of several blocks. The time stamps corresponding to the creation time of the block are recorded in the blocks respectively, and all the blocks form a time-ordered data chain according to the time stamps recorded in the blocks strictly.
The real data generated by the physical world can be constructed into a standard transaction (transaction) format supported by a block chain, then is issued to the block chain, is identified by node equipment in the block chain, and is packed into a block by the node equipment serving as an accounting node in the block chain after the identification is achieved, and is subjected to persistent evidence storage in the block chain.
In the field of blockchain, an important concept is Account (Account); taking an ether house as an example, the ether house generally divides an account into an external account and a contract account; the external account is an account directly controlled by the user; and the contract account is created by the user through an external account, the account containing the contract code (i.e. the smart contract).
Of course, for some blockchain items derived based on the ethernet framework, the account types supported by the blockchain may be further expanded, and are not particularly limited in this specification.
For accounts in a blockchain, the account status of the account is usually maintained through a structure. When a transaction in a block is executed, the status of the account associated with the transaction in the block chain is also typically changed.
Taking etherhouses as an example, the structure of an account usually includes fields such as Balance, Nonce, Code, and storage. Wherein:
a Balance field for maintaining the current account Balance of the account;
a Nonce field for the number of transactions for the account; the counter is used for guaranteeing that each transaction can be processed only once, and replay attack is effectively avoided.
A code field for maintaining a contract code for the account; in practical applications, only the hash value of the contract code is typically maintained in the code field; thus, the code field is also commonly referred to as a codehash field. For external accounts, this field is null.
storage field to maintain the storage of the account (default to empty). In practical application, the storage field only maintains the root node of an MPT (Merkle Patricia Trie) tree constructed based on the storage content of the account; thus, the storage field is also commonly referred to as the storageRoot field.
Wherein, for the external account, the code field and storage field shown above are null values.
Most blockchain items typically use Merkle trees; alternatively, the data is stored and maintained based on the data structure of the Merkle tree. Taking etherhouses as an example, the etherhouses use MPT tree (a Merkle tree variation) as a data organization form for organizing and managing important data such as account status, transaction information, and the like.
The Etherhouse designs three MPT trees, namely an MPT state tree, an MPT transaction tree and an MPT receipt tree, aiming at data needing to be stored and maintained in a block chain.
The MPT state tree is an MPT tree organized by account state data (state) of all accounts in the block chain; the MPT transaction tree is transaction data (transaction) in a block and is organized into the MPT tree; the MPT receipt tree is an MPT tree organized by transaction receipts (receipts) corresponding to each transaction generated after the transaction in the block is completed. The hash values of the root nodes of the MPT state tree, MPT transaction tree, and MPT receipt tree shown above are all added to the block header.
Wherein the MPT transaction tree and the MPT receipt tree correspond to tiles, each tile having its own MPT transaction tree and MPT receipt tree. The MPT state tree is a global MPT tree, which does not correspond to a specific tile, but covers account state data of all accounts in the tile chain.
For the MPT transaction tree, the MPT receipt tree and the MPT state tree which are organized, the MPT transaction tree, the MPT receipt tree and the MPT state tree are finally stored in a Key-Value type database (such as a levelDB) which adopts a multi-level data storage structure.
The database adopting a multi-level storage structure can be generally divided into n-level data storage; for example, each level of data storage may be set to L0, L1, L2, L3.. L (n-1) in sequence; for each level of data storage in the database, the smaller the level number is, the higher the level is generally; for example, L0 stores the latest data of several blocks, L1 stores the next latest data of several blocks, and so on.
In practical applications, as the block height increases, the data stored in the database may contain a lot of historical data; also, the longer the data in a block with a smaller block number is, the less important it is. Therefore, in order to reduce the overall storage cost, data of different block heights generally needs to be "treated differently";
for example, the data in the block with the smaller block number can be stored on a storage medium with lower cost; and storing the data in the block with larger block number on the storage medium with higher cost
The node on the MPT state tree is finally stored in a database in a Key-Value Key Value pair mode;
when a node on the MPT state tree is stored in a database, a key in a key value pair of the node on the MPT state tree is a hash value of data content contained in the node; value in the key Value pair of the node on the MPT state tree is the data content contained in the node.
That is, when a node in the MPT state tree is stored in the database, a hash Value of data content contained in the node may be calculated (that is, the whole node is subjected to hash calculation), the calculated hash Value is used as a Key, the data content contained in the node is used as a Value, and a Key-Value Key Value pair is generated; and then storing the generated Key-Value Key Value pair into a database.
Because the node in the MPT state tree takes the hash value of the data content contained in the node as Key and the data content contained in the node as value for storage; therefore, when a node on the MPT state tree needs to be queried, content addressing can be performed as a key based on the hash value of the data content contained in the node. By adopting the content addressing, for some nodes with repeated content, the node can be generally multiplexed to save the storage space of data storage.
The above is a description of the storage structure in the block chain, and the following is a description of the storage structure of the service data block chain in the present application.
The present specification discloses an evaluation data storage method based on a service data block chain, which is applied to an evaluation data storage system of a service data block chain, as shown in fig. 1, where the evaluation data storage system of the service data block chain includes a plurality of evaluation block chain nodes; the method includes S101-S102.
The user information, the user evaluation data and the integral data in the specification all include associated attributes and non-associated attributes, and the associated attributes mean that attribute values can be increased or decreased; the user information refers to description information of a user, and the user information comprises a user address; the point information is point information issued by the user, and is point information other than the original points on the block chain, and the point information includes the name and the total amount of the point.
In addition, the service data block chain in this specification refers to a block chain including a chain storage structure and a tree storage structure and used for storing service data.
In addition, in this specification, the processes of grouping the user evaluation operation data into blocks, completing the consensus verification, and the like are not described, and a common data uplink method may be adopted.
S101, an evaluation block chain node receives an evaluation client side and sends a user evaluation operation data uplink request.
In one example, the user rating operation data comprises one or more of a timestamp, an operation user address, an operated address, an operation type, a value of an operation, a point address, a user signature on the user rating operation data, and a hash value of the user rating operation data; the evaluation data operation type comprises operation on evaluation data and operation on integration by a user, and the operated address comprises an operation address on the evaluation data and an address of the user operating other evaluation data.
In this specification, the client may be a server or a user equipment. If the uplink request is the server, the server can directly receive the uplink request sent by the client and then forwards the uplink request to the evaluation block link node; or the server receives the operation of the user through a webpage mode and directly sends the uplink request to the evaluation block chain node.
S102, storing user evaluation data through a chain structure and a tree structure; the user evaluation data comprises user evaluation operation data and state data after the user evaluation operation, the chain structure is used for storing the user evaluation operation data, and the tree structure is used for storing the state data after the user evaluation operation; the tree structure comprises a state tree and a relation tree, the state tree is used for storing the overall state of user evaluation operation data, the overall state is the overall state after the user evaluation operation, and the relation tree is used for storing the incidence relation between the overall states after the user evaluation operation; the chain type structure is a chain type storage structure of blocks.
S103, sending the uplink response of the operation data of the user to the evaluation client.
In one example, the state tree stores user rating operation data global states including one or more of user information, rating data, and point data.
In one example, the incidence relation stored in the relation tree comprises the incidence relation between user evaluation operation data information and user information; wherein, one user evaluation operation data information corresponds to one or more user information.
The user evaluation operation data comprises an evaluation object, evaluation times and evaluation content; and the number of approval and disapproval for any of the contents of evaluation. For the same evaluation object, one or more users evaluate the evaluation object. The corresponding relation between the user evaluation operation data and the user can exist on a block chain, and the block chain cannot be tampered, has high reliability and is convenient to query; and the experience of the user using the block chain evaluation system is improved.
In one example, the relationship tree stores associations comprising associations of user information and point information; wherein one user information corresponds to one or more point information.
The integral can correspond to the authority of the user to the evaluation object A; that is, the evaluation object a, the user can perform the evaluation operation only if he/she owns the point. Thus, a user may have one or more points, which may be of the same or different types.
For example, for the evaluation object B, the evaluation authority is to have 2B-points, that is, the user can evaluate the evaluation object B only when having 2B-points; thereby avoiding the user from evaluating without limit. The relation exists on the block chain, cannot be tampered, and is convenient to query.
In one example, the incidence relation stored in the relation tree comprises the incidence relation of user evaluation operation data information and integral information; wherein, one user evaluation operation data information corresponds to one or more integral information.
In this case, the user evaluation operation data authority is expressed by an integral. That is, one type of point corresponds to a user's authority to evaluate the operation data. For example: the evaluation authority of the evaluation object C is 1 integral C, and the authority can be set by a user initiating the evaluation object C; for other users, the evaluation object C can be evaluated if the user has 1 point C.
In addition, the points are obtained by the user through the mortgage of the native points. The native score is the score required by using the blockchain system, and only the mortgage native score can enable a user to use the network and storage resources of the blockchain system; the native score can also avoid the problem that the user uses the network resources of the blockchain system without limit, which causes the waste of the blockchain system resources. In this case, the user shifts the point, which corresponds to the authority to shift the evaluation-related operation.
In one example, the tree structure employs a database supporting attribute query or a KV database, wherein the database supporting attribute query includes a relational database and an in-memory database.
The relational database can be a MySql database, and the memory database can be a MongoDB database; when the database supporting attribute query is adopted to store the user operation evaluation data, the user can conveniently query through the attribute fields, and the user query efficiency is improved.
When a KV database is adopted, for example, a Key-Value database is adopted, and the query needs to be carried out through an address; for example: inquiring user information according to a user address, inquiring user evaluation operation data according to the user evaluation operation address, and inquiring user point data according to the point address; the user information-integral information needs to be inquired according to a user address, the user evaluation operation data information-integral information needs to be inquired according to the user evaluation operation data address, and the user evaluation operation data information-user information needs to be inquired according to the user evaluation operation data address.
It should be noted that the address of the user information can be obtained by performing multiple hash operations according to the user public key; the user evaluation operation data address or the integral address can be obtained by taking the preset first few characters of the operation result after the integral operation is created or initiated by the user according to the user or the Hash operation is carried out on the user evaluation operation.
In one example, any one of the user information, the user rating operation data information, the point information, the user rating operation data information-user information, the user information-point information, and the user rating operation data information-point information is organized into an MPT state tree; the root of any one of the MPT state trees is stored in the block header (as shown in fig. 4), and the MPT state Tree is a merkel Tree Merkle variant of a Tree structure fused with a prefix Tree Trie, and the merkel Tree Merkle is a Merkle Patricia Tree state Tree.
In one example, leaf nodes in the relational tree store a tree root of a relational sub-tree, values of leaf nodes of the relational sub-tree store one or more of user information-score information, entity information-user information, and entity information-score information; or
And the value of the leaf node in the relational tree stores one or more of user information-integral information, entity information-user information and entity information-integral information in an array or hash table mode.
In one example, any one of the user information, the entity information, the point information, the user information-point information, the entity information-user information and the entity information-point information is stored in a database supporting attribute query in a form of a data table, so that a user can query according to an attribute field in the data table; one kind of information corresponds to one kind of data table, any line in any kind of data table corresponds to one piece of information, and one kind of information comprises a plurality of lines of information.
In fig. 4, Action represents user rating operation, Account represents user information, Asset represents points, Object represents user rating operation data, Object-Asset represents an association relationship between user rating operation data and user information, Account-Asset represents an association relationship between user information and point information, and Object-Asset represents an association relationship between user rating operation data and point information. Root denotes the tree Root. Briefly, a block includes a block header and a block body, and the root of the MPT state tree shown in fig. 4 is stored in the block header.
The method comprises the steps that user evaluation operation data are stored in a service data block chain, and the uplink of the user evaluation operation data is achieved; meanwhile, the business data block chain adopts a chain storage mode and a tree storage mode, so that the query of the operation data evaluated by the user is facilitated, and the query efficiency is improved.
The specification also discloses an evaluation data storage system based on the service data block chain, as shown in fig. 2. In practice, the number of blockchain nodes is not limited thereto. The evaluation data storage system of the service data block chain comprises a plurality of evaluation block chain nodes; the evaluation block link point comprises a receiving unit, a processing unit and a sending unit.
The receiving unit receives a user evaluation operation data uplink request sent by an evaluation client.
The processing unit stores user evaluation data through a chain structure and a tree structure; the user evaluation data comprises user evaluation operation data and state data after the user evaluation operation, the chain structure is used for storing the user evaluation operation data, and the tree structure is used for storing the state data after the user evaluation operation; the tree structure comprises a state tree and a relation tree, the state tree is used for storing the overall state of user evaluation operation data, the overall state is the overall state after the user evaluation operation, and the relation tree is used for storing the incidence relation between the overall states after the user evaluation operation; the chain type structure is a chain type storage structure of blocks.
And the sending unit is used for sending the uplink response of the operation data of the user to the evaluation client.
In one example, the user rating operation data comprises one or more of a timestamp, an operation user address, an operated address, an operation type, a value of an operation, a point address, a user signature on the user rating operation data, and a hash value of the user rating operation data; wherein,
the evaluation data operation type comprises operation on evaluation data and operation on integration by a user, and the operated address comprises an operation address on the evaluation data and an address of the user operating other evaluation data.
In one example, the state tree stores user rating operation data global states including one or more of user information, rating data, and point data.
In one example, the incidence relation stored in the relation tree comprises the incidence relation of user evaluation operation data and user information; wherein, one user evaluation operation data information corresponds to one or more user information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between the user information and the integral information; wherein, one user information corresponds to one or more integral information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between user evaluation operation data information and integral information; wherein, one user evaluation operation data information corresponds to one or more integral information.
In one example, the tree structure employs a database supporting attribute query or a KV database, wherein the database supporting attribute query includes a relational database and an in-memory database.
In one example, any one of the user information, the user rating operation data, the point information, the user rating operation data-user information, the user information-point information, and the user rating operation data-point information is organized into an MPT tree or a mercker tree; wherein,
the root of any Tree is stored in the block header, the MPT Tree is a Merck Tree variation of a Tree structure fused with a prefix Tree, and the Merck Tree is a Merkle Patricia Tree Tree.
The method comprises the steps that user evaluation operation data are stored in a service data block chain, and the uplink of the user evaluation operation data is achieved; meanwhile, the business data block chain adopts a chain storage mode and a tree storage mode, so that the query of the operation data evaluated by the user is facilitated, and the query efficiency is improved.
The same or similar parts in the above device embodiments and the above method embodiments can be referred to each other, and are not described herein again.
The present specification also discloses a computer readable storage medium storing computer instructions which, when executed by a processor, implement any one of the above-mentioned technical solutions.
The present specification also discloses an electronic device comprising a processor configured to perform any of the above-described technical solutions.
Meanwhile, the application also provides an embodiment of the entity device.
Fig. 3 shows a schematic diagram of a computer device, which may include: a processor 310, a memory 320, an input/output interface 330, a communication interface 340, and a bus 350. Wherein the processor 340, the memory 320, the input/output interface 330, and the communication interface 340 are communicatively coupled to each other within the device via a bus 350.
The processor 310 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 related programs to implement the technical solutions provided in the embodiments of the present specification.
The Memory 320 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 320 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 320 and called to be executed by the processor 310.
The input/output interface 330 is used for connecting an 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 340 is used for connecting a communication module (not shown in the figure) to implement communication interaction between the present device and other devices. 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).
Bus 350 includes a path that transfers information between the various components of the device, such as processor 310, memory 320, input/output interface 330, and communication interface 340.
It should be noted that although the above-mentioned device only shows the processor 310, the memory 320, the input/output interface 330, the communication interface 340 and the bus 350, 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. The method is applied to an evaluation data storage system of the service data block chain, and the evaluation data storage system of the service data block chain comprises a plurality of evaluation block chain nodes; the method comprises the following steps:
an evaluation block chain node receives an evaluation client side and sends a user evaluation operation data uplink request;
storing user evaluation data through a chain structure and a tree structure; the user evaluation data comprises user evaluation operation data and state data after the user evaluation operation, the chain structure is used for storing the user evaluation operation data, and the tree structure is used for storing the state data after the user evaluation operation; the tree structure comprises a state tree and a relation tree, the state tree is used for storing the overall state of user evaluation operation data, the overall state is the overall state after the user evaluation operation, and the relation tree is used for storing the incidence relation between the overall states after the user evaluation operation; the chain type structure is a chain type storage structure of a block;
and sending the operation data uplink response of the user to the evaluation client.
2. The rating data storage method according to claim 1, wherein the user rating operation data includes one or more of a time stamp, an operation user address, an operated address, an operation type, a value of an operation, a point address, a signature of the user on the user rating operation data, and a hash value of the user rating operation data; wherein,
the evaluation data operation type comprises operation on evaluation data and operation on integration by a user, and the operated address comprises an operation address on the evaluation data and an address of the user operating other evaluation data.
3. The ratings data storage method of claim 1, wherein the state tree stores user ratings operation data global state including one or more of user information, ratings data, and point data.
4. The evaluation data storage method according to claim 3, wherein the association stored in the relationship tree includes an association of user evaluation operation data and user information; wherein, one user evaluation operation data information corresponds to one or more user information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between the user information and the integral information; wherein, one user information corresponds to one or more integral information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between user evaluation operation data information and integral information; wherein, one user evaluation operation data information corresponds to one or more integral information.
5. The method for storing the evaluation data according to claim 1, wherein the tree structure adopts a database supporting attribute query or a KV database, wherein the database supporting attribute query includes a relational database and an in-memory database.
6. The rating data storing method according to claim 4, wherein any one of the user information, the user rating operation data, the point information, the user rating operation data-user information, the user information-point information, and the user rating operation data-point information is organized into an MPT tree or a mercker tree; wherein,
the root of any Tree is stored in the block header, the MPT Tree is a Merck Tree variation of a Tree structure fused with a prefix Tree, and the Merck Tree is a Merkle Patricia Tree Tree.
7. The evaluation data storage system based on the service data block chain is characterized by comprising a plurality of evaluation block chain nodes; the evaluation block link point comprises a receiving unit, a processing unit and a sending unit; wherein,
the receiving unit is used for receiving a user evaluation operation data uplink request sent by an evaluation client;
the processing unit stores user evaluation data through a chain structure and a tree structure; the user evaluation data comprises user evaluation operation data and state data after the user evaluation operation, the chain structure is used for storing the user evaluation operation data, and the tree structure is used for storing the state data after the user evaluation operation; the tree structure comprises a state tree and a relation tree, the state tree is used for storing the overall state of user evaluation operation data, the overall state is the overall state after the user evaluation operation, and the relation tree is used for storing the incidence relation between the overall states after the user evaluation operation; the chain type structure is a chain type storage structure of a block;
and the sending unit is used for sending the uplink response of the operation data of the user to the evaluation client.
8. The ratings data storage system of claim 7, wherein the user ratings operation data includes one or more of a timestamp, an operating user address, an operated address, an operation type, a value of an operation, a point address, a user signature of the user ratings operation data, and a hash value of the user ratings operation data; wherein,
the evaluation data operation type comprises operation on evaluation data and operation on integration by a user, and the operated address comprises an operation address on the evaluation data and an address of the user operating other evaluation data.
9. The ratings data storage system of claim 7, wherein the state tree stores user ratings operation data global state including one or more of user information, ratings data, and points data.
10. The ratings data storage system of claim 9, wherein the relationship tree stores associations including associations of user ratings operational data and user information; wherein, one user evaluation operation data information corresponds to one or more user information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between the user information and the integral information; wherein, one user information corresponds to one or more integral information; and/or
The incidence relation stored in the relation tree comprises the incidence relation between user evaluation operation data information and integral information; wherein, one user evaluation operation data information corresponds to one or more integral information.
CN202010271034.XA 2020-04-08 2020-04-08 Evaluation data storage method and system based on service data block chain Pending CN111737729A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010271034.XA CN111737729A (en) 2020-04-08 2020-04-08 Evaluation data storage method and system based on service data block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010271034.XA CN111737729A (en) 2020-04-08 2020-04-08 Evaluation data storage method and system based on service data block chain

Publications (1)

Publication Number Publication Date
CN111737729A true CN111737729A (en) 2020-10-02

Family

ID=72646932

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010271034.XA Pending CN111737729A (en) 2020-04-08 2020-04-08 Evaluation data storage method and system based on service data block chain

Country Status (1)

Country Link
CN (1) CN111737729A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117033334A (en) * 2023-10-08 2023-11-10 吉林省高速公路集团有限公司 Expressway toll lane log acquisition processing method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117033334A (en) * 2023-10-08 2023-11-10 吉林省高速公路集团有限公司 Expressway toll lane log acquisition processing method and system
CN117033334B (en) * 2023-10-08 2023-12-22 吉林省高速公路集团有限公司 Expressway toll lane log acquisition processing method and system

Similar Documents

Publication Publication Date Title
CN111488396B (en) Data synchronization method and device for service data block chain
CN111488614A (en) Digital identity storage method and device based on service data block chain
CN111488608A (en) Data verification method and device for service data block chain
CN111737726A (en) Relation data query method and device based on business data block chain
CN111488344A (en) User operation data uplink method and system based on service data block chain
CN111488356A (en) Data storage method and device for service data block chain
CN111488610A (en) State data query method and device based on service data block chain
CN111488349A (en) Data query method and device based on service data block chain
CN111488353A (en) Intelligent contract implementation method and device for business data block chain
CN111737729A (en) Evaluation data storage method and system based on service data block chain
CN111695132A (en) Voting data storage method and system based on service data block chain
CN111488611B (en) Relation data storage method and device of business data block chain
CN111737728A (en) Self-media data storage method and system based on service data block chain
CN111523137A (en) Data recommendation method and device based on service data block chain
CN111695139A (en) Knowledge question-answer data storage method and system based on service data block chain
CN111488613A (en) Data efficient query method and device for service data block chain
CN111488345A (en) Storage optimization method and device for service data block chain
CN111488343A (en) E-commerce data uplink method and device based on business data block chain
CN111695137A (en) Travel data storage method and system based on business data block chain
CN111488606B (en) Data sharing method and device based on service data block chain
CN111695141A (en) Social data storage method and system based on business data block chain
CN111695138A (en) Renting house data storage method and system based on service data block chain
CN111694838A (en) Network taxi appointment data storage method and system based on service data block chain
CN111737731A (en) Shared bicycle data storage method and system based on service data block chain
CN111695140A (en) Recruitment data storage method and system based on business data block chain

Legal Events

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

Application publication date: 20201002

WD01 Invention patent application deemed withdrawn after publication