CN109117501A - Science data modeling and storage method based on block chain - Google Patents

Science data modeling and storage method based on block chain Download PDF

Info

Publication number
CN109117501A
CN109117501A CN201810722515.0A CN201810722515A CN109117501A CN 109117501 A CN109117501 A CN 109117501A CN 201810722515 A CN201810722515 A CN 201810722515A CN 109117501 A CN109117501 A CN 109117501A
Authority
CN
China
Prior art keywords
data
block
coin
current
transaction
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
CN201810722515.0A
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.)
Beihang University
Original Assignee
Beihang University
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 Beihang University filed Critical Beihang University
Priority to CN201810722515.0A priority Critical patent/CN109117501A/en
Publication of CN109117501A publication Critical patent/CN109117501A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • 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

Abstract

The embodiment of the present invention discloses a kind of science data modeling and storage method based on block chain, is related to block chain technical field, convenient for providing safety guarantee for management of the science data in terms of true power.The science data modeling and storage method based on block chain, comprising: be based on target requirement, construct the entity of the science data modeling based on block chain;Wherein, the entity includes coin, transaction and block;According to the entity, the structure table of each entity is established;According to the structure table of each entity, the entire design of block chain is completed;Wherein, the Transaction Information of the block chain storage includes: coin input information, coin output information and Transaction Details information.The present invention is suitable for the management and use of science data.

Description

Science data modeling and storage method based on block chain
Technical field
The present invention relates to block chain technical field more particularly to a kind of science data modelings and storage side based on block chain Method.
Background technique
In recent years, due to the diversity of data source and the low cost of storage medium, more and more data are produced Existence is stored up and is accumulated.With data scale sharply increase and more attention of the people to data, big data rapidly develop simultaneously The hot spot paid close attention to as focus concerned by people and various circles of society.
How the data especially science data resource one of mostly important as current era uses reasonable data knot Structure storing data, while the management of ownership in data sharing is further improved, while deepening data Utilization ability to realize Data with safety guarantee are open, are a urgent problems to be solved.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of science data modeling and storage method based on block chain, it is convenient for Safety guarantee is provided for management of the science data in terms of true power.
A kind of science data modeling and storage method based on block chain, comprising:
Based on target requirement, the entity of the science data modeling based on block chain is constructed;Wherein, the entity includes money Coin, transaction and block;
According to the entity, the structure table of each entity is established;
According to the structure table of each entity, the entire design of block chain is completed;Wherein, the Transaction Information of the block chain storage It include: coin input information, coin output information and Transaction Details information.
A kind of specific implementation according to an embodiment of the present invention, it is described according to the entity, establish the structure of each entity Table, comprising:
According to coin entity, coin structure table is established;
According to transaction entity, structure of deal table is established;
According to block entity, block structure table is established.
A kind of specific implementation according to an embodiment of the present invention, the structure table according to each entity complete block chain Entire design, comprising:
According to coin structure table, structure of deal table and block structure table, according to from the inside to the outside, design side from small to large Method completes the entire design of block chain.
The field name of a kind of specific implementation according to an embodiment of the present invention, the coin structure table includes: coin Save location, this value is unique;The quantity of coin under current location;The owner id of current coin, this value are unique;
The field name of the structure of deal table includes: all coin inputs, this coin is used for buying data, and These coins are not yet spent;The output of all coins, this coin be the income side to trade and coin beyond transaction value into Row is replaced;The time that current transaction generates, using Unix timing;The movement of this transaction is currently generated, wherein behavior act includes: Purchase data, downloading data upload data, audit data, login system, Modify password, give password for change;Data seller, and This value is unique;Data purchaser, and this value is unique;Currently trade the data id being related to, and this value is unique;The valence currently traded Lattice;The auditor id of current data;
The field name of the block structure table includes: the height of block, this value is incremented by as block generates;Work as proparea The time that block generates, using the Unix time;The hash value of a upper block is constructed and is verified for next block;Block is all Transaction;The proof of work value generated by distributed common recognition mechanism.
A kind of specific implementation according to an embodiment of the present invention, the method, further includes:
In the database by the data storage in Partial Block chain, and multiple indexes are established on the database.
A kind of specific implementation according to an embodiment of the present invention, the database include: block table, tables of data, transaction Table, income accounting table and coin table;Wherein,
The field of the block table of the database includes: the unique identification of block, this value is uniquely used for distinguishing different areas Block;The height of block, another layer of meaning, that is, chronological order of elevation information, the birth of block were incremented by strict accordance with the time It generates;The time that current block generates;The size of current block, default units are bytes;The number of deals for including in current block Amount can be used this field and carry out ascending or descending order arrangement operation to block;Current block hash value, for carrying out block hash inspection Rope;
The field of the tables of data of the database includes: data unique identification id, this value is unique;Data owner id;Number According to title, user is facilitated to browse purchase data;Data introduction facilitates user to check data specifying information;When current data uploads Between, using the Unix time;Data source;Data type;Data label;Data current review state;The md5 value of current data, For carrying out data uniqueness verifying;The current size of data, default units KB;Data number of downloads, after data upload successfully Default value is 0;Data purchase volume, data purchase can once download repeatedly;Data price;Data storage location;Data grading, point For 1-5 grade, higher grade illustrates that the quality of data is better;Participate in the evaluation number of this data;
The field of the tran list of the database includes: transaction unique identification id;Data purchaser id;Data seller id;The data id currently to participate in business;The time currently traded;The price currently traded;Current transaction grading;Current data Last download time, avoid frequent downloads;
The field name of the income accounting table of the database includes: data unique identification id;The use of current data income Name in an account book;The income accounting of current beneficiary is realized for automating distribution of income;
The field name of the coin table of the database includes: coin unique identification id;The owner of current coin;Currently Whether coin has spent, and Timing Synchronization block chain data avoid malfunctioning;The generation time of coin;Coin under current location Quantity.
A kind of specific implementation according to an embodiment of the present invention, the method, further includes: based on the block chain and The Database really weighs system based on the science data of block chain.
A kind of science data modeling and storage method based on block chain provided in an embodiment of the present invention, in the block of foundation In chain, the Transaction Information of storage includes: coin input information, coin output information and Transaction Details information, to original area Data structure on block chain is extended and improves, and can store more generally data model, thus can be by block chain Decentralization technology, convenient for providing safety guarantee for management of the science data in terms of true power.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the embodiment of the present invention based on the science data modeling of block chain and the flow diagram of storage method;
Fig. 2 is the block chain overall structure diagram established according to one embodiment of the invention;
Fig. 3 is really to weigh system construction drawing according to the science data based on block chain that one embodiment of the invention is established;
Fig. 4 is to be shown according to the functional structure that the science data based on block chain that one embodiment of the invention is established really weighs system It is intended to.
Specific embodiment
The embodiment of the present invention is described in detail with reference to the accompanying drawing.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all its Its embodiment, shall fall within the protection scope of the present invention.
Fig. 1 is the embodiment of the present invention based on the science data modeling of block chain and the flow diagram of storage method, such as Fig. 1 Shown, the method for the present embodiment, may include step:
S101, it is based on target requirement, constructs the entity of the science data modeling based on block chain;Wherein, the entity packet Include coin, transaction and block.
The Transaction Information stored in current block chain technology only includes " transaction initiator ", " transaction acceptance side " and " is handed over Three attributes of the easy amount of money ".And the various data of science data institute subordinate are then many kinds of, attribute is different, existing block The data structure that chain uses can not directly store these data.The application is based on analyzing existing block chain technology, and particular for Science data establishes unified mathematical model according to data type, data source, size of data etc., enables model well Data storage efficiency, the fault-tolerance etc. of description block chain technology.
S102, according to the entity, establish the structure table of each entity.
S103, the structure table according to each entity complete the entire design of block chain;Wherein, the friendship of the block chain storage Easy information includes: coin input information, coin output information and Transaction Details information.
It only include " transaction initiator ", " transaction acceptance side " relative to the Transaction Information stored in existing block chain technology For " transaction amount " three attributes, the embodiment of the present invention, in the block chain of foundation, the Transaction Information of storage includes: Coin inputs information, coin output information and Transaction Details information, to the data structure on original block chain be extended with It improves, more generally data model can be stored, it thus can be by the decentralization technology of block chain, convenient for being scientific and technological number Safety guarantee is provided according to the management in terms of true power.
In an embodiment of the present invention, described according to the entity, establish the structure table (S102) of each entity, comprising:
S1021, according to coin entity, establish coin structure table.
In the present embodiment, the field name of the coin structure table can include: the save location of coin, this value are unique;When The quantity of coin under front position;The owner id of current coin, this value are unique.
Specifically, the coin structure table in the present embodiment can be as shown in table 1.
Table 1: coin structure table
Field name Type Field is described in detail
coin_uuid VARchar(64) Save the address of coin
number_coin Float The quantity of coin
owner VARchar(64) Save the coin owner
Field coin_uuid stores the save location of coin, this value is unique;
Field number_coin stores the quantity of the coin under current location;
Field owner stores the owner id of current coin, this value is unique.
S1022, according to transaction entity, establish structure of deal table.
In the present embodiment, the field name of the structure of deal table can include: all coin inputs, this coin is for purchasing Data use is bought, and these coins are not yet spent;The output of all coins, this coin be the income side of transaction and beyond trading The coin of price is replaced;The time that current transaction generates, using Unix timing;The movement of this transaction is currently generated, wherein Behavior act includes: purchase data, downloading data, uploads data, audit data, login system, Modify password, gives password for change; Data seller, and this value is unique;Data purchaser, and this value is unique;Currently trade the data id being related to, and this value is only One;The price currently traded;The auditor id of current data.
Specifically, the structure of deal table in the present embodiment can be as shown in table 2.
Table 2: structure of deal table
Field in_coins saves all coin inputs, this coin is for buying data use, and these coins are not yet It is spent, coin structure is shown in Table shown in 1 coin structure table.
Field out-coins saves the output of all coins, this coin be the income side to trade and beyond transaction value Coin is replaced, and structure is as shown in 1 coin structure table of table.
Field timestamp saves the time that current transaction generates, using Unix timing.
Field action saves the movement for currently generating this transaction, and wherein behavior act includes: purchase data, downloading number According to, upload data, audit data, login system, Modify password, give password for change.
Field seller saves data seller, and this value is unique.
Field buyer saves data purchaser, and this value is unique.
Field data_uuid saves the data id being related to that currently trades, and this value is unique.
Field credit saves the price currently traded.
The auditor id of field reviewer preservation current data.
S1023, according to block entity, establish block structure table.
In the present embodiment, the field name of the block structure table can include: the height of block, this value are generated with block And it is incremented by;The time that current block generates, using the Unix time;The hash value of a upper block, for next block construction with Verifying;All transaction of block;The proof of work value generated by distributed common recognition mechanism.
Specifically, in the present embodiment, block structure table can be as shown in table 3.
Table 3: block structure table
The height of field index memory block, this value are incremented by as block generates.
Field timestamp stores the time that current block generates, and equally uses the Unix time.
Field prev-hash stores the hash value an of block, constructs and verifies for next block.
All transaction of field transactions memory block, wherein structure of deal is shown in Table shown in 2 structure of deal tables.
The proof of work value that field nonce storage is generated by distributed common recognition mechanism.
In an embodiment of the present invention, the structure table according to each entity completes the entire design (S103) of block chain, It include: according to coin structure table, structure of deal table and block structure table, according to from the inside to the outside, design method from small to large is complete At the entire design of block chain.Fig. 2 is the block chain overall structure diagram established according to one embodiment of the invention.
Building data directory is to speed up Various types of data query processing speed, improves the important method of system performance.In data In terms of storage and management, it there are no the mature application based on block chain technology and occur, establish the index technology on block chain It does not know where to begin even more.On the one hand the reason of leading to this situation is not have the mature data management system based on block chain technology System occurs, on the other hand also due to the time series data that block chain is stored has essence different from traditional relational database structure, Index technology is also difficult to migrate.For this defect, the embodiment of the present invention according to the characteristics of science data with used bottom Block chain data structure supports it effectively with science data on block chain by constructing multiple indexes on the database All kinds of inquiries of core.That is, the embodiment of the present invention passes through the basis category that will establish the science data on block chain Property be combined with database index, improve block chain on science data recall precision.Specifically, in one embodiment of the invention In, the method may also include that
In the database by the data storage in Partial Block chain, and multiple indexes are established on the database, built with utilizing Multiple indexes on the database are found to accelerate the inquiry velocity and recall precision of Various types of data information.
Further, in the embodiment of the present invention, by establishing multiple relationships such as tables of data, tran list, Yong Hubiao, check list Type tables of data, and index is established on it, and then improves and improve the recall precision of data.Wherein main index includes: to build Found the major key index on multiple tables;Settling time stamp index column establishes joint index column.
The present embodiment is using storing Partial Block information into database, by constructing a variety of indexes on this database Structure further increases the index to block.Meanwhile the data to ensure to store in database and the data phase one in block chain It causes, the present embodiment realizes the function of periodically synchronizing block chain data and database data, reduces because of database number Data retrieval problem caused by being tampered according to loss or data.
By means of establishing a variety of indexes on the database, project is realized according to block hash value and the inspection of block height The function of rope block realizes searching for generally and realizing according to timestamp, data according to data name, data introduction etc. The ranking function of a variety of sort fields such as name, size of data.
In an embodiment of the present invention, the database include: block table, tables of data, tran list, income accounting table and Coin table.
Wherein, the field of the block table of the database includes: the unique identification of block, this value is uniquely used for distinguishing different Block;The height of block, another layer of meaning, that is, chronological order of elevation information, the birth of block is in strict accordance with the time It is incremented by and generates;The time that current block generates;The size of current block, default units are bytes;The friendship for including in current block Easy quantity can be used this field and carry out ascending or descending order arrangement operation to block;Current block hash value, for carrying out block Hash retrieval.
Specifically, in the present embodiment, the block table details of database are as shown in table 4.
Table 4: block table structure
Title Type Constraint condition Explanation
id INT Major key, non-empty From increasing id
height VARchar(64) It is non-empty, unique Block height
timestamp VARchar(32) Non-empty Block generation time
block_size FLOAT Non-empty Block size
tx_number INT Non-empty The number of transaction that block is included
block_hash VARchar(64) Non-empty Block hash value
Field id indicates that the unique identification of block, this value are uniquely used for distinguishing different blocks.
Field height is used to identify the height of block, another layer of meaning, that is, chronological order of elevation information, block Birth be in strict accordance with the time be incremented by generate.
Field timestamp stores the time that current block generates.
Field block_size stores the size of current block, and default units are byte (Bit).
The number of transaction for including in field tx-number storage current block, can be used this field and carries out ascending order to block Or descending arrangement operation.
Field block-size stores current block hash value, for carrying out block hash retrieval.
The field of the tables of data of the database includes: data unique identification id, this value is unique;Data owner id;Number According to title, user is facilitated to browse purchase data;Data introduction facilitates user to check data specifying information;When current data uploads Between, using the Unix time;Data source;Data type;Data label;Data current review state;The md5 value of current data, For carrying out data uniqueness verifying;The current size of data, default units KB;Data number of downloads, after data upload successfully Default value is 0;Data purchase volume, data purchase can once download repeatedly;Data price;Data storage location;Data grading, point For 1-5 grade, higher grade illustrates that the quality of data is better;Participate in the evaluation number of this data.
Specifically, in the present embodiment, the tables of data details of database are as shown in table 5.
Table 5:data table structure
Field data_id saves data unique identification id, this value is unique.
Field user_id saves data owner id.
Field data_name saves data name, and user is facilitated to browse purchase data.
Field data_info saves data introduction, and user is facilitated to check data specifying information.
Field timestamp saves current data uplink time, using the Unix time.
Field data_source saves data source, such as Tsing-Hua University, Beijing University, Beijing Institute of Aeronautics etc..
Field data-type saves data type, such as pdf, ppt, xls, mp3 etc..
Field data_tag saves data label, such as traffic, medical treatment, education etc..
Field data_status saves data current review state, is divided into audit, audit passes through, audits and do not pass through.
Field data_md5 saves the md5 value of current data, for carrying out data uniqueness verifying.
Field data_size saves the current size of data, default units KB.
Field data_download saves data number of downloads, and default value is 0 after data upload successfully.
Field data_purchase saves data purchase volume, and data purchase can once download repeatedly.
Field data_price saves data price.
Field data_address saves data storage location.
Field data_score saves data grading, is divided into 1-5 grade, higher grade illustrates that the quality of data is better.
Field comment_number saves the evaluation number for participating in this data.
The field of the tran list of the database includes: transaction unique identification id;Data purchaser id;Data seller id;The data id currently to participate in business;The time currently traded;The price currently traded;Current transaction grading;Current data Last download time, avoid frequent downloads.
Specifically, as shown in table 6 according to the tran list details in library in the present embodiment.
Table 6: transaction table structure
Title Type Constraint condition Explanation
transaction_id VARchar(64) Major key, non-empty Transaction unique identification
buver_id VARchar(64) Non-empty Data purchaser's unique identification
seller_id VARchar(64) Non-empty Data seller's unique identification
data_id VARchar(64) Non-empty Data unique identification
timestamp VARchar(32) Non-empty Transaction generation time
pr1ce FLOAT Non-empty Purchasing price
data-score INT Non-empty Transaction grading
last_download_time VARchar(32) Non-empty The last downloading data time
Field transaction_id saves transaction unique identification id.
Field buyer_id saves data purchaser id.
Field seller_id saves data seller id.
Field data_id saves the data id currently to participate in business.
Field timestamp saves the time currently traded.
Field price saves the price currently traded.
Field data-score saves current transaction grading.
Field last-download-time saves the last download time of current data, avoids frequent downloads.
The field name of the income accounting table of the database includes: data unique identification id;The use of current data income Name in an account book;The income accounting of current beneficiary is realized for automating distribution of income.
Specifically, in the present embodiment, the income accounting table details of database are as shown in table 7.
Table 7: income accounting table structure
Title Type Constraint condition Explanation
data-id VARchar(64) Major key, non-empty Data unique identification
user-name VARchar(20) It is major key, unique User login name
ratio FLOAT Non-empty The income accounting of data
Field data_id saves data unique identification id.
The user name of field user_name preservation current data income.
Field ratio saves the income accounting of current beneficiary, realizes for automating distribution of income.
The field name of the coin table of the database includes: coin unique identification id;The owner of current coin;Currently Whether coin has spent, and Timing Synchronization block chain data avoid malfunctioning;The generation time of coin;Coin under current location Quantity.
Specifically, in the present embodiment, the coin table details of database are as shown in table 8.
Table 8: coin table structure
Title Type Constraint condition Explanation
coin_id VARchar(64) Major key, non-empty Coin address unique identification
owner_id VARchar(64) Non-empty Coin owner's unique identification
is_spent BOOLEAN Non-empty Whether coin spends
timestamp VARchar(32) Non-empty Coin generation time
coin_credit FLOAT Non-empty Coin quantity
Field coin_id saves coin unique identification id.
Field owner_id saves the owner of current coin.
Field is_spent saves whether current coin has spent, and Timing Synchronization block chain data avoid malfunctioning.
The generation time of field timestamp preservation coin.
Field coin_credit saves the coin quantity under current location.
In an embodiment of the present invention, the method, further includes: be based on the block chain and the Database base System is really weighed in the science data of block chain.
On the basis of existing method for secret protection, in the embodiment of the present invention, for the privacy for ensuring data, need by Data carry out conversion map operation, and using secure hash algorithm, SHA256 algorithm specifically can be used.Secure hash algorithm is resonable By the information of endless above may be implemented to the mapping of fixed-length string.
It furthermore is the safety for ensuring transaction data, the present embodiment is calculated using rivest, shamir, adelman-elliptic curve cryptography Method carries out cryptographic operation to transaction, avoids the malicious modification of data in stealing.
To ensure the legitimacy of block data and the benign development of distributed block environment, need using distributed common recognition Mechanism.This project is by analyzing the actual environment disposed with investigating system and future usage situation, using Proof of Work mechanism.
In addition to ensure the ownership of data and the right to use of data, the data in block will save time or less user's row Are as follows: user buy data (buy), user's downloading data (download), administrator audit data by (review_pass), Audit data do not pass through (review_reject), login system (login), upload data (upload), give password for change (reset_pwd), Modify password (modify_pwd).Action field in block will be used to distinguish above-mentioned different behavior, The information such as the time for carrying out aforesaid operations, the user id for carrying out aforesaid operations behavior will be saved in block.
For the uniqueness for guaranteeing data, when user carries out data upload operation, system will carry out the verifying of md5 value.When And if only if this data can be just included in database by system when the data in the md5 and database of data are inconsistent, and same When this md5 value is recorded into database.Once there is the case where Data duplication upload, system automatic will send that platform is short to disappear Breath, informs when data owner (users of first upload data) is being produced upload in violation of rules and regulations by whom in which data Operation.In addition, system will also notify current data uploader, inform that the data that it is uploaded conflict with data generation in system.
For the legitimacy for further ensureing data, the audit state for the data default that user is uploaded is in audit, when and Only after platform administrator audit is by this data, data just can carry out transaction sharing by platform.Skill for the convenience of the user According to audit state, system will send auditing result automatically and inform user.
When using Pow mechanism, system needs the transaction to user to generate processing in time and response.For the friendship of anti-locking system Yi Chi occurs being detained or overflow problem, needs to reduce the whole network for the degree-of-difficulty factor of PoW mechanism, to reduce to electric power resource Using and meet transaction is timely responded to.The shared of file is carried out using Pow algorithm and by common recognition network, is furthermore used With most long-chain for main chain, most long-chain common recognition algorithm is realized.Since the data in MySQL database may be modified artificially, then lead to It crosses timing to be updated block chain with system data, the consistency of data is safeguarded by this Data renewal mechanism.It is such more New operation will read the address coin all in block chain, and its result be synchronized inserted or updated to database.It is fixed using this When simultaneous techniques on the one hand can give data in database for change by block chain, on the other hand correctly search block information for user Efficient retrieval is provided to ensure.
By means of can not the distorting of block chain, decentralization, open and clear feature, by by data operating record to block In chain, and by means of weighing mechanism designed by platform really, the time backtracking to any data operation behavior, Jin Erbao are realized Hinder the legal right to use of data of the ownership and data purchaser of data owner.
Fig. 3 is really to weigh system construction drawing according to the science data based on block chain that one embodiment of the invention is established, referring to Fig. 3, data storage layer include system key data information, and basic data layer includes customer transaction relevant information, and logical layer includes The function of system is realized.
Data storage layer, basic data layer and logical layer are described in detail respectively below.
(1) data storage layer
Data storage layer includes block chain information and MySQL database, and wherein block chain information is as open account book note The information such as all Transaction Informations, record user login operation, record manager audit in recording system.It can by the displosure account book To ensure the right of data owner, according to time sequencing trace back data uploader and uplink time.Furthermore it can record management The operation of member's audit data, so that data audit movement is traceable, and can verify whether certain data has out by block chain It sells condition or verifies whether certain data is reviewed.
MySQL database storage system account information (user name, mailbox, mobile phone, address etc.), data details (number According to size, data uplink time, data price, data grading etc.), notification information (access time, the information content, information Sender, receiver) etc..
The big composition of the two of data storage layer: it is synchronous to guarantee data that block chain can carry out periodic data with MySQL database Consistency.Synchronous information is mainly the address coin traded, coin quantity, the coin owner, coin quantity at present.It uses Coin data in block chain are as the data source that can not be distorted, according to this data source to the coin information in MySQL database It is updated operation.
(2) basic data layer
Basic data layer includes current system configuration information, trading pit, block caching, userspersonal information, browser Session data (identity information etc. of active user).Wherein configuration information includes and installs matching for the reward mechanism of current system Set, the resetting cryptographic chaining expired time of current system configuration, system paging situation configuration etc..Trading pit in the present embodiment will For saving transaction not yet packed in current system, need further to be verified.Block caching indicates the present embodiment block chain The next block but this block that network generates not yet are written into block chain.
(3) logical layer
Logical layer includes personal information maintenance, data audit, data upload, income is distributed automatically, transaction encryption processing, order Single evaluation, information notice, data search, user's registration, personal income details etc..
The systematic functional structrue of the present embodiment mainly includes three functional modules: user management module, data management module, Trade management module.Systematic functional structrue figure is as shown in Figure 4.In addition to above-mentioned several functional modules, needing in addition to write cooperation should The digging mine algorithm of system and the algorithm of block chain and database Timing Synchronization.
User management module, data management module, trade management module are illustrated respectively below.
(1) family management module
User management module specifically includes that user's registration, unified portal login, password is given for change, password is modified, individual subscriber Information modification.
(1) user's registration.It needs to input login name, mailbox, password when visitor registers.Wherein system can verify registration Whether name repeats with the user name in database and provides necessary information alert.
(2) unified portal login.System provides unified entrance for ordinary user and administrator, and system is automatic by user name It identifies current registrant's identity, and jumps to the different pages.
(3) password is given for change.System mailbox is opened into SMTP service first, it is that user sends mail that this function, which can be used,. Wherein Mail Contents mainly include password resetting link and link expired time.When password is given in user's application for change, system is should User generates specific resetting cryptographic chaining, and saves to database and save the time that the lower link generates simultaneously.The password weight It sets link to be tied to present application and give for change on the user of password, mail will be sent in mailbox reserved when the user's registration.For Guarantee user password safety, the chance which has and only once reset, and expired time is set as 30 minutes.
(4) password is modified.User inputs current password, and inputs achievable Modify password operation after new password twice.Together When send password modification inform user.
(5) userspersonal information modifies.Personal information can be improved after logging in system by user, this information is carried out as administrator One of the index of user data audit, it is ensured that the reliability and safety of data source.
(2) data management module
The major function of data management module has: data information is perfect, data search, data income is arranged, data score Maintenance, data audit.
(1) data information is perfect.When user uploads data, data name, data introduction need to be filled in as requested and selects number According to source, data tag, data price etc..
(2) data search.User can pass through the fields logarithms such as data name, data introduction, data tag in the Data Market page According to scanning for.System will carry out fuzzy matching by obtaining the key word of the inquiry of user in the database, and return to all The data information matched.
(3) data income is arranged.When user uploads data, it may be added to that more 5 other beneficiaries, and income is set and is accounted for Than.Simultaneity factor informs the avail data name and income accounting of every beneficiary by details are sent.
(4) data scoring maintenance.After user successfully buys data, data scoring operation can be carried out thus.At present from as low as High score is 1 to 5 five grade, and the default level after data upload is 0.The scoring of every user will all be saved to historical trading table In, while data level and data evaluation person in more new data table.This function user guarantee transaction the quality of data and Reference information as other users purchase.
(5) data are audited, this function is only open to administrator.After administrator's login system, data review operations can be carried out. The search of data is supported in the data audit page and is sorted according to data uplink time, size of data, data grading etc., it is convenient The review operations of administrator.The auditing result of administrator will be updated to database while generate msu message and save to block chain, Furthermore auditing result will send information automatically and inform data uploader.
(3) trade management module
The major function of trade management module has: trading into chain, block caching, income is distributed automatically, Transaction Information is checked.
(1) transaction such as chain.The present embodiment is packaged generated transaction using PoW mechanism.Transaction Information will save Into system trading pit, new block will be generated after a certain period of time by transaction and is packaged the new block of generation.It will be tested when being packaged processing Demonstrate,prove the structural validation of each transaction, and the encryption to transaction data.
(2) block caches.System will carry out caching process for current block, and current digging mine algorithm is by periodic verification The legitimacy of block chain simultaneously carries out legitimate verification for the All Activity in each block.Verifying content includes: to work as proparea The prev_hash value of block is equal to the hash value of a upper block, and the nonce value of current block meets the degree-of-difficulty factor of current network It is required that.
(3) income is distributed automatically.System will acquire the avail information in income accounting table, when other users buy this data When, income, which is carried out, according to the setting of user automatically distributes automatically.Distribution of income will generate a transaction, but include different coin Flow direction.Transaction Information is packaged into block into trading pit waiting according to after structure progress data filling before.
(4) Transaction Information is checked.User can check current all incomes, the data including income, data income size, Income time etc..User can be ranked up operation according to avail data, income time etc., and sorting operation will be completed by rear end.
(5) transaction verification.According to system requirements, Transaction Information is by behavior act current under preservation.To ensure letter of trading The legitimacy of automatic verifying trading activity will not be packaged behaviour for illegal trading activity by the reasonability of breath, system Make.The present embodiment uses ProofoF Work mechanism carries out packing verification operation to transaction, using Pow algorithm and passes through common recognition Network carries out the shared of file, furthermore uses with most long-chain as main chain, realizes most long-chain common recognition algorithm.
The embodiment of the present invention, using block chain technology, this really weighs the fair disclosure that system realizes data trade, ensures transaction Responsibility and right it is legal accurate, safeguard going on smoothly for data trade.Using the method for distributed open account book, own in guarantee system Transaction it is legal and transparent, realize the decentralization that data are really weighed.Compared with conventional trading systems, which is greatly reduced To the dependency degree of central node, the transaction data of user can be carried out safely and efficiently.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by those familiar with the art, all answers It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.

Claims (7)

1. a kind of science data modeling and storage method based on block chain characterized by comprising
Based on target requirement, the entity of the science data modeling based on block chain is constructed;Wherein, the entity includes coin, hands over Easy and block;
According to the entity, the structure table of each entity is established;
According to the structure table of each entity, the entire design of block chain is completed;Wherein, the Transaction Information packet of the block chain storage Include: coin inputs information, coin output information and Transaction Details information.
2. the method according to claim 1, wherein described establish the structure table of each entity according to the entity, Include:
According to coin entity, coin structure table is established;
According to transaction entity, structure of deal table is established;
According to block entity, block structure table is established.
3. according to the method described in claim 2, it is characterized in that, the structure table according to each entity, completes block chain Entire design, comprising:
According to coin structure table, structure of deal table and block structure table, according to from the inside to the outside, design method from small to large is complete At the entire design of block chain.
4. according to the method described in claim 2, it is characterized in that,
The field name of the coin structure table includes: the save location of coin, this value is unique;The number of coin under current location Amount;The owner id of current coin, this value are unique;
The field name of the structure of deal table includes: all coin inputs, this coin is for buying data use, and these Coin is not yet spent;All coin outputs, this coin are that the income side of transaction and the coin beyond transaction value are moved back It changes;The time that current transaction generates, using Unix timing;The movement of this transaction is currently generated, wherein behavior act includes: purchase Data, downloading data upload data, audit data, login system, Modify password, give password for change;Data seller, and this value Uniquely;Data purchaser, and this value is unique;Currently trade the data id being related to, and this value is unique;The price currently traded; The auditor id of current data;
The field name of the block structure table includes: the height of block, this value is incremented by as block generates;Current block produces The raw time, using the Unix time;The hash value of a upper block is constructed and is verified for next block;All friendships of block Easily;The proof of work value generated by distributed common recognition mechanism.
5. the method according to claim 1, wherein further include:
In the database by the data storage in Partial Block chain, and multiple indexes are established on the database.
6. according to the method described in claim 5, it is characterized in that, the database include: block table, tables of data, tran list, Income accounting table and coin table;Wherein,
The field of the block table of the database includes: the unique identification of block, this value is uniquely used for distinguishing different blocks;Area The height of block, another layer of meaning, that is, chronological order of elevation information, the birth of block are to be incremented by generate in strict accordance with the time; The time that current block generates;The size of current block, default units are bytes;The number of transaction for including in current block, can Ascending or descending order arrangement operation is carried out to block using this field;Current block hash value, for carrying out block hash retrieval;
The field of the tables of data of the database includes: data unique identification id, this value is unique;Data owner id;Data name Claim, user is facilitated to browse purchase data;Data introduction facilitates user to check data specifying information;Current data uplink time, is adopted With the Unix time;Data source;Data type;Data label;Data current review state;The md5 value of current data, for into The verifying of row data uniqueness;The current size of data, default units KB;Data number of downloads, default value after data upload successfully It is 0;Data purchase volume, data purchase can once download repeatedly;Data price;Data storage location;Data grading, is divided into 1-5 Grade, higher grade illustrates that the quality of data is better;Participate in the evaluation number of this data;
The field of the tran list of the database includes: transaction unique identification id;Data purchaser id;Data seller id;When Before the data id that participates in business;The time currently traded;The price currently traded;Current transaction grading;Current data it is upper Download time, avoid frequent downloads;
The field name of the income accounting table of the database includes: data unique identification id;The user name of current data income; The income accounting of current beneficiary is realized for automating distribution of income;
The field name of the coin table of the database includes: coin unique identification id;The owner of current coin;Current coin Whether spend, Timing Synchronization block chain data avoid malfunctioning;The generation time of coin;Coin quantity under current location.
7. according to the method described in claim 5, it is characterized by further comprising: being built based on the block chain and the database The science data of block chain of being based on really weighs system.
CN201810722515.0A 2018-07-03 2018-07-03 Science data modeling and storage method based on block chain Pending CN109117501A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810722515.0A CN109117501A (en) 2018-07-03 2018-07-03 Science data modeling and storage method based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810722515.0A CN109117501A (en) 2018-07-03 2018-07-03 Science data modeling and storage method based on block chain

Publications (1)

Publication Number Publication Date
CN109117501A true CN109117501A (en) 2019-01-01

Family

ID=64822501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810722515.0A Pending CN109117501A (en) 2018-07-03 2018-07-03 Science data modeling and storage method based on block chain

Country Status (1)

Country Link
CN (1) CN109117501A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109785135A (en) * 2019-01-23 2019-05-21 珠海横琴跨境说网络科技有限公司 A kind of method of commerce based on block chain technology, system and storage medium
CN109857811A (en) * 2019-02-15 2019-06-07 上海优扬新媒信息技术有限公司 A kind of block chain data managing method and device
CN110109874A (en) * 2019-05-13 2019-08-09 北京共识数信科技有限公司 A kind of non-stop layer distributed document retrieval method based on block chain
CN111147575A (en) * 2019-12-25 2020-05-12 山东公链信息科技有限公司 Data storage system based on block chain

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004355198A (en) * 2003-05-28 2004-12-16 Hitachi Information Systems Ltd Configuration table automatic generation method, configuration table automatic generation system, and supply chain management method and management system applied with the configuration table automatic creation method
CN107332847A (en) * 2017-07-05 2017-11-07 武汉凤链科技有限公司 A kind of access control method and system based on block chain
WO2017218984A1 (en) * 2016-06-16 2017-12-21 The Bank Of New York Mellon Ensuring data integrity of executed transactions
CN108052321A (en) * 2017-12-28 2018-05-18 杭州趣链科技有限公司 A kind of method that block chain intelligence contract is automatically generated based on configuration information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004355198A (en) * 2003-05-28 2004-12-16 Hitachi Information Systems Ltd Configuration table automatic generation method, configuration table automatic generation system, and supply chain management method and management system applied with the configuration table automatic creation method
WO2017218984A1 (en) * 2016-06-16 2017-12-21 The Bank Of New York Mellon Ensuring data integrity of executed transactions
CN107332847A (en) * 2017-07-05 2017-11-07 武汉凤链科技有限公司 A kind of access control method and system based on block chain
CN108052321A (en) * 2017-12-28 2018-05-18 杭州趣链科技有限公司 A kind of method that block chain intelligence contract is automatically generated based on configuration information

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
连玉明: "《大数据》", 28 February 2017, 团结出版社 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109785135A (en) * 2019-01-23 2019-05-21 珠海横琴跨境说网络科技有限公司 A kind of method of commerce based on block chain technology, system and storage medium
CN109857811A (en) * 2019-02-15 2019-06-07 上海优扬新媒信息技术有限公司 A kind of block chain data managing method and device
CN109857811B (en) * 2019-02-15 2022-08-26 度小满科技(北京)有限公司 Block chain data management method and device
CN110109874A (en) * 2019-05-13 2019-08-09 北京共识数信科技有限公司 A kind of non-stop layer distributed document retrieval method based on block chain
CN111147575A (en) * 2019-12-25 2020-05-12 山东公链信息科技有限公司 Data storage system based on block chain

Similar Documents

Publication Publication Date Title
CN109120590A (en) The credible shared transaction system of data based on block chain
CN109447648A (en) The method of recorded data zone block, accounting nodes and medium in block chain network
CN109117501A (en) Science data modeling and storage method based on block chain
CN109327512A (en) Game data subregion storage method based on block chain hash addressing and re-encryption
CN109690539A (en) Self-cleaning token pool
CN111861677A (en) Intelligent purchase, sale, storage and express delivery method based on e-commerce platform
CN109472646A (en) A kind of financial product recommended method and device
CN109359973A (en) Data based on block chain deposit card method and apparatus
JP2020507158A (en) Computer-implemented systems and methods for generating and extracting user-related data stored on a blockchain
CN109584035A (en) The overdue method of disposal of micro-credit and system
CN109472678A (en) A kind of accounting account book management method, electronic device and readable storage medium storing program for executing based on block chain
CN104376452B (en) System and method based on international card payment channel managing payment success rate
CN106570741A (en) Application of automatic matching method in network spot transaction platform
CN111488616A (en) Method and device for realizing preplan machine of service data block chain
WO2020118859A1 (en) Decentralized chip research and development transaction data storage method and system
Dzobo et al. Proposed framework for blockchain technology in a decentralised energy network
Lytvyn et al. Development of the system to integrate and generate content considering the cryptocurrent needs of users
CN110197426A (en) A kind of method for building up of credit scoring model, device and readable storage medium storing program for executing
CN109697626A (en) Marketing system, method, electric terminal and medium based on JeeSite quick development platform
CN111415067A (en) Enterprise and personal credit rating system
CN110060163A (en) Method of commerce, system, medium and the device of podcast chain based on ether mill
CN114399389A (en) Block chain-based power generation data management method and smart grid system
CN107403107A (en) A kind of data safety control method and system based on multipoint cooperative mechanism
Belov et al. Blockchain technology to manage the energy supply of real estate
CN111488343A (en) E-commerce data uplink method and device based on business data block chain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190101

RJ01 Rejection of invention patent application after publication