CN110659967A - House management method and device based on block chain - Google Patents

House management method and device based on block chain Download PDF

Info

Publication number
CN110659967A
CN110659967A CN201910919579.4A CN201910919579A CN110659967A CN 110659967 A CN110659967 A CN 110659967A CN 201910919579 A CN201910919579 A CN 201910919579A CN 110659967 A CN110659967 A CN 110659967A
Authority
CN
China
Prior art keywords
house
information
transferred
block
transfer
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
CN201910919579.4A
Other languages
Chinese (zh)
Other versions
CN110659967B (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 CN201910919579.4A priority Critical patent/CN110659967B/en
Publication of CN110659967A publication Critical patent/CN110659967A/en
Application granted granted Critical
Publication of CN110659967B publication Critical patent/CN110659967B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0645Rental transactions; Leasing transactions
    • 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/602Providing cryptographic facilities or services
    • 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
    • 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/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/16Real estate

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioethics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Tourism & Hospitality (AREA)
  • Primary Health Care (AREA)
  • Human Resources & Organizations (AREA)
  • Development Economics (AREA)
  • Databases & Information Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the application discloses a house management method based on a block chain, which comprises the following steps: the method comprises the steps of obtaining house transfer information sent by an agent node, wherein the house transfer information comprises house information to be transferred, house ownership information to be transferred, transfer time information to be transferred and transfer data volume information to be transferred, obtaining a first block from a house block chain, determining that house state information in the first block is matched with the house transfer information to be transferred, indicating that the house transfer information of a house to be transferred is correct by the agent node, generating a house transfer block to be transferred according to the house information to be transferred, the house ownership information to be transferred, the transfer time information to be transferred and the transfer data volume information to be transferred, and adding the house transfer block to be transferred into the house block chain. By adopting the method and the system, the transaction condition of each house is uploaded to the block chain, so that the agent node or the house user and the like can know the specific information of the house, and the efficiency and the reliability of house management are improved.

Description

House management method and device based on block chain
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method and an apparatus for managing a house based on a blockchain.
Background
With the development of economy, the development bias of different places is different, and with the more convenience of transportation, the employment situation selected by each person is different, which means that many people may choose to work in different countries. Many people may choose to rent for short-term rentals for a number of reasons, on the one hand because acquiring ownership of a house may require a lot of financial resources, on the other hand for the occupants, the current residence may not be a long-term residence, and for the occupants, may only have something in the residence, may only live temporarily, etc. At present, most people can obtain a more satisfactory house for renting through introduction by acquaintances, inquiry by intermediaries, house renting software and the like, on-site viewing by advertisements and the like. When the agent and the house-renting software release the related information of the house to be rented, the related information is generally provided by the owner of the house to be rented, and in the process, some certificates and other materials provided by the owner are checked, however, when the owner hides some conditions, the house to be rented released by the agent and the house-renting software may deviate from the actual conditions, the legal rights and interests of the tenant are likely to be damaged, and further, the credibility, the reputation and the like of the agent and the house-renting software are affected, so that the management of the house is difficult.
Disclosure of Invention
The embodiment of the application provides a house management method and device based on a block chain, and the house management effectiveness and efficiency can be improved.
A first aspect of an embodiment of the present application provides a house management method based on a block chain, including:
acquiring a house to-be-transferred message sent by an agent node, wherein the house to-be-transferred message comprises house information to be transferred, house owner information to be transferred, time information to be transferred and data volume information to be transferred;
acquiring a first block from a house block chain, and acquiring a first private key in a key pair provided by a node to which a house corresponding to the house information to be transferred belongs; decrypting the first block according to the first private key; the first block comprises house state information; the first block is a block with the latest time stamp in the blocks associated with the house information to be transferred;
and if the decrypted house state information in the first block is matched with the house to-be-transferred message, generating a house to-be-transferred block according to the house to-be-transferred information, the house owner information to be transferred, the house to-be-transferred time information and the data volume to be transferred, and adding the house to-be-transferred block into the house block chain.
The house state information in the first block comprises house information, house ownership information, expected transfer time information and an expected transfer data volume range;
the method further comprises the following steps:
acquiring the house ownership person information, the expected transfer time information and the expected transfer data volume range in the house state information;
if the information of the house ownership person to be transferred is the same as the information of the house ownership person, the information of the time to be transferred is the same as the information of the expected transfer time, and the information of the data volume to be transferred is in the range of the expected transfer data volume, determining that the house state information in the decrypted first block is matched with the information of the house ownership person to be transferred;
and if the information of the house owner to be transferred is different from the information of the house owner, or the information of the time to be transferred is different from the information of the expected transfer time, or the information of the data volume to be transferred is not in the range of the expected transfer data volume, determining that the house state information in the decrypted first block is not matched with the information of the house owner to be transferred.
The house state information in the first block comprises house information, house owner information, short-term transfer starting time, short-term transfer duration and short-term transfer data volume information;
the method further comprises the following steps:
acquiring the house ownership information of the house state information in the decrypted first block, and acquiring the short-term ownership information, the short-term transfer starting time and the short-term transfer duration if the house ownership information to be transferred is the same as the house ownership information;
determining short-term transfer ending time according to the short-term transfer starting time and the short-term transfer duration, and if the transfer starting time in the to-be-transferred time information is before the short-term transfer ending time or the transfer starting time and the transfer ending time are the same, determining that the house state information in the decrypted first block is not matched with the house to-be-transferred message;
and if the transfer starting time in the transfer time information is after the short-term transfer ending time, determining that the house state information in the decrypted first block is matched with the house transfer message.
The house to-be-transferred message further comprises a digital signature, wherein the digital signature is obtained by the proxy node generating a proxy hash value according to the house to-be-transferred message and encrypting the proxy hash value based on a second private key;
the method further comprises the following steps:
decrypting the digital signature through a public key in a key pair provided by the node to which the house belongs, and if the digital signature is not decrypted successfully, sending a house proxy right invalid message to the proxy node;
and if the digital signature is successfully decrypted, generating a verification hash value according to the house transfer message, and if the verification hash value is the same as the proxy hash value, executing the process of decrypting the first block according to the first private key.
The generating a block to be transferred of the house according to the information of the house to be transferred, the information of the owner of the house to be transferred, the information of the time to be transferred and the information of the data amount to be transferred comprises the following steps:
generating a block to be linked according to the house information to be transferred, the house owner information to be transferred, the time information to be transferred and the data volume information to be transferred, and verifying the block to be linked through a common identification mechanism;
if the block to be subjected to chain winding passes the verification, taking a hash value generated according to the block to be subjected to chain winding as a current hash value, acquiring a second block with the latest block timestamp in the house block chain, taking the hash value of the second block as a forward hash value, acquiring current network time, and taking the current network time as a timestamp;
and generating the block to be transferred of the house according to the block to be linked, the current hash value, the forward hash value and the timestamp.
Wherein the method further comprises:
counting capacity information corresponding to the house to-be-transferred message;
if the capacity information is larger than a block capacity threshold value in the house block chain, generating a house hash value corresponding to the house information, and recording a corresponding relation between the house hash value and the house information;
the generating of the to-be-linked chain block according to the to-be-transferred house information, the to-be-transferred house owner information, the to-be-transferred time information and the to-be-transferred data volume information comprises the following steps:
and generating the block to be linked according to the house hash value, the information of the house ownership to be transferred, the information of the time to be transferred and the information of the data volume to be transferred.
Wherein the method further comprises:
receiving a house query request sent by a target terminal, wherein the house query request comprises a house number corresponding to the house information to be transferred;
acquiring the first block associated with the house information to be transferred from the house block chain according to the house number; the first block is a block with the latest block time stamp in the blocks associated with the house information to be transferred;
acquiring a first private key in the key pair provided by the node to which the house corresponding to the house information to be transferred belongs, and decrypting the first block according to the first private key;
and sending the house state information in the decrypted first block to the target terminal.
A second aspect of the embodiments of the present application provides a house management device based on a block chain, where the device includes:
the system comprises a receiving module, a transfer module and a transfer module, wherein the receiving module is used for acquiring a house to-be-transferred message sent by an agent node, and the house to-be-transferred message comprises house to-be-transferred information, house owner information to be transferred, transfer time information to be transferred and data volume information to be transferred;
the first obtaining module is used for obtaining a first block from the house block chain and obtaining a first private key in a key pair provided by a node to which the house corresponding to the information of the house to be transferred belongs; the first block comprises house state information; the first block is a block with the latest time stamp in the blocks associated with the house information to be transferred;
the decryption module is used for decrypting the first block according to the first private key;
and the first generation module is used for generating a block to be transferred of the house according to the information of the house to be transferred, the information of the owner of the house to be transferred, the information of the time to be transferred and the information of the data volume to be transferred if the house state information in the decrypted first block is matched with the information to be transferred of the house, and adding the block to be transferred of the house into the house block chain.
The house state information in the first block comprises house information, house ownership information, expected transfer time information and an expected transfer data volume range;
the device further comprises:
a second obtaining module, configured to obtain the house owner information, the expected transfer time information, and the expected transfer data volume range in the house state information;
a first determining module, configured to determine that the house state information in the decrypted first chunk matches the house to-be-transferred message if the house owner information to be transferred is the same as the house owner information, the time information to be transferred is the same as the expected transfer time information, and the data volume information to be transferred is within the expected transfer data volume range;
the first determining module is further configured to determine that the house state information in the decrypted first block is not matched with the house to-be-transferred message if the house owner information to be transferred is different from the house owner information, or the time to be transferred is different from the expected transfer time information, or the data volume to be transferred is not within the expected transfer data volume range.
The house state information in the first block comprises house information, house owner information, short-term transfer starting time, short-term transfer duration and short-term transfer data volume information;
the device further comprises:
a third obtaining module, configured to obtain the house owner information of the house state information in the decrypted first block, and if the house owner information to be transferred is the same as the house owner information, obtain the short-term owner information, the short-term transfer start time, and the short-term transfer duration;
a second determining module, configured to determine a short-term transfer ending time according to the short-term transfer starting time and the short-term transfer duration, and if the to-be-transferred starting time in the to-be-transferred time information is before the short-term transfer ending time or the to-be-transferred starting time is the same as the short-term transfer ending time, determine that the house state information in the decrypted first block is not matched with the house to-be-transferred message;
the second determining module is further configured to determine that the house state information in the decrypted first block matches the house to-be-transferred message if the to-be-transferred start time in the to-be-transferred time information is after the short-term transfer end time.
The house to-be-transferred message further comprises a digital signature, wherein the digital signature is obtained by the proxy node generating a proxy hash value according to the house to-be-transferred message and encrypting the proxy hash value based on a second private key;
the device further comprises:
the decryption module is further configured to decrypt the digital signature through a public key in a key pair provided by the node to which the house belongs;
the first sending module is used for sending a house agency right invalid message to the agency node if the digital signature is not decrypted successfully;
and the second generation module is used for generating a verification hash value according to the house transfer message if the digital signature is successfully decrypted, and executing the process of decrypting the first block according to the first private key through the decryption module if the verification hash value is the same as the proxy hash value.
Wherein the first generating module comprises:
the first generation unit is used for generating a to-be-linked chain block according to the to-be-transferred house information, the to-be-transferred house owner information, the to-be-transferred time information and the to-be-transferred data volume information;
a verification unit, configured to verify the block to be uplink through a common identification mechanism;
a second generation unit, configured to, if the block to be linked is verified to be passed, take a hash value generated according to the block to be linked as a current hash value, obtain a second block with a latest block timestamp in the house block chain, take the hash value of the second block as a previous hash value, obtain a current network time, and take the current network time as a timestamp;
the second generating unit is further configured to generate the block to be transferred of the house according to the block to be uplink, the current hash value, the next hash value and the timestamp.
Wherein the apparatus further comprises:
the statistical module is used for counting the capacity information corresponding to the to-be-transferred message of the house;
a third generating module, configured to generate a house hash value corresponding to the house information if the capacity information is greater than a block capacity threshold in the house block chain, and record a corresponding relationship between the house hash value and the house information;
in the aspect of generating a to-be-linked chain block according to the to-be-transferred house information, the to-be-transferred house owner information, the to-be-transferred time information and the to-be-transferred data volume information, the first generation module is specifically configured to:
and generating the block to be linked according to the house hash value, the information of the house ownership to be transferred, the information of the time to be transferred and the information of the data volume to be transferred.
Wherein the apparatus further comprises:
the receiving module is further configured to receive a house query request sent by a target terminal, where the house query request includes a house number corresponding to the house information to be transferred;
the first obtaining module is further configured to obtain the first block associated with the house information to be transferred from the house block chain according to the house number; the first block is a block with the latest block time stamp in the blocks associated with the house information to be transferred;
the decryption module is further configured to obtain a first private key in the key pair provided by the node to which the house corresponding to the to-be-transferred house information belongs, and decrypt the first block according to the first private key;
and the second sending module is used for sending the decrypted house state information in the first block to the target terminal.
A third aspect of the embodiments of the present application provides an electronic device, including a processor, a memory, and an input/output interface;
the processor is connected to the memory and the input/output interface, respectively, where the input/output interface is configured to interact with each participating node, the memory is configured to store program codes, and the processor is configured to call the program codes to execute the method for building management based on a blockchain as described in the first aspect of the embodiment of the present application.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, where the computer program includes program instructions that, when executed by a processor, perform the method for block chain based premises management as described in the first aspect of the embodiments of the present application.
The embodiment of the application has the following beneficial effects:
according to the method and the device, the house to-be-transferred message sent by the agent node is obtained, wherein the house to-be-transferred message comprises house to-be-transferred information, house owner information to be transferred, transfer time information to be transferred and data volume information to be transferred; acquiring a first block from a house block chain, and acquiring a first private key in a key pair provided by a node to which a house corresponding to the house information to be transferred belongs; decrypting the first block according to the first private key; the first block includes house status information; the first block is a block with the latest time stamp in the blocks associated with the house information to be transferred; and if the decrypted house state information in the first block is matched with the house to-be-transferred message, generating a house to-be-transferred block according to the house to-be-transferred information, the house ownership information to be transferred, the house to-be-transferred time information and the house to-be-transferred data volume information, and adding the house to-be-transferred block into a house block chain. Through the steps, each transaction process of the house is linked, so that when the agency node needs to rent the house to be transferred, the relevant blocks of the house to be transferred can be inquired in the house management system, each transaction information of the house to be transferred can be obtained, the authenticity and the accuracy of the relevant information of the house to be transferred, which is issued by the agency node, are ensured, and the related information of the linked house is real and credible. Moreover, the transaction condition of each house can be traced, and when the current condition of the house needs to be acquired, the transaction condition of the house can be acquired very conveniently, so that the effectiveness and the reliability of house management are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a block chain according to an embodiment of the present application;
fig. 2 is a schematic diagram of a house block chain processing scenario provided in an embodiment of the present application;
fig. 3 is a flowchart of a house management method based on a block chain according to an embodiment of the present application;
fig. 4 is a schematic diagram of an identification of a house to-be-transferred message provided by an embodiment of the present application;
fig. 5 is a schematic diagram illustrating generation of a to-be-transferred block of a house according to an embodiment of the present application;
fig. 6 is a schematic diagram of a house management device based on a block chain according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
First, the block chain, block, chain and consensus mechanism mentioned in the embodiments of the present application will be described.
1. Block chains: in a narrow sense, a block chain is a chain data structure taking a block as a basic unit, and the prior transaction history is verified by utilizing a digital abstract in the block, so that the block chain is suitable for the requirements of tamper resistance and expandability under a distributed accounting scene; in a broad sense, blockchain also refers to distributed accounting techniques implemented by blockchain architecture, including distributed consensus, privacy and security protection, peer-to-peer communication techniques, network protocols, intelligent contracts, and the like. The goal of the blockchain is to implement a distributed data record ledger that allows only additions and not deletions. The basic structure of the ledger bottom layer is a linear linked list. The linked list is composed of a series of 'blocks', the Hash (Hash) value of the previous block is recorded in the subsequent block, and whether each block (and the transaction in the block) is legal or not can be quickly checked by calculating the Hash value. If a node in the network proposes to add a new block, the block must be acknowledged through a consensus mechanism.
2. Block (Block): all transactions and status results, etc. occurring over a period of time are recorded, which is a consensus on the current ledger status. Specifically, for a block chain, each time data is written, i.e. the above transaction process, a block is created.
3. Chain (Chain): the blocks are connected in series according to the occurrence sequence and are log records of the state change of the whole account book.
4. A consensus mechanism: the verification and validation of the transaction is accomplished in a short time by voting of the particular nodes, with the goal of having all honest nodes maintain a consistent blockchain graph.
Specifically, a block chain is composed of blocks, and each block includes two parts: a chunk header and a chunk body, and the chunk header includes a timestamp, a current hash value, and a next hash value. The time stamp is used for recording the generation time of the block; the current hash value is the hash value of the block; the previous hash value is the hash value of the previous block of the block; and the block body is used for storing the transaction information for the block. Specifically, taking the example of adding the second block to the block chain, the manner of generating the new block is as follows:
when a first block exists in the block chain, the first block is used for indicating first transaction data generated by a first transaction, if a second transaction occurs, second transaction data can be generated through the second transaction, and if the second transaction data passes verification, a second block is generated through the second transaction data and is added into the block chain as a subsequent block of the first block. The time stamp contained in the block header of the second block is used for recording the generation time of the second block; the current hash value is generated by the block chain system through the data contained in the second block; the previous hash value is the hash value of the first block; the block of the second block is used for recording second transaction data.
Similarly, a third block is added to the block chain, and the third block is used for indicating third transaction data generated by a third transaction. If a new transaction occurs in the transaction chain indicated by the block chain, a new block is generated according to the same manner, and a subsequent block is generated and added into the block chain.
Specifically, referring to fig. 1, fig. 1 is a house management architecture diagram provided in an embodiment of the present application, and as shown in fig. 1, when a house owner rents a house through an intermediary, house information to be transferred is sent to an agent node, the agent node is the intermediary, and after the agent node acquires the house information to be transferred, the agent node acquires the house owner information and an expected value of the house owner to rent the house to be transferred. The house owner information is personal information of a house owner, and the expected value rented by the house owner to the house to be transferred comprises the time information to be transferred and the data volume information to be transferred. When the agent node needs to upload the information about the house to be transferred provided by the house owner to the house block chain for filing, sending a house to-be-transferred message to the house management system, wherein the house to-be-transferred message comprises house to-be-transferred information, house owner to be transferred information, transfer time information and transfer data volume information. And the house management system verifies the to-be-transferred information of the house after receiving the to-be-transferred information of the house, if the to-be-transferred information of the house is matched with the historical house state information corresponding to the to-be-transferred house in the house block chain, the to-be-transferred information of the house is correct, a to-be-transferred block of the house is generated according to the to-be-transferred house information, the owner information of the to-be-transferred house, the to-be-transferred time information and the to-be-transferred data volume information, and the to-be-transferred block of the house is added into the house block. Similarly, when the house to which the node belongs acquires the house to be transferred, the house to which the node belongs sends a house acquisition request to the house management system, and the house management system generates a block according to the house acquisition request when determining that data included in the house acquisition request is correct, and uploads the block to a house block chain after consensus is performed on the block, and the like. Through the steps, for each house, data generated from building to selling, to-be-transferred, short-term transfer, mortgage and the like of the house corresponds to one block in the house block chain respectively, and all historical transaction processes of the house can be inquired in the house block chain. When a tenant needs to rent a house, the tenant acquires a house meeting the requirement from the agent node or the node to which the house belongs, and then can acquire information associated with the house from the house management system to ensure that the house has no other debt disputes and the like, so that the legal right of the house is guaranteed. For example, if the user a mortises his house to the user B, and after a period of time, the user C rents the house to the user C, and when the user C signs a house renting contract or checks the house, the user C can know the historical house state information of the house from the house block chain, so that the situation that the house is mortgage by the user a can be known, and at this time, the user C can refuse to rent the house, so that the renting right of the user C cannot be guaranteed when the subsequent user a cannot solve the problem of the right of debt with the user B.
The house management system is a system for storing information related to business activities experienced by each user, data sharing can be performed between nodes, the house management system may include a plurality of nodes, and the plurality of nodes may refer to respective clients in the house management system. Each node may receive input information while operating normally and maintain shared data within the premises management system based on the received input information. In order to ensure the information intercommunication in the house management system, information connection can exist between each node in the house management system, and the information transmission can be carried out between the nodes through the information connection. For example, when an arbitrary node in the house management system receives input information, other nodes in the house management system acquire the input information according to the consensus algorithm, and store the input information as data in shared data, so that the data stored on all the nodes in the data sharing system are consistent.
Further, referring to fig. 2, fig. 2 is a schematic diagram of a house block chain processing scenario provided in an embodiment of the present application, as shown in fig. 2, when a house is built, a development node uploads house built information to a house management system 204 through a client 201, after the house management system 204 verifies the house built information, a block 2041 is generated according to the house built information, and the block 2041 is uploaded to a house block chain; when a house is transferred to a house owner by a development node, the house owner node uploads the house transfer information to a house management system 204 through a client 202, the house management system 204 verifies the house transfer information through the historical state information of the house, if the verification is passed, a block 2042 is generated according to the house transfer information, and the block 2042 is uploaded to a house block chain, wherein in the embodiment, the historical state information of the house is obtained through the block 2041; similarly, the house management system 204 generates a block 2044 according to the house to-be-transferred information uploaded by the node to which the house belongs through the client 203, and uploads the block 2044 to the house block chain; and so on. When the tenant sends the query request of the house to the house management system 204 through the client 205, the house management system 204 acquires each block associated with the house according to the query request of the house, including the block 2041, the block 2042, and the block 2044, generates house information according to each block, and sends the house information to the client 205, so that the tenant can know historical house state information of the house. Optionally, when the tenant sends the query request of the house to the house management system 204 through the client 205, the house management system 204 may also obtain a block with the largest timestamp, that is, the block 2044, from the blocks associated with the house according to the query request of the house, generate house information according to the block 2044, and send the house information to the client 205, so that the tenant knows the latest house state information of the house.
Referring to fig. 3, fig. 3 is a flowchart of a house management method based on a block chain according to an embodiment of the present application. As shown in fig. 3, the house management process includes the following steps:
step S301, acquiring the house to-be-transferred message sent by the agent node.
Specifically, the house to-be-transferred message sent by the agent node is obtained, and the house to-be-transferred message comprises house to-be-transferred information, house ownership person to be transferred information, transfer time information and transfer data volume information. Specifically, when the agent node acquires the information about the house to be transferred provided by the house owner, the house to be transferred needs to be uploaded to a house transfer center, and the process of the house to be transferred is uploaded to a house management system for filing. The method comprises the steps that an agent node generates a house to-be-transferred message according to data in the to-be-transferred processing process, the house to-be-transferred message is sent to a house management system, and the house management system obtains the house to-be-transferred message sent by the agent node. The information of the house to be transferred comprises the geographical position of the house, introduction of the house pattern, the house year limit and the like, the information of the house owner to be transferred is the information of the house owner of the house to be transferred, and the information of the data volume to be transferred is determined by the agency node according to the expected data volume provided by the house owner.
For example, the house management system acquires a house to-be-transferred message sent by the agent node, where the house to-be-transferred message includes "house information: x district X street X district X building XX, one house, one hall, …, X city X province X; and (3) information of the house ownership to be transferred: the house owner A, contact information, identity information and the like; information of time to transfer: 2019, 10, 8; data amount to be transferred information: 2000".
Step S302, obtain a first block from the house block chain, and decrypt the first block, where the first block includes house state information.
Specifically, a first block is obtained from a house block chain, and a first private key in a key pair provided by a node to which a house corresponding to the house information to be transferred belongs is obtained; and decrypting the first block according to the first private key, wherein the first block comprises the house state information. Specifically, at least one block is acquired from a house block chain according to the house information to be transferred, the at least one block is associated with the house information to be transferred, a timestamp of each block in the at least one block is acquired, and the block with the latest timestamp is determined as a first block. The method comprises the steps of obtaining a block in a house block chain, wherein when the block is obtained in the house block chain, the block is obtained by tracing each block in the house block chain, judging whether the block is associated with house information to be transferred after the last block in the house block chain is obtained, if the block is associated with the house information to be transferred, the last block is a first block, if the block is not associated with the house information to be transferred, obtaining a subsequent block of the last block, judging whether the subsequent block of the last block is associated with the house information to be transferred, until the traced block is associated with the house information to be transferred, and the block associated with the house information to be transferred is the first block. And after the first block is obtained, a key pair provided by a node to which the house corresponding to the house information to be transferred belongs is obtained, the key pair comprises a first private key and a public key, and the first block is decrypted through the first private key. After the house transaction data sent by the node to which the house belongs is verified, the house management system generates a first block according to the house transaction data, and encrypts the first block through a public key.
If the acquired house state information in the first block comprises house information, house owner information, expected transfer time information and an expected transfer data volume range, namely if the house to-be-transferred information uploaded by the node to which the house belongs is recorded in the first block, the house owner information, the expected transfer time information and the expected transfer data volume range in the house state information are acquired. If the information of the house ownership person to be transferred is the same as the information of the house ownership person, the information of the time to be transferred is the same as the information of the expected transfer time, and the information of the data volume to be transferred is in the range of the expected transfer data volume, it is indicated that the information of the house ownership person determined by the agent node is consistent with the house owner information of the house, the determined transfer data of the house to be transferred is consistent with the expectation of the house ownership person, the house state information in the first decrypted block is determined to be matched with the information of the house to be transferred, and the step S303 is executed; and if the information of the house owner to be transferred is different from the information of the house owner, or the information of the time to be transferred is different from the information of the expected transfer time, or the information of the data volume to be transferred is not in the range of the expected transfer data volume, determining that the house state information in the decrypted first block is not matched with the information of the house owner to be transferred. Optionally, a difference between the to-be-transferred time information and the expected transfer time information may be calculated, if the to-be-transferred time information is after the expected transfer time information and the difference between the to-be-transferred time information and the expected transfer time information is smaller than a time threshold, the house owner information to be transferred is the same as the house owner information, and the data volume information to be transferred is within the expected transfer data volume range, it may also be determined that the house state information in the decrypted first block matches the house information to be transferred, and step S303 is executed. For example, if the house status information acquired in the first block includes "house information: x district X street X district X building XX, one house, one hall, …, X city X province X; information of ownership of the house: the house owner A, contact information, identity information and the like; expected transfer time information: 2019, 10, 8; expected transfer data volume range: 1900-2100 ", comparing with the example shown in step S301, determining that the house state information in the first block matches with the house to-be-transferred message, and executing step S303.
If the acquired house state information in the first block comprises house information, house owner information, short-term transfer starting time, short-term transfer duration and short-term transfer data volume information, namely if the house leasing information uploaded by the node to which the house belongs is recorded in the first block, the house owner information of the house state information in the first block after decryption is acquired, and if the house owner information to be transferred is the same as the house owner information, the short-term transfer starting time and the short-term transfer duration are acquired. Determining short-term transfer ending time according to the short-term transfer starting time and the short-term transfer duration, if the to-be-transferred starting time in the to-be-transferred time information is before the short-term transfer ending time or the to-be-transferred starting time and the short-term transfer ending time are the same, indicating that the house leasing time determined by the agency node conflicts with the existing leasing time of the house to be transferred, and determining that the house state information in the decrypted first block is not matched with the house to-be-transferred message; if the transfer start time to be transferred in the transfer time information is after the short-term transfer end time, it is determined that the house state information in the decrypted first block matches the house transfer message, and step S303 is performed. For example, if the house status information acquired in the first block includes "house information: x district X street X district X building XX, one house, one hall, …, X city X province X; information of ownership of the house: the house owner A, contact information, identity information and the like; short-term ownership information: a tenant A; short-term transfer start time: 13/2/2019; short-term transfer duration: 1 year; short-term transfer data amount information: 1950 ", determining that the short-term transfer end time is" 2020 year, 2 month and 13 days "according to the short-term transfer start time" 2019 year, 2 month and 13 days "and the short-term transfer duration" 1 year ", as shown in the example of step S301, the to-be-transferred start time in the to-be-transferred time information is" 2019 year, 10 month and 8 days ", the to-be-transferred start time is before the short-term transfer end time, that is, the to-be-transferred time determined by the broker node conflicts with the existing lease time of the to-be-transferred house, in other words, the broker node leases the to-be-transferred house to the tenant B at the to-be-transferred start time, and the lease time of the tenant a to the to-be-transferred house is not yet expired, so that the lease times of the tenant. If the short-term transfer start time is "10/1/2018 and the short-term transfer duration is" 1 year ", it is determined that the short-term transfer end time is" 10/1/2019, before the to-be-transferred start time, that is, at the to-be-transferred start time, the to-be-transferred house is in an idle state, which indicates that the house state information in the decrypted first block matches the house to-be-transferred message, and step S303 is executed.
Optionally, the house to-be-transferred message further includes a digital signature, and the digital signature is obtained by the proxy node generating a proxy hash value according to the house to-be-transferred message and encrypting the proxy hash value based on the second private key. After the house to-be-transferred message sent by the agent node is acquired, decrypting the digital signature through a public key in a key pair provided by the node to which the house belongs, if the digital signature is not decrypted successfully, indicating that the second private key is different from the first private key, and sending a house agent right invalid message to the agent node, wherein the house agent right invalid message is not acquired by the agent node and is given by a house owner of the house to be transferred; if the digital signature is successfully decrypted, a verification hash value is generated according to the house transfer message, if the verification hash value is the same as the proxy hash value, the house transfer message is not tampered in the process of being sent to the house management system by the proxy node, and then the process of decrypting the first block according to the first private key is executed. Specific process can be seen in fig. 4, which is a schematic diagram of an acceptance check of a house to-be-transferred message provided in the embodiment of the present application. As shown in fig. 4, after receiving a house to-be-transferred message uploaded by a client, an agent node 401 generates an agent hash value according to the house to-be-transferred message, encrypts the agent hash value by a second private key to generate a digital signature, sends a house to-be-transferred message 402 carrying the digital signature to a house management system, and after receiving the house to-be-transferred message 402 carrying the digital signature, the house management system extracts the digital signature 403, decrypts the digital signature 403 by using a public key 404 in a key pair provided by a node to which the house belongs to obtain the agent hash value, and further the house management system can perform a hash operation on the house to-be-transferred message by using a hash algorithm 405 (the hash algorithm 405 is a hash algorithm used by the agent node 401 to generate the digital signature), so as to obtain a verification hash value corresponding to the house management system, and if the agent hash value is equal to the verification hash value, the house to-be-transferred message is not tampered in the uploading process, and the signature is verified to pass; and if the agent hash value is not equal to the verification hash value, the fact that the actual data in the house to-be-transferred message is possibly tampered in the uploading process is represented, the signature is verified to be not passed, the house to-be-transferred message is deleted, and a prompt that the house to-be-transferred message is tampered is sent to the agent node.
Step S303, if the house state information in the decrypted first block is matched with the house to-be-transferred message, a house to-be-transferred block is generated, and the house to-be-transferred block is added into a house block chain.
Specifically, if the house state information in the decrypted first block is matched with the house to-be-transferred message, a house to-be-transferred block is generated according to the house to-be-transferred information, the house owner information to be transferred, the house to-be-transferred time information and the house to-be-transferred data volume information, and the house to-be-transferred block is added into a house block chain. Specifically, a block to be linked is generated according to the house information to be transferred, the house owner information to be transferred, the time information to be transferred and the data volume information to be transferred, and the block to be linked is verified through a common identification mechanism. And if the block to be subjected to chain winding passes the verification, taking the hash value generated according to the block to be subjected to chain winding as the current hash value, acquiring a second block with the latest block timestamp in the house block chain, taking the hash value of the second block as a forward hash value, acquiring the current network time, and taking the current network time as a timestamp. And generating a block to be transferred of the house according to the block to be linked, the current hash value, the forward hash value and the timestamp.
Optionally, after the block to be transferred of the house is generated, the capacity information corresponding to the message to be transferred of the house is counted. And if the capacity information is larger than the block capacity threshold value in the house block chain, generating a house hash value corresponding to the house information, and recording the corresponding relation between the house hash value and the house information. And generating a block to be linked according to the house hash value, the information of the house owner to be transferred, the information of the time to be transferred and the information of the data volume to be transferred. In this case, if the capacity information of the house to-be-transferred message is greater than the block capacity threshold value in the house block chain, the house hash value corresponding to the house information to be transferred is recorded in the generated house to-be-transferred block, and then the corresponding relation between the house hash value and the house information to be transferred is recorded. Through the method for storing the hash values, the same house information records in the house block chain are the same hash value, and the corresponding relation between the same house information and the house hash value only needs to be recorded once, namely when the corresponding relation exists between the house information 1 and the hash value 1, the house information 1 is replaced by the hash value 1 when appearing in the house block chain, and the corresponding relation between the house information 1 and the hash value 1 only needs to be recorded once, so that the storage space is saved.
The process for generating the to-be-transferred block of the house is shown in fig. 5, and fig. 5 is a schematic diagram for generating a to-be-transferred block of the house according to the embodiment of the present application. As shown in fig. 5, after the block 501 to be uplink is generated according to the house information to be transferred, the house owner information to be transferred, the time information to be transferred, and the data size information to be transferred, the block 501 to be uplink is broadcasted to other participating nodes 502, after the block 501 to be uplink is identified by other participating nodes 502, the second block 503 with the latest timestamp in the house block chain is obtained, the current hash value in the second block 503 is used as the block head relay hash value of the block 501 to be uplink, the current hash value in the block head of the block 501 to be uplink is updated according to the hash value generated by the block 501 to be uplink, and the current network time is obtained as the timestamp, so that the updated block to be uplink is the block 504 to be transferred.
When a house query request sent by a target terminal is received, the house query request comprises a house number corresponding to house information to be transferred, and a first block associated with the house information to be transferred is obtained from a house block chain according to the house number; the first block is a block with the latest block time stamp in the blocks associated with the house information to be transferred, and the acquisition process of the first block can be referred to the acquisition process of the first block in step S302. And acquiring a first private key in a key pair provided by a node to which the house corresponding to the house information to be transferred belongs, and decrypting the first block according to the first private key. And sending the decrypted house state information in the first block to the target terminal. Optionally, each block associated with the house information to be transferred may be acquired from the house block chain according to the house number, and the house state information recorded in each block is sent to the target terminal, so that a user of the target terminal may know historical house state information of the house, thereby avoiding a transaction conflict. For example, when a house is in a short-term transfer state, secondary transfer (i.e., short-term rental) cannot be performed; when the house is in the short-term transfer state, the mortgage cannot be performed, so that the lease right and the mortgage right of the house are prevented from conflicting and the like.
The house number of the house corresponding to the block can be recorded in each block in the house block chain, so that subsequent searching is facilitated.
According to the method and the device, the house to-be-transferred message sent by the agent node is obtained, wherein the house to-be-transferred message comprises house to-be-transferred information, house owner information to be transferred, transfer time information to be transferred and data volume information to be transferred; acquiring a first block from a house block chain, and acquiring a first private key in a key pair provided by a node to which a house corresponding to the house information to be transferred belongs; decrypting the first block according to the first private key; the first block includes house status information; the first block is a block with the latest time stamp in the blocks associated with the house information to be transferred; and if the decrypted house state information in the first block is matched with the house to-be-transferred message, generating a house to-be-transferred block according to the house to-be-transferred information, the house ownership information to be transferred, the house to-be-transferred time information and the house to-be-transferred data volume information, and adding the house to-be-transferred block into a house block chain. Through the steps, each transaction process of the house is linked, so that when the agency node needs to rent the house to be transferred, the relevant blocks of the house to be transferred can be inquired in the house management system, each transaction information of the house to be transferred can be obtained, the authenticity and the accuracy of the relevant information of the house to be transferred, which is issued by the agency node, are ensured, and the related information of the linked house is real and credible. Moreover, the transaction condition of each house can be traced, and when the current condition of the house needs to be acquired, the transaction condition of the house can be acquired very conveniently, so that the effectiveness and the reliability of house management are improved. Further, after the house to-be-transferred message sent by the agent node is acquired, the authenticity of the house to-be-transferred message and the agent authority of the agent node to-be-transferred house can be verified, specifically, historical house state information of the house to-be-transferred is traced back in a house block chain, the authenticity of the house to-be-transferred message is verified through the historical house state information, and the agent authority of the house to-be-transferred is acquired by the agent node through digital signature determination, so that the authenticity of the house agent authority owned by the agent node is guaranteed, and the management safety of the house is improved.
Referring to fig. 6, fig. 6 is a schematic diagram of a house management apparatus based on a block chain according to an embodiment of the present application, and as shown in fig. 6, the house management apparatus 60 based on a block chain may be used in the electronic device in the embodiment corresponding to fig. 3, specifically, the apparatus may include: a receiving module 601, a first obtaining module 602, a decrypting module 603 and a first generating module 604.
The receiving module 601 is configured to acquire a to-be-transferred house message sent by an agent node, where the to-be-transferred house message includes information of a to-be-transferred house, information of a to-be-transferred house owner, information of to-be-transferred time, and information of to-be-transferred data amount;
a first obtaining module 602, configured to obtain a first block from a house block chain, and obtain a first private key in a key pair provided by a node to which a house corresponding to the information of the house to be transferred belongs; the first block comprises house state information; the first block is a block with the latest time stamp in the blocks associated with the house information to be transferred;
a decryption module 603, configured to decrypt the first block according to the first private key;
a first generating module 604, configured to generate a to-be-transferred-to-home block according to the to-be-transferred-to-home information, the to-be-transferred-to-home owner information, the to-be-transferred-to-transfer time information, and the to-be-transferred-to-data amount information if the house state information in the decrypted first block is matched with the to-be-transferred-to-home message, and add the to-be-transferred-to-home block into the house block chain.
The house state information in the first block comprises house information, house ownership information, expected transfer time information and an expected transfer data volume range;
the apparatus 60 further comprises:
a second obtaining module 605, configured to obtain the house owner information, the expected transfer time information, and the expected transfer data volume range in the house state information;
a first determining module 606, configured to determine that the house state information in the decrypted first chunk matches the house to-be-transferred message if the house owner information to be transferred is the same as the house owner information, the time information to be transferred is the same as the expected transfer time information, and the data volume information to be transferred is within the expected transfer data volume range;
the first determining module 606 is further configured to determine that the house state information in the decrypted first chunk is not matched with the house to-be-transferred message if the house owner information to be transferred is different from the house owner information, or the time to be transferred is different from the expected transfer time information, or the data volume to be transferred is not within the expected transfer data volume range.
The house state information in the first block comprises house information, house owner information, short-term transfer starting time, short-term transfer duration and short-term transfer data volume information;
the apparatus 60 further comprises:
a third obtaining module 607, configured to obtain the house owner information of the house state information in the decrypted first block, and if the house owner information to be transferred is the same as the house owner information, obtain the short-term owner information, the short-term transfer start time, and the short-term transfer duration;
a second determining module 608, configured to determine a short-term transfer ending time according to the short-term transfer starting time and the short-term transfer duration, and if the transfer starting time in the to-be-transferred time information is before the short-term transfer ending time or the transfer starting time is the same as the short-term transfer ending time, determine that the house state information in the decrypted first block is not matched with the house to-be-transferred message;
the second determining module 608 is further configured to determine that the house state information in the decrypted first chunk matches the house to-be-transferred message if the to-be-transferred time in the to-be-transferred time information is after the short-term transfer end time.
The house to-be-transferred message further comprises a digital signature, wherein the digital signature is obtained by the proxy node generating a proxy hash value according to the house to-be-transferred message and encrypting the proxy hash value based on a second private key;
the apparatus 60 further comprises:
the decryption module 603 is further configured to decrypt the digital signature through a public key in a key pair provided by the node to which the house belongs;
a first sending module 609, configured to send a house agent right invalid message to the agent node if the decryption of the digital signature is unsuccessful;
a second generating module 610, configured to generate a verification hash value according to the house transfer message if the decryption of the digital signature is successful, and execute, by the decryption module 603, the process of decrypting the first block according to the first private key if the verification hash value is the same as the proxy hash value.
Wherein the first generating module 604 comprises:
a first generating unit 6041, configured to generate a to-be-uplink block according to the to-be-transferred house information, the to-be-transferred house owner information, the to-be-transferred time information, and the to-be-transferred data amount information;
a verification unit 6042, configured to verify the to-be-uplink block through a consensus mechanism;
a second generating unit 6043, configured to, if the verification on the block to be linked is passed, take a hash value generated according to the block to be linked as a current hash value, acquire a second block with a latest block timestamp in the house block chain, take the hash value of the second block as a previous hash value, acquire a current network time, and take the current network time as a timestamp;
the second generating unit 6043 is further configured to generate the block to be transferred to the house according to the block to be uplink, the current hash value, the previous hash value, and the timestamp.
Wherein the apparatus 60 further comprises:
the statistical module 611 is configured to count capacity information corresponding to the to-be-transferred-to-home message;
a third generating module 612, configured to generate a house hash value corresponding to the house information if the capacity information is greater than a block capacity threshold in the house block chain, and record a corresponding relationship between the house hash value and the house information;
in the aspect of generating the to-be-linked chain block according to the to-be-transferred house information, the to-be-transferred house owner information, the to-be-transferred time information, and the to-be-transferred data volume information, the first generating module 604 is specifically configured to:
and generating the block to be linked according to the house hash value, the information of the house ownership to be transferred, the information of the time to be transferred and the information of the data volume to be transferred.
Wherein the apparatus 60 further comprises:
the receiving module 601 is further configured to receive a house query request sent by a target terminal, where the house query request includes a house number corresponding to the house information to be transferred;
the first obtaining module 602 is further configured to obtain, according to the house number, the first block associated with the house information to be transferred from the house block chain; the first block is a block with the latest block time stamp in the blocks associated with the house information to be transferred;
the decryption module 603 is further configured to obtain a first private key in the key pair provided by the node to which the house corresponding to the to-be-transferred house information belongs, and decrypt the first block according to the first private key;
a second sending module 613, configured to send the decrypted house state information in the first block to the target terminal.
The embodiment of the application provides a house management device based on a block chain, which obtains a house to-be-transferred message sent by an agent node, wherein the house to-be-transferred message comprises house information to be transferred, house owner information to be transferred, transfer time information to be transferred and data volume information to be transferred; acquiring a first block from a house block chain, and acquiring a first private key in a key pair provided by a node to which a house corresponding to the house information to be transferred belongs; decrypting the first block according to the first private key; the first block includes house status information; the first block is a block with the latest time stamp in the blocks associated with the house information to be transferred; and if the decrypted house state information in the first block is matched with the house to-be-transferred message, generating a house to-be-transferred block according to the house to-be-transferred information, the house ownership information to be transferred, the house to-be-transferred time information and the house to-be-transferred data volume information, and adding the house to-be-transferred block into a house block chain. Through the steps, each transaction process of the house is linked, so that when the agency node needs to rent the house to be transferred, the relevant blocks of the house to be transferred can be inquired in the house management system, each transaction information of the house to be transferred can be obtained, the authenticity and the accuracy of the relevant information of the house to be transferred, which is issued by the agency node, are ensured, and the related information of the linked house is real and credible. Moreover, the transaction condition of each house can be traced, and when the current condition of the house needs to be acquired, the transaction condition of the house can be acquired very conveniently, so that the effectiveness and the reliability of house management are improved.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 7, the electronic device in the present embodiment may include: one or more processors 701, a memory 702, and an input-output interface 703. The processor 701, the memory 702, and the input/output interface 703 are connected by a bus 704. The memory 702 is used for storing a computer program comprising program instructions, the input output interface 703 is used for interacting with the respective participating nodes; the processor 701 is configured to execute the program instructions stored in the memory 702 to perform the following operations:
acquiring a house to-be-transferred message sent by an agent node, wherein the house to-be-transferred message comprises house information to be transferred, house owner information to be transferred, time information to be transferred and data volume information to be transferred;
acquiring a first block from a house block chain, and acquiring a first private key in a key pair provided by a node to which a house corresponding to the house information to be transferred belongs; decrypting the first block according to the first private key; the first block comprises house state information; the first block is a block with the latest time stamp in the blocks associated with the house information to be transferred;
and if the decrypted house state information in the first block is matched with the house to-be-transferred message, generating a house to-be-transferred block according to the house to-be-transferred information, the house owner information to be transferred, the house to-be-transferred time information and the data volume to be transferred, and adding the house to-be-transferred block into the house block chain.
In some possible embodiments, the processor 701 may be a Central Processing Unit (CPU), and the processor may also 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 702 may include both read-only memory and random-access memory, and provides instructions and data to the processor 701 and the input/output interface 703. A portion of the memory 702 may also include non-volatile random access memory. For example, the memory 702 may also store device type information.
In a specific implementation, the electronic device may execute the implementation manners provided in the steps in fig. 3 through the built-in functional modules, which may specifically refer to the implementation manners provided in the steps in fig. 3, and details are not described herein again.
The embodiment of the present application provides an electronic device, including: the system comprises a processor, an input/output interface and a memory, wherein the processor acquires computer instructions in the memory, and executes the steps of the method shown in the figure 3 to perform house management operation. Through computer instructions in the memory, the processor executes operations of inquiring or chaining the house transaction information recorded in the block in the house management system, so that each participating node in the house management system can inquire the historical house state information of each house at any time, and when the current transaction data of the house needs to be verified, the historical house state information recorded in the block chain of the house can be inquired very conveniently, and the accuracy and the authenticity of the current transaction data are determined. The block data is public and transparent, so that the accuracy and traceability of the block data are improved.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, where the computer program includes program instructions, and when the program instructions are executed by a processor, the house management method provided in each step in fig. 3 is implemented, which may specifically refer to the implementation manner provided in each step in fig. 3, and is not described herein again.
The computer-readable storage medium may be the house management apparatus provided in any of the foregoing embodiments or an internal storage unit of the electronic device, such as a hard disk or a memory of the 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. 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 description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or apparatus that comprises a list of steps or elements is not limited to the listed steps or modules, but may alternatively include other steps or modules not listed or inherent to such process, method, apparatus, product, or apparatus.
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. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. 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 application.
The method and the related apparatus provided by the embodiments of the present application are described with reference to the flowchart and/or the structural diagram of the method provided by the embodiments of the present application, and each flow and/or block of the flowchart and/or the structural diagram of the method, and the combination of the flow and/or block in the flowchart and/or the block diagram can be specifically implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block or blocks.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (10)

1. A block chain-based premises management method, the method comprising:
acquiring a house to-be-transferred message sent by an agent node, wherein the house to-be-transferred message comprises house information to be transferred, house owner information to be transferred, time information to be transferred and data volume information to be transferred;
acquiring a first block from a house block chain, and acquiring a first private key in a key pair provided by a node to which a house corresponding to the house information to be transferred belongs; decrypting the first block according to the first private key; the first block comprises house state information; the first block is a block with the latest time stamp in the blocks associated with the house information to be transferred;
and if the decrypted house state information in the first block is matched with the house to-be-transferred message, generating a house to-be-transferred block according to the house to-be-transferred information, the house owner information to be transferred, the house to-be-transferred time information and the data volume to be transferred, and adding the house to-be-transferred block into the house block chain.
2. The method of claim 1, wherein the house status information in the first block includes house information, house owner information, expected transfer time information, and expected transfer data volume range;
the method further comprises the following steps:
acquiring the house ownership person information, the expected transfer time information and the expected transfer data volume range in the house state information;
if the information of the house ownership person to be transferred is the same as the information of the house ownership person, the information of the time to be transferred is the same as the information of the expected transfer time, and the information of the data volume to be transferred is in the range of the expected transfer data volume, determining that the house state information in the decrypted first block is matched with the information of the house ownership person to be transferred;
and if the information of the house owner to be transferred is different from the information of the house owner, or the information of the time to be transferred is different from the information of the expected transfer time, or the information of the data volume to be transferred is not in the range of the expected transfer data volume, determining that the house state information in the decrypted first block is not matched with the information of the house owner to be transferred.
3. The method of claim 1, wherein the house status information in the first block includes house information, house owner information, short term transfer start time, short term transfer duration, and short term transfer data volume information;
the method further comprises the following steps:
acquiring the house ownership information of the house state information in the decrypted first block, and acquiring the short-term ownership information, the short-term transfer starting time and the short-term transfer duration if the house ownership information to be transferred is the same as the house ownership information;
determining short-term transfer ending time according to the short-term transfer starting time and the short-term transfer duration, and if the transfer starting time in the to-be-transferred time information is before the short-term transfer ending time or the transfer starting time and the transfer ending time are the same, determining that the house state information in the decrypted first block is not matched with the house to-be-transferred message;
and if the transfer starting time in the transfer time information is after the short-term transfer ending time, determining that the house state information in the decrypted first block is matched with the house transfer message.
4. The method of claim 1, wherein the house to be transferred message further comprises a digital signature, the digital signature being generated by the broker node generating a broker hash value from the house to be transferred message, the broker hash value being encrypted based on a second private key;
the method further comprises the following steps:
decrypting the digital signature through a public key in a key pair provided by the node to which the house belongs, and if the digital signature is not decrypted successfully, sending a house proxy right invalid message to the proxy node;
and if the digital signature is successfully decrypted, generating a verification hash value according to the house transfer message, and if the verification hash value is the same as the proxy hash value, executing the process of decrypting the first block according to the first private key.
5. The method according to claim 1, wherein the generation of the block to be transferred of the house based on the house information to be transferred, the house owner information to be transferred, the time information to be transferred, and the data amount information to be transferred, comprises:
generating a block to be linked according to the house information to be transferred, the house owner information to be transferred, the time information to be transferred and the data volume information to be transferred, and verifying the block to be linked through a common identification mechanism;
if the block to be subjected to chain winding passes the verification, taking a hash value generated according to the block to be subjected to chain winding as a current hash value, acquiring a second block with the latest block timestamp in the house block chain, taking the hash value of the second block as a forward hash value, acquiring current network time, and taking the current network time as a timestamp;
and generating the block to be transferred of the house according to the block to be linked, the current hash value, the forward hash value and the timestamp.
6. The method of claim 5, wherein the method further comprises:
counting capacity information corresponding to the house to-be-transferred message;
if the capacity information is larger than a block capacity threshold value in the house block chain, generating a house hash value corresponding to the house information, and recording a corresponding relation between the house hash value and the house information;
the generating of the to-be-linked chain block according to the to-be-transferred house information, the to-be-transferred house owner information, the to-be-transferred time information and the to-be-transferred data volume information comprises the following steps:
and generating the block to be linked according to the house hash value, the information of the house ownership to be transferred, the information of the time to be transferred and the information of the data volume to be transferred.
7. The method of claim 1, wherein the method further comprises:
receiving a house query request sent by a target terminal, wherein the house query request comprises a house number corresponding to the house information to be transferred;
acquiring the first block associated with the house information to be transferred from the house block chain according to the house number; the first block is a block with the latest block time stamp in the blocks associated with the house information to be transferred;
acquiring a first private key in the key pair provided by the node to which the house corresponding to the house information to be transferred belongs, and decrypting the first block according to the first private key;
and sending the house state information in the decrypted first block to the target terminal.
8. A block chain based premises management device, the device comprising:
the system comprises a receiving module, a transfer module and a transfer module, wherein the receiving module is used for acquiring a house to-be-transferred message sent by an agent node, and the house to-be-transferred message comprises house to-be-transferred information, house owner information to be transferred, transfer time information to be transferred and data volume information to be transferred;
the first obtaining module is used for obtaining a first block from the house block chain and obtaining a first private key in a key pair provided by a node to which the house corresponding to the information of the house to be transferred belongs;
the decryption module is used for decrypting the first block according to the first private key; the first block comprises house state information; the first block is a block with the latest time stamp in the blocks associated with the house information to be transferred;
and the first generation module is used for generating a block to be transferred of the house according to the information of the house to be transferred, the information of the owner of the house to be transferred, the information of the time to be transferred and the information of the data volume to be transferred if the house state information in the decrypted first block is matched with the information to be transferred of the house, and adding the block to be transferred of the house into the house block chain.
9. An electronic device, comprising a processor, a memory, an input-output interface;
the processor is connected to the memory and the input/output interface, respectively, wherein the input/output interface is used for interacting with each participating node, the memory is used for storing program codes, and the processor is used for calling the program codes to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method according to any one of claims 1-7.
CN201910919579.4A 2019-09-26 2019-09-26 House management method and device based on block chain Active CN110659967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910919579.4A CN110659967B (en) 2019-09-26 2019-09-26 House management method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910919579.4A CN110659967B (en) 2019-09-26 2019-09-26 House management method and device based on block chain

Publications (2)

Publication Number Publication Date
CN110659967A true CN110659967A (en) 2020-01-07
CN110659967B CN110659967B (en) 2023-06-23

Family

ID=69039369

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910919579.4A Active CN110659967B (en) 2019-09-26 2019-09-26 House management method and device based on block chain

Country Status (1)

Country Link
CN (1) CN110659967B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111586157A (en) * 2020-04-30 2020-08-25 财付通支付科技有限公司 Information processing method, device and equipment
CN111696019A (en) * 2020-06-08 2020-09-22 中国联合网络通信集团有限公司 House signing information recording method based on block chain and house signing management node
CN115170322A (en) * 2022-09-05 2022-10-11 深圳市明源云科技有限公司 Real estate property right transfer method, device, terminal device and computer medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991334A (en) * 2016-11-24 2017-07-28 阿里巴巴集团控股有限公司 A kind of method, system and device of data access
CN107506661A (en) * 2017-08-15 2017-12-22 河南真二互联网科技有限公司 A kind of method of the generation house historical record based on block chain
CN109523362A (en) * 2018-11-16 2019-03-26 大唐高鸿信息通信研究院(义乌)有限公司 A kind of second-hand house transaction system and method based on 5G framework and block chain
CN109544302A (en) * 2018-11-28 2019-03-29 平安科技(深圳)有限公司 House renting management method, electronic device based on block chain
CN110163753A (en) * 2019-04-23 2019-08-23 阿里巴巴集团控股有限公司 Houseclearing based on block chain deposits card, application method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106991334A (en) * 2016-11-24 2017-07-28 阿里巴巴集团控股有限公司 A kind of method, system and device of data access
CN107506661A (en) * 2017-08-15 2017-12-22 河南真二互联网科技有限公司 A kind of method of the generation house historical record based on block chain
CN109523362A (en) * 2018-11-16 2019-03-26 大唐高鸿信息通信研究院(义乌)有限公司 A kind of second-hand house transaction system and method based on 5G framework and block chain
CN109544302A (en) * 2018-11-28 2019-03-29 平安科技(深圳)有限公司 House renting management method, electronic device based on block chain
CN110163753A (en) * 2019-04-23 2019-08-23 阿里巴巴集团控股有限公司 Houseclearing based on block chain deposits card, application method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111586157A (en) * 2020-04-30 2020-08-25 财付通支付科技有限公司 Information processing method, device and equipment
CN111586157B (en) * 2020-04-30 2024-01-23 财付通支付科技有限公司 Information processing method, device and equipment
CN111696019A (en) * 2020-06-08 2020-09-22 中国联合网络通信集团有限公司 House signing information recording method based on block chain and house signing management node
CN115170322A (en) * 2022-09-05 2022-10-11 深圳市明源云科技有限公司 Real estate property right transfer method, device, terminal device and computer medium

Also Published As

Publication number Publication date
CN110659967B (en) 2023-06-23

Similar Documents

Publication Publication Date Title
CN107274139B (en) Bill data management method and computer-readable medium
WO2021233049A1 (en) Blockchain–based data processing method, apparatus, device, and readable storage medium
CN110995673B (en) Case evidence management method and device based on block chain, terminal and storage medium
CN110633963B (en) Electronic bill processing method, electronic bill processing device, computer readable storage medium and computer readable storage device
CN110490610B (en) Community management system based on block chain
CN110659967B (en) House management method and device based on block chain
CN111027028A (en) Copyright data processing method and device based on intelligent contract
CN111427957A (en) Block chain voting information verification method, device, equipment and storage medium
CN110958319B (en) Method and device for managing infringement and evidence-based block chain
CN109243045A (en) A kind of voting method, device, computer equipment and computer readable storage medium
JPH09507729A (en) Cryptographic system and method with key escrow function
CN110599172B (en) Asset information processing method and device based on blockchain, equipment and storage medium
CN111292174A (en) Tax payment information processing method and device and computer readable storage medium
CN110929229A (en) Block chain-based office document credibility verification method and system
CN112612856B (en) Block chain-based data processing method and device
CN109242481A (en) Information approach, device and computer equipment are pledged based on block chain query
CN110597864A (en) Block chain-based personal information management method and device
CN111414434B (en) Block chain-based data transaction management network, transaction device and storage medium
CN111131234A (en) Intelligent contract data processing method and device in supply chain and computer equipment
CN110347750B (en) Block chain-based data processing method and device
CN114303129A (en) Document authentication method and system
CN111324666B (en) Data processing method and device based on block chain
CN111475778A (en) Music data processing method and device based on block chain
CN110599211A (en) Ticket information processing method and device and computer equipment
US10341314B2 (en) Method of security and verifiability of an electronic vote

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