Specific embodiment
In order to make those skilled in the art better understand the technical solutions in the application, below in conjunction with the application reality
The attached drawing in example is applied, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described implementation
Example is merely a part but not all of the embodiments of the present application.Based on the embodiment in the application, this field is common
The application protection all should belong in technical staff's every other embodiment obtained without creative efforts
Range.
As previously mentioned, some most of products for helping user record data are that server is built for user currently on the market
Appropriate database.And server is not very reliable in information security, once it is attacked, it is easy to cause number of users
According to loss or distort.In addition, it is contemplated that cost factor, product supplier generally will not built multiple servers for user everywhere
Record or inquire the data of oneself.
Numerous block chain nodes is distributed in block chain, is substantially the database of a decentralization, is particularly suitable for note
Employ the data in the daily life of family.For this purpose, the application is intended to provide one kind based on block chain technology, realize whenever and wherever possible as use
Family provides the data record and data query service never lost and can not distorted.
Fig. 1 is the flow chart of data processing method of the embodiment of the present application based on block chain.Method shown in FIG. 1 can be by
Hereafter corresponding device executes, comprising:
Step S102 obtains the cochain for the first user data that the first user initiates to target block chain node and asks
It asks, the first user data includes the personal lifestyle data of the first user.
Wherein, block chain belonging to target block chain node can be publicly-owned chain, be also possible to privately owned chain.Target block chain
Node can be public block chain node, be also possible to the self-built block chain node of user.First user data, which can be, appoints
The data, such as picture data, text data, video data etc. of what type.
Step S104 determines the corresponding first identifier of the first user.
As exemplary introduction, this step can be according to the identification card number or the first user of the first user in block chain
The information such as the account name of registration configure first identifier.If being before that the first user configuration crosses first identifier, this step
Suddenly configured first identifier can be continued to use.
Step S106, addition record has the firstth area of the first user data in the local block chain of target block chain node
Block;Wherein, the first block arrangement has index field, and recording address and first block of first user data in the first block are matched
The index field set includes the first identifier for determining and obtaining.
In this step, if target block chain node is accounting nodes, record has the first user data the is generated
One block, and the first block is added in the local block chain of target block chain node, and the first block is broadcasted to other
Block chain node.If target block chain node is non-accounting nodes, the record for receiving other block chain node broadcasts has the
First block of one user data, and the first block is added in the local block chain of target block chain node.
It should be understood that the first identifier based on the first user, it can be from local block chain corresponding to each block chain node
The first block that record has the first user data is searched, and further inquires the first user data from the first block.
It can see that the scheme of the embodiment of the present application is recorded using block chain based on data processing method shown in FIG. 1
The personal lifestyle data of user.The block chain of decentralization has numerous block chain nodes, needs to destroy more than half area
Block chain node could carry out data tampering, or destroy all block chain nodes ability complete deletion data, theoretically
It can not accomplish, therefore user data can obtain good safety guarantee after cochain.In addition, the area in block chain
Block chain node is widely distributed and addition is flexible, ensure that the covering of data storage service and data reading service, can satisfy use
Use demand of the family in each place.
Wherein, the method for the embodiment of the present application may comprise steps of in query process:
Step S108 obtains the inquiry for second user data that second user is initiated to target block chain node and asks
It asks, second user data include the personal lifestyle data of second user.
Wherein, inquiry request carries the query information of second user data, and query information includes at least: second user pair
The second identifier answered.
Step S110, based on the corresponding second identifier of second user carried in inquiry request, from target block chain node
Local block chain in obtain record and have the second block of second user data, wherein the search packet of second user data
Containing the corresponding second identifier of second user, the rope of recording address and second block arrangement of the second user data in the second block
Drawing field includes the second identifier.
It should be understood that the second block can be added to by this step based on the identical method of above-mentioned steps S102- step S106
In the local block chain of target block chain node.
Step S112 executes the data query about second identifier based on the index field of the second block arrangement, obtains the
The second user data of two blocks record.
It should be understood that in a kind of wherein feasible implementation: the second user in step S108- step S112 can be
Refer to above-mentioned first user.Accordingly, second user data, that is, above-mentioned first user data, the second block, that is, above-mentioned first block.
It describes in detail below to the method for the embodiment of the present application.
The method of the embodiment of the present application utilizes the decentralization of block chain, anti-lost, anti-tamper Distributed Storage skill
Art, to realize record and the inquiry to user data.
Wherein, the executing subject of data processing method can be, but not limited to arbitrary block chain node in block chain.With mesh
For marking block chain node configuration for executing data processing, then the record process of user data is as shown in Figure 2, comprising:
Step S201, target block chain node obtain the first Client-initiated and request for the cochain of the first user data.
In this step, the first user can be by the modes such as taking pictures, imaging, keep a diary by some experience of oneself, such as:
It goes to school, love, working, give birth to children, spending a holiday etc. is recorded, these data got off by the first user record i.e. the first number of users
According to.
Later, the first user can be by individual terminal devices, and the target block chain node into block chain initiates first
The cochain of user data is requested.
In practical applications, if the first user is in more remote position, target block chain link can voluntarily be built
Point, and target block chain link is added in block chain.
Step S202, target block chain node are requested in response to cochain, are the first user configuration account name.
Wherein, the unique corresponding first identifier of account name i.e. the first user.If the first user registered in block chain
Account name, then the account name before this step is continued to use is as first identifier.
Step S203, target block chain node judge whether itself is accounting nodes, are to then follow the steps S204, otherwise
Execute step S205.
In this step, if block chain be publicly-owned chain, target block chain node can with but it is nonessential to other blocks
Chain node initiates the multi-party common recognition for being directed to the first user data, such as to the first user, the first user data and target block chain
Any one of node is verified.If the first user data successfully passes the verifying of multi-party formula, itself is further judged
It whether is accounting nodes.If the first user data by the verifying of multi-party formula, can refuse cochain request not successfully.
Step S204, target block chain node generate the first block that record has the first user data, and in local block
First block is added in chain, and block is broadcasted to other block chain nodes.
Wherein, the search field extension of the block head record of the first block has the first identifier of the first user, and first uses
User data consists of two parts in the recording address of the first block.
A part is the first identifier of the first user, and another part is that target block chain node is based on hashing algorithm to first
At least partly content of user data is compiled the character string of acquisition.
Based on the former part, target block chain node can be found by the index field of the block head of the first block
The recording address of first user data, and then the first user data is found according to the recording address of the first user data.
Based on latter portion, it can verify whether the first user data is tampered.For example, when the first user data is usurped
When changing, corresponding recording address can also change therewith.It imitates and determines whether the content of target data occurred to distort, and then sentence
The accuracy of disconnected target data.For example, recording address and most areas when the first user data of a small number of block chain nodes preservations
When the recording address for the first user data that block chain node saves occurs inconsistent, then it can indicate to remember in a small number of block chain nodes
First user data of record is (for the block chain of decentralization, destroying to distort the first user data of being tampered with
Block chain node more than half is the thing that it is almost impossible).
Step S205, the record that target block chain node receives other block chain node broadcasts have the of the first user data
One block, and add in local block chain the first block of broadcast acquisition.
It should be understood that target block chain node is that other block chain nodes use and above-mentioned step from the first block that broadcast obtains
Rapid 204 same method is generated.
Accordingly, the querying flow of user data is as shown in Figure 3, comprising:
Step S301, target block chain node obtain the inquiry request that the first Client-initiated is directed to the first user data.
Specifically, inquiry request carries the query information of the first user data, can be, but not limited to include: the first user
Account name and the first user data rule searching.Wherein, rule searching is used to further limit query context, than
Such as: rule searching indicates that the data format of this inquiry is the data of picture, this inquiry cochain in January.
Step S302, account name of the target block chain node based on the first user carried in inquiry request determine local
Record has the first block of the first user data in block chain.
As previously mentioned, the index field that the block head of the first block configures includes the account name of the first user, therefore this
Step can carry out the summary info of the corresponding each block of target block chain node by the account name of the first user
Match, finds first block.
Step S304, what target block chain node carried in index field and inquiry request based on the first block arrangement looks into
Rule is ask, the data query to the first onblock executing about the account name of the first user obtains the first user data.
In conclusion the method for the embodiment of the present application utilizes block chain, realize to the decentralization of user data, anti-lost
It loses, anti-tamper distributed storage.While the record data of the user data in the index field and block of block head
The mark of extending user in location, to realize the quick search based on user identifier to user data.Implemented based on the application
The method of example, user can be handled by the life of block chained record oneself, therefore practical value with higher.
It is the introduction to the method for the embodiment of the present application above.It should be understood that not departing from hereinbefore basis,
Variation appropriate can also be carried out, these variations also should be regarded as the protection scope of the embodiment of the present application.For example, the embodiment of the present application
Data record method be applicable in record any data, however it is not limited to be the experience in user's daily life.
Ground is corresponded to the above method, as shown in figure 4, the embodiment of the present application is also provided at a kind of data based on block chain
Manage device 400, comprising:
Cochain request receiving module 410, what the first user of acquisition initiated to target block chain node is directed to the first number of users
According to cochain request, wherein first user data includes the personal lifestyle data of first user.
Determining module 420 is identified, determines the corresponding first identifier of the first user.
Block adding module 430, addition record has described first in the local block chain of the target block chain node
First block of user data;Wherein, first block arrangement has index field, and first user data is described first
The index field of recording address and first block arrangement in block includes the first identifier for determining and obtaining.
Data processing equipment based on shown in Fig. 4 can see that the scheme of the embodiment of the present application is recorded using block chain
The personal lifestyle data of user.The block chain of decentralization has numerous block chain nodes, needs to destroy more than half area
Block chain node could carry out data tampering, or destroy all block chain nodes ability complete deletion data, theoretically
It can not accomplish, therefore user data can obtain good safety guarantee after cochain.In addition, the area in block chain
Block chain node is widely distributed and addition is flexible, ensure that the covering of data storage service and data reading service, can satisfy use
Use demand of the family in each place.
Optionally, the data processing equipment of the embodiment of the present application further include:
Inquiry request receiving module, what acquisition second user was initiated to the target block chain node is directed to second user number
According to inquiry request, wherein the second user data include the personal lifestyle data of the second user;
Block locating module, based on the corresponding second identifier of the second user carried in the inquiry request, from institute
It states and obtains the second block that record has the second user data in the local block chain of target block chain node, wherein is described
The search information of second user data includes the corresponding second identifier of the second user, and the second user data are described the
The index field of recording address and second block arrangement in two blocks includes the second identifier;
Block data enquiry module is executed based on the index field of second block arrangement about the second identifier
Data query, obtain the second user data of second block record.
Optionally, if the target block chain node is accounting nodes, the generation record of block adding module 330 has described
First block of the first user data, and first block is added in the local block chain of the target block chain node,
And first block is broadcasted to other block chain nodes.If the target block chain node is non-accounting nodes, area
The record that block adding module 330 receives other block chain node broadcasts has the first block of first user data, and in institute
It states in the local block chain of target block chain node and adds first block.
Optionally, recording address of first user data in first block also includes based on hashing algorithm pair
At least partly content of first user data is compiled the character string of acquisition;And/or the second user data are in institute
Stating the recording address in the second block also includes to be carried out based at least partly content of the hashing algorithm to the second user data
Compile the character string obtained.
Optionally, the target block chain node is the self-built block chain node of first user.
Optionally, first user data is the personal data of first user, and the first identifier includes described
The account information that first user registers in block chain;And/or the second user data are a numbers of the second user
According to the second identifier includes the account information that the second user is registered in block chain;
Obviously, the data processing equipment of the embodiment of the present application can be used as holding for above-mentioned data processing method shown in FIG. 1
Row main body, therefore the data processing equipment can be realized the function that the data processing method is realized in Fig. 1-Fig. 3.Due to
Principle is identical, and repeats no more herein.
Fig. 5 is the structural schematic diagram of one embodiment electronic equipment of the application.Referring to FIG. 5, in hardware view, the electricity
Sub- equipment includes processor, optionally further comprising internal bus, network interface, memory.Wherein, memory may be comprising interior
It deposits, such as high-speed random access memory (Random-Access Memory, RAM), it is also possible to further include non-volatile memories
Device (non-volatile memory), for example, at least 1 magnetic disk storage etc..Certainly, which is also possible that other
Hardware required for business.
Processor, network interface and memory can be connected with each other by internal bus, which can be ISA
(Industry Standard Architecture, industry standard architecture) bus, PCI (Peripheral
Component Interconnect, Peripheral Component Interconnect standard) bus or EISA (Extended Industry Standard
Architecture, expanding the industrial standard structure) bus etc..The bus can be divided into address bus, data/address bus, control always
Line etc..Only to be indicated with a four-headed arrow in Fig. 5, it is not intended that an only bus or a type of convenient for indicating
Bus.
Memory, for storing program.Specifically, program may include program code, and said program code includes calculating
Machine operational order.Memory may include memory and nonvolatile memory, and provide instruction and data to processor.
Processor is from the then operation into memory of corresponding computer program is read in nonvolatile memory, in logical layer
Data processing equipment is formed on face.Processor executes the program that memory is stored, and is specifically used for executing following operation:
It obtains the cochain for the first user data that the first user initiates to target block chain node to request, wherein institute
State the personal lifestyle data that the first user data includes first user.
Determine the corresponding first identifier of the first user.
Addition record has the firstth area of first user data in the local block chain of the target block chain node
Block;Wherein, first block arrangement has index field, recording address of first user data in first block
Index field with first block arrangement includes the first identifier for determining and obtaining.
It can see that the scheme of the embodiment of the present application records user using block chain based on electronic equipment shown in fig. 5
Personal lifestyle data.The block chain of decentralization has numerous block chain nodes, needs to destroy more than half block chain
Node just can be carried out data tampering, or destroy all block chain nodes ability complete deletion data, be nothing theoretically
What method was accomplished, therefore user data can obtain good safety guarantee after cochain.In addition, the block chain in block chain
Node distribution is extensively and addition is flexible, ensure that the covering of data storage service and data reading service, can satisfy user and exist
The use demand in each place.
The data processing method based on block chain disclosed in the above-mentioned embodiment illustrated in fig. 1 such as the application can be applied to handle
In device, or realized by processor.Processor may be a kind of IC chip, the processing capacity with signal.It is realizing
In the process, each step of the above method can pass through the integrated logic circuit of the hardware in processor or the instruction of software form
It completes.Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processor, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
Field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device are divided
Vertical door or transistor logic, discrete hardware components.It may be implemented or execute and is in the embodiment of the present application disclosed each
Method, step and logic diagram.General processor can be microprocessor or the processor is also possible to any conventional place
Manage device etc..The step of method in conjunction with disclosed in the embodiment of the present application, can be embodied directly in hardware decoding processor and execute
At, or in decoding processor hardware and software module combination execute completion.Software module can be located at random access memory,
This fields such as flash memory, read-only memory, programmable read only memory or electrically erasable programmable memory, register maturation
In storage medium.The storage medium is located at memory, and processor reads the information in memory, completes above-mentioned side in conjunction with its hardware
The step of method.
It should be understood that above-mentioned data processing equipment may be implemented in Fig. 1 and shown in Fig. 2 in the electronic equipment of the embodiment of the present application
The function of embodiment, repeats no more herein.
Certainly, other than software realization mode, other implementations are not precluded in the electronic equipment of the application, for example patrol
Collect device or the mode of software and hardware combining etc., that is to say, that the executing subject of following process flow is not limited to each patrol
Unit is collected, hardware or logical device are also possible to.
In addition, the embodiment of the present application also proposed a kind of computer readable storage medium, the computer readable storage medium
One or more programs are stored, which includes instruction, and it is included the portable of multiple application programs which, which works as,
When formula electronic equipment executes, the method that the portable electronic device can be made to execute embodiment illustrated in fig. 1, and be specifically used for executing
Following methods:
It obtains the cochain for the first user data that the first user initiates to target block chain node to request, wherein institute
State the personal lifestyle data that the first user data includes first user.
Determine the corresponding first identifier of the first user.
Addition record has the firstth area of first user data in the local block chain of the target block chain node
Block;Wherein, first block arrangement has index field, recording address of first user data in first block
Index field with first block arrangement includes the first identifier for determining and obtaining.
Based on above-mentioned computer readable storage medium, electronic equipment can record data using block chain.Decentralization
Block chain have numerous block chain nodes, data tampering could be carried out more than half block chain node by needing to destroy, or
Person is to destroy all block chain nodes ability complete deletion data, can not be accomplished theoretically, therefore user data one
After denier cochain, good safety guarantee can be obtained.In addition, the block chain node in block chain is widely distributed and addition is flexible,
The covering that ensure that data storage service and data reading service can satisfy user in the use demand in each place.
It should be understood that above-metioned instruction can make above when the portable electronic device for being included multiple application programs executes
The data processing equipment realizes the function of Fig. 1 and embodiment illustrated in fig. 2, and repeats no more herein.
It will be understood by those skilled in the art that the embodiment of this specification can provide as the production of method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or implementation combining software and hardware aspects can be used in this specification
The form of example.Moreover, it wherein includes the computer of computer usable program code that this specification, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
It is above-mentioned that this specification specific embodiment is described.Other embodiments are in the scope of the appended claims
It is interior.In some cases, the movement recorded in detail in the claims or step can be come according to the sequence being different from embodiment
It executes and desired result still may be implemented.In addition, process depicted in the drawing not necessarily require show it is specific suitable
Sequence or consecutive order are just able to achieve desired result.In some embodiments, multitasking and parallel processing be also can
With or may be advantageous.
The above is only the embodiments of this specification, are not limited to this specification.For those skilled in the art
For, this specification can have various modifications and variations.All any modifications made within the spirit and principle of this specification,
Equivalent replacement, improvement etc., should be included within the scope of the claims of this specification.