CN109660352A - A kind of distribution relation record method, apparatus and terminal device based on block chain - Google Patents

A kind of distribution relation record method, apparatus and terminal device based on block chain Download PDF

Info

Publication number
CN109660352A
CN109660352A CN201811373876.5A CN201811373876A CN109660352A CN 109660352 A CN109660352 A CN 109660352A CN 201811373876 A CN201811373876 A CN 201811373876A CN 109660352 A CN109660352 A CN 109660352A
Authority
CN
China
Prior art keywords
user
block chain
signature
distribution
cryptographic hash
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.)
Granted
Application number
CN201811373876.5A
Other languages
Chinese (zh)
Other versions
CN109660352B (en
Inventor
王义辉
卜筱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Changshilong Information Technology Co Ltd
Original Assignee
Shenzhen Changshilong Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Changshilong Information Technology Co Ltd filed Critical Shenzhen Changshilong Information Technology Co Ltd
Priority to CN201811373876.5A priority Critical patent/CN109660352B/en
Publication of CN109660352A publication Critical patent/CN109660352A/en
Application granted granted Critical
Publication of CN109660352B publication Critical patent/CN109660352B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Development Economics (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Marketing (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Storage Device Security (AREA)

Abstract

The application is suitable for block chain technical field, provides a kind of distribution relation record method, apparatus and terminal device based on block chain, and method includes: the distribution relation record request for receiving the first user and sending;The signature of the first user is decrypted to obtain the first cryptographic Hash using the public key of the first user, the signature of second user is decrypted to obtain the second cryptographic Hash using the public key of second user, Hash operation is carried out to the distribution relationship of the first user and second user and obtains third cryptographic Hash;When the first cryptographic Hash and consistent with third cryptographic Hash the second cryptographic Hash, by the signature broadcast of the distribution relationship of the first user and second user, the first user's signature and second user into block chain.The application can solve existing distribution relation record method and be easy that the data of distribution relationship is made to be tampered or damage loss, during recording distribution relationship, the problem of can not verifying to the authenticity of distribution relationship.

Description

A kind of distribution relation record method, apparatus and terminal device based on block chain
Technical field
The application belongs to block chain technical field more particularly to a kind of distribution relation record method based on block chain, dress It sets and terminal device.
Background technique
Distribution refers to the meaning for establishing Sales Channel, and distribution relationship refers to certain commodity or service from the producer to consumer During transfer, obtains the ownership of this commodity and service and help between all enterprises and individuals of ownership transfer Relationship.
Current distribution relationship mainly passes through database and is recorded, and is easy because of factors such as external attack and mechanical disorders The data of distribution relationship are caused to be tampered or damage loss.
In addition, the supply and marketing quotient that is related to of distribution relationship and the bipartite relationship of distributor, carry out distribution pass using database It when system's record, can only be responsible for recording distribution relationship, the authenticity of distribution relationship can not be verified.
To sum up, existing distribution relation record method is easy that the data of distribution relationship is made to be tampered or damage loss, together When, during recording distribution relationship, the authenticity of distribution relationship can not be verified.
Summary of the invention
In view of this, the embodiment of the present application provide it is a kind of based on the distribution relation record method, apparatus of block chain and end End equipment to solve existing distribution relation record method is easy that the data of distribution relationship is made to be tampered or damage loss, note During recording distribution relationship, the problem of can not being verified to the authenticity of distribution relationship.
The first aspect of the embodiment of the present application provides a kind of distribution relation record method based on block chain, comprising:
The distribution relation record request of the first user transmission is received, the distribution relation record request includes first use The signature of the distribution relationship of family and second user, the signature of first user and the second user;
The signature of first user is decrypted to obtain the first cryptographic Hash using the public key of first user, is used The public key of the second user is decrypted the signature of the second user to obtain the second cryptographic Hash, to first user with The distribution relationship of second user carries out Hash operation and obtains third cryptographic Hash, judges first cryptographic Hash and second Hash Whether consistent with the third cryptographic Hash it is worth;
When first cryptographic Hash and consistent with the third cryptographic Hash second cryptographic Hash, described first is used The distribution relationship of family and second user, first user's signature and second user signature broadcast are into block chain.
The second aspect of the embodiment of the present application provides a kind of distribution relation record device based on block chain, comprising:
Request module is received, for receiving the distribution relation record request of the first user transmission, the distribution relation record Request includes distribution relationship, the signature of first user and the label of the second user of first user and second user Name;
Hash authentication module is decrypted for signature of the public key using first user to first user To the first cryptographic Hash, the signature of the second user is decrypted to obtain the second Hash using the public key of the second user Value carries out Hash operation to the distribution relationship of first user and second user and obtains third cryptographic Hash, judges described first Whether cryptographic Hash and second cryptographic Hash are consistent with the third cryptographic Hash;
Verify broadcast module, for when first cryptographic Hash and second cryptographic Hash with the third cryptographic Hash one When cause, the distribution relationship of first user and second user, first user's signature and the second user are signed wide It casts in block chain.
The third aspect of the embodiment of the present application provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program It realizes such as the step of the above method.
The fourth aspect of the embodiment of the present application provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, realizes when the computer program is executed by processor such as the step of the above method.
Existing beneficial effect is the embodiment of the present application compared with prior art:
In the distribution relation record method based on block chain of the application, the record of distribution relationship is carried out by block chain, It can not be distorted by block chain and guarantee that distribution relationship is not tampered or damages loss with the characteristic of distributed storage, meanwhile, note Before the distribution relationship for recording the first user and second user, the signature and second user of the first user that also the first user is sent Signature verified, if the first user's signature and second user signature be proved to be successful, then it represents that this distribution relationship The approval for crossing the first user and second user both sides is true distribution relationship, at this time again by the first user and second user The signature of distribution relationship, the signature of the first user and second user is broadcasted into block chain, guarantees the authenticity of distribution relationship, solution Existing distribution relation record method of having determined is easy that the data of distribution relationship is made to be tampered or damage loss, records distribution relationship During, the problem of can not being verified to the authenticity of distribution relationship.
Detailed description of the invention
It in order to more clearly explain the technical solutions in the embodiments of the present application, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only some of the application Embodiment for those of ordinary skill in the art without creative efforts, can also be attached according to these Figure obtains other attached drawings.
Fig. 1 is a kind of implementation process signal of distribution relation record method based on block chain provided by the embodiments of the present application Figure;
Fig. 2 is a kind of schematic diagram of distribution relation record device based on block chain provided by the embodiments of the present application;
Fig. 3 is the schematic diagram of terminal device provided by the embodiments of the present application.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, so as to provide a thorough understanding of the present application embodiment.However, it will be clear to one skilled in the art that there is no these specific The application also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, so as not to obscure the description of the present application with unnecessary details.
In order to illustrate technical solution described herein, the following is a description of specific embodiments.
It should be appreciated that ought use in this specification and in the appended claims, term " includes " instruction is described special Sign, entirety, step, operation, the presence of element and/or component, but be not precluded one or more of the other feature, entirety, step, Operation, the presence or addition of element, component and/or its set.
It is also understood that mesh of the term used in this present specification merely for the sake of description specific embodiment And be not intended to limit the application.As present specification and it is used in the attached claims, unless on Other situations are hereafter clearly indicated, otherwise " one " of singular, "one" and "the" are intended to include plural form.
It will be further appreciated that the term "and/or" used in present specification and the appended claims is Refer to any combination and all possible combinations of one or more of associated item listed, and including these combinations.
As used in this specification and in the appended claims, term " if " can be according to context quilt Be construed to " when ... " or " once " or " in response to determination " or " in response to detecting ".Similarly, phrase " if it is determined that " or " if detecting [described condition or event] " can be interpreted to mean according to context " once it is determined that " or " in response to true It is fixed " or " once detecting [described condition or event] " or " in response to detecting [described condition or event] ".
In the specific implementation, mobile terminal described in the embodiment of the present application is including but not limited to such as with the sensitive table of touch Mobile phone, laptop computer or the tablet computer in face (for example, touch-screen display and/or touch tablet) etc it is other Portable device.It is to be further understood that in certain embodiments, above equipment is not portable communication device, but is had The desktop computer of touch sensitive surface (for example, touch-screen display and/or touch tablet).
In following discussion, the mobile terminal including display and touch sensitive surface is described.However, should manage Solution, mobile terminal may include that one or more of the other physical User of such as physical keyboard, mouse and/or control-rod connects Jaws equipment.
Mobile terminal supports various application programs, such as one of the following or multiple: drawing application program, demonstration application Program, word-processing application, website creation application program, disk imprinting application program, spreadsheet applications, game are answered With program, telephony application, videoconference application, email application, instant messaging applications, forging Refining supports application program, photo management application program, digital camera application program, digital camera application program, web-browsing to answer With program, digital music player application and/or video frequency player application program.
At least one of such as touch sensitive surface can be used in the various application programs that can be executed on mobile terminals Public physical user-interface device.It can be adjusted among applications and/or in corresponding application programs and/or change touch is quick Feel the corresponding information shown in the one or more functions and terminal on surface.In this way, terminal public physical structure (for example, Touch sensitive surface) it can support the various application programs with user interface intuitive and transparent for a user.
In addition, term " first ", " second ", " third " etc. are only used for distinguishing description, and cannot in the description of the present application It is interpreted as indication or suggestion relative importance.
Embodiment one:
A kind of distribution relation record method based on block chain provided below the embodiment of the present application one is described, and asks Refering to attached drawing 1, the distribution relation record method based on block chain in the embodiment of the present application one includes:
Step S101, the distribution relation record request that the first user sends is received, the distribution relation record request includes The signature of the distribution relationship of first user and second user, the signature of first user and the second user;
After the first user and second user establish distribution relationship, the first user can send distribution to management platform Relation record request, by management platform by the distribution relation record of the first user and second user in block chain.
It may include the signature of the distribution relationship of the first user and second user, the first user in distribution relation record request With the signature of second user, the distribution relationship of the first user and second user may include distribution relationship between superior and subordinate and distribution commission Allocation plan, for example, the first user can be second user higher level distribution person, when second user complete transaction after need according to Distribution commission allocation plan pays commissions to the first user, or can also be the higher level distribution person of the first user with second user.
The signature of first user and the signature of second user are in order to which the authenticity to distribution relationship is verified, and first uses Family pair distribution relationship relevant to the first user carries out available first cryptographic Hash of Hash operation, and second user pair is used with second The relevant distribution relationship in family carries out available second cryptographic Hash of Hash operation, and the signature of the first user can be used by the first user The private key of first user is encrypted to obtain to the first cryptographic Hash, and the signature of second user can use second user by second user Private key the second cryptographic Hash is encrypted to obtain.
Step S102, the signature of first user is decrypted to obtain the first Kazakhstan using the public key of first user Uncommon value, is decrypted the signature of the second user to obtain the second cryptographic Hash, to described using the public key of the second user The distribution relationship of first user and second user carries out Hash operation and obtains third cryptographic Hash, judges first cryptographic Hash and institute Whether consistent with the third cryptographic Hash state the second cryptographic Hash;
The public key that the first user can be used is decrypted the signature of the first user to obtain the first cryptographic Hash, uses second The public key of user is decrypted the signature of second user to obtain the second cryptographic Hash, closes to the distribution of the first user and second user System carries out Hash operation and obtains third cryptographic Hash;
By judging the first cryptographic Hash and whether the second cryptographic Hash is consistent with third cryptographic Hash may determine that distribution relationship Authenticity.
It step S103, will when first cryptographic Hash and consistent with the third cryptographic Hash second cryptographic Hash The distribution relationship of first user and second user, first user's signature and second user signature are broadcasted to block In chain.
Due to if operation content changes, even if amplitude of variation very little, also resulting in last calculating in Hash operation Cryptographic Hash gap it is very big, therefore, if the first cryptographic Hash and the second cryptographic Hash are consistent with third cryptographic Hash, then it represents that calculate First cryptographic Hash, the second cryptographic Hash are consistent with the content of third cryptographic Hash;
Meanwhile first the signature of user have passed through the private key encryption of the first user, the signature of second user have passed through second The private key encryption of user, private key may indicate that the identity of user.
Therefore, when the signature decryption of signature obtained the first cryptographic Hash of decryption of the first user and second user obtain the When two cryptographic Hash are consistent with third cryptographic Hash, show that the distribution relationship has been checked and approved to the first user and second user, This distribution relationship is true distribution relationship.
After the authenticity that confirmed the distribution relationship of the first user and second user, management platform is by the first user and the Distribution relationship, the signature of the first user and the signature of second user of two users, which is broadcasted into block chain, to be stored, and is avoided point Situations such as pin relationship distorts or loses.
When not consistent with third cryptographic Hash there are any one in the first cryptographic Hash and the second cryptographic Hash, management platform can Not execute the prompt of any movement or return recording unsuccessfully to the first user.
Further, described when first cryptographic Hash and second cryptographic Hash are consistent with the third cryptographic Hash When, the distribution relationship of first user and second user, first user's signature and the second user are signed and broadcasted It is specifically included into block chain:
A1, when first cryptographic Hash and consistent with the third cryptographic Hash second cryptographic Hash, use platform Public key is signed to the distribution relationship of first user and second user, first user's signature and the second user and is carried out Encryption;
Since the data on block chain are disclosed to each node, and distribute relationship and belong to for some enterprises and need to protect Close content is therefore, wide by the signature of the distribution relationship of the first user and second user, the signature of the first user and second user It casts to before block chain, can first be encrypted using platform public key.
A2, by the distribution relationship of encrypted first user and second user, first user's signature and described Second user signature broadcast is into block chain.
After having used platform public key to be encrypted, only using platform private key just can to encrypted data deciphering, I.e. only management platform can check encrypted data, and other block chain nodes can receive the data after being encrypted, But it can not learn specific content.
Therefore, the distribution relationship of first user and second user, first user's signature and described second are used Family signature can both guarantee the secure contents such as distribution relationship by block chain using broadcast after platform public key encryption into block chain Other nodes receive record, and can guarantee that other nodes can not learn the specific details of secure content, avoid information leakage.
Further, the method also includes:
B1, the signature for receiving distribution relational query instruction and third user, using the public key of the third user to described The signature of third user is verified;
When inquiring user's needs inquiry distribution relationship relevant to third user, the qualification for proving to have inquiry is needed, So inquiry user needs to send the signature of distribution relational query instruction and third user to managing platform, management platform uses the The public key of three users verifies the signature of third user.
The signature of third user can specify content to obtain by third user using the private key encryption of third user, specify content It can be determined according to actual needs, for example, specified content can be distribution relational query instruction, or distribution relationship Inquiry instruction carries out the 4th cryptographic Hash obtained after Hash operation.
B2, when the signature verification of the third user passes through, from local data base obtain and the third user phase The distribution relationship is back to inquiry user by the distribution relationship of pass;
When the signature verification of third user passes through, indicate that third user has authorized inquiry user query and third user's phase The qualification of the distribution relationship of pass, third user and inquiry user can be same or different user at this time, for example, user A Want to inquire the distribution relationship of oneself, at this time third user and inquiry user all refer to alternative family A, user A need to send oneself Signature extremely management platform;Alternatively, user A wants to inquire the distribution relationship of user B at this time, third user refers to user B, inquiry at this time User refers to user A, and user A needs to inquire qualification to user's B application, and user B returns to signature and gives user A, user A that can just lead to The distribution relationship of the signature inquiry user B of user B is crossed, otherwise user A can not inquire the distribution relationship of user B.
After the signature verification of third user passes through, distribution relevant to third user can be obtained from local data base and closed Distribution relationship is back to inquiry user by system.
Alternatively, obtaining the encrypted and third from block chain when the signature verification of the third user passes through The relevant distribution relationship of user is decrypted the distribution relationship using platform private key, and the distribution relationship after decryption is returned To the inquiry user.
Distribution relationship can also obtain, due to block chain other than can be in local data library inquiry from block chain The distribution relationship of middle acquisition is encrypted distribution relationship, it is possible to the distribution relationship is decrypted using platform private key, The distribution relationship after decryption is back to inquiry user again.
If the signature verification of third user fails, any movement can not be executed, or authentication failed can also be returned Prompt information to inquiring user.
Further, the method also includes:
C1, data base recreation instruction is received, the area for obtaining each node in block chain is instructed according to the data base recreation Block chain data, the block chain data that the node to be greater than preset proportion is approved are as standard block chain data, with the standard regions Distribution reconstruction of relations local data base in block chain data.
When local data base damage or staff think to need to carry out data to local data base to update reconstruction, Data base recreation instruction can be sent, management platform instructs the block chain for obtaining each node in block chain according to data base recreation Data;
After getting the block chain data of each node in block chain, the area of preset proportion node approval can be will be greater than Block chain data are as standard block chain data, with the distribution reconstruction of relations local data base in standard block chain data.
Preset proportion can be configured according to the actual situation, such as can be set to 50%.
Further, the reception data base recreation instruction, instructs according to the data base recreation and obtains in block chain respectively The block chain data of a node, using the block chain data that the node greater than preset proportion is approved as standard block chain data, with Distribution reconstruction of relations local data base in the standard block chain data specifically includes:
D1, data base recreation instruction is received, each node in the block chain is obtained according to data base recreation instruction Block chain data merkle root;
D2, the corresponding block chain data of merkle root approved using the node for being greater than preset proportion are as standard block chain number According to the distribution relationship and commission settlement records reconstruction local data base in the standard block chain data.
When carrying out the comparison of block chain data of each node, can directly it be compared using complete block chain data Compared with, but the data volume for needing operation extremely huge, and arithmetic speed is extremely slow, accordingly it is also possible to be referred to according to data base recreation The merkle root for obtaining the block chain data of each node in block chain is enabled, the merkle root of each node is compared, with Greater than the node of preset proportion approve the corresponding block chain data of merkle root as standard block chain data.
The block chain data of each node storage are segmented into multiple affairs, such as using the data of a block as one Affairs, each affairs can carry out Hash operation and obtain cryptographic Hash, and two neighboring cryptographic Hash can carry out Hash operation and obtain One layer of cryptographic Hash successively calculates and forms merkle tree, when the block chain data of two nodes storage are consistent, the two nodes Block chain data formed merkle tree it is identical, root node having the same, i.e. merkle root.
It therefore, is the block chain number that can determine whether each node by comparing the merkle root of the block chain data of each node According to whether unanimously, the comparison of complete block chain data is become to the comparison of merkle root, the number of operation can be greatly reduced According to the speed for measuring and improving operation.
In the distribution relation record method based on block chain that the present embodiment one provides, pass through the first user of block chained record With the distribution relationship of second user, can occur distorting to avoid distribution relationship or the case where damage and loss, by distribution relationship note Record verifies the signature of the first user and second user before block chain, it can be ensured that distributes the authenticity of relationship, solves Existing distribution relation record method is easy that the data of distribution relationship is made to be tampered or damage loss, record distribution relationship In the process, the problem of authenticity of distribution relationship can not being verified.
Before the data broadcastings such as distribution relationship to block chain, platform public key can be used to be encrypted, only management platform can It is checked with using platform private key to be decrypted, avoids the leakage of secure content.
When inquiring the distribution relationship of user query third user, verifying judgement is carried out by the signature to third user and is looked into It askes whether user has inquiry qualification, only holds qualification just and can be carried out the inquiry of distribution relationship.
When local data base damage or because other reasons need to update when rebuilding, can be instructed by data base recreation The block chain data for obtaining each node in block chain, using the block chain data that the node greater than preset proportion is approved as standard Block chain data, with the distribution reconstruction of relations local data base in standard block chain data, the block chain data of each node Comparison procedure can be compared by merkle root, to reduce the data volume of operation and improve the speed of operation.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit It is fixed.
Embodiment two:
The embodiment of the present application two provides a kind of distribution relation record device based on block chain, for purposes of illustration only, only showing Part relevant to the application out, as shown in Fig. 2, the distribution relation record device based on block chain includes,
Request module 201 is received, for receiving the distribution relation record request of the first user transmission, the distribution relationship note Record request includes the distribution relationship of first user and second user, the signature of first user and the second user Signature;
Hash authentication module 202 is solved for signature of the public key using first user to first user It is close to obtain the first cryptographic Hash, the signature of the second user is decrypted to obtain the second Kazakhstan using the public key of the second user Uncommon value carries out Hash operation to the distribution relationship of first user and second user and obtains third cryptographic Hash, judges described the Whether one cryptographic Hash and second cryptographic Hash are consistent with the third cryptographic Hash;
Verify broadcast module 203, for when first cryptographic Hash and second cryptographic Hash with the third Hash When being worth consistent, by the distribution relationship of first user and second user, first user's signature and the second user label Name broadcast is into block chain.
Further, the verifying broadcast module 203 specifically includes:
Submodule is encrypted, it is consistent with the third cryptographic Hash for working as first cryptographic Hash and second cryptographic Hash When, distribution relationship, first user's signature and described second using platform public key to first user and second user User's signature is encrypted;
Submodule is broadcasted, for using the distribution relationship of encrypted first user and second user, described first Family signature and second user signature broadcast are into block chain.
Further, described device further include:
Inquiring and authenticating module is used for receiving the signature of distribution relational query instruction and third user using the third The public key at family verifies the signature of the third user;
Verify return module, for when the signature verification of the third user passes through, obtained from local data base with The distribution relationship is back to inquiry user by the relevant distribution relationship of the third user;
Alternatively, the verifying return module, for being obtained from block chain when the signature verification of the third user passes through Encrypted distribution relationship relevant to the third user is taken, the distribution relationship is decrypted using platform private key, it will Distribution relationship after decryption is back to the inquiry user.
Further, described device further include:
Instruction module is rebuild, library rebuilds instruction for receiving data, instructs according to the data base recreation and obtains block chain In each node block chain data, the block chain data that the node to be greater than preset proportion is approved are as standard block chain number According to the distribution reconstruction of relations local data base in the standard block chain data.
Further, the reconstruction instruction module specifically includes:
Data submodule, library rebuilds instruction for receiving data, obtains the block according to data base recreation instruction The merkle root of the block chain data of each node in chain;
Comparative sub-module, for using be greater than preset proportion node approve the corresponding block chain data of merkle root as Standard block chain data, with the distribution relationship and commission settlement records reconstruction local data base in the standard block chain data.
It should be noted that the contents such as information exchange, implementation procedure between above-mentioned apparatus/unit, due to the application Embodiment of the method is based on same design, concrete function and bring technical effect, for details, reference can be made to embodiment of the method part, this Place repeats no more.
Embodiment three:
Fig. 3 is the schematic diagram for the terminal device that the embodiment of the present application three provides.As shown in figure 3, the terminal of the embodiment is set Standby 3 include: processor 30, memory 31 and are stored in the meter that can be run in the memory 31 and on the processor 30 Calculation machine program 32.The processor 30 realizes the above-mentioned distribution relation record based on block chain when executing the computer program 32 Step in embodiment of the method, such as step S101 to S103 shown in FIG. 1.Alternatively, the processor 30 executes the calculating The function of each module/unit in above-mentioned each Installation practice, such as the function of module 201 to 203 shown in Fig. 2 are realized when machine program 32 Energy.
Illustratively, the computer program 32 can be divided into one or more module/units, it is one or Multiple module/units are stored in the memory 31, and are executed by the processor 30, to complete the application.Described one A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, which is used for Implementation procedure of the computer program 32 in the terminal device 3 is described.For example, the computer program 32 can be divided It is cut into and receives request module, Hash authentication module and verify broadcast module, each module concrete function is as follows:
The distribution relation record request of the first user transmission is received, the distribution relation record request includes first use The signature of the distribution relationship of family and second user, the signature of first user and the second user;
The signature of first user is decrypted to obtain the first cryptographic Hash using the public key of first user, is used The public key of the second user is decrypted the signature of the second user to obtain the second cryptographic Hash, to first user with The distribution relationship of second user carries out Hash operation and obtains third cryptographic Hash, judges first cryptographic Hash and second Hash Whether consistent with the third cryptographic Hash it is worth;
When first cryptographic Hash and consistent with the third cryptographic Hash second cryptographic Hash, described first is used The distribution relationship of family and second user, first user's signature and second user signature broadcast are into block chain.
The terminal device 3 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set It is standby.The terminal device may include, but be not limited only to, processor 30, memory 31.It will be understood by those skilled in the art that Fig. 3 The only example of terminal device 3 does not constitute the restriction to terminal device 3, may include than illustrating more or fewer portions Part perhaps combines certain components or different components, such as the terminal device can also include input-output equipment, net Network access device, bus etc..
Alleged processor 30 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 31 can be the internal storage unit of the terminal device 3, such as the hard disk or interior of terminal device 3 It deposits.The memory 31 is also possible to the External memory equipment of the terminal device 3, such as be equipped on the terminal device 3 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 31 can also both include the storage inside list of the terminal device 3 Member also includes External memory equipment.The memory 31 is for storing needed for the computer program and the terminal device Other programs and data.The memory 31 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed Scope of the present application.
In embodiment provided herein, it should be understood that disclosed device/terminal device and method, it can be with It realizes by another way.For example, device described above/terminal device embodiment is only schematical, for example, institute The division of module or unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation, such as Multiple units or components can be combined or can be integrated into another system, or some features can be ignored or not executed.Separately A bit, shown or discussed mutual coupling or direct-coupling or communication connection can be through some interfaces, device Or the INDIRECT COUPLING or communication connection of unit, it can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated module/unit be realized in the form of SFU software functional unit and as independent product sale or In use, can store in a computer readable storage medium.Based on this understanding, the application realizes above-mentioned implementation All or part of the process in example method, can also instruct relevant hardware to complete, the meter by computer program Calculation machine program can be stored in a computer readable storage medium, the computer program when being executed by processor, it can be achieved that on The step of stating each embodiment of the method.Wherein, the computer program includes computer program code, the computer program generation Code can be source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium It may include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic that can carry the computer program code Dish, CD, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that described The content that computer-readable medium includes can carry out increasing appropriate according to the requirement made laws in jurisdiction with patent practice Subtract, such as does not include electric carrier signal and electricity according to legislation and patent practice, computer-readable medium in certain jurisdictions Believe signal.
Embodiment described above is only to illustrate the technical solution of the application, rather than its limitations;Although referring to aforementioned reality Example is applied the application is described in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution should all Comprising within the scope of protection of this application.

Claims (10)

1. a kind of distribution relation record method based on block chain characterized by comprising
Receive the distribution relation record request of the first user transmission, distribution relation record request include first user and The signature of the distribution relationship of second user, the signature of first user and the second user;
The signature of first user is decrypted to obtain the first cryptographic Hash using the public key of first user, using described The public key of second user is decrypted the signature of the second user to obtain the second cryptographic Hash, to first user and second The distribution relationship of user carries out Hash operation and obtains third cryptographic Hash, judges first cryptographic Hash and second cryptographic Hash is It is no consistent with the third cryptographic Hash;
When first cryptographic Hash and consistent with the third cryptographic Hash second cryptographic Hash, by first user with The distribution relationship of second user, first user's signature and second user signature broadcast are into block chain.
2. the distribution relation record method based on block chain as described in claim 1, which is characterized in that described to work as described first When cryptographic Hash and consistent with the third cryptographic Hash second cryptographic Hash, by the distribution of first user and second user Relationship, first user's signature and second user signature broadcast are specifically included into block chain:
When first cryptographic Hash and consistent with the third cryptographic Hash second cryptographic Hash, using platform public key to institute Distribution relationship, first user's signature and the second user signature for stating the first user and second user encrypt;
By the distribution relationship of encrypted first user and second user, first user's signature and the second user Signature broadcast is into block chain.
3. the distribution relation record method based on block chain as claimed in claim 2, which is characterized in that the method is also wrapped It includes:
The signature for receiving distribution relational query instruction and third user, using the public key of the third user to the third user Signature verified;
When the signature verification of the third user passes through, distribution relevant to the third user is obtained from local data base The distribution relationship is back to inquiry user by relationship;
Alternatively, obtaining the encrypted and third user from block chain when the signature verification of the third user passes through Relevant distribution relationship is decrypted the distribution relationship using platform private key, the distribution relationship after decryption is back to institute State inquiry user.
4. the distribution relation record method based on block chain as described in claim 1, which is characterized in that the method is also wrapped It includes:
Data base recreation instruction is received, the block chain number for obtaining each node in block chain is instructed according to the data base recreation According to the block chain data that the node to be greater than preset proportion is approved are as standard block chain data, with the standard block chain number Distribution reconstruction of relations local data base in.
5. the distribution relation record method based on block chain as claimed in claim 4, which is characterized in that the reception database Instruction is rebuild, the block chain data for obtaining each node in block chain are instructed according to the data base recreation, to be greater than preset ratio The block chain data that the node of example is approved are as standard block chain data, with the distribution relationship weight in the standard block chain data Local data base is built to specifically include:
Data base recreation instruction is received, the block chain of each node in the block chain is obtained according to data base recreation instruction The merkle root of data;
The corresponding block chain data of merkle root that node to be greater than preset proportion is approved are as standard block chain data, with institute The distribution relationship and commission settlement records stated in standard block chain data rebuild local data base.
6. a kind of distribution relation record device based on block chain characterized by comprising
Request module is received, for receiving the distribution relation record request of the first user transmission, the distribution relation record request Distribution relationship, the signature of first user and the signature of the second user including first user and second user;
Hash authentication module is decrypted to obtain for signature of the public key using first user to first user One cryptographic Hash is decrypted the signature of the second user to obtain the second cryptographic Hash using the public key of the second user, right The distribution relationship of first user and second user carries out Hash operation and obtains third cryptographic Hash, judges first cryptographic Hash It is whether consistent with the third cryptographic Hash with second cryptographic Hash;
Broadcast module is verified, it is consistent with the third cryptographic Hash for working as first cryptographic Hash and second cryptographic Hash When, the distribution relationship of first user and second user, first user's signature and the second user are signed and broadcasted Into block chain.
7. the distribution relation record device based on block chain as claimed in claim 6, which is characterized in that mould is broadcasted in the verifying Block specifically includes:
Submodule is encrypted, is used for when first cryptographic Hash and consistent with the third cryptographic Hash second cryptographic Hash, Using platform public key to the distribution relationship of first user and second user, first user's signature and the second user Signature is encrypted;
Submodule is broadcasted, for signing the distribution relationship of encrypted first user and second user, first user Name and second user signature broadcast are into block chain.
8. the distribution relation record device based on block chain as claimed in claim 7, which is characterized in that described device is also wrapped It includes:
Inquiring and authenticating module uses the third user's for receiving the signature of distribution relational query instruction and third user Public key verifies the signature of the third user;
Verify return module, for when the signature verification of the third user passes through, obtained from local data base with it is described The distribution relationship is back to inquiry user by the relevant distribution relationship of third user;
Alternatively, the verifying return module, for obtaining and adding from block chain when the signature verification of the third user passes through Distribution relationship relevant to the third user after close is decrypted the distribution relationship using platform private key, will decrypt Distribution relationship afterwards is back to the inquiry user.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 5 when executing the computer program The step of any one the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 5 of realization the method.
CN201811373876.5A 2018-11-16 2018-11-16 Block chain-based distribution relation recording method and device and terminal equipment Active CN109660352B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811373876.5A CN109660352B (en) 2018-11-16 2018-11-16 Block chain-based distribution relation recording method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811373876.5A CN109660352B (en) 2018-11-16 2018-11-16 Block chain-based distribution relation recording method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN109660352A true CN109660352A (en) 2019-04-19
CN109660352B CN109660352B (en) 2021-12-03

Family

ID=66111353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811373876.5A Active CN109660352B (en) 2018-11-16 2018-11-16 Block chain-based distribution relation recording method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN109660352B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110334160A (en) * 2019-06-11 2019-10-15 阿里巴巴集团控股有限公司 Relationship binding method, device and equipment based on block chain
CN110597840A (en) * 2019-09-26 2019-12-20 腾讯科技(深圳)有限公司 Partner relationship establishing method, device, equipment and storage medium based on block chain
CN111144851A (en) * 2019-06-10 2020-05-12 北京中搜云悦网络技术有限公司 Block chain distribution system
CN111371785A (en) * 2020-03-02 2020-07-03 杭州溪塔科技有限公司 Block chain privacy transaction method and device and electronic equipment
CN111402011A (en) * 2020-05-29 2020-07-10 支付宝(杭州)信息技术有限公司 Block chain based commission distribution method and device
US10909252B2 (en) 2019-06-11 2021-02-02 Advanced New Technologies Co., Ltd. Blockchain-based relationship binding method, apparatus, and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170344435A1 (en) * 2016-05-24 2017-11-30 Mastercard International Incorporated Method and system for desynchronization recovery for permissioned blockchains using bloom filters
CN107426170A (en) * 2017-05-24 2017-12-01 阿里巴巴集团控股有限公司 A kind of data processing method and equipment based on block chain
CN107657553A (en) * 2017-09-21 2018-02-02 浙江惠码科技有限公司 A kind of electronic contract generation method based on alliance's chain, information anti-fake method of tracing to the source
CN108647361A (en) * 2018-05-21 2018-10-12 中国工商银行股份有限公司 A kind of date storage method, apparatus and system based on block chain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170344435A1 (en) * 2016-05-24 2017-11-30 Mastercard International Incorporated Method and system for desynchronization recovery for permissioned blockchains using bloom filters
CN107426170A (en) * 2017-05-24 2017-12-01 阿里巴巴集团控股有限公司 A kind of data processing method and equipment based on block chain
CN107657553A (en) * 2017-09-21 2018-02-02 浙江惠码科技有限公司 A kind of electronic contract generation method based on alliance's chain, information anti-fake method of tracing to the source
CN108647361A (en) * 2018-05-21 2018-10-12 中国工商银行股份有限公司 A kind of date storage method, apparatus and system based on block chain

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111144851A (en) * 2019-06-10 2020-05-12 北京中搜云悦网络技术有限公司 Block chain distribution system
CN111144851B (en) * 2019-06-10 2024-01-19 北京云悦共创网络技术有限公司 Block chain distribution system
CN110334160A (en) * 2019-06-11 2019-10-15 阿里巴巴集团控股有限公司 Relationship binding method, device and equipment based on block chain
US10909252B2 (en) 2019-06-11 2021-02-02 Advanced New Technologies Co., Ltd. Blockchain-based relationship binding method, apparatus, and device
CN110597840A (en) * 2019-09-26 2019-12-20 腾讯科技(深圳)有限公司 Partner relationship establishing method, device, equipment and storage medium based on block chain
CN110597840B (en) * 2019-09-26 2023-09-22 腾讯科技(深圳)有限公司 Partner relationship establishment method, device, equipment and storage medium based on blockchain
CN111371785A (en) * 2020-03-02 2020-07-03 杭州溪塔科技有限公司 Block chain privacy transaction method and device and electronic equipment
CN111402011A (en) * 2020-05-29 2020-07-10 支付宝(杭州)信息技术有限公司 Block chain based commission distribution method and device
CN111402011B (en) * 2020-05-29 2020-09-08 支付宝(杭州)信息技术有限公司 Block chain based commission distribution method and device
WO2021239084A1 (en) * 2020-05-29 2021-12-02 支付宝(杭州)信息技术有限公司 Blockchain-based commission

Also Published As

Publication number Publication date
CN109660352B (en) 2021-12-03

Similar Documents

Publication Publication Date Title
TWI701623B (en) Logistics information transmission method, system and device based on blockchain
US11869012B2 (en) Systems, devices, and methods for DLT-based data management platforms and data products
CN109660352A (en) A kind of distribution relation record method, apparatus and terminal device based on block chain
US20230023857A1 (en) Data processing method and apparatus, intelligent device, and storage medium
CN108805656B (en) Supply and demand matching method, platform, system and computer readable storage medium
CN110612697B (en) Method and system for efficient information retrieval of data storage layer indexes
US10942920B2 (en) Service processing system and method based on blockchain
CN110851496B (en) Method, apparatus, accounting node and medium for querying transaction information in blockchain network
CN109493047A (en) A kind of commission settlement method, device and terminal device based on block chain
WO2019214311A1 (en) Blockchain-based information supervision method and device
TW202029044A (en) Block chain transaction generation method and device
CN106296359A (en) Credible electric power networks transaction platform based on block chain technology
CN112613956B (en) Bidding processing method and device
WO2022001526A1 (en) Block chain-based trade data processing method and related device thereof
CN109635572A (en) A kind of contract signing method, apparatus and terminal device based on block chain
WO2020051710A1 (en) System and process for managing digitized security tokens
CN109684786A (en) A kind of copyright registration method, apparatus and terminal device based on block chain
Saranya et al. Efficient mobile security for E health care application in cloud for secure payment using key distribution
CN113486122A (en) Data sharing method and electronic equipment
CN109547203A (en) A kind of backup method of private key, back-up device and terminal device
CN113706261A (en) Block chain-based power transaction method, device and system
CN113344574A (en) Management method and storage medium for electric power transaction trusted data link
An et al. Achieving Secure and Efficient P2P Data Trading based on Blockchain for Internet of Things
Anwar et al. A Comprehensive Insight into Blockchain Technology: Past Development, Present Impact and Future Considerations
CN112598411A (en) Retrievable privacy authorization transfer method, apparatus and storage 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