CN108197498A - Obtain the method and device of data - Google Patents
Obtain the method and device of data Download PDFInfo
- Publication number
- CN108197498A CN108197498A CN201711404888.5A CN201711404888A CN108197498A CN 108197498 A CN108197498 A CN 108197498A CN 201711404888 A CN201711404888 A CN 201711404888A CN 108197498 A CN108197498 A CN 108197498A
- Authority
- CN
- China
- Prior art keywords
- node
- block data
- data
- trusted
- credit rating
- 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
Links
Classifications
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/062—Securing storage systems
- G06F3/0623—Securing storage systems in relation to content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/20—Network architectures or network communication protocols for network security for managing network security; network security policies in general
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Abstract
The present invention provides a kind of method and device for obtaining data.Method includes:The acquisition request that first node is sent is received, wherein, it obtains request and includes target block mark;At least two trusted nodes are determined according to the credit rating of each node;It is obtained and the corresponding block data of target block mark from each trusted node;The each block data obtained is compared, and target block data are determined according to comparison result, target block data are sent to first node.The method and device provided by the invention for obtaining data, by determining trusted node, then therefrom obtain block data and be compared, so that it is determined that going out target block data, it can make the user do not need to traverse all nodes progress comparings, can also achieve the effect that obtain correct data.
Description
Technical field
The present invention relates to block chain technology more particularly to a kind of method and devices for obtaining data, belong to database field.
Background technology
In block chain network, there are multiple nodes, each node is stored with identical block chain data, each block
Chain data include multiple blocks being connected sequentially in time, and each block can preserve a data information.
User can obtain the data information in block chain from any of which node, also, when obtaining information, time
Other all nodes are gone through, whether data information and the information preserved in other nodes for comparing acquisition are identical, if other nodes
The information of interior preservation is identical with the information obtained, then it is assumed that the data information of acquisition is correct.Employ above-mentioned mechanism so that
Data in only most of node are changed, when can make user's modified data of acquisition, it is believed that it is correct.Cause
This, even if occurring the situation that respective nodes are changed in block chain technology, replaces with after also detecting identification automatically by system
Correct data, this allows for the storage system based on block chain technology with higher safety.
Inventor has found, in the storage system based on block chain technology, in order to ensure that the block chain data obtained are accurate
, user is needed to traverse all nodes in block chain network when obtaining block chain data, and then determine the accuracy of data,
This results in expending the too many time when obtaining data, moreover, when the data of acquisition are larger, traversing all nodes can cause to count
The serious waste of calculation machine resource, still, if not traversing all nodes, and it is the number after being tampered that can have the data obtained
According to, cause obtain data it is inaccurate the problem of.Therefore, the method based on block chain technical limit spacing data exists in the prior art
The problem of consuming excess resource.
Invention content
The present invention provides a kind of method and device for obtaining data, by determining trusted node, then therefrom obtain block counts
According to and be compared, determine target block data, user can be avoided to obtain the data that are tampered and as correct data
It uses, carries out comparing so as to make the user do not need to traverse all nodes, can also achieve the effect that obtain correct data.
The first aspect of the invention is to provide a kind of method for obtaining data, including:
The acquisition request that first node is sent is received, wherein, described obtain asks to include target block mark;
At least two trusted nodes are determined according to the credit rating of each node;
It is obtained and the corresponding block data of target block mark from each trusted node;
The each block data obtained is compared, and target block data are determined according to comparison result, by the mesh
Mark block data is sent to the first node.
Another aspect of the present invention is to provide a kind of device for obtaining data, including:
Receiving module, for receiving the acquisition request of first node transmission, wherein, described obtain asks to include target block
Mark;
Determining module, for determining at least two trusted nodes according to the credit rating of each node;
Acquisition module, for being obtained and the corresponding block counts of target block mark from each trusted node
According to;
Comparing module for comparing each block data obtained, and determines target block according to comparison result
The target block data are sent to the first node by data.
The method and device provided by the invention for obtaining data has the technical effect that:
The method and device provided in this embodiment for obtaining data, the acquisition request sent including receiving first node,
In, it obtains request and includes target block mark;At least two trusted nodes are determined according to the credit rating of each node;From each
It is obtained and the corresponding block data of target block mark in trusted node;The each block data obtained is compared, and according to comparison
As a result target block data are determined, target block data are sent to first node.Acquisition data provided in this embodiment
Method and device determines the higher trusted node of credit rating, then obtained from trusted node according to the credit rating of each node
Data needed for user, since the data stored in the high node of credit rating are more accurate, mode in this way can
Get more accurate block data.Further, method and device provided in this embodiment is also from least two trusted nodes
Middle acquisition block data, and each block data of acquisition is compared, it is determined to be sent to first node according to comparison result
Target block data, so as to further ensure target block data accuracy.Therefore, method provided in this embodiment
And device provides a user accurate block data in the case where traversing all nodes without user terminal.
Description of the drawings
Fig. 1 is the flow chart of the method for the acquisition data shown in an exemplary embodiment of the invention;
Fig. 2 is the flow chart of the method for the acquisition data shown in another exemplary embodiment of the present invention;
Fig. 3 is the structure chart of the device of the acquisition data shown in an exemplary embodiment of the invention;
Fig. 4 is the structure chart of the device of the acquisition data shown in another exemplary embodiment of the present invention.
Specific embodiment
Fig. 1 is the flow chart of the method for the acquisition data shown in an exemplary embodiment of the invention.
As shown in Figure 1, the method provided in this embodiment for obtaining data includes:
Step 101, the acquisition request that first node is sent is received, wherein, it obtains request and includes target block mark.
Wherein, node refers to each node in block chain network, and each node can mutually be interconnected by block chain network
It connects.Block chain technology (BT, Blockchain technology), also referred to as distributed account book technology, is a kind of interconnection netting index
According to library technology, its main feature is that it is decentralization, open and clear, each node is allowed to each may participate in data-base recording.Have in block chain more
A node, each node can be a data storage server, and each node is able to record identical data information.Number
It is believed that breath is stored in each node in the form of block, also, sequentially in time by data block with sequentially connected side
A kind of linked data structure that formula is combined into, and what is ensured in a manner of cryptography can not distort and can not forge.Each block
With block-identified, corresponding block data can be determined by block-identified.It for example, can be according to block data
Generated time determines that its is block-identified.
Specifically, after each node generates new block data, other nodes can be sent it to, so as to make
The block data for having node memory storage is identical.
Further, user terminal can be connect with first node, can be accessed thereby using family by first node whole
A block chain network.For example, can connect user terminal with first node, allow user by user terminal to first segment
Point, which is sent, obtains request, and acquisition request includes block-identified, is capable of determining that user's needs obtain according to block-identified
Block data.Furthermore it is also possible to install client in user terminal, which is able to access that first node.In order to reduce
A part of user terminal can be connect, other users terminal and block by the processing pressure of individual node with a first node
Other first nodes connection in chain network, wherein, can be that wired connection can also be between user terminal and first node
Wireless connection.
During practical application, node server can also be set, which connect with each node, for performing sheet
The method for the acquisition data that embodiment provides.
After first node receives the acquisition request of user terminal transmission, it can will obtain request and be sent to node server
In, target block data are determined by node server, all nodes are traversed without user terminal, determine target area block number
According to.Wherein, it can also be wireless connection that each node and node server, which can be wired connections,.
Step 102, at least two trusted nodes are determined according to the credit rating of each node.
Node server can store the credit rating of coupled each node, further according to credit rating in multiple nodes
Determine at least two trusted nodes.For example, the credit rating of each node can be ranked up, then choose the high section of credit rating
Point, as trusted node.It can also determine that multiple credit ratings are higher than the node of credit threshold in multiple nodes,
Therefrom select several trusted nodes at random again.
Specific trusted node number can be set according to demand, can also be determined according to the credit rating of each node.If
The high node of credit rating is less, then can be using the high node of all credit ratings all as trusted node.If for example, each node
Credit rating is all relatively low, only 2 be higher than credit threshold nodes, then at this time can using the high node of the two credit ratings as
Trusted node.But it at least should determine that out two trusted nodes.
Wherein, the credit rating of each node can be that pre-set or server is right according to certain rule
Obtained from preset credit rating is adjusted.For example, can the credit rating of each node be set as identical value in advance, save
Point server obtained from one of node with the corresponding block data of target block mark, and send it to first segment
Point, then send it to user terminal for users to use by first node, user can be by first nodes to node serve
Device feeds back whether the data can be used, if unavailable, node server can reduce the credit rating for the node for obtaining block data.
Specifically, node server can determine trusted node after the acquisition request of first node transmission is received.
It can not also be asked to be limited by obtaining for first node transmission is connected to, update trusted node at any time, request is obtained when receiving
Afterwards, the trusted node having determined that is directly acquired.Therefore, can first step 101, step 102, Huo Zhetong can also be first carried out
Shi Zhihang steps 101 and step 102.
Step 103, it is obtained and the corresponding block data of target block mark from each trusted node.
After node server determines at least two trusted nodes, wrapped in the acquisition request being sent to according to first node
The target block mark included, obtains and the corresponding block data of target block mark in each trusted node.Wherein, block
Each node in chain network is likely to be confirmed as trusted node, including the first node being connect with user terminal.
Specifically, being stored with a large amount of data information in the form of block in each node, can be wrapped in each block
Block-identified and block data is included, same block mark can be determined according to target block mark in each node
Know, then with obtaining the block-identified corresponding block data, that is, user needs the data obtained.It can be by node according to mesh
The block data that block-identified acquisition is stored in the node is marked, then sends it to node server or node clothes
Business device identifies inquiry and the corresponding block data of mark in the node according to target block.
Step 104, each block data of acquisition is compared, and target block data are determined according to comparison result, by mesh
Mark block data is sent to first node.
Further, node server compare obtain multiple block datas, can compare each block data whether phase
Together, it is if identical, then it is assumed that the identical block data is accurate, otherwise it is assumed that some data in multiple block datas
It is maliciously tampered.
During practical application, if each block data is all identical, it is determined as target block data, and send it to
First node, so that user can get target block data by first node.If each block data obtained is endless
It is exactly the same, then trusted node can be determined in each node again, then therefrom obtain block data and be compared, until obtaining
Until each block data taken is all identical.If the data stored in some nodes are maliciously tampered, by determining trusted node,
Block data is obtained from multiple trusted nodes again, user can be avoided to obtain the data being tampered and is made as correct data
With carrying out comparings so as to make the user do not need to traverse all nodes, can also achieve the effect that obtain correct data.
Determining target block data are sent to first node again, allow the user to obtain accordingly by first node
Target block data.For example, can target block data or user actively be sent to user terminal from first node
Terminal reads the target block data in first node.
The method provided in this embodiment for obtaining data, the acquisition request sent including receiving first node, wherein, it obtains
Request includes target block mark;At least two trusted nodes are determined according to the credit rating of each node;From each credible section
It is obtained and the corresponding block data of target block mark in point;The each block data obtained is compared, and true according to comparison result
Target block data are made, target block data are sent to first node.The method provided in this embodiment for obtaining data, root
The higher trusted node of credit rating is determined according to the credit rating of each node, then the number needed for user is obtained from trusted node
According to since the data stored in the high node of credit rating are more accurate, mode in this way can be got compared with subject to
True block data.Further, method provided in this embodiment also obtains block data from least two trusted nodes, and will
The each block data obtained is compared, and is determined to be sent to the target block data of first node according to comparison result, so as to
The further accuracy for ensureing target block data.Therefore, method provided in this embodiment is traversed without user terminal
Accurate block data is provided a user in the case of all nodes.
Fig. 2 is the flow chart of the method for the acquisition data shown in another exemplary embodiment of the present invention.
As shown in Fig. 2, the method provided in this embodiment for obtaining data, including:
Step 201, the acquisition request that first node is sent is received, wherein, it obtains request and includes target block mark.
The realization principle and realization method of step 201 are similar to step 101, and details are not described herein.
Step 202, the credit rating of each node is obtained, and determines that credit rating is more than the with a high credibility of credit threshold
Node.
Wherein it is possible to pre-set credit threshold, and the node of credit threshold is will be above as section with a high credibility
Point.Furthermore it is also possible to obtain the credit rating of each node, credit threshold is determined according to the credit rating of each node, for example, can
It is averaged with the credit rating to all nodes, using obtained average value as credit threshold.It can also be according to by each section
The credit rating of point is ranked up, and using the credit rating for coming predeterminated position as credit threshold, such as shares 10 nodes, credit rating
Ranking results are 10,10,10,9,8, can be using the credit rating 10 for third position of sorting as credit threshold.
Specifically, will be greater than being determined as node with a high credibility equal to the node of credit threshold, credit rating is for weighing
Measure the index of node security.Credit rating is higher, and the safety of node is higher, the probability that the data that node memory stores up are tampered
Lower, therefore, the data accuracy stored in determining node with a high credibility through the above way is higher.
Further, the confidence level of each node can be determined there are many mode, for example, can actively be set by user,
The credit rating of node whether can also be accurately adjusted according to the data obtained from node, for example, when user passes through first node
After obtaining data from block chain network, can feedback opinion be sent to node server by first node, marked wherein
Whether the block data of acquisition is correct, if correctly, node server increases the credit rating for the node for obtaining block data, gathers then
Reduce credit rating.
During practical application, the credit rating and credit threshold of each node can be stored by node server.
Step 203, in node with a high credibility, at least two trusted nodes are determined according to the first preset rules.
Wherein it is possible at least two trusted nodes are determined in multiple nodes with a high credibility again.It for example, can be random
At least two trusted nodes are determined in node with a high credibility.It can also be true in node with a high credibility according to polling algorithm
Fixed at least two trusted nodes, so as to avoid repeatedly obtaining data from same node, can mitigate single credible section
The processing pressure of point.
Specifically, node server can also receive update request, for updating above-mentioned first preset rules.Specifically may be used
To add in the first new preset rules, existing first preset rules can also be improved.
Step 204, it is obtained and the corresponding block data of target block mark from each trusted node.
The realization principle and realization method of step 204 are similar to step 103, and details are not described herein.
Step 205, whether the block data for comparing acquisition is identical.
It wherein,, can be by the block counts in a node after generation block data due to the block chain network property of itself
According to broadcast to entire block chain network, make, he also stores the block data by node, so that each node can store phase
Same block data.Due to the block chain network characteristic of itself, the block data stored in each node in block chain network is all
It is identical.Therefore, if the block data in node is not maliciously tampered, then node server root from different nodes
The block data obtained according to same target block mark should be identical, if there is a situation where different, illustrate the section having
Block data in point is maliciously tampered.
It is whether identical by comparing the block data obtained from each trusted node, it can determine the block data of acquisition
Whether safety and precise.If each block data is all identical, step 206 is performed, if there are inconsistent feelings for each block data
Condition then performs step 208.
Step 206, identical block data is determined as target block data.
Wherein, if obtain block data all same, can directly determine acquisition block data be it is safe and reliable,
Identical block data can be then determined as to target block data, that is, user needs the block data obtained.
Step 207, the credit of trusted node corresponding with obtaining same block data is improved according to the second preset rules tune
Degree.
Wherein, if each block data obtained is all identical, it may be considered that corresponding with obtaining the same block data
Trusted node is safe and reliable, it is thus possible to improve the credit rating of these nodes.For example, according to target block mark from can
Identical block data is obtained in letter node 1,2,3, then can improve the credit rating of trusted node 1,2,3, for example, can be
1 is improved on the basis of its current credit.
Step 208, it determines the number of same block data in the block data obtained, and determines of same block data
Number and the ratio of the number of block data obtained.
Wherein, by compare obtain block data it is whether identical, be capable of determining that including same block data,
The number of each same block data is determined again.Then the number of same block data and of the block data obtained are calculated
Several ratio.
Specifically, multiple same block data may be included in the block data obtained, for example, from 10 trusted nodes
In 10 block datas obtained, 8 block data A are identical, and in addition 2 block data B are identical, then are being obtained
Block data include same block data A and same block data B.Same block data A accountings can be calculated
It is 80%, the accounting of same block data B is 20%.
Step 209, judge whether ratio is more than or equal to default ratio.
Further, default ratio can be set according to demand, and default ratio is higher, the target block data finally obtained
Also it is more accurate, therefore, default ratio can be set as to a higher ratio, such as 80% and its more than.In addition, in order to
It avoids the occurrence of two different same block data amount checks and default ratio is both greater than with the ratio of block data number obtained
Preset ratio can be set greater than the numerical value equal to 51% by situation.
During practical application, it can compare and ratio and preset value ratio is calculated, so that it is determined that going out accounting is more than default ratio
Same block data.
If so, performing step 210, step 203 is otherwise continued to execute.
Step 210, same block data are determined as target block data.
Since the node in block chain network is more, maliciously block chain network is attacked and then changes what is wherein stored
During data, it is difficult to most of node therein is attacked, therefore, if the accounting of same block data is more than default ratio, that is,
Major part in the block data of acquisition is identical, it may be considered that accurately and reliably, therefore the identical block data is
It can be as target block data.
For example, same block data A accountings are 80%, the accounting of same block data B is 20%, and default ratio is
70%, since the accounting of block data A is more than default ratio, then can be using block data A as target block data.
If judging, ratio is less than default ratio, step 203 is continued to execute, in node with a high credibility, according to first
Preset rules determine at least two trusted nodes.
Wherein, if the ratio being calculated is less than default ratio, it may be considered that being all in the block data this time obtained
It is incredible, it can not therefrom determine target data.Therefore, can in node with a high credibility, at least two determined again
A trusted node, then obtain block data from new trusted node.Until determining target block data.
Specifically, if the first preset rules are to sort to determine trusted node according to credit rating, that is, directly acquire credit rating height
Node as trusted node, then method provided in this embodiment can also include:
In node with a high credibility, the last trusted node obtained is rejected, further according to the first preset rules in residue
Node with a high credibility in determine at least two trusted nodes.So as to which the trusted node obtained again and last time be avoided to obtain
Take it is identical the problem of, if the trusted node obtained again with last time obtain trusted node it is identical, then therefrom obtain
Each block data is also identical, will result in the state that entire method enters endless loop.
Step 211, target block data are sent to first node.
Determining target block data are sent to first node again, allow the user to obtain accordingly by first node
Target block data.Specific user can operate user terminal, so as to be obtained from the first node being connect with user terminal
Take target block data.
The method provided in this embodiment for obtaining data, obtains block data, and compare acquisition from multiple trusted nodes
Block data it is whether identical, if identical, directly as target block data, otherwise, then determine same block data
Account for the ratio of the block data of acquisition, and judge whether ratio is more than default ratio, if more than, then using same block data as
Otherwise target block data, reacquire trusted node and block data, until determining target block data, most
Determining target block data are sent to first node at last.By the above method, allow users to without user terminal time
Accurate block data is provided a user in the case of going through all nodes.
Fig. 3 is the structure chart of the device of the acquisition data shown in an exemplary embodiment of the invention.
As shown in figure 3, the device provided in this embodiment for obtaining data, including:
Receiving module 31, for receiving the acquisition request of first node transmission, wherein, described obtain asks to include target area
Block identification;
Determining module 32, for determining at least two trusted nodes according to the credit rating of each node;
Acquisition module 33, for being obtained and the corresponding block counts of target block mark from each trusted node
According to;
Comparing module 34 for comparing each block data obtained, and determines target area according to comparison result
The target block data are sent to the first node by block number evidence.
Wherein, receiving module 31, determining module 32, acquisition module 33 and comparing module 34 are sequentially connected.
The device provided in this embodiment for obtaining data, including receiving module, for receiving the acquisition of first node transmission
Request, wherein, it obtains request and includes target block mark;Determining module, for according to the credit rating of each node determine to
Few two trusted nodes;Acquisition module, for being obtained and the corresponding block data of target block mark from each trusted node;
Comparing module for comparing each block data obtained, and determines target block data, by target area according to comparison result
Block number evidence is sent to first node.The device provided in this embodiment for obtaining data, is determined according to the credit rating of each node
The higher trusted node of credit rating, then the data from trusted node needed for acquisition user, due to being deposited in the high node of credit rating
The data of storage are more accurate, therefore mode in this way can get more accurate block data.Further, this implementation
The device that example provides also obtains block data, and each block data of acquisition is compared from least two trusted nodes
It is right, it is determined to be sent to the target block data of first node according to comparison result, so as to further ensure target area block number
According to accuracy.Therefore, device provided in this embodiment is carried in the case where traversing all nodes without user terminal to user
For accurate block data.
It is provided in this embodiment obtain data device concrete principle and realization method with embodiment class shown in FIG. 1
Seemingly, details are not described herein again.
Fig. 4 is the structure chart of the device of the acquisition data shown in another exemplary embodiment of the present invention.
As shown in figure 4, on the basis of above-described embodiment, it is described true in the device provided in this embodiment for obtaining data
Cover half block 32 includes:
Acquiring unit 321, for obtaining the credit rating of each node;
First determination unit 322, for determining that the credit rating is more than the node with a high credibility of credit threshold;
First determination unit 322 is additionally operable in the node with a high credibility, is determined according to the first preset rules
Go out at least two trusted nodes.
Wherein, acquiring unit 321 is connect with the first determination unit 322.
Optionally, the comparing module 34 includes:
Whether comparing unit 341 is identical for comparing the block data obtained;
If identical, the identical block data is determined as target block data by the second determination unit 342.
Specifically, comparing unit 341 is connect with the second determination unit 342.
Optionally, the device provided in this embodiment for obtaining data, further includes credit block 35, is used for:It is pre- according to second
If rule improves the credit rating of the corresponding trusted node of identical with the acquisition block data.
Wherein, credit block 35 is connect with comparing module 34, is compared so as to which credit block 35 be enable to obtain comparing module 34
To result.
Optionally, if comparing unit 341 compares the block data obtained and differs,
Then the second determination unit 342 is additionally operable to the number of same block data in the block data for determining acquisition, and
Determine the number of the same block data and the ratio of the number of the block data obtained;
Correspondingly, the comparing module 34 further includes judging unit 343, for judging it is pre- whether the ratio is more than or equal to
If ratio;
If so, second determination unit 342 is used to the same block data being determined as target block data;
Otherwise, the determining module 32 is continued to execute determines at least two trusted nodes according to the credit rating of each node
The step of.
Wherein, judging unit 343 is connect with the second determination unit 342, and judging unit 343 is also connect with determining module 32.
The device provided in this embodiment for obtaining data, obtains block data, and compare acquisition from multiple trusted nodes
Block data it is whether identical, if identical, directly as target block data, otherwise, then determine same block data
Account for the ratio of the block data of acquisition, and judge whether ratio is more than default ratio, if more than, then using same block data as
Otherwise target block data, reacquire trusted node and block data, until determining target block data, most
Determining target block data are sent to first node at last.Using device provided in this embodiment, allow users to need not
User terminal provides a user accurate block data in the case of traversing all nodes.
It is provided in this embodiment obtain data device concrete principle and realization method with embodiment class shown in Fig. 2
Seemingly, details are not described herein again.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
The relevant hardware of program instruction is crossed to complete.Aforementioned program can be stored in a computer read/write memory medium.The journey
Sequence when being executed, performs the step of including above-mentioned each method embodiment;And aforementioned storage medium includes:ROM, RAM, magnetic disc or
The various media that can store program code such as person's CD.
Finally it should be noted that:The above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe is described in detail the present invention with reference to foregoing embodiments, it will be understood by those of ordinary skill in the art that:Its according to
Can so modify to the technical solution recorded in foregoing embodiments either to which part or all technical features into
Row equivalent replacement;And these modifications or replacement, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (10)
- A kind of 1. method for obtaining data, which is characterized in that including:The acquisition request that first node is sent is received, wherein, described obtain asks to include target block mark;At least two trusted nodes are determined according to the credit rating of each node;It is obtained and the corresponding block data of target block mark from each trusted node;The each block data obtained is compared, and target block data are determined according to comparison result, by the target area Block number evidence is sent to the first node.
- 2. according to the method described in claim 1, it is characterized in that, the credit rating according to each node determines at least two A trusted node, including:The credit rating of each node is obtained, and determines that the credit rating is more than the node with a high credibility of credit threshold;In the node with a high credibility, at least two trusted nodes are determined according to the first preset rules.
- 3. method according to claim 1 or 2, which is characterized in that each block data for comparing acquisition, and Target block data are determined according to comparison result, including:Whether identical compare the block data obtained;If identical, the identical block data is determined as target block data.
- 4. according to the method described in claim 3, it is characterized in that, improve the area identical with acquisition according to the second preset rules Block number according to corresponding trusted node credit rating.
- 5. according to the method described in claim 3, it is characterized in that, if the block data obtained differs, it is determined that obtain The number of same block data in the block data taken, and determine that the number of the same block data is described with obtaining The ratio of the number of block data;Judge whether the ratio is more than or equal to default ratio;If so, the same block data are determined as target block data;Otherwise, the step of at least two trusted nodes is determined according to the credit rating of each node is continued to execute.
- 6. a kind of device for obtaining data, which is characterized in that including:Receiving module, for receiving the acquisition request of first node transmission, wherein, described obtain asks to include target block mark Know;Determining module, for determining at least two trusted nodes according to the credit rating of each node;Acquisition module, for being obtained and the corresponding block data of target block mark from each trusted node;Comparing module for comparing each block data obtained, and determines target block data according to comparison result, The target block data are sent to the first node.
- 7. device according to claim 6, which is characterized in that the determining module includes:Acquiring unit, for obtaining the credit rating of each node;First determination unit, for determining that the credit rating is more than the node with a high credibility of credit threshold;First determination unit is additionally operable in the node with a high credibility, and at least two are determined according to the first preset rules A trusted node.
- 8. the device described according to claim 6 or 7, which is characterized in that the comparing module includes:Whether comparing unit is identical for comparing the block data obtained;If identical, the identical block data is determined as target block data by the second determination unit.
- 9. device according to claim 8, which is characterized in that further include credit block, be used for:According to the second preset rules Improve the credit rating of the corresponding trusted node of identical with the acquisition block data.
- 10. device according to claim 8, which is characterized in that if comparing unit compares the block data obtained not It is identical,Then the second determination unit is additionally operable to the number of same block data in the block data for determining acquisition, and determines described The number of same block data and the ratio of the number of the block data obtained;Correspondingly, the comparing module further includes judging unit, for judging whether the ratio is more than or equal to default ratio;If so, second determination unit is used to the same block data being determined as target block data;Otherwise, the determining module continues to execute the step that at least two trusted nodes are determined according to the credit rating of each node Suddenly.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711404888.5A CN108197498A (en) | 2017-12-22 | 2017-12-22 | Obtain the method and device of data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711404888.5A CN108197498A (en) | 2017-12-22 | 2017-12-22 | Obtain the method and device of data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108197498A true CN108197498A (en) | 2018-06-22 |
Family
ID=62583345
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711404888.5A Pending CN108197498A (en) | 2017-12-22 | 2017-12-22 | Obtain the method and device of data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108197498A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109450996A (en) * | 2018-10-25 | 2019-03-08 | 国信优易数据有限公司 | A kind of data cochain management method, device, equipment and block catenary system |
CN111309762A (en) * | 2020-02-18 | 2020-06-19 | 杭州复杂美科技有限公司 | Data acquisition method, device and storage medium |
CN112184429A (en) * | 2020-11-06 | 2021-01-05 | 上海优扬新媒信息技术有限公司 | User information processing method and block chain link point |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104050250A (en) * | 2011-12-31 | 2014-09-17 | 北京奇虎科技有限公司 | Distributed key-value query method and query engine system |
US20160232090A1 (en) * | 2015-02-06 | 2016-08-11 | Beijing Fortunet Information & Technology Co., Ltd | Crash-proof cache data protection method and system |
CN106716421A (en) * | 2016-12-30 | 2017-05-24 | 深圳前海达闼云端智能科技有限公司 | Data query method, device and node apparatus |
CN107077674A (en) * | 2016-12-29 | 2017-08-18 | 深圳前海达闼云端智能科技有限公司 | Transaction verification processing method and device and node equipment |
-
2017
- 2017-12-22 CN CN201711404888.5A patent/CN108197498A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104050250A (en) * | 2011-12-31 | 2014-09-17 | 北京奇虎科技有限公司 | Distributed key-value query method and query engine system |
US20160232090A1 (en) * | 2015-02-06 | 2016-08-11 | Beijing Fortunet Information & Technology Co., Ltd | Crash-proof cache data protection method and system |
CN107077674A (en) * | 2016-12-29 | 2017-08-18 | 深圳前海达闼云端智能科技有限公司 | Transaction verification processing method and device and node equipment |
CN106716421A (en) * | 2016-12-30 | 2017-05-24 | 深圳前海达闼云端智能科技有限公司 | Data query method, device and node apparatus |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109450996A (en) * | 2018-10-25 | 2019-03-08 | 国信优易数据有限公司 | A kind of data cochain management method, device, equipment and block catenary system |
CN111309762A (en) * | 2020-02-18 | 2020-06-19 | 杭州复杂美科技有限公司 | Data acquisition method, device and storage medium |
CN112184429A (en) * | 2020-11-06 | 2021-01-05 | 上海优扬新媒信息技术有限公司 | User information processing method and block chain link point |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111339436B (en) | Data identification method, device, equipment and readable storage medium | |
CN111614690B (en) | Abnormal behavior detection method and device | |
CN109117275A (en) | Account checking method, device, computer equipment and storage medium based on data fragmentation | |
JP2021533474A (en) | Node classification method, model training method, and its equipment, equipment and computer program | |
CN108197498A (en) | Obtain the method and device of data | |
CN110648180B (en) | Method and device for adjusting delivery channel and electronic equipment | |
CN106487939B (en) | A kind of method and apparatus, a kind of electronic equipment of determining User IP subnet | |
US11270227B2 (en) | Method for managing a machine learning model | |
CN111339129A (en) | Remote meter reading abnormity monitoring method and device, gas meter system and gas cloud platform | |
CN108366012B (en) | Social relationship establishing method and device and electronic equipment | |
CN108768695B (en) | KQI problem positioning method and device | |
CN111740977B (en) | Voting detection method and device, electronic equipment and computer readable storage medium | |
CN108763536A (en) | Data bank access method and device | |
CN110661719A (en) | Flow load balancing method and device | |
CN108647739A (en) | A kind of myspace discovery method based on improved density peaks cluster | |
CN111258968B (en) | Enterprise redundant data cleaning method and device and big data platform | |
CN107659982B (en) | Wireless network access point classification method and device | |
CN112308345A (en) | Communication network load prediction method, device and server | |
CN105550250B (en) | A kind of processing method and processing device of access log | |
CN110991241A (en) | Abnormality recognition method, apparatus, and computer-readable medium | |
CN116094849A (en) | Application access authentication method, device, computer equipment and storage medium | |
CN116047223A (en) | Electricity larceny distinguishing method based on real-time electricity consumption and big data analysis | |
CN110427557A (en) | Main broadcaster's recommended method, device, electronic equipment and computer readable storage medium | |
CN111723338A (en) | Detection method and detection equipment | |
CN110648181B (en) | Method and device for controlling delivery channel based on monitoring delivery efficiency and electronic equipment |
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: 20180622 |
|
RJ01 | Rejection of invention patent application after publication |