CN110941672A - Household registration management method, device, equipment and storage medium - Google Patents

Household registration management method, device, equipment and storage medium Download PDF

Info

Publication number
CN110941672A
CN110941672A CN201911151840.7A CN201911151840A CN110941672A CN 110941672 A CN110941672 A CN 110941672A CN 201911151840 A CN201911151840 A CN 201911151840A CN 110941672 A CN110941672 A CN 110941672A
Authority
CN
China
Prior art keywords
household
information
hash value
household registration
family
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
CN201911151840.7A
Other languages
Chinese (zh)
Other versions
CN110941672B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911151840.7A priority Critical patent/CN110941672B/en
Publication of CN110941672A publication Critical patent/CN110941672A/en
Application granted granted Critical
Publication of CN110941672B publication Critical patent/CN110941672B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Abstract

The embodiment of the invention discloses a household registration management method, a household registration management device, household registration management equipment and a storage medium, wherein the method comprises the following steps: receiving a household registration association request; generating associated family membership information based on the first family membership information and the second family membership information, wherein the associated family membership information comprises personal membership information of all family members of the first family and the second family; determining a Merck tree and a hash value of a root node of the Merck tree based on personal household information of all family members in the associated family household information; constructing a new block based on the Mercker tree and the hash value of the root node to add the new block to the block chain network; and determining a storage path of the personal membership information of each family member in the associated family membership information in the Mercker tree, and returning the hash value of the root node and the storage path of the personal membership information of each family member in the Mercker tree. By adopting the embodiment of the invention, a plurality of family household registration information can be stored in an associated manner, and the flexibility of family household registration information management is improved.

Description

Household registration management method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a household registration management method, apparatus, device, and storage medium.
Background
Currently, personal household registration information is generally stored in two ways. For individuals, the family membership information is kept in national issued household scripts, and for government departments, the family membership information is centrally stored in a database.
However, at present, all home registration information is centrally stored in a database of a government agency, and although it is relatively quick to query the personal registration information of a certain person, the information can be obtained only by searching and querying the personal registration information of the direct relatives and the collateral relatives, so that the query efficiency is low. On the other hand, the storage amount of the family household registration information in the database is huge and is easy to be falsified, so that information safety hazards always exist for all people and family household registration information.
Therefore, how to improve and optimize the management method of the household registration information of individuals and families is a problem which needs to be solved urgently.
Disclosure of Invention
Embodiments of the present invention provide a household registration management method, apparatus, device, and storage medium, which can store information of a plurality of household registrations in association, thereby improving flexibility of household registration information management.
In a first aspect, an embodiment of the present invention provides a household registration management method, where the method includes:
receiving a household registration association request, wherein the household registration association request carries first household registration information of a first user and second household registration information of a second user, the first household registration information comprises personal registration information of all household members of a first household where the first user is located, and the second household registration information comprises personal registration information of all household members of a second household where the second user is located;
if the household registration association request is a valid request, determining a first household registration moving record of the first user and a second household registration moving record of the second user, and determining whether the first household registration information and the second household registration information have a household registration association relationship based on the first household registration moving record and/or the second household registration moving record;
if the first family household registration information and the second family household registration information have the household registration association relationship, generating associated family household registration information based on the first family household registration information and the second family household registration information, wherein the associated family household registration information comprises personal household registration information of all family members of the first family and the second family;
determining a Merck tree and a hash value of a root node of the Merck tree based on personal household information of all family members in the associated family household information, and sending the hash value of the root node to a common identification node so that the common identification node verifies the hash value of the root node based on the associated family household information;
receiving a signature confirmation message sent by the consensus node after the hash value of the root node passes verification, and constructing a new block based on the Mercker tree and the hash value of the root node and adding the new block into a block chain network under the condition that the signature confirmation message meets a preset consensus strategy;
and determining a storage path of the personal family information of each family member in the associated family information in the Mercker tree, and returning the hash value of the root node and the storage path of the personal family information of each family member in the Mercker tree.
With reference to the first aspect, in a possible implementation manner, the determining whether the first home information and the second home information have a home association relationship based on the first home migration record and/or the second home migration record includes:
determining whether the home household information corresponding to the first user before moving out and the home household information corresponding to the second user before moving out are the same home household information or not based on the first and second home household moving out records, if the first and second home household information are the same home household information, determining that the first and second home household information have a household association relationship, and if the first and second home household information do not have the household association relationship; alternatively, the first and second electrodes may be,
and determining whether the home household information corresponding to the first user before the first user moves out is the second home household information or not based on the first home movement record, if so, determining that the first home household information and the second home household information have the household association relationship, and if not, determining that the first home household information and the second home household information do not have the household association relationship.
With reference to the first aspect, in a possible implementation manner, the determining the mercker tree and the hash value of the root node of the mercker tree based on the personal household information of all the family members in the associated family household information includes:
performing hash calculation on the individual household registration information of each family member in the associated household registration information respectively to obtain a plurality of basic hash values;
determining at least one upper-layer hash value based on the plurality of basic hash values, wherein the upper-layer hash value is obtained by performing hash calculation on at least two basic hash values;
determining a target hash value from the at least one upper layer hash value, wherein the target hash value is obtained by performing hash calculation on the plurality of basic hash values;
determining a Mercker tree based on a plurality of basic hash values and the at least one upper layer hash value, wherein the plurality of basic hash values are hash values of leaf nodes of the Mercker tree, the at least one upper layer hash value is a hash value of a middle node of the Mercker tree, and the target hash value is a hash value of a root node of the Mercker tree.
With reference to the first aspect, in one possible implementation manner, the constructing a new chunk based on the mercker tree and the hash value of the root node and adding the new chunk to a blockchain network includes:
acquiring a block head characteristic value of the last block in a block chain network, and constructing a new block head based on the block hash value and the hash value of the root node;
constructing a new block body based on the Merckel tree;
and constructing a new block based on the new block header and the new block body, and connecting the new block to the last block so as to add the new block into the block chain network.
With reference to the first aspect, in one possible implementation, the method further includes:
receiving a household registration confirmation request, wherein the household registration inquiry request carries personal household registration information of a third user, a hash value of a first target root node and a first target storage path;
determining a first target block with a block head containing the hash value of the first target root node from the block chain network, and determining a first target basic hash value from the Mercker tree of the first target block based on the first target storage path;
performing hash calculation on the personal household registration information of the third user to obtain a hash value of the personal household registration information of the third user;
and if the first target basic hash value is consistent with the hash value of the personal household registration information of the third user, returning a household registration confirmation message.
With reference to the first aspect, in one possible implementation, the method further includes:
receiving a household registration updating request, wherein the household registration updating request carries personal household registration information of a fourth user, a hash value of a second target root node and a second target storage path;
determining a second target block with a block head containing the hash value of the second target root node from the block chain network, and determining a second target basic hash value from the Merck tree of the second target block based on the second target storage path;
performing hash calculation on the personal account information of the fourth user to obtain a hash value of the personal account information of the fourth user;
updating the Merck tree of the second target block based on the hash value of the personal membership information of the fourth user to obtain a new Merck tree, and updating the second target block based on the new Merck tree.
With reference to the first aspect, in a possible implementation manner, the household registration association request is submitted by a household registration association department, the new block stores personal household registration information of all household members in the associated household registration information, and the personal household registration information of all household members is encrypted by a private key of the household registration association department; the method also comprises
Receiving a household registration confirmation request submitted by a household registration confirmation department, wherein the household registration confirmation request submitted by the household registration confirmation department carries identity information of a fifth user and a hash value of a third target root node;
determining a third target block with a block header containing the hash value of the third target root node from the blockchain network, and determining the personal membership information of the fifth user from the third target block based on the identity information of the fifth user;
acquiring the public key of the household registration confirming department, decrypting the personal household registration information of the fifth user based on the public key of the household registration confirming department, and returning a household registration confirming message if the decryption is successful;
the household registration association department and the household registration confirmation department are sub-departments of the household registration management department, the private key of the household registration association department is a sub-private key of the household registration management department, and the public key of the household registration confirmation department is a public key of the household registration management department or a sub-public key of the household registration management department.
In a second aspect, an embodiment of the present invention provides an household registration management apparatus, where the apparatus includes:
a first receiving module, configured to receive a household registration association request, where the household registration association request carries first household registration information of a first user and second household registration information of a second user, the first household registration information includes personal registration information of all household members of a first household where the first user is located, and the second household registration information includes personal registration information of all household members of a second household where the second user is located;
a first determining module, configured to determine, when the household registration association request is an effective request, a first household registration moving record of the first user and a second household registration moving record of the second user, and determine, based on the first household registration moving record and/or the second household registration moving record, whether a household registration association relationship exists between the first household registration information and the second household registration information;
a generating module, configured to generate associated family household information based on the first family household information and the second family household information when the first family household information and the second family household information have the household association relationship, where the associated family household information includes personal household information of all family members of the first family and the second family;
a first processing module, configured to determine a tacher tree and a hash value of a root node of the tacher tree based on personal household information of all household members in the associated household information, and send the hash value of the root node to a consensus node, so that the consensus node verifies the hash value of the root node based on the associated household information;
a second processing module, configured to receive a signature confirmation message sent by the consensus node after the hash value of the root node passes verification, and construct a new block based on the merkel tree and the hash value of the root node and add the new block to a block chain network when the signature confirmation message satisfies a preset consensus policy;
a first returning module, configured to determine a storage path of the personal membership information of each family member in the associated family membership information in the mercker tree, and return the hash value of the root node and the storage path of the personal membership information of each family member in the mercker tree.
With reference to the second aspect, in one possible implementation manner, the first determining module includes:
a first determining unit, configured to determine, based on the first household registration moving record and the second household registration moving record, whether the household registration information corresponding to the first user before moving out and the household registration information corresponding to the second user before moving out are the same household registration information, if the household registration information is the same household registration information, it is determined that the first household registration information and the second household registration information have a household registration association relationship, and if the household registration information is not the same household registration information, it is determined that the first household registration information and the second household registration information do not have the household registration association relationship; alternatively, the first and second electrodes may be,
a second determining unit, configured to determine, based on the first household registration moving record, whether home household registration information corresponding to the first user before moving out is the second household registration information, if the home household registration information is the second household registration information, determine that the first household registration information and the second household registration information have the household registration association relationship, and if the home household registration information is not the second household registration information, determine that the first household registration information and the second household registration information do not have the household registration association relationship.
With reference to the second aspect, in one possible implementation manner, the first processing module includes:
the processing unit is used for respectively carrying out hash calculation on the individual household registration information of each family member in the associated household registration information to obtain a plurality of basic hash values;
a third determining unit, configured to determine at least one upper layer hash value based on the plurality of basic hash values, where one upper layer hash value is obtained by performing hash calculation on at least two basic hash values;
a fourth determining unit, configured to determine a target hash value from the at least one upper-layer hash value, where the target hash value is obtained by performing hash calculation on the plurality of base hash values;
a first constructing unit, configured to determine a tachr tree based on a plurality of basic hash values and the at least one upper-layer hash value, where the plurality of basic hash values are hash values of leaf nodes of the tachr tree, and each of the at least one upper-layer hash value except the target hash value is a hash value of a middle node of the tachr tree, and the target hash value is a hash value of a root node of the tachr tree.
With reference to the second aspect, in one possible implementation manner, the second processing module includes:
a second construction unit, configured to obtain a block header feature value of a last block in a blockchain network, and construct a new block header based on the block hash value and the hash value of the root node;
a third constructing unit, configured to construct a new block based on the mercker tree;
a fourth constructing unit, configured to construct a new block based on the new block header and the new block body, and connect the new block to the last block to add the new block to the blockchain network.
With reference to the second aspect, in a possible implementation manner, the apparatus further includes:
the second receiving module is further configured to receive a household registration confirmation request, where the household registration inquiry request carries personal household registration information of a third user, a hash value of the first target root node, and the first target storage path;
a second determining module, configured to determine, from the blockchain network, a first target block whose block header includes the hash value of the first target root node, and determine, based on the first target storage path, a first target base hash value from the merkel tree of the first target block;
the third processing module is further configured to perform a hash calculation on the personal household registration information of the third user to obtain a hash value of the personal household registration information of the third user;
and the second returning module is further used for returning the household registration confirmation message when the first target basic hash value is consistent with the hash value of the personal household registration information of the third user.
With reference to the second aspect, in a possible implementation manner, the apparatus further includes:
the third receiving module is further configured to receive a household registration update request, where the household registration update request carries personal household registration information of a fourth user, a hash value of a second target root node, and a second target storage path;
a third determining module, configured to determine, from the blockchain network, a second target block whose block header includes the hash value of the second target root node, and determine, based on the second target storage path, a second target base hash value from the merkel tree of the second target block;
the fourth processing module is further configured to perform a hash calculation on the personal household registration information of the fourth user to obtain a hash value of the personal household registration information of the fourth user;
and the updating module is further configured to update the mercker tree of the second target block based on the hash value of the personal membership information of the fourth user to obtain a new mercker tree, and update the second target block based on the new mercker tree.
With reference to the second aspect, in a possible implementation manner, the household registration association request is submitted by a household registration association department, the new block stores personal household registration information of all household members in the associated household registration information, and the personal household registration information of all household members is encrypted by a private key of the household registration association department; the device also comprises
The fourth receiving module is further configured to receive a household registration confirmation request submitted by a household registration confirmation department, where the household registration confirmation request submitted by the household registration confirmation department carries identity information of a fifth user and a hash value of a third target root node;
a fourth determining module, configured to determine, from the blockchain network, a third target block whose block header includes the hash value of the third target root node, and determine, from the third target block, personal membership information of the fifth user based on the identity information of the fifth user;
the fifth processing module is further configured to obtain the public key of the household registration confirming department, decrypt the personal household registration information of the fifth user based on the public key of the household registration confirming department, and return a household registration confirming message if decryption is successful;
the household registration association department and the household registration confirmation department are sub-departments of the household registration management department, the private key of the household registration association department is a sub-private key of the household registration management department, and the public key of the household registration confirmation department is a public key of the household registration management department or a sub-public key of the household registration management department.
In a third aspect, an embodiment of the present invention provides an apparatus, which includes a processor and a memory, where the processor and the memory are connected to each other. The memory is configured to store a computer program that supports the terminal device to execute the method provided by the first aspect and/or any one of the possible implementation manners of the first aspect, where the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method provided by the first aspect and/or any one of the possible implementation manners of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to implement the method provided by the first aspect and/or any one of the possible implementation manners of the first aspect.
In the embodiment of the present invention, the existence of the association relationship between the first home location information corresponding to the first user and the second home location information corresponding to the second user is determined by registering the first user and the second user, so that the first home location information and the second home location information can be ensured to have the associated storage condition, and the reliability is high. Meanwhile, associated family household information is generated based on the first family household information and the second family household information, and then the individual household information hash value of each family member in the associated family household information is written into the block chain network by constructing the Mercury tree, so that the individual user information of each family member in the associated family household information can be ensured not to be falsified, and the storage stability of the associated family household information is improved. Furthermore, the confirmation and the update of the personal household registration information of a certain user can be completed based on the household registration confirmation request and the household registration update request, so that the efficiency of household registration management is further improved, and the applicability is higher.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a household registration management method according to an embodiment of the present invention;
fig. 2 is a flow chart of a household registration management method according to an embodiment of the present invention;
fig. 3a is a schematic view of a scenario for determining a household registration association according to an embodiment of the present invention;
fig. 3b is a schematic diagram of another scenario for determining a household registration association according to an embodiment of the present invention;
FIG. 4a is a diagram illustrating a scenario for determining a Mercker tree according to an embodiment of the present invention;
FIG. 4b is a diagram illustrating another scenario for determining a Mercker tree according to an embodiment of the present invention;
FIG. 4c is a diagram illustrating another scenario for determining a Mercker tree according to an embodiment of the present invention;
FIG. 5a is a schematic diagram of a block header according to an embodiment of the present invention;
FIG. 5b is a block diagram according to an embodiment of the present invention;
fig. 6 is another flow chart of the household registration management method according to the embodiment of the present invention;
fig. 7 is a schematic flowchart of a household registration management method according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating a scenario for updating the Mercker tree according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a household registration management apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of an apparatus provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a household registration management method according to an embodiment of the present invention. In fig. 1, when a household association request 10 carrying household information of a plurality of users (e.g., first household information 101 of a first user and second household information 102 of a second user) is received, whether a household association relationship exists between the first household information 101 and the second household information 102 may be determined according to a household migration record of the first user and/or a household migration record of the second user. When it is determined that the first home information 101 and the second home information 102 have a home association relationship, the first home information 101 and the second home information 102 may be combined to obtain an associated home information 20. The related family membership information 20 includes personal membership information of all family members of the family where the first user is located, which is included in the first family membership information 101, and personal membership information of all family members of the family where the second user is located, which is included in the second family membership information 102.
After the associated family membership information 20 is obtained, hash values 40 for the root nodes of the merkel tree 30 and the merkel tree 30 used to construct the block may be determined based on the individual membership information of each family member in the associated family membership information. At this time, the hash value 40 of the root node may be sent to common nodes (e.g., the common node 50a, the common node 50b, and the common node 50c) in the blockchain network, so that the common node 50a, the common node 50b, and the common node 50c verify the hash value 40 of the root node, and receive a signature confirmation message sent by the common node 50a, the common node 50b, and the common node 50c after the hash value 40 of the root node is verified. When the received signature confirmation message satisfies the predetermined consensus policy, a new block 60 is constructed based on the above-mentioned merkel tree 30 and the hash value 40 of the root node, and the new block 60 is added to the main chain 70 in the blockchain network, so as to achieve the purpose of storing the associated household information 20 including the first household information 101 and the second household information 102 in the blockchain network.
The common node 50a, the common node 50b, and the common node 50c are only some nodes in the blockchain network, and the number of the specific common nodes may be determined based on an actual application scenario, which is not limited herein.
It should be understood that the predetermined consensus strategies include, but are not limited to, a Proof of Work (PoW), a Proof of rights mechanism (PoS), a Proof of rights mechanism (released Proof of stamp, DPoS) Pragmatic Byzantine (PBFT), a Ripple consensus algorithm, etc., and may be specifically determined based on an actual application scenario, and are not limited herein. In addition, anyone, any enterprise, can set up a server to join the blockchain network into one node. Therefore, a blockchain network can be understood as a database that can process and share data in a blockchain network composed of a plurality of sites, different geographic locations or a plurality of organizations.
Referring to fig. 2, fig. 2 is a flow chart of a household registration management method according to an embodiment of the present invention. The household registration management method provided by the embodiment of the invention can include the following steps S101 to S106.
S101, receiving a household registration association request.
In some possible embodiments, the household registration association request may be a request submitted by any user to manage and store the household registration information of the user and the household registration information of another user in an association manner, may also be a request submitted by two users together to associate and store two pieces of household registration information, and may also be a request generated when a third party platform (such as a government agency) and the like performs associated storage on the household registration information of the relevant user, and may specifically be determined based on an actual application scenario, which is not limited herein.
The household registration association request carries first household registration information of a first user and household registration information of a second user, the first household registration information comprises personal registration information of all household members in a family where the first user is located, and the second household registration information comprises personal registration information of all household members in a family where the second user is located. That is, after receiving a membership association request, the family membership information of two users and the individual membership information of each family member contained in each family membership information are also received.
The individual household registration information of each family member includes, but is not limited to, a name, a past name, a gender, a birth date, a relationship with a family owner, a place of birth, a native place, a citizen identification number, a family address, an occupation, a cultural degree, and the like, and can be determined based on an actual application scenario, which is not limited herein. It should be noted that, the information presentation forms of the first home location information and the second home location information in the home location association request include, but are not limited to, a character string, binary data, and the like, and may also be determined based on an actual application scenario, which is not limited herein.
S102, if the household registration association request is an effective request, determining a first household registration moving record of the first user and a second household registration moving record of the second user, and determining whether the first household registration information and the second household registration information have a household registration association relationship based on the first household registration moving record and/or the second household registration moving record.
In some possible embodiments, after receiving the household registration association request, if the household registration association request further carries the first digital signature of the first household registration information and the second digital signature of the second household registration information, it may be further determined whether the household registration association request is a valid request based on the first digital signature and the second digital signature, and if the household registration association request is a valid request, the first household registration information and the second household registration information are further processed. If not, a request error message may be returned to inform the requesting sender that the request is an invalid request, and the request is resubmitted to the membership association request.
Specifically, the first public key of the first user and the second public key of the second user may be obtained, the first digital signature of the first home membership information is decrypted based on the first public key to obtain the first digest information of the first home membership information, and the second digital signature of the second home membership information is decrypted based on the second public key to obtain the second digest information of the second home membership information. On the other hand, the hash calculation may be performed on the first home information and the second home information carried in the home association request, respectively, to obtain the third digest information of the first home information and the fourth digest information of the second home information.
Further, at this time, the first summary information and the third summary information of the first home membership information may be compared, and the second summary information and the fourth summary information of the second home membership information may be compared. If the first summary information and the third summary information of the first home domino information are consistent, and the second summary information and the fourth summary information of the second home domino information are consistent, it can be described that the first home domino information and the second home domino information are not falsified in the submitting process of the domino association request, and further it can be described that the domino association request is a valid request from the side. On the other hand, if the first summary information and the third summary information of the first home location information are not consistent, and/or the second summary information and the fourth summary information of the second home location information are not consistent, it indicates that the home location information of at least one home is falsified in the process of submitting the home location association request, and this may further determine that the home location association request is an invalid request.
For example, it is assumed that the digital signature of the first home information is 0010101 and the digital signature of the second home information is 0110101. If the first digest information obtained by decrypting the digital signature 0010101 with the first public key is 1000100, the third digest information obtained by performing the hash calculation on the first family membership information is also 1000100, and the first digest information is consistent with the third digest information. If the second digest information obtained by decrypting the digital signature 0110101 with the second public key is 1000101, and the fourth digest information obtained by performing the hash calculation on the second home information is also 1000101, the second digest information and the fourth digest information are identical. Based on the above implementation, it can be stated that the first home location information and the second home location information are not tampered in the process of submitting the home location association request, and further, that the home location association request is a valid request.
Optionally, when the household registration association request is verified, the verification may be performed in a manner of verifying identity information (e.g., whether the user is a preset blacklist user) of a submitting party of the request, a management authority (whether the household registration information can be obtained and the household registration information can be associated), and a manner of verifying whether a request parameter in the household registration association request includes an abnormal parameter, and a specific implementation manner may be determined based on an actual application scenario, and is not limited herein.
In some possible embodiments, when the household registration association request is a valid request, the first household registration record of the first user and the second household registration record of the second user may be determined, and then whether a household association relationship exists between the first household registration information and the second household registration information is determined based on the first household registration record and/or the second household registration record. The first household registration moving record and the second household registration moving record respectively include a detailed description that the first user and the second user move from one household registration information to another household registration information, and a specific representation form of any household registration moving record can be determined based on an actual application scenario, which is not limited herein.
Specifically, when the first user has a first user movement record and the second user has a second user movement record, the home information corresponding to the first user before the first user movement and the home information corresponding to the second user before the second user movement can be determined based on the first user movement record and the second user movement record, and the home information corresponding to the first user before the first user movement and the home information corresponding to the second user before the second user movement are compared. If the home membership information corresponding to the first user before moving out and the home membership information corresponding to the second user before moving out are the same home membership information, it can be said that the first home membership information and the second home membership information have a membership association relationship. Otherwise, it is determined that the first family membership information and the second family membership information do not have a membership association relationship.
For example, referring to fig. 3a, fig. 3a is a schematic view of a scenario for determining a household registration association according to an embodiment of the present invention. In fig. 3a, it can be determined that the user a has moved from the home a based on the user's home movement record, that is, the home information of the home a is the home information of the home where the user a has moved (the user a is a member of the home in the home a). Based on the family membership record of the user B, it can be determined that the user B has moved out of the family B, that is, the family membership information of the family B is the family membership information where the user B was located before moving out (with B being a family member in the family B). At this time, the family household information of the family a and the family household information of the family B are compared, if the family household information of the family a is consistent with the family household information of the family B, it indicates that the user a and the user B are family members in the same family before moving out, and at this time, it can indicate that the family household information corresponding to the user a and the family household information corresponding to the user B have a certain household association relationship. If the family membership information of the family a is inconsistent with the family membership information of the family B, it indicates that the user a and the user B are family members in different families before moving out, and at this time, it may indicate that the family membership information corresponding to the user a and the family membership information corresponding to the user B do not have a membership association relationship.
Optionally, when only one of the first user and the second user has a user registration record (for example, the first user has a first user registration record and the second user does not have a second user registration record), the home user registration information corresponding to the first user before the first user is transferred may be determined based on the first user registration record, and the home user registration information corresponding to the first user before the first user is transferred may be compared with the home user registration information of the second user. If the corresponding home information before the first user moves out and the home information of the second user are the same home information, it can be said that the first home information and the second home information have a home association relationship. Otherwise, it is determined that the first family membership information and the second family membership information do not have a membership association relationship.
For example, referring to fig. 3b, fig. 3b is a schematic view illustrating another scenario for determining a household membership association according to an embodiment of the present invention. In fig. 3b, it can be determined that the user a has moved from the home a based on the user's home movement record, that is, the home information of the home a is the home information of the home where the user a has moved (the user a is a member of the home in the home a). At this time, the family household information of the family a is compared with the family household information of the user B, if the family household information of the family a is consistent with the family household information of the user B, the user A and the user B are family members in the same family before moving out, and at this time, the family household information corresponding to the user A and the family household information corresponding to the user B have a certain family household association relationship. If the family membership information of the family a is inconsistent with the family membership information of the user B, it indicates that the user A and the user B are family members in different families before moving out, and at this time, it can be indicated that the family membership information corresponding to the user A and the family membership information corresponding to the user B do not have a membership association relationship.
S103, if the first family household information and the second family household information have a household association relationship, generating associated household information based on the first family household information and the second family household information.
In some possible embodiments, when the first home location information and the second home location information have a home location association relationship, the first home location information and the second home location information may be combined to generate a single associated home location information. The associated family membership information includes personal membership information of all family members in the first family membership information and personal membership information of all family members in the second family membership information.
Specifically, the associated family membership information may further include a membership relationship between the family member in the first family membership information and the family member in the second family membership information, for example, assuming that the owner in the first family membership information and the owner in the second family membership information are brother relationships in the same family membership information corresponding to the moved family membership, a membership relationship such as a table sister, a table brother, and the like between the members in the associated family membership information may be determined, and a specific membership relationship may be determined based on the individual membership information of the specific member of the first family membership information and the second family membership information, which is not limited herein.
It should be noted that, the specific existence manner of the individual household registration information of each family member in the associated household registration information may be determined based on the actual application scenario, and is not limited herein.
S104, determining the Merck tree and the hash value of the root node of the Merck tree based on the personal household information of all family members in the associated family household information, and sending the hash value of the root node to the consensus node so that the consensus node verifies the hash value of the root node based on the associated family household information.
In some possible embodiments, after determining the associated family membership information, hash calculation may be performed on the individual household membership information of each family member in the associated family household information, to obtain a basic hash value of the individual household membership information of each family member, and then at least one upper-layer hash value is determined based on the obtained basic hash values. At least two basic hash values are subjected to hash calculation to obtain one upper-layer hash value.
After obtaining the at least one upper-level hash value, a target hash value obtained by hashing all the base hash values may be determined from the at least one upper-level hash value, so as to determine the merkel tree based on the plurality of base hash values and the at least one hash value. Each basic hash value is a leaf node of the merkel tree, and one leaf node corresponds to only one basic hash value, the target hash value is a hash value of a root node of the merkel tree, and the other upper-layer hash values except the target hash value in the at least one upper-layer hash value are hash values of intermediate nodes of the merkel tree.
Specifically, after obtaining the basic hash values of the individual household registration information of each family member in the associated family household registration information, the basic hash values may be arranged horizontally (a specific arrangement manner may be based on a birth date, a first letter sequence, and the like, and may be determined specifically based on an actual application scenario, which is not limited herein). When the number of the basic hash values is an even number, every two basic hash values can be connected in series in sequence and hash calculation is performed on the two basic hash values after the two basic hash values are connected in series to obtain a plurality of upper-layer hash values. Each upper-layer hash value (hereinafter referred to as a first upper-layer hash value for convenience of description) obtained at this time is obtained by connecting two basic hash values in series and then performing hash calculation. When the number of the first upper layer hash values is 1, only one upper layer hash value can be determined as the target hash value, and a merkel tree including two leaf nodes and a root node can be obtained. When the number of the first upper-layer nodes is not 1 and is an even number, connecting every two upper-layer hash values in series again and performing hash calculation to obtain at least one second upper-layer hash value, and so on until the last upper-layer hash value is obtained. At this time, the last upper-layer hash value is the hash value of the root node of the merkel tree, the rest upper-layer hash values are the hash values of the intermediate nodes of the merkel tree, and each basic hash value is a leaf node of the merkel tree.
For example, referring to fig. 4a, fig. 4a is a schematic view of a scenario for determining a merkel tree according to an embodiment of the present invention. In fig. 4a, it is assumed that the single related family membership information includes the individual membership information 1 of the family member 1, the individual membership information 2 of the family member 2, the individual membership information 3 of the family member 3, and the individual membership information 4 of the family member 4. At this time, the individual household information 1 of the family member 1, the individual household information 2 of the family member 2, the individual household information 3 of the family member 3, and the individual household information 4 of the family member 4 are respectively subjected to hash calculation to obtain a hash value 1, a hash value 2, a hash value 3, and a hash value 4 (all of which are basic hash values). At this time, the hash value 1 and the hash value 2 may be connected in series and hash calculation may be performed on the serially connected hash values to obtain a hash value 12, the hash value 3 and the hash value 4 may be connected in series and hash calculation may be performed on the serially connected hash values to obtain a hash value 34, and at this time, the hash value 12 and the hash value 34 are both upper-layer hash values. Further, the hash value 12 and the hash value 34 may be concatenated again and the concatenated hash values may be hashed to obtain the last hash value 1234. At this time, a tachr tree can be constructed by the basic hash values (hash value 1, hash value 2, hash value 3, and hash value 4), the upper hash values (hash value 12 and hash value 34), and the target hash value (hash value 1234), and the hash values 1, 2, 3, and 4 are hash values of leaf nodes of the tachr tree, the hash values 12 and 34 are hash values of intermediate nodes of the tachr tree, and the hash value 1234 is a hash value of a root node of the tachr tree.
Optionally, when the number of the basic hash values is an odd number, each two basic hash values may be sequentially connected in series and hash calculation may be performed on the two basic hash values after the two basic hash values are connected in series, so as to obtain a plurality of upper layer hash values. And at the moment, each obtained first upper-layer hash value is obtained by connecting two basic hash values in series and then performing hash calculation, and one basic hash value does not participate in the calculation of the first upper-layer hash value. At this time, the basic hash value calculated for participating in the first hash value and the obtained first upper-layer hash value may be together, based on the implementation manner, obtained as at least one second upper-layer hash value, and so on, until the last upper-layer hash value is obtained. At this time, the last upper-layer hash value is the hash value of the root node of the merkel tree, and the rest upper-layer hash values are the hash values of the intermediate nodes of the merkel tree.
For example, referring to fig. 4b, fig. 4b is a schematic diagram of another scenario for determining a merkel tree according to an embodiment of the present invention. In fig. 4b, it is assumed that the related family membership information includes the individual membership information 1 of the family member 1, the individual membership information 2 of the family member 2, and the individual membership information 3 of the family member 3. At this time, hash calculation is performed on the individual household information 1 of the family member 1, the individual household information 2 of the family member 2, and the individual household information 3 of the family member 3, respectively, to obtain a hash value 1, a hash value 2, and a hash value 3 (all of which are basic hash values). At this time, since the number of the basic hash values is an odd number, the hash value 1 and the hash value 2 may be connected in series and hash calculation may be performed on the hash values after the series connection to obtain the hash value 12. Further, the hash value 12 and the hash value 3 may be concatenated and the concatenated hash values may be hashed to obtain the last hash value 123. At this time, a tachr tree can be constructed by the basic hash values (hash value 1, hash value 2, and hash value 3), the upper hash value (hash value 12), and the target hash value (hash value 123), and the hash values 1, 2, and 3 are hash values of leaf nodes of the tachr tree, the hash value 12 is a hash value of a middle node of the tachr tree, and the hash value 123 is a hash value of a root node of the tachr tree.
Optionally, when the number of the basic hash values is an odd number, any one basic hash value may be copied to obtain an even number of basic hash values, and then every two basic hash values are sequentially connected in series again and hash calculation is performed on the two basic hash values after the series connection to obtain a plurality of upper-layer hash values. And at the moment, each obtained first upper-layer hash value is obtained by connecting two basic hash values in series and then performing hash calculation, and one basic hash value does not participate in the calculation of the first upper-layer hash value. At this time, the basic hash value calculated for participating in the first hash value and the obtained first upper-layer hash value may be together, based on the implementation manner, obtained as at least one second upper-layer hash value, and so on, until the last upper-layer hash value is obtained. At this time, the last upper-layer hash value is the hash value of the root node of the merkel tree, and the rest upper-layer hash values are the hash values of the intermediate nodes of the merkel tree.
For example, referring to fig. 4c, fig. 4c is a schematic diagram of another scenario for determining a merkel tree according to an embodiment of the present invention. The related family membership information includes individual membership information 1 of the family member 1, individual membership information 2 of the family member 2, and individual membership information 3 of the family member 3. At this time, hash calculation is performed on the individual household information 1 of the family member 1, the individual household information 2 of the family member 2, and the individual household information 3 of the family member 3, respectively, to obtain a hash value 1, a hash value 2, a hash value 3, and a hash value 4 (all of which are basic hash values). Since the number of the basic hash values is odd, the hash value 3 may be copied to obtain two identical hash values 3, so as to obtain an even number of basic hash values. Further, the hash value 1 and the hash value 2 may be connected in series and hash calculation may be performed on the hash value after the series connection to obtain a hash value 12, the hash value 3 and the hash value 3 (obtained by replication) may be connected in series and hash calculation may be performed on the hash value after the series connection to obtain a hash value 33, where the hash value 12 and the hash value 33 are both upper hash values. Further, the hash value 12 and the hash value 33 may be concatenated again and the concatenated hash values may be hashed to obtain the last hash value 1233. At this time, a tachr tree can be constructed from the base hash values (hash value 1, hash value 2, hash value 3), the upper hash values (hash value 12 and hash value 33), and the target hash value (hash value 1233), and the hash values 1, 2, and 3 are hash values of leaf nodes of the tachr tree, the hash values 12 and 33 are hash values of intermediate nodes of the tachr tree, and the hash value 1233 is a hash value of a root node of the tachr tree.
Further, when the number of the upper layer hash values obtained from the basic hash value based on any one of the above implementation manners is greater than 1 and is an odd number, the upper layer hash value may be processed by using any one of the above processing methods for odd number of the basic hash values, and the specific implementation manner is not limited herein.
In some possible embodiments, after determining the hash value of the root node of the merkel tree, the hash value of the root node may be sent to a consensus node in the blockchain network, so that the consensus node verifies the hash value of the root node based on the associated home domicile information. Specifically, each consensus node may perform hash calculation on the individual household registration information of each family member in the associated household registration information to obtain a hash value of the individual household registration information of each family member, and obtain a hash value of a root node of a mercker tree based on the obtained plurality of hash values. And each consensus node compares the hash value of the root node calculated by the consensus node with the received hash value of the root node, if the hash value of the root node calculated by the consensus node is consistent with the received hash value of the root node, the received hash value of the root node can be determined to be an accurate and effective hash value, and at the moment, the consensus node returns a signature confirmation message. Optionally, the signature confirmation message may be any form of information used for notifying that the hash value of the root node passes verification, and specific information content is not limited herein. Meanwhile, the signature confirmation message generated by each consensus node can represent the generation node of the signature confirmation message, so that after the signature confirmation message of each consensus node is received, the consensus node which sends the signature confirmation message can be determined according to the signature confirmation message. Optionally, after generating the signature confirmation message, each common node may perform hash calculation on the signature confirmation message to generate a digest, and encrypt the digest by its own private key to prevent the signature confirmation message from being tampered.
And S105, receiving a signature confirmation message sent by the consensus node after the hash value of the root node passes the verification, and constructing a new block based on the Mercker tree and the hash value of the root node and adding the new block into the block chain network under the condition that the signature confirmation message meets a preset consensus strategy.
In some possible embodiments, signature confirmation messages sent by a plurality of consensus nodes in the block chain network may be received, and the new block may be determined to be a valid block when each received signature confirmation message satisfies a predetermined consensus policy. The preset consensus strategy may be that the hash value of the root node is considered to be a valid hash value after a certain proportion of consensus nodes in all the consensus nodes in the blockchain network verify the hash value of the root node, for example, after a signature confirmation message sent by ninety-five percent of the consensus nodes is received, the hash value of the root node may be considered to be a valid block, and a new block may be constructed based on the tacle tree and the hash value of the root node. Or, the preset consensus strategy may be that when receiving a signature confirmation message sent by a plurality of consensus nodes in the blockchain network, it is determined whether the consensus node sending the signature confirmation message belongs to a preset consensus node based on a signature in the signature confirmation message, and the hash value of the root node may be considered as a valid hash value when the consensus node sending the signature confirmation message is the preset consensus node and/or the consensus node sending the signature confirmation message exceeds all the consensus nodes in the blockchain network by a certain ratio, and at this time, a new block may be constructed based on the tacle tree and the hash value of the root node. It should be particularly noted that the predetermined consensus strategy may further include, but is not limited to, a workload certification mechanism (Proof of office, PoW), a rights and interests certification mechanism (Proof of post, PoS), a rights and rights granted certification mechanism (released Proof of post, DPoS) Practical Byzantine mechanism (PBFT), a Ripple consensus algorithm, and the like, and may be specifically determined based on an actual application scenario, which is not limited herein.
In some possible embodiments, the blockchain network is composed of a plurality of blocks, each block includes a block header and a block body, the block header stores the characteristic value of the input information, and the version number, the timestamp, the difficulty value, and the like, and the block body stores the input information. Referring to fig. 5a, fig. 5a is a schematic composition diagram of a block header provided in an embodiment of the present invention. As shown in fig. 5a, one block above each block is a parent block, and the next block also includes a block header and a block body, where the block header stores an input information characteristic value of the current block, a block header characteristic value of the parent block, a version number, a timestamp, and a difficulty value, and so on, so that block data stored in each block in the block chain is associated with block data stored in the parent block, thereby ensuring the security of input information in the block. When a new block is generated, the block hash value of the last block in the current blockchain network may be obtained as the block header characteristic value of the parent block in the block header of the new block, and the timestamp may be updated to the generation time of the new block. Meanwhile, different random numbers are tried, and the characteristic value calculation is carried out for multiple times, so that the calculated block head characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
wherein, SHA256 is a characteristic value algorithm used for calculating a characteristic value; version is version information of the relevant block protocol in the block chain; prev _ hash is a block header characteristic value of a parent block of the new block; merkle root is an input information characteristic value; ntime is the update time of the update timestamp; nbits is the current difficulty, is a fixed value within a period of time, and is determined again after exceeding a fixed time period; x is a random number; TARGET is a feature threshold, which can be determined from nbits. Thus, when the random number satisfying the above formula is obtained by calculation, the block header of the new block can be constructed based on the hash value of the root node of the mercker tree, the timestamp, the difficulty value, the version number, and the block header characteristic value of the parent block. And storing the complete Merck tree and the personal household registration information of each family member in the associated household registration information into a new block to obtain a new block.
S106, determining a storage path of the personal membership information of each family member in the related family membership information in the Mercker tree, and returning the hash value of the root node and the storage path of the personal membership information of each family member in the Mercker tree.
In some possible embodiments, after a new block is constructed based on the hash values of the above-mentioned mercke tree and root node and the new block is added to the blockchain network, a storage path of the personal membership information of each family member may be further generated based on the specific location (for example, located at the next leaf node) of the personal membership information of each family member in the mercke tree, so that after the personal membership information storage path of any family member and the hash value of the root node of the corresponding mercke tree are obtained, the hash value of the personal membership information of the family member may be determined from the blockchain network.
Referring to fig. 5b, fig. 5b is a block composition diagram according to an embodiment of the present invention. As shown in fig. 5b, the hash value of the individual household information of each family member in the zone block can be obtained based on the hash value of the root node stored in the block header. Since the hash value of the personal membership information of each family member is one leaf node of the merkel tree in the block body, the hash value of the personal membership information of each family member has a unique storage location in the block body. Based on the above description, it is obvious that after determining the storage path of the personal membership information of any family member in the mercker tree and the hash value of the root node contained in the block header of the block where the mercker tree is located, the hash value of the personal membership information of the family member can be determined. Based on the implementation manner, after a new block is added into the block chain network, the storage path of the personal membership information of each family member in the associated family membership information in the merkel tree can be determined, and the hash value of the root node and the storage path of the personal membership information of each family member in the merkel tree are returned.
In the embodiment of the present invention, the existence of the association relationship between the first home location information corresponding to the first user and the second home location information corresponding to the second user is determined by registering the first user and the second user, so that the first home location information and the second home location information can be ensured to have the associated storage condition, and the reliability is high. Meanwhile, associated family household information is generated based on the first family household information and the second family household information, and then the individual household information hash value of each family member in the associated family household information is written into the block chain network by constructing the Mercury tree, so that the individual user information of each family member in the associated family household information can be ensured not to be falsified, and the storage stability of the associated family household information is improved.
Referring to fig. 6, fig. 6 is another flow chart of the household registration management method according to the embodiment of the present invention. The household registration management method shown in fig. 6 may include the following steps S201 to S204.
S201, receiving a household registration confirmation request.
In some possible embodiments, the household registration association request may be a request submitted by any user to confirm personal household information, or may also be a request generated when a third-party platform (e.g., a government agency) confirms personal household information of a relevant user, and may be determined based on an actual application scenario, which is not limited herein.
The household registration confirmation request carries personal household information of a third user, a hash value of a root node corresponding to a block storing the personal household information of the user (for convenience of description, hereinafter referred to as a hash value of a first target root node), and a storage path of the personal household information of the user in a merkel tree (for aspect description, hereinafter referred to as a first target storage path).
The personal household registration information of the third user includes, but is not limited to, a name, a past name, a gender, a birth date, a relationship with a family owner, a place of birth, a native place, a citizen identification number, a family address, an occupation, a cultural degree, and the like, and may be determined based on an actual application scenario, which is not limited herein. It should be noted that, the information presentation form of the personal membership information of the third user in the membership confirmation request includes, but is not limited to, a character string, binary data, and the like, and may also be determined based on an actual application scenario, which is not limited herein.
S202, a first target block with a block head containing the hash value of the first target root node is determined from the block chain network, and a first target basic hash value is determined from the Mercker tree of the first target block based on a first target storage path.
In some possible embodiments, after receiving the membership confirmation request, the hash values of the root nodes of the mercker trees stored in the block headers of all blocks in the blockchain network may be obtained, and the hash values of the first target root nodes may be compared, so as to determine the target block containing the hash value of the first target root node. At this time, the block body of the target block may be analyzed to obtain a target tachr tree stored in the block body, and a first target basic hash value (hash value of a target leaf node) corresponding to a first target storage path in the target tachr tree is determined based on the first target storage path carried in the household registration confirmation request, so as to confirm the personal household registration information of the third user carried in the household registration confirmation request based on the first target hash value.
S203, carrying out hash calculation on the personal household registration information of the third user to obtain a hash value of the personal household registration information of the third user, and returning a household registration confirmation message if the first target basic hash value is consistent with the hash value of the personal household registration information of the third user.
In some possible embodiments, after obtaining the first target hash value, the hash value of the personal membership information of the third user may be obtained by performing a hash calculation on the personal membership information of the third user, and the hash value of the personal membership information of the third user may be compared with the first target basic hash value. If the hash value of the individual household registration information of the third user is completely consistent with the first target basic hash value, the individual household registration information carried in the household registration confirmation request can be determined to be correct individual household registration information. And at this time, generating and returning a registration confirmation message to the submitting party of the registration confirmation request so as to inform the submitting party that the personal registration information of the third user submitted by the submitting party is consistent with the personal registration information stored in the block chain network.
In some possible embodiments, when the household association request is a request submitted by a household association department, and when a new block is constructed, the personal household information for managing each family member in the household information may be encrypted by a private key of the household association department and stored in the new block. Based on the above implementation manner, when the household registration confirmation request submitted by the household registration confirmation department is received, the identity information of the fifth user and the hash value of the third target root node, which are carried by the household registration confirmation request submitted by the household registration confirmation department, can be obtained, and the third target block of which the block head contains the hash value of the third target root node is determined from the block chain network. And further determining the personal household information of the fifth user from the third target block based on the identity information of the fifth user, wherein the personal household information of the fifth user is stored in the block body of the third target block and is encrypted by the private key of the corresponding household association department when being stored. After the personal account information of the fifth user is obtained from the third target block, the public key of the account confirmation department may be obtained, and the personal account information of the fifth user is decrypted based on the public key, if the decryption is successful, the account confirmation department and the account association department agree with the personal account information of the fifth user, thereby completing the confirmation of the personal account information of the fifth user. The household registration association department and the household registration confirmation department are sub-departments of the household registration management department, the private key of the household registration association department is a sub-private key of the household registration management department, and the public key of the household registration confirmation department is a public key of the household registration management department or a sub-public key of the household registration management department. Furthermore, the household management department can generate a plurality of sub-private keys and send the sub-private keys to each sub-department based on the mnemonic words and the private keys thereof, and can also generate a plurality of sub-public keys and send the sub-public keys to each department (or send the public keys thereof to each sub-department).
Referring to fig. 7, fig. 7 is a schematic flowchart of a household registration management method according to an embodiment of the present invention. The household registration management method provided in fig. 7 may include the following steps S301 to S304.
S301, a household registration updating request is received.
In some possible embodiments, the household registration update request may be a request submitted by any user to update the personal household registration information stored in the blockchain network, or may be a request generated when a third-party platform (e.g., a government agency) performs a management update on the household registration information of the relevant user, and may be specifically determined based on an actual application scenario, which is not limited herein.
The household registration update request carries personal household registration information of a fourth user, a hash value of a root node corresponding to a block storing the personal household registration information of the user (for convenience of description, hereinafter referred to as a hash value of a second target root node), and a storage path of the personal household registration information of the user in a mercker tree (for aspect description, hereinafter referred to as a second target storage path).
The personal household registration information of the fourth user includes, but is not limited to, a name, a past name, a gender, a birth date, a relationship with a family owner, a place of birth, a native place, a citizen identification number, a family address, an occupation, a cultural degree, and the like, and may be determined based on an actual application scenario, which is not limited herein. It should be noted that, the information presentation form in the household registration update request includes, but is not limited to, a character string, binary data, and the like, and may also be determined based on an actual application scenario, which is not limited herein.
S302, a second target block with a block head containing the hash value of a second target root node is determined from the block chain network, and a second target basic hash value is determined from the Merckel tree of the second target block based on a second target storage path.
In some possible embodiments, a specific implementation process of determining a second target block with a block head containing a hash value of a second target root node from the blockchain network and determining a second target base hash value from the merkel tree of the second target block based on a second target storage path may refer to the implementation manner shown in step S202 in fig. 6, and is not described herein again.
S303, carrying out Hash calculation on the personal account information of the fourth user to obtain a Hash value of the personal account information of the fourth user.
In some possible embodiments, the specific determination process of performing the hash calculation on the personal membership information of the fourth user to obtain the hash value of the personal membership information of the fourth user may also refer to the implementation manner shown in step S202 in fig. 6, which is not described herein.
S304, updating the Merck tree of the second target block based on the hash value of the personal membership information of the fourth user to obtain a new Merck tree, and updating the second target block based on the new Merck tree.
In some possible embodiments, when updating the mercker tree of the second target block based on the hash value of the personal membership information of the fourth user, the second target base hash value of the mercker tree in the block of the second target block may be updated based on the hash value of the personal membership information of the fourth user, and the upper layer hash value obtained based on the second target base hash value and the hash value of the root node may be updated at the same time to obtain a new mercker tree. Meanwhile, the hash value of the primitive root node in the block header needs to be updated based on the new merkel tree.
Fig. 8 is a schematic view of a scenario for updating a mercker tree according to an embodiment of the present invention, as shown in fig. 8. In the merkel tree in fig. 8, the hash value 1 of the personal membership information 1, the hash value 2 of the personal membership information 2, the hash value 3 of the personal membership information 3, and the hash value 4 of the personal membership information 4 are leaf nodes of the merkel tree, respectively. At this time, assuming that the basic hash value that needs to be updated and is determined based on the household registration update request is hash value 4, the hash value 4 in the merkel tree may be replaced with the hash value of the personal household registration information of the fourth user, and the upper hash value 34 in the merkel tree and the hash value 1234 of the root node are updated together with the hash value 3, thereby completing the update of the merkel tree.
In the embodiment of the present invention, the existence of the association relationship between the first home location information corresponding to the first user and the second home location information corresponding to the second user is determined by registering the first user and the second user, so that the first home location information and the second home location information can be ensured to have the associated storage condition, and the reliability is high. Meanwhile, associated family household information is generated based on the first family household information and the second family household information, and then the individual household information hash value of each family member in the associated family household information is written into the block chain network by constructing the Mercury tree, so that the individual user information of each family member in the associated family household information can be ensured not to be falsified, and the storage stability of the associated family household information is improved. Furthermore, the confirmation and the update of the personal household registration information of a certain user can be completed based on the household registration confirmation request and the household registration update request, so that the efficiency of household registration management is further improved, and the applicability is higher.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a household registration management apparatus according to an embodiment of the present invention. The device 1 provided by the embodiment of the invention comprises:
a first receiving module 11, configured to receive a household registration association request, where the household registration association request carries first household registration information of a first user and second household registration information of a second user, the first household registration information includes personal registration information of all household members of a first household where the first user is located, and the second household registration information includes personal registration information of all household members of a second household where the second user is located;
a first determining module 12, configured to determine, when the household registration association request is a valid request, a first household registration moving record of the first user and a second household registration moving record of the second user, and determine, based on the first household registration moving record and/or the second household registration moving record, whether the first household registration information and the second household registration information have a household association relationship;
a generating module 13, configured to generate associated family household information based on the first family household information and the second family household information when the first family household information and the second family household information have the household association relationship, where the associated family household information includes personal household information of all family members of the first family and the second family;
a first processing module 14, configured to determine a tacle tree and a hash value of a root node of the tacle tree based on personal household information of all household members in the associated household information, and send the hash value of the root node to a consensus node, so that the consensus node verifies the hash value of the root node based on the associated household information;
a second processing module 15, configured to receive a signature confirmation message sent by the consensus node after the hash value of the root node passes verification, and construct a new block based on the merkel tree and the hash value of the root node and add the new block to a block chain network when the signature confirmation message satisfies a preset consensus policy;
a first returning module 16, configured to determine a storage path of the personal membership information of each family member in the associated family membership information in the mercker tree, and return the hash value of the root node and the storage path of the personal membership information of each family member in the mercker tree.
In some possible embodiments, the first determining module 12 includes:
a first determining unit 121, configured to determine, based on the first household registration moving record and the second household registration moving record, whether the household registration information corresponding to the first user before moving out and the household registration information corresponding to the second user before moving out are the same household registration information, if the household registration information is the same household registration information, it is determined that the first household registration information and the second household registration information have a household registration association relationship, and if the household registration information is not the same household registration information, it is determined that the first household registration information and the second household registration information do not have the household registration association relationship; alternatively, the first and second electrodes may be,
a second determining unit 122, configured to determine, based on the first household registration record, whether the corresponding household registration information before the first user is moved is the second household registration information, if the corresponding household registration information is the second household registration information, determine that the first household registration information and the second household registration information have the household registration association relationship, and if the corresponding household registration information is not the second household registration information, determine that the first household registration information and the second household registration information do not have the household registration association relationship.
In some possible embodiments, the first processing module 14 includes:
a processing unit 141, configured to perform hash calculation on the individual household registration information of each family member in the associated household registration information to obtain a plurality of basic hash values;
a third determining unit 142, configured to determine at least one upper-layer hash value based on the plurality of basic hash values, where one upper-layer hash value is obtained by performing hash calculation on at least two basic hash values;
a fourth determining unit 143, configured to determine a target hash value from the at least one upper layer hash value, where the target hash value is obtained by performing a hash calculation on the plurality of base hash values;
a first constructing unit 144, configured to determine a tachr tree based on a plurality of basic hash values and the at least one upper-layer hash value, where the plurality of basic hash values are hash values of leaf nodes of the tachr tree, and each of the at least one upper-layer hash value except the target hash value is a hash value of a middle node of the tachr tree, and the target hash value is a hash value of a root node of the tachr tree.
In some possible embodiments, the second processing module 15 includes:
a second constructing unit 151, configured to obtain a block header feature value of a last block in a block chain network, and construct a new block header based on the block hash value and the hash value of the root node;
a third constructing unit 152, configured to construct a new block based on the above-mentioned merkel tree;
a fourth constructing unit 153, configured to construct a new block based on the new block header and the new block body, and connect the new block to the end of the last block to add the new block to the blockchain network.
In some possible embodiments, the above-mentioned device 1 further comprises:
the second receiving module 17 is further configured to receive a household registration confirmation request, where the household registration inquiry request carries the personal household registration information of the third user, the hash value of the first target root node, and the first target storage path;
a second determining module 18, further configured to determine a first target block in a block header that includes the hash value of the first target root node from the blockchain network, and determine a first target base hash value from the merkel tree of the first target block based on the first target storage path;
a third processing module 19, further configured to perform a hash calculation on the personal household registration information of the third user to obtain a hash value of the personal household registration information of the third user;
the second returning module 20 is further configured to return a household identity confirmation message when the first target basic hash value is consistent with the hash value of the personal household information of the third user.
In some possible embodiments, the above-mentioned device 1 further comprises:
a third receiving module 21, configured to receive a household registration update request, where the household registration update request carries personal household registration information of a fourth user, a hash value of a second target root node, and a second target storage path;
a third determining module 22, configured to determine a second target block with a block header containing the hash value of the second target root node from the blockchain network, and determine a second target base hash value from the merkel tree of the second target block based on the second target storage path;
the fourth processing module 23 is further configured to perform a hash calculation on the personal household registration information of the fourth user to obtain a hash value of the personal household registration information of the fourth user;
the updating module 24 is further configured to update the merck tree of the second target block based on the hash value of the personal membership information of the fourth user to obtain a new merck tree, and update the second target block based on the new merck tree.
In some possible embodiments, the household affiliation request is submitted by a household affiliation department, the new block stores personal household information of all household members in the associated household affiliation information, and the personal household affiliation information of all household members is encrypted by a private key of the household affiliation department; the above apparatus 1 further comprises:
the fourth receiving module 25 is further configured to receive a household registration confirmation request submitted by a household registration confirmation department, where the household registration confirmation request submitted by the household registration confirmation department carries identity information of a fifth user and a hash value of the third target root node;
a fourth determining module 26, configured to determine a third target block with a block header containing a hash value of the third target root node from the blockchain network, and determine personal membership information of the fifth user from the third target block based on the identity information of the fifth user;
the fifth processing module 27 is further configured to obtain the public key of the household registration confirming authority, decrypt the personal household registration information of the fifth user based on the public key of the household registration confirming authority, and if the decryption is successful, return a household registration confirming message;
the household registration association department and the household registration confirmation department are sub-departments of the household registration management department, the private key of the household registration association department is a sub-private key of the household registration management department, and the public key of the household registration confirmation department is a public key of the household registration management department or a sub-public key of the household registration management department.
In a specific implementation, the device 1000 may execute, through each built-in functional module thereof, the implementation manners provided in each step in fig. 2, fig. 6, and/or fig. 7, which may specifically refer to the implementation manners provided in each step, and are not described herein again.
In the embodiment of the present invention, the existence of the association relationship between the first home location information corresponding to the first user and the second home location information corresponding to the second user is determined by registering the first user and the second user, so that the first home location information and the second home location information can be ensured to have the associated storage condition, and the reliability is high. Meanwhile, associated family household information is generated based on the first family household information and the second family household information, and then the individual household information hash value of each family member in the associated family household information is written into the block chain network by constructing the Mercury tree, so that the individual user information of each family member in the associated family household information can be ensured not to be falsified, and the storage stability of the associated family household information is improved. Furthermore, the confirmation and the update of the personal household registration information of a certain user can be completed based on the household registration confirmation request and the household registration update request, so that the efficiency of household registration management is further improved, and the applicability is higher.
Referring to fig. 10, fig. 10 is a schematic structural diagram of an apparatus provided in an embodiment of the present invention. As shown in fig. 10, the apparatus 1000 in the present embodiment may include: the processor 1001, the network interface 1004, and the memory 1005, and the apparatus 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 10, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the device 1000 shown in fig. 10, the network interface 1004 may provide network communication functions; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
receiving a household registration association request, wherein the household registration association request carries first household registration information of a first user and second household registration information of a second user, the first household registration information comprises personal registration information of all household members of a first household where the first user is located, and the second household registration information comprises personal registration information of all household members of a second household where the second user is located;
if the household registration association request is a valid request, determining a first household registration moving record of the first user and a second household registration moving record of the second user, and determining whether the first household registration information and the second household registration information have a household registration association relationship based on the first household registration moving record and/or the second household registration moving record;
if the first family household registration information and the second family household registration information have the household registration association relationship, generating associated family household registration information based on the first family household registration information and the second family household registration information, wherein the associated family household registration information comprises personal household registration information of all family members of the first family and the second family;
determining a Merck tree and a hash value of a root node of the Merck tree based on personal household information of all family members in the associated family household information, and sending the hash value of the root node to a common identification node so that the common identification node verifies the hash value of the root node based on the associated family household information;
receiving a signature confirmation message sent by the consensus node after the hash value of the root node passes verification, and constructing a new block based on the Mercker tree and the hash value of the root node and adding the new block into a block chain network under the condition that the signature confirmation message meets a preset consensus strategy;
and determining a storage path of the personal family information of each family member in the associated family information in the Mercker tree, and returning the hash value of the root node and the storage path of the personal family information of each family member in the Mercker tree.
In some possible embodiments, the processor 1001 is configured to:
determining whether the home household information corresponding to the first user before moving out and the home household information corresponding to the second user before moving out are the same home household information or not based on the first and second home household moving out records, if the first and second home household information are the same home household information, determining that the first and second home household information have a household association relationship, and if the first and second home household information do not have the household association relationship; alternatively, the first and second electrodes may be,
and determining whether the home household information corresponding to the first user before the first user moves out is the second home household information or not based on the first home movement record, if so, determining that the first home household information and the second home household information have the household association relationship, and if not, determining that the first home household information and the second home household information do not have the household association relationship.
In some possible embodiments, the processor 1001 is configured to:
performing hash calculation on the individual household registration information of each family member in the associated household registration information respectively to obtain a plurality of basic hash values;
determining at least one upper-layer hash value based on the plurality of basic hash values, wherein the upper-layer hash value is obtained by performing hash calculation on at least two basic hash values;
determining a target hash value from the at least one upper layer hash value, wherein the target hash value is obtained by performing hash calculation on the plurality of basic hash values;
determining a Mercker tree based on a plurality of basic hash values and the at least one upper layer hash value, wherein the plurality of basic hash values are hash values of leaf nodes of the Mercker tree, the at least one upper layer hash value is a hash value of a middle node of the Mercker tree, and the target hash value is a hash value of a root node of the Mercker tree.
In some possible embodiments, the processor 1001 is configured to:
acquiring a block head characteristic value of the last block in a block chain network, and constructing a new block head based on the block hash value and the hash value of the root node;
constructing a new block body based on the Merckel tree;
and constructing a new block based on the new block header and the new block body, and connecting the new block to the last block so as to add the new block into the block chain network.
In some possible embodiments, the processor 1001 is further configured to:
receiving a household registration confirmation request, wherein the household registration inquiry request carries personal household registration information of a third user, a hash value of a first target root node and a first target storage path;
determining a first target block with a block head containing the hash value of the first target root node from the block chain network, and determining a first target basic hash value from the Mercker tree of the first target block based on the first target storage path;
performing hash calculation on the personal household registration information of the third user to obtain a hash value of the personal household registration information of the third user;
and if the first target basic hash value is consistent with the hash value of the personal household registration information of the third user, returning a household registration confirmation message.
In some possible embodiments, the processor 1001 is further configured to:
receiving a household registration updating request, wherein the household registration updating request carries personal household registration information of a fourth user, a hash value of a second target root node and a second target storage path;
determining a second target block with a block head containing the hash value of the second target root node from the block chain network, and determining a second target basic hash value from the Merck tree of the second target block based on the second target storage path;
performing hash calculation on the personal account information of the fourth user to obtain a hash value of the personal account information of the fourth user;
updating the Merck tree of the second target block based on the hash value of the personal membership information of the fourth user to obtain a new Merck tree, and updating the second target block based on the new Merck tree.
In some possible embodiments, the household affiliation request is submitted by a household affiliation department, the new block stores personal household information of all household members in the associated household affiliation information, and the personal household affiliation information of all household members is encrypted by a private key of the household affiliation department; the processor 1001 is further configured to:
receiving a household registration confirmation request submitted by a household registration confirmation department, wherein the household registration confirmation request submitted by the household registration confirmation department carries identity information of a fifth user and a hash value of a third target root node;
determining a third target block with a block header containing the hash value of the third target root node from the blockchain network, and determining the personal membership information of the fifth user from the third target block based on the identity information of the fifth user;
acquiring the public key of the household registration confirming department, decrypting the personal household registration information of the fifth user based on the public key of the household registration confirming department, and returning a household registration confirming message if the decryption is successful;
the household registration association department and the household registration confirmation department are sub-departments of the household registration management department, the private key of the household registration association department is a sub-private key of the household registration management department, and the public key of the household registration confirmation department is a public key of the household registration management department or a sub-public key of the household registration management department.
It should be understood that in some possible embodiments, the processor 1001 may be a Central Processing Unit (CPU), and the processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The memory may include both read-only memory and random access memory, and provides instructions and data to the processor. The portion of memory may also include non-volatile random access memory. For example, the memory may also store device type information.
In a specific implementation, the device 1000 may execute, through each built-in functional module thereof, the implementation manners provided in each step in fig. 2, fig. 6, and/or fig. 7, which may specifically refer to the implementation manners provided in each step, and are not described herein again.
In the embodiment of the present invention, the existence of the association relationship between the first home location information corresponding to the first user and the second home location information corresponding to the second user is determined by registering the first user and the second user, so that the first home location information and the second home location information can be ensured to have the associated storage condition, and the reliability is high. Meanwhile, associated family household information is generated based on the first family household information and the second family household information, and then the individual household information hash value of each family member in the associated family household information is written into the block chain network by constructing the Mercury tree, so that the individual user information of each family member in the associated family household information can be ensured not to be falsified, and the storage stability of the associated family household information is improved. Furthermore, the confirmation and the update of the personal household registration information of a certain user can be completed based on the household registration confirmation request and the household registration update request, so that the efficiency of household registration management is further improved, and the applicability is higher.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and is executed by a processor to implement the method provided in each step in fig. 2, fig. 6, and/or fig. 7, which may specifically refer to implementation manners provided in each step, and are not described herein again.
The computer readable storage medium may be an internal storage unit of the task processing device provided in any of the foregoing embodiments, for example, a hard disk or a memory of an electronic device. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash card (flash card), and the like, which are provided on the electronic device. The computer readable storage medium may further include a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), and the like. Further, the computer readable storage medium may also include both an internal storage unit and an external storage device of the electronic device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the electronic device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
The terms "first", "second", and the like in the claims, in the description and in the drawings of the present invention are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. A household registration management method, the method comprising:
receiving a household registration association request, wherein the household registration association request carries first household registration information of a first user and second household registration information of a second user, the first household registration information comprises personal registration information of all household members of a first household where the first user is located, and the second household registration information comprises personal registration information of all household members of a second household where the second user is located;
if the household registration association request is an effective request, determining a first household registration moving record of the first user and a second household registration moving record of the second user, and determining whether the first family household registration information and the second family household registration information have a household registration association relationship based on the first household registration moving record and/or the second household registration moving record;
if the first family household registration information and the second family household registration information have the household registration association relationship, generating associated family household registration information based on the first family household registration information and the second family household registration information, wherein the associated family household registration information comprises personal household registration information of all family members of the first family and the second family;
determining a Merck tree and a hash value of a root node of the Merck tree based on personal household information of all family members in the associated family household information, and sending the hash value of the root node to a consensus node so that the consensus node verifies the hash value of the root node based on the associated family household information;
receiving a signature confirmation message sent by the consensus node after the hash value of the root node passes verification, and constructing a new block based on the Mercker tree and the hash value of the root node and adding the new block into a block chain network under the condition that the signature confirmation message meets a preset consensus strategy;
and determining a storage path of the personal family information of each family member in the associated family information in the Mercker tree, and returning the hash value of the root node and the storage path of the personal family information of each family member in the Mercker tree.
2. The method of claim 1, wherein the determining whether a domicile association exists between the first home domicile information and the second home domicile information based on the first domicile migration record and/or the second domicile migration record comprises:
determining whether the home household registration information corresponding to the first user before moving out and the home household registration information corresponding to the second user before moving out are the same home household registration information or not based on the first home household registration moving out record and the second home household registration moving out record, if the home household registration information is the same home household registration information, determining that the first home household registration information and the second home household registration information have a home registration association relationship, and if the home household registration information is not the same home household registration information, determining that the first home household registration information and the second home information do not have the home registration association relationship; alternatively, the first and second electrodes may be,
determining whether the corresponding home household registration information before the first user moves out is the second home household registration information or not based on the first home household registration moving record, if so, determining that the first home household registration information and the second home household registration information have the home registration association relationship, and if not, determining that the first home household registration information and the second home household registration information do not have the home registration association relationship.
3. The method of claim 1, wherein determining the mercker tree and the hash value of the root node of the mercker tree based on the personal household information of all the family members in the associated family household information comprises:
performing hash calculation on the individual household registration information of each family member in the associated household registration information respectively to obtain a plurality of basic hash values;
determining at least one upper-layer hash value based on the plurality of basic hash values, wherein the upper-layer hash value is obtained by performing hash calculation on at least two basic hash values;
determining a target hash value from the at least one upper layer hash value, wherein the target hash value is obtained by performing hash calculation on the plurality of basic hash values;
determining the Mercker tree based on a plurality of basic hash values and the at least one upper layer hash value, wherein the basic hash values are hash values of leaf nodes of the Mercker tree, the other upper layer hash values except the target hash value in the at least one upper layer hash value are hash values of middle nodes of the Mercker tree, and the target hash value is a hash value of a root node of the Mercker tree.
4. The method of claim 1, wherein constructing and adding a new chunk to a blockchain network based on the merkel tree and the hash value of the root node comprises:
acquiring a block head characteristic value of the last block in a block chain network, and constructing a new block head based on the block hash value and the hash value of the root node;
constructing a new block body based on the Mercker tree;
constructing a new block based on the new block header and the new block body, and connecting the new block to the last block to add the new block to the blockchain network.
5. The method of claim 1, further comprising:
receiving a household registration confirmation request, wherein the household registration inquiry request carries personal household registration information of a third user, a hash value of a first target root node and a first target storage path;
determining a first target block containing the hash value of the first target root node in a block head from the blockchain network, and determining a first target basic hash value from the Mercker tree of the first target block based on the first target storage path;
performing hash calculation on the personal household registration information of the third user to obtain a hash value of the personal household registration information of the third user;
and if the first target basic hash value is consistent with the hash value of the personal household registration information of the third user, returning a household registration confirmation message.
6. The method of claim 1, further comprising:
receiving a household registration updating request, wherein the household registration updating request carries personal household registration information of a fourth user, a hash value of a second target root node and a second target storage path;
determining a second target block with a block head containing the hash value of the second target root node from the blockchain network, and determining a second target basic hash value from the Merck tree of the second target block based on the second target storage path;
performing hash calculation on the personal household registration information of the fourth user to obtain a hash value of the personal household registration information of the fourth user;
updating the Merck tree of the second target block based on the hash value of the personal membership information of the fourth user to obtain a new Merck tree, and updating the second target block based on the new Merck tree.
7. The method of claim 1, wherein the household association request is submitted by a household association department, and the new block stores personal household information of all household members in the associated household information, and the personal household information of all household members is encrypted by a private key of the household association department; the method also comprises
Receiving a household registration confirmation request submitted by a household registration confirmation department, wherein the household registration confirmation request submitted by the household registration confirmation department carries identity information of a fifth user and a hash value of a third target root node;
determining a third target block with a block header containing the hash value of the third target root node from the blockchain network, and determining the personal domicile information of the fifth user from the third target block based on the identity information of the fifth user;
acquiring the public key of the household registration confirmation department, decrypting the personal household registration information of the fifth user based on the public key of the household registration confirmation department, and returning a household registration confirmation message if the decryption is successful;
the household association department and the household confirmation department are sub-departments of the household management department, the private key of the household association department is a sub-private key of the household management department, and the public key of the household confirmation department is a public key of the household management department or a sub-public key of the household management department.
8. An household registration management apparatus, the apparatus comprising:
a first receiving module, configured to receive a household registration association request, where the household registration association request carries first household registration information of a first user and second household registration information of a second user, the first household registration information includes personal registration information of all household members of a first household where the first user is located, and the second household registration information includes personal registration information of all household members of a second household where the second user is located;
a second determining module, configured to determine, if the household registration association request is an effective request, a first household registration moving record of the first user and a second household registration moving record of the second user, and determine, based on the first household registration moving record and/or the second household registration moving record, whether a household registration association relationship exists between the first household registration information and the second household registration information;
a generating module, configured to generate associated family household registration information based on the first family household registration information and the second family household registration information when the first family household registration information and the second family household registration information have the household registration association relationship, where the associated family household registration information includes personal household registration information of all family members of the first family and the second family;
the first processing module is used for determining a Merck tree and a hash value of a root node of the Merck tree based on personal household information of all family members in the associated family household information, and sending the hash value of the root node to a consensus node so that the consensus node verifies the hash value of the root node based on the associated family household information;
the second processing module is used for receiving a signature confirmation message sent by the consensus node after the hash value of the root node passes the verification, and constructing a new block based on the Mercker tree and the hash value of the root node and adding the new block into a block chain network under the condition that the signature confirmation message meets a preset consensus strategy;
a first returning module, configured to determine a storage path of the personal membership information of each family member in the associated family membership information in the mercker tree, and return the hash value of the root node and the storage path of the personal membership information of each family member in the mercker tree.
9. A device comprising a processor and a memory, the processor and memory interconnected;
the memory for storing a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method of any one of claims 1 to 7.
CN201911151840.7A 2019-11-21 2019-11-21 Household registration management method, device, equipment and storage medium Active CN110941672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911151840.7A CN110941672B (en) 2019-11-21 2019-11-21 Household registration management method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911151840.7A CN110941672B (en) 2019-11-21 2019-11-21 Household registration management method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110941672A true CN110941672A (en) 2020-03-31
CN110941672B CN110941672B (en) 2023-11-24

Family

ID=69907341

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911151840.7A Active CN110941672B (en) 2019-11-21 2019-11-21 Household registration management method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110941672B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111554407A (en) * 2020-04-16 2020-08-18 深圳中兴网信科技有限公司 Crowd marking method, system and computer readable storage medium
CN111984616A (en) * 2020-08-04 2020-11-24 中国人民银行数字货币研究所 Method, device and system for updating shared file
CN112131489A (en) * 2020-09-28 2020-12-25 青岛海尔科技有限公司 Friend relationship management method, system, storage medium and electronic device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101849912B1 (en) * 2017-05-25 2018-04-19 주식회사 코인플러그 Method for providing certificate service based on smart contract and server using the same
CN108765230A (en) * 2018-04-10 2018-11-06 平安科技(深圳)有限公司 A kind of resident's household register approaches to IM and server
CN110175840A (en) * 2019-04-19 2019-08-27 华中科技大学 Method, client, alliance's chain and the system of light wallet mechanism are realized in alliance's chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101849912B1 (en) * 2017-05-25 2018-04-19 주식회사 코인플러그 Method for providing certificate service based on smart contract and server using the same
CN108765230A (en) * 2018-04-10 2018-11-06 平安科技(深圳)有限公司 A kind of resident's household register approaches to IM and server
CN110175840A (en) * 2019-04-19 2019-08-27 华中科技大学 Method, client, alliance's chain and the system of light wallet mechanism are realized in alliance's chain

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111554407A (en) * 2020-04-16 2020-08-18 深圳中兴网信科技有限公司 Crowd marking method, system and computer readable storage medium
CN111984616A (en) * 2020-08-04 2020-11-24 中国人民银行数字货币研究所 Method, device and system for updating shared file
CN111984616B (en) * 2020-08-04 2023-08-01 中国人民银行数字货币研究所 Method, device and system for updating shared file
CN112131489A (en) * 2020-09-28 2020-12-25 青岛海尔科技有限公司 Friend relationship management method, system, storage medium and electronic device

Also Published As

Publication number Publication date
CN110941672B (en) 2023-11-24

Similar Documents

Publication Publication Date Title
CN110708171B (en) Block chain consensus voting method, device, equipment and storage medium
CN111080295B (en) Electronic contract processing method and device based on blockchain
CN110633963B (en) Electronic bill processing method, electronic bill processing device, computer readable storage medium and computer readable storage device
US8914351B2 (en) Method and system for secure automated document registration from social media networks
CN108769230B (en) Transaction data storage method, device, server and storage medium
CN110489946B (en) Copyright authentication method, device, equipment and storage medium based on block chain
US20130138619A1 (en) Method and system for automated document registration with cloud computing
US20100153407A1 (en) Method and system for automated document registration
CN110309259B (en) Audit result data storage and query methods, and audit item storage method and device
CN110941672A (en) Household registration management method, device, equipment and storage medium
CN109861996B (en) Block chain-based relationship proving method, device, equipment and storage medium
CN111488372A (en) Data processing method, device and storage medium
CN112163240A (en) Block chain based distributed government affair architecture unifying method and system
CN112804354B (en) Method and device for data transmission across chains, computer equipment and storage medium
CN111488626A (en) Data processing method, device, equipment and medium based on block chain
CN113255014A (en) Data processing method based on block chain and related equipment
CN112187471A (en) Data copying method, system and medium based on block chain and intelligent contract
CN111367923A (en) Data processing method, data processing device, node equipment and storage medium
CN115514470B (en) Storage method and system for community correction data security
CN110750735A (en) False event identification method, device, equipment and storage medium based on block chain network
CN112583606B (en) Security verification method, server, terminal and storage medium
CN110995440B (en) Work history confirming method, device, equipment and storage medium
JP5001968B2 (en) Certificate authority setting device and certificate authority setting method for setting a certificate authority that guarantees the validity of the public key of each user in a social network
Xu et al. A two-dimensional sharding model for access control and data privilege management of blockchain
CN116757857B (en) Block chain-based business insurance data management method, system, terminal 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