CN112100279B - Data sharing system based on block chain - Google Patents
Data sharing system based on block chain Download PDFInfo
- Publication number
- CN112100279B CN112100279B CN202011185969.2A CN202011185969A CN112100279B CN 112100279 B CN112100279 B CN 112100279B CN 202011185969 A CN202011185969 A CN 202011185969A CN 112100279 B CN112100279 B CN 112100279B
- Authority
- CN
- China
- Prior art keywords
- node
- data
- content
- event
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
Abstract
The invention relates to a data sharing system based on a block chain, which comprises the block chain, a processor and a memory which is stored with a computer program, wherein the block chain comprisesA data storage unit,Is shown asA data storage unit for storingThe information of the event is transmitted to the user,which represents the type id of the event,the composition isTherein is stored withData sheet, firstThe fields of the data table include a node id, a content id, content data, and a content status value. The invention improves the efficiency and accuracy of data sharing.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a data sharing system based on a block chain.
Background
Data sharing is generally realized by cooperation of a plurality of servers, and the existing data sharing system is generally a centralized processing mode. For example, the server of the first layer sends the original data to the server of the second layer, the server of the second layer integrates the received data and sends the integrated data to the server of the third layer, and the server of the third layer sends the integrated data to the server of the fourth layer until the data finally reaches the central server, so that the information routing transmission distance is long, the transmission layers are multiple, the data transmission efficiency is low, the real-time performance of data sharing is poor, the efficiency is low, and when the server of the middle layer integrates the data, a data error may occur, which results in low accuracy of the data finally reaching the central server, thereby causing low accuracy of data sharing. Therefore, how to improve the efficiency and accuracy of data sharing becomes an urgent technical problem to be solved.
Disclosure of Invention
The invention aims to provide a data sharing system based on a block chain, which improves the efficiency and accuracy of data sharing.
The invention provides a data sharing system based on a block chain, which is characterized by comprising the block chain, a processor and a memory which stores a computer program, wherein the block chain comprisesA data storage unit,Is shown asA plurality of data storage units for storing data,therein is stored withData table, saidThe data table is used for storingThe event information corresponding to the type of the event,which represents the type id of the event,the first mentionedFields of the data table comprise a node id, a content id, content data and a content state value, wherein the content state value is used for representing the credibility of the content data;
when executed by a processor, the computer program implementing the steps of:
step S1, receiving event information to be stored sent by a first node;
step S2, analyzing a first event type id, a first node id, a first content id and a first content from the event information to be storedData, the first event type id is,If the event type corresponding to the event information to be stored is the secondType of event, firstEvent information corresponding to the event type is stored inTo (1)In the data table, go through the firstData table, judge the secondWhether the event information corresponding to the first content id is stored in the data table or not, if so, executing the step S3, otherwise, executing the step S5;
step S3, go through the second stepJudging whether content data identical to the first content data exists in all content data corresponding to the stored first content id in the data table, if so, executing step S4, and if not, executing step S5;
step S4, adding a first preset step value to the content status value corresponding to the content data identical to the first content data, and ending the process;
step S5, converting the first eventCorrespondingly storing the type id, the first node id, the first content id and the first content data to the first nodeIn the data sheet.
Compared with the prior art, the invention has obvious advantages and beneficial effects. By means of the technical scheme, the data sharing system based on the block chain can achieve considerable technical progress and practicability, has industrial wide utilization value, and at least has the following advantages:
the invention carries out data sharing based on the block chain, improves the real-time performance and the efficiency of multi-node data sharing, and improves the success rate of data conflict solution. The system can record the original data sent by all the nodes, each node can also acquire the corresponding original data, the accuracy of the data is improved, and in addition, all the data can be traced.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Drawings
Fig. 1 is a schematic flow chart of data storage performed by the data sharing system according to the embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention for achieving the predetermined objects, the following detailed description will be given with reference to the accompanying drawings and preferred embodiments of a block chain-based data sharing system according to the present invention.
The embodiment of the invention provides a data sharing system based on a block chain, which is characterized by comprising the block chain, a processor and a computer program stored in the processorThe block chain comprisesA data storage unit,Is shown asA plurality of data storage units for storing data,therein is stored withData table, saidThe data table is used for storingThe event information corresponding to the type of the event,which represents the type id of the event,the first mentionedThe fields of the data table include a node id, a content id, content data, and a content status value, which is used to indicate the trustworthiness of the content data, as will be appreciatedThe fields of the data table may also include information such as the storage time of the content data,can be expanded according to specific application requirementsThe field contents of the data table.
When executed by a processor, the computer program performs the following steps, as shown in fig. 1:
step S1, receiving event information to be stored sent by a first node;
step S2, a first event type id, a first node id, a first content id and first content data are analyzed from the event information to be stored, wherein the first event type id is,If the event type corresponding to the event information to be stored is the secondType of event, firstEvent information corresponding to the event type is stored inTo (1)In the data table, go through the firstData table, judge the secondWhether the event information corresponding to the first content id is stored in the data table or not, if so, executing the step S3, otherwise, executing the step S5;
step S3, passCalendar saidJudging whether content data identical to the first content data exists in all content data corresponding to the stored first content id in the data table, if so, executing step S4, and if not, executing step S5;
step S4, adding a first preset step value to the content status value corresponding to the content data identical to the first content data, and ending the process;
it is understood that the reliability of the content data is positively correlated with the magnitude of the content status value.
Step S5, correspondingly storing the first event type id, the first node id, the first content id and the first content data to the first eventIn the data sheet.
It is understood that the second step is performed by performing the steps S1-S5The data tables are dynamically changing. The system of the embodiment of the invention carries out data sharing based on the block chain, improves the real-time performance and the efficiency of multi-node data sharing, ensures that the data is not lost based on the synchronous storage of the blocks and the nodes, and improves the reliability of the data. And the data information of the event is judged and stored, and a corresponding content state value is set for each content data based on multi-node data cooperation, so that the problem of data conflict is successfully solved.
It should be noted that the node described in the embodiment of the present invention may be physically implemented as one server, or may be implemented as a server group including a plurality of servers, and those skilled in the art know that parameters such as the model and the specification of a server do not affect the protection scope of the present invention.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments of the invention are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. A process may be terminated when its operations are completed, but may have additional steps not included in the figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
In order to further improve the security of the data, the authority of each node can be set through the intelligent contract, so that each node accesses or stores the data according to the authorization information preset in the intelligent contract. As an embodiment, the system further includes a preset intelligent contract, where authorization information of the block chain for each node id is stored in the intelligent contract, the authorization information includes event type ids that the nodes can interact with each other and corresponding interaction permissions, and the interaction permissions include query permissions and storage permissions. If the node id has the storage authority, the step of linking the information to be stored can be executed through the steps S1 to S5, and if the node id does not have the storage authority, the step of linking the information to be stored cannot be stored, specifically, the step S2 further includes querying the intelligent contract according to the first event type id and the first node id, determining whether the first node id has the storage authority of the first event type id, if so, continuing the process, and if not, ending the process.
As an embodiment, the computer program, when executed by a processor, further performs the following data query steps:
step S10, receiving a data query request sent by a second node;
step S20, a second node id, a second event type id and a second content id are analyzed from the data query request;
step S30, inquiring the intelligent contract according to the second node id and the second event type id, judging whether the second node id has the inquiry authority of the second event type id, and if yes, executing step S40;
step S40, when the second event type id is a, traversing the a-th data table, obtaining content data and content state values corresponding to all the second content ids, and sending the content data and content state values to the second node.
It is understood that the second node may not only obtain the content data and the content status value, but when the second node needs to obtain information of a publisher, a publishing time, and the like of the content data at the same time, the node id and the storage time information corresponding to the data content may be obtained at the same time in step S40, and the specifically obtained field information may be adjusted according to application requirements. The system can record the original data sent by all the nodes, each node can also acquire the corresponding original data, the accuracy of the data is improved, and in addition, all the data in the system can be traced.
The content data and the content state value corresponding to the second content id may be obtained through step S40, the second node may select data according to the size of the content state value, but there may be a case where the size of the state value is the same, at this time, another parameter is needed to measure the reliability of different data corresponding to the same state value, as an embodiment, the node state value may be specifically set according to the condition of the uploaded data of the node-to-block chain, specifically including the quantity and quality of the uploaded data, so as to measure the reliability of the node, and the reliability of the node and the reliability of the content data corresponding to the node are positively correlated. Specifically, the block chain further includes a state configuration table, a field of the state configuration table includes a node id and a node state value, an initial value of the node state value is 0, the node state value is updated in real time according to event information sent and stored by a node, and the node state value is positively correlated with the reliability of data issued by the node. When executed by a processor, further performs the steps of:
step S100, when it is detected that the xth node stores the content data once on the block chain, judging whether the stored content data has uniqueness on the block chain, if so, adding a second step value to a node state value corresponding to the xth node, otherwise, adding a third step value, wherein the second step value is larger than the third step value;
step S200, when detecting that a content state value corresponding to content data corresponding to an x-th node id is added with a first preset step value, adding a first step value to a node state value corresponding to the x-th node, wherein the first step value is smaller than a second step value;
step S300, when the number of times of the event information to be stored sent by the x-th node id which is not received within the preset time period is detected to be less than the preset number threshold, subtracting a fourth step value from the node state value corresponding to the x-th node;
and S400, when the fact that the event type id sent by the x-th node id does not have uniqueness is detected, subtracting a fifth step value from the node state value corresponding to the x-th node, wherein the fifth step value is smaller than the fourth step value.
By updating the node state value corresponding to each node id in the state configuration table in real time, the credibility of each current node can be obtained in real time, so that the nodes are helped to select data with high accuracy, the nodes can be urged to actively contribute own data, error data can be corrected in time, the accuracy of uploaded data is guaranteed, and the overall accuracy of the system is improved.
As an embodiment, the step S40 further includes:
step S401, obtaining a node id list corresponding to all content data corresponding to the second content id;
step S402, obtaining a node state value corresponding to each node id in the id node list from the state configuration table, and sending the node list node id in the id node list and the corresponding node state value to the second node.
As an embodiment, the intelligent contract further includes a preset display event type id corresponding to the node id, and a preset display field, and the system further includes an information interaction interface for displaying, to the node, content of the preset display field corresponding to the preset display event type id corresponding to the node id. Based on the accounting characteristics of the block chain, all data of the system can be traced, and when the fact that the data of the system is inconsistent with the reality is found, the system can quickly locate the source and the adoption process of the problem data, correct the mechanism reliability in time and optimize the adoption algorithm due to the fact that the data of the block chain can not be tampered and the distributed storage capacity.
As an embodiment, the system may be used for sharing flight data, and the corresponding nodes may be servers corresponding to airports, air enterprises, air traffic control, and each security department and joint inspection unit, so that communication and trust costs between mechanisms are reduced, and efficiency and accuracy of data sharing between mechanisms are improved.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (8)
1. A data sharing system based on a block chain is characterized by comprising the block chain, a processor and a memory which stores a computer program, wherein the block chain comprisesA data storage unit, Is shown asA plurality of data storage units for storing data,therein is stored withData table, saidThe data table is used for storingThe event information corresponding to the type of the event,which represents the type id of the event,the first mentionedFields of the data table comprise a node id, a content id, content data and a content state value, wherein the content state value is used for representing the credibility of the content data; when executed by a processor, the computer program implementing the steps of:
step S1, receiving event information to be stored sent by a first node;
step S2, a first event type id, a first node id, a first content id and first content data are analyzed from the event information to be stored, wherein the first event type id is, If the event type corresponding to the event information to be stored is the secondType of event, firstEvent information corresponding to the event type is stored inTo (1)In the data table, go through the firstData table, judge the secondWhether the event information corresponding to the first content id is stored in the data table or not, if so, executing the step S3, otherwise, executing the step S5;
step S3, go through the second stepJudging whether content data identical to the first content data exists in all content data corresponding to the stored first content id in the data table, if so, executing step S4, and if not, executing step S5;
step S4, adding a first preset step value to the content status value corresponding to the content data identical to the first content data, and ending the process;
2. The system of claim 1,
the system further comprises a preset intelligent contract, wherein authorization information of the block chain to each node id is stored in the intelligent contract, the authorization information comprises event type ids which can be interacted by the nodes and corresponding interaction authority, and the interaction authority comprises query authority and storage authority.
3. The system of claim 2,
the step S2 further includes querying the intelligent contract according to the first event type id and the first node id, determining whether the first node id has the storage authority of the first event type id, if yes, continuing the process, and if not, ending the process.
4. The system of claim 2,
when executed by a processor, further performs the steps of:
step S10, receiving a data query request sent by a second node;
step S20, a second node id, a second event type id and a second content id are analyzed from the data query request;
step S30, inquiring the intelligent contract according to the second node id and the second event type id, judging whether the second node id has the inquiry authority of the second event type id, and if yes, executing step S40;
step S40, when the second event type id is a, traversing the a-th data table, obtaining content data and content state values corresponding to all the second content ids, and sending the content data and content state values to the second node.
5. The system of claim 4,
the block chain comprises a state configuration table, a field of the state configuration table comprises a node id and a node state value, an initial value of the node state value is 0, the node state value is updated in real time according to event information sent and stored by a node, and the node state value is positively correlated with the reliability of data sent by the node.
6. The system of claim 5,
when executed by a processor, further performs the steps of:
step S100, when it is detected that the xth node stores the content data once on the block chain, judging whether the stored content data has uniqueness on the block chain, if so, adding a second step value to a node state value corresponding to the xth node, otherwise, adding a third step value, wherein the second step value is larger than the third step value;
step S200, when detecting that a content state value corresponding to content data corresponding to an x-th node id is added with a first preset step value, adding a first step value to a node state value corresponding to the x-th node, wherein the first step value is smaller than a second step value;
and step S300, when the number of times of the event information to be stored sent by the x-th node id which is not received in the preset time period is detected to be less than the preset number threshold, subtracting a fourth step value from the node state value corresponding to the x-th node.
7. The system of claim 5,
the step S40 further includes:
step S401, obtaining a node id list corresponding to all content data corresponding to the second content id;
step S402, obtaining the node state value corresponding to each node id in the node id list from the state configuration table, and sending the node id in the node id list and the corresponding node state value to the second node.
8. The system according to any one of claims 2-7,
the intelligent contract further comprises a preset display event type id corresponding to the node id and a preset display field, and the system further comprises an information interaction interface used for displaying the content of the preset display field corresponding to the preset display event type id corresponding to the node id to the node.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011185969.2A CN112100279B (en) | 2020-10-30 | 2020-10-30 | Data sharing system based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011185969.2A CN112100279B (en) | 2020-10-30 | 2020-10-30 | Data sharing system based on block chain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112100279A CN112100279A (en) | 2020-12-18 |
CN112100279B true CN112100279B (en) | 2021-06-29 |
Family
ID=73785869
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011185969.2A Active CN112100279B (en) | 2020-10-30 | 2020-10-30 | Data sharing system based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112100279B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112905554A (en) * | 2021-02-07 | 2021-06-04 | 全链通有限公司 | Data sharing method and device based on block chain |
CN112632096B (en) * | 2021-03-09 | 2021-05-18 | 中航信移动科技有限公司 | Stroke list data processing system based on block chain |
CN114357534B (en) * | 2022-03-18 | 2022-06-03 | 中科互联科技(广州)有限公司 | Classroom training platform construction method, device, equipment and medium based on block chain |
CN115118474A (en) * | 2022-06-20 | 2022-09-27 | 广东省工业边缘智能创新中心有限公司 | Identification query and storage management method, identification agent module and authority management system |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107291862A (en) * | 2017-06-12 | 2017-10-24 | 腾讯科技(深圳)有限公司 | Business datum storage method, device, storage medium and electronic equipment |
CN108520307A (en) * | 2018-03-31 | 2018-09-11 | 深圳慧通商务有限公司 | Data processing method and relevant apparatus |
CN108848080A (en) * | 2018-06-01 | 2018-11-20 | 深圳崀途科技有限公司 | Data-sharing systems based on the storage verification of alliance's chain |
CN109086325A (en) * | 2018-06-29 | 2018-12-25 | 阿里巴巴集团控股有限公司 | Data processing method and device based on block chain |
CN110175847A (en) * | 2019-05-31 | 2019-08-27 | 联想(北京)有限公司 | Exchange management method, trade managing system and computer system |
CN110209671A (en) * | 2019-05-17 | 2019-09-06 | 无锡朝阳供应链科技股份有限公司 | A kind of the access system and its application of distribution account book data |
CN110555783A (en) * | 2019-07-18 | 2019-12-10 | 中国南方电网有限责任公司 | block chain-based power marketing data protection method and system |
CN111460031A (en) * | 2020-03-23 | 2020-07-28 | 腾讯科技(深圳)有限公司 | Data synchronization method, device, equipment and medium |
CN111723355A (en) * | 2019-03-22 | 2020-09-29 | 国际商业机器公司 | Information management in a database |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11243945B2 (en) * | 2017-12-11 | 2022-02-08 | International Business Machines Corporation | Distributed database having blockchain attributes |
-
2020
- 2020-10-30 CN CN202011185969.2A patent/CN112100279B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107291862A (en) * | 2017-06-12 | 2017-10-24 | 腾讯科技(深圳)有限公司 | Business datum storage method, device, storage medium and electronic equipment |
CN108520307A (en) * | 2018-03-31 | 2018-09-11 | 深圳慧通商务有限公司 | Data processing method and relevant apparatus |
CN108848080A (en) * | 2018-06-01 | 2018-11-20 | 深圳崀途科技有限公司 | Data-sharing systems based on the storage verification of alliance's chain |
CN109086325A (en) * | 2018-06-29 | 2018-12-25 | 阿里巴巴集团控股有限公司 | Data processing method and device based on block chain |
CN111723355A (en) * | 2019-03-22 | 2020-09-29 | 国际商业机器公司 | Information management in a database |
CN110209671A (en) * | 2019-05-17 | 2019-09-06 | 无锡朝阳供应链科技股份有限公司 | A kind of the access system and its application of distribution account book data |
CN110175847A (en) * | 2019-05-31 | 2019-08-27 | 联想(北京)有限公司 | Exchange management method, trade managing system and computer system |
CN110555783A (en) * | 2019-07-18 | 2019-12-10 | 中国南方电网有限责任公司 | block chain-based power marketing data protection method and system |
CN111460031A (en) * | 2020-03-23 | 2020-07-28 | 腾讯科技(深圳)有限公司 | Data synchronization method, device, equipment and medium |
Also Published As
Publication number | Publication date |
---|---|
CN112100279A (en) | 2020-12-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112100279B (en) | Data sharing system based on block chain | |
US10740355B2 (en) | System and method for optimizing data migration in a partitioned database | |
US9542404B2 (en) | Subpartitioning of a namespace region | |
US9053167B1 (en) | Storage device selection for database partition replicas | |
US20160085829A1 (en) | Query method for a distributed database system and query apparatus | |
US9483482B2 (en) | Partitioning file system namespace | |
US8544094B2 (en) | Suspicious node detection and recovery in MapReduce computing | |
US8402119B2 (en) | Real-load tuning of database applications | |
JP5245711B2 (en) | Distributed data processing system, distributed data processing method, and distributed data processing program | |
EP3218805B1 (en) | Method and system for model-driven, affinity-based, network functions | |
US11496562B1 (en) | Method and system for accessing digital object in human-cyber-physical environment | |
CN113315811A (en) | Identifier analysis method and device based on alliance block chain, storage medium and server | |
CN112583716A (en) | Path selection method and device based on data transmission of Internet of things | |
US9667499B2 (en) | Sparsification of pairwise cost information | |
US20230107925A1 (en) | Modeling individual interfaces for executing interface queries over multiple interfaces | |
US11366598B1 (en) | Dynamic lease assignments in a time-series database | |
Nasir et al. | Partial key grouping: Load-balanced partitioning of distributed streams | |
CN115114289A (en) | Data query method and device and electronic equipment | |
Cha et al. | Design and Implementation of a Real-time Monitoring Tool for Data Distribution Service | |
US11500837B1 (en) | Automating optimizations for items in a hierarchical data store | |
US10120897B2 (en) | Interception of database queries for delegation to an in memory data grid | |
CN115454354B (en) | Data processing method, system, electronic device and storage medium | |
US11782901B2 (en) | Method and system for performing computations in a distributed system | |
CN111163088B (en) | Message processing method, system and device and electronic equipment | |
CN111030856B (en) | Cloud-based data access method, electronic device and computer readable medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |