Disclosure of Invention
The present disclosure is directed to an information query request response method based on a blockchain network, an information query request response apparatus based on a blockchain network, a computer-readable storage medium, and an electronic device, which overcome the problem that an organization cannot verify the authenticity of information provided by a user to some extent, and further reduce the risk degree of authentication or transaction processing.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided an information query request response method based on a blockchain network, including:
encrypting the user information according to a preset encryption mode;
according to the information generation time, adding a timestamp to the encrypted user information and uploading the user information added with the timestamp to a block chain network;
updating a database for information query according to the user information in the block chain network;
and when the information query request is received and the authorization information corresponding to the information query request is legal authorization information, responding to the information query request according to the database.
In an exemplary embodiment of the present disclosure, encrypting user information according to a preset encryption method includes:
converting the user information into a hash value with a preset length through hash function mapping in a preset encryption mode so as to realize encryption of the user information; or,
and encrypting the user information by a public key in a user key with a preset encryption mode, wherein the user key further comprises a private key which is used for decrypting the user information.
In an exemplary embodiment of the present disclosure, the user information includes user physical examination information, and the user physical examination information includes physical examination results corresponding to various types of physical examination items.
In an exemplary embodiment of the present disclosure, a manner of time-stamping the encrypted user information according to the information generation time is:
determining sub-generation time of each physical examination result in the user information, and respectively determining the sub-generation time as a timestamp of each physical examination result;
and determining the information generation time of the user information, and determining the information generation time as the time stamp of the encrypted user information.
In an exemplary embodiment of the present disclosure, a manner of uploading the user information after being time-stamped to the blockchain network is as follows:
adding a digital signature to the user information with the timestamp and generating a data block;
and checking the chain to which the current node corresponding to the data block belongs, and synchronizing the data block to other nodes in the block chain network if the checking is successful.
In an exemplary embodiment of the present disclosure, the authorization information includes an identity information field of the user, and the identity information field includes at least one of a mobile phone number, an identification number, a name, a block address, a zip code, and a mailbox; the method further comprises the following steps:
detecting the consistency degree of the authorization information corresponding to the information query request and the authorization information corresponding to the user information;
and if the consistency degree is greater than the preset degree, judging that the authorization information corresponding to the information inquiry request is legal authorization information.
In an exemplary embodiment of the present disclosure, responding to an information query request according to a database includes:
traversing the database according to data in the information query request to determine target user information;
if the query authority corresponding to the information query request is the first query authority, returning the target user information; and if the inquiry authority is the second inquiry authority, determining specific information in the target user information according to the second inquiry authority and returning.
According to a second aspect of the present disclosure, there is provided an information query request responding apparatus based on a blockchain network, including a user information processing unit, a data updating unit, and a query request responding unit, wherein:
the user information processing unit is used for encrypting the user information according to a preset encryption mode; according to the information generation time, adding a timestamp to the encrypted user information and uploading the user information added with the timestamp to a block chain network;
the data updating unit is used for updating a database for information query according to the information of each user in the block chain network;
and the query request response unit is used for responding the information query request according to the database when the information query request is received and the authorization information corresponding to the information query request is legal authorization information.
In an exemplary embodiment of the present disclosure, the manner in which the user information processing unit encrypts the user information according to the preset encryption manner is specifically:
the user information processing unit converts the user information into a hash value with a preset length through hash function mapping of a preset encryption mode so as to realize encryption of the user information; or,
the user information processing unit encrypts the user information through a public key in a user key with a preset encryption mode, wherein the user key further comprises a private key, and the private key is used for decrypting the user information.
In an exemplary embodiment of the present disclosure, the user information includes user physical examination information, and the user physical examination information includes physical examination results corresponding to various types of physical examination items.
In an exemplary embodiment of the present disclosure, the user information processing unit time stamps the user information after the encryption processing according to the information generation time in such a manner that:
the user information processing unit determines the sub-generation time of each physical examination result in the user information and respectively determines the sub-generation time as the time stamp of each physical examination result;
the user information processing unit determines an information generation time of the user information, and determines the information generation time as a time stamp of the user information after the encryption processing.
In an exemplary embodiment of the present disclosure, the manner in which the user information processing unit uploads the user information after being time-stamped to the blockchain network is as follows:
the user information processing unit adds a digital signature to the user information with the timestamp and generates a data block;
and the user information processing unit checks the chain to which the current node corresponding to the data block belongs, and synchronizes the data block to other nodes in the block chain network if the check is successful.
In an exemplary embodiment of the present disclosure, the authorization information includes an identity information field of the user, and the identity information field includes at least one of a mobile phone number, an identification number, a name, a block address, a zip code, and a mailbox; the apparatus further includes an information detection unit and an information determination unit, wherein:
the information detection unit is used for detecting the consistency degree of the authorization information corresponding to the information inquiry request and the authorization information corresponding to the user information;
and the information judging unit is used for judging the authorization information corresponding to the information inquiry request as legal authorization information when the consistency degree is greater than the preset degree.
In an exemplary embodiment of the present disclosure, the manner of the query request responding unit responding to the information query request according to the database specifically is:
the query request response unit traverses the database according to the data in the information query request to determine the information of the target user;
if the query authority corresponding to the information query request is the first query authority, the query request response unit returns the target user information; and if the inquiry authority is the second inquiry authority, the inquiry request response unit determines the specific information in the target user information according to the second inquiry authority and returns the specific information.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any one of the above via execution of the executable instructions.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of the above.
Exemplary embodiments of the present disclosure may have some or all of the following benefits:
in the information query request response method based on the blockchain network provided by an example embodiment of the present disclosure, user information (e.g., physical examination information) may be encrypted according to a preset encryption manner (e.g., hash encryption), and the encrypted user information is time-stamped according to information generation time and the time-stamped user information is uploaded to the blockchain network, so that it is ensured that information queried by a third party (e.g., a company where a user is about to enter a job) is authentic and reliable through non-tamper-property of data of the blockchain network; furthermore, the database for information query can be updated according to the user information in the block chain network, and compared with the method that the user information is directly acquired from the block chain node and updated into the database, the data calling efficiency can be improved; furthermore, when the information query request is received and the authorization information corresponding to the information query request is legal authorization information, the information query request can be responded according to the database, so that the user information can be legally queried under the condition of ensuring the information safety. According to the scheme, the method and the system can overcome the problem that an organization cannot verify the authenticity of the information provided by the user to a certain extent, and further reduce the risk degree of identity verification or transaction processing; on the other hand, the user information can be stored through the block chain network, so that the evidence storage difficulty of the user information is reduced; in another aspect, based on the time-sequence connection between the blocks, the query efficiency of the user information can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
Fig. 1 is a schematic diagram illustrating a system architecture of an exemplary application environment to which an information query request response method based on a blockchain network and an information query request response device based on a blockchain network according to an embodiment of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to desktop computers, portable computers, smart phones, tablet computers, and the like. It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The information query request response method based on the blockchain network provided by the embodiment of the present disclosure is generally executed by the server 105, and accordingly, the information query request response apparatus based on the blockchain network is generally disposed in the server 105. However, it is easily understood by those skilled in the art that the information query request response method based on the blockchain network provided in the embodiment of the present disclosure may also be executed by the terminal devices 101, 102, and 103, and accordingly, the information query request response apparatus based on the blockchain network may also be disposed in the terminal devices 101, 102, and 103, which is not particularly limited in this exemplary embodiment.
For example, in an exemplary embodiment, the server 105 may encrypt the user information according to a preset encryption manner; the user information after encryption processing can be stamped according to the information generation time and uploaded to the block chain network; updating a database for information query according to the information of each user in the block chain network; and when the information inquiry request is received and the authorization information corresponding to the information inquiry request is legal authorization information, responding to the information inquiry request according to the database.
FIG. 2 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present disclosure.
It should be noted that the computer system 200 of the electronic device shown in fig. 2 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments of the present disclosure.
As shown in fig. 2, the computer system 200 includes a Central Processing Unit (CPU)201 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)202 or a program loaded from a storage section 208 into a Random Access Memory (RAM) 203. In the RAM 203, various programs and data necessary for system operation are also stored. The CPU201, ROM 202, and RAM 203 are connected to each other via a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
The following components are connected to the I/O interface 205: an input portion 206 including a keyboard, a mouse, and the like; an output section 207 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 208 including a hard disk and the like; and a communication section 209 including a network interface card such as a LAN card, a modem, or the like. The communication section 209 performs communication processing via a network such as the internet. A drive 210 is also connected to the I/O interface 205 as needed. A removable medium 211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 210 as necessary, so that a computer program read out therefrom is mounted into the storage section 208 as necessary.
In particular, the processes described below with reference to the flowcharts may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 209 and/or installed from the removable medium 211. The computer program, when executed by a Central Processing Unit (CPU)201, performs various functions defined in the methods and apparatus of the present application.
The technical solution of the embodiment of the present disclosure is explained in detail below:
under the scenes of handling enrollment, handling health certificates, purchasing personal insurance and the like, a user is generally required to provide physical examination certificates to complete the handling of the affairs. In general, a user provides a paper-based or electronic medical examination report stored by himself/herself. First, since the physical examination report is kept by the user, the physical examination report may have been tampered, which may result in a low reliability of the physical examination report. Secondly, the physical examination party delivers the physical examination report to the user for storage, so that the risk of loss exists, and the transaction of the affairs is difficult.
In view of one or more of the above problems, the present example embodiment provides an information query request response method based on a blockchain network. The information query request response method based on the blockchain network may be applied to the server 105, and may also be applied to one or more of the terminal devices 101, 102, and 103, which is not particularly limited in this exemplary embodiment. Referring to fig. 3, the information query request response method based on the blockchain network may include the following steps S310 to S340:
step S310: and encrypting the user information according to a preset encryption mode.
Step S320: and adding a time stamp to the encrypted user information according to the information generation time and uploading the user information added with the time stamp to the block chain network.
Step S330: and updating a database for information query according to the user information in the block chain network.
Step S340: and when the information query request is received and the authorization information corresponding to the information query request is legal authorization information, responding to the information query request according to the database.
It should be noted that the embodiment of the present disclosure may be applied to evidence storage of user information (e.g., physical examination information), where the blockchain network may be used to store the user information, and a third party or a user may query corresponding user information through a query request, so that the evidence storage efficiency of the user information is improved, and the authenticity of the user information obtained by the user or the third party is ensured.
The above steps of the present exemplary embodiment will be described in more detail below.
In step S310, the user information is encrypted according to a preset encryption method.
In this example embodiment, the user information may include physical examination information of the user, and may also include daily weight data of the user, sleep conditions of the user (for example, deep sleep duration and rapid eye movement sleep duration), daily steps of the user, and a dietary structure of the user, and the embodiments of the present disclosure are not limited; the user physical examination information may include physical examination results (e.g., whether glaucoma, whether tumor exists, whether thrombus exists, etc.) corresponding to various types of physical examination items (e.g., ophthalmic examination items, ultrasonic examination items, magnetic resonance examination items, etc.).
In the exemplary embodiment, the blockchain technology utilized by the blockchain network is a special database technology, and is designed based on an Elliptic Curve Digital Signature Algorithm (ECDSA) in cryptography to realize a decentralized point-to-point (Peer to Peer, P2P) system. From a data perspective, a blockchain is a distributed database, where the distribution is embodied not only as distributed storage of data, but also as distributed records of data (i.e., collectively maintained by system participants). From the perspective of effect, the block chain can generate a set of database which records time sequence, is not falsifiable and is reliable, the set of database is decentralized to store, and data security can be effectively guaranteed. In addition, the blockchain network applied to the embodiment of the present disclosure may be composed of data blocks for storing user information, wherein the data blocks have a time sequence, and the hash value corresponding to each data block may be tracked from the current block to the target block.
In this exemplary embodiment, optionally, the encrypting the user information according to the preset encryption mode includes:
converting the user information into a hash value with a preset length through hash function mapping in a preset encryption mode so as to realize encryption of the user information; or,
and encrypting the user information by a public key in a user key with a preset encryption mode, wherein the user key further comprises a private key which is used for decrypting the user information.
In the present exemplary embodiment, the user information is converted into a hash value of a preset length by hash function mapping, which may be understood as that the user information is converted into a hash value of a preset length (e.g., 256 bits) by a hash algorithm; the hash algorithm compresses an arbitrary input through mapping of a hash function to generate a string of values with a certain length, i.e., a hash value or a hash value. In the embodiment of the present disclosure, the Hash Algorithm may be a Message-digest Algorithm (MD 5) or a Secure Hash Algorithm (SHA), and the embodiment of the present disclosure is not limited thereto. Wherein:
MD5 is a cryptographic hash function that generates a 128-bit (i.e., 16-byte) hash value to ensure that the information transfer is complete and consistent. Specifically, the MD5 code processes the incoming user information in 512-bit packets, and each packet is divided into 16 32-bit sub-packets, and after a series of processing, the output of the algorithm is composed of four 32-bit packets, and a 128-bit hash value is generated by concatenating the four 32-bit packets. SHA is a family of cryptographic hash functions, including SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512, which are used to calculate an algorithm for a fixed-length string corresponding to a digital message.
In this exemplary embodiment, the encrypting the user information according to the preset encryption mode may be: the user information is encrypted through the Hash algorithm in the preset encryption mode and then encrypted through the public key in the user key in the preset encryption mode, so that the data security is further improved through the double encryption mode, the privacy of the user can be better protected, and the use experience of the user is improved.
In this exemplary embodiment, the manner of converting the user information into a hash value with a preset length through hash function mapping to encrypt the user information may specifically be:
filling data corresponding to the user information to enable the data length to be a preset data length (such as 448 modulo 512), and adding 64-bit data length information; furthermore, a 256-bit cache may BE used to store the intermediate and final results of the hash function, where the cache may BE represented by 8 32-bit registers (i.e., A, B, C, D, E, F, G and H), a ═ 0x6a09E667, B ═ 0xBB67AE85, C ═ 0x3C6EF372, D ═ 0xA54FF53A, E ═ 0x510E527F, F ═ 0x9B05688C, G ═ 0x1F83D9AB, and H ═ 0x5BE0CD 19; further, with the 256-bit buffer values A, B, C, D, E, F, G and H as inputs, the buffer contents are updated until 64 iterations are completed, and a hash value of a preset length (e.g., 256 bits) is output.
In this exemplary embodiment, the method for encrypting the user information by using the public key in the user key of the preset encryption method may specifically be:
and encrypting the user information through an encryption algorithm and a public key of a preset encryption mode. The encryption algorithm may be a symmetric key algorithms (symmetric algorithms) or an asymmetric encryption algorithm (asymmetric algorithms), and the embodiments of the present disclosure are not limited thereto. Specifically, in a symmetric encryption algorithm, the key used for encryption and the key used for decryption are the same. In an asymmetric encryption algorithm, the key used for encryption and the key used for decryption are not the same.
In this exemplary embodiment, the method may further include the steps of:
when an information query request is received and the information query request is a third-party query request, detecting that authorization information corresponding to the information query request is legal authorization information; and when the information query request is received and is a user query request, returning the encrypted user information corresponding to the user query request. If the private key held by the user corresponds to the public key, the user information can be decrypted according to the plaintext comparison table.
The third party may be a company, an insurance company, or a school, etc. to which the user will enter, and the embodiments of the present disclosure are not limited.
Therefore, by implementing the optional embodiment, the probability that the user information is stolen or leaked can be reduced through the encryption of the user information, and the safety of the user information is guaranteed.
In step S320, the encrypted user information is time-stamped according to the information generation time and uploaded to the blockchain network.
In this exemplary embodiment, optionally, the manner of time-stamping the encrypted user information according to the information generation time is as follows:
determining sub-generation time of each physical examination result in the user information, and respectively determining the sub-generation time as a timestamp of each physical examination result;
and determining the information generation time of the user information, and determining the information generation time as the time stamp of the encrypted user information.
For example, if the physical examination result includes the following information: the test results were observed for glaucoma, tumor absence, and thrombus absence, wherein the child production time for the test results with glaucoma was 8:00 in 1/2019, the child production time for the test results with tumor absence was 9:00 in 1/2019, and the child production time for the test results with thrombus absence was 10:00 in 1/2019. Then, the examination result with glaucoma is time-stamped with a time stamp of 8:00 on 1 month 1.1.2019, the examination result without tumor is time-stamped with 9:00 on 1 month 1.1.2019, and the examination result without thrombus is time-stamped with 10:00 on 1 month 1.2019. If the generation time of the user information including the physical examination results is 2019, 1, 11:00, the user information is determined to be the time stamp of the user information on 1, 11:00 of 2019.
Therefore, by implementing the optional embodiment, the generation time of the information can be determined by stamping the time stamp, and the time corresponding to various types of information is determined for the user, so that the use experience of the user is improved.
In this example embodiment, optionally, the manner of uploading the user information after being stamped to the blockchain network is as follows:
adding a digital signature to the user information with the timestamp and generating a data block;
and checking the chain to which the current node corresponding to the data block belongs, and synchronizing the data block to other nodes in the block chain network if the checking is successful.
In the present exemplary embodiment, a digital signature (also referred to as a public key digital signature or an electronic signature) is a physical signature, which is implemented by using a technique in the field of public key encryption, and is a method for authenticating digital information. A set of digital signatures typically defines two complementary operations, one for signing and the other for verification. It can also be understood as an unforgeable string of digits that can only be generated by the sender of the message, which string of digits can be used as a valid proof of the authenticity of the message sent by the message sender.
In this exemplary embodiment, the manner of adding a digital signature to the user information after being time-stamped and generating the data block may specifically be:
calculating the abstract corresponding to the user information with the timestamp through a Hash algorithm, encrypting the abstract through a private key of a sender and generating a data packet so as to finish the operation of adding a data signature to the user information; the digital signature is understood to be an encrypted digest.
In this exemplary embodiment, the method for checking the chain to which the current node corresponding to the data block belongs may specifically be:
sequentially checking all blocks before the data block in the chain to which the current node belongs;
if the verification result is that the chain to which the current node belongs is the same as the chain corresponding to the other node, judging that the verification is successful; or, if the verification result is that the chain to which the current node belongs is the same as the chains corresponding to other nodes in a preset proportion (for example, 80%), it is determined that the verification is successful.
Therefore, by implementing the optional embodiment, the real reliability of the user information can be improved by utilizing the non-falsification of the block chain technology, so that a third party or a user can conveniently obtain the real and reliable user information.
In step S330, a database for performing information query is updated according to each piece of the user information in the blockchain network.
In this exemplary embodiment, the database is used to store user information for a user or a third party to query.
In this exemplary embodiment, the method for updating the database for performing information query according to each piece of user information in the blockchain network may specifically be: updating a database for information query in an online verification platform according to the user information in the block chain network; the online verification platform is used for providing information query service for users or third parties. Compared with the method for acquiring the user information from the blockchain network, the speed of the database of the online verification platform responding to the information query request is higher, and further the use experience of the user can be improved.
In step S340, when the information query request is received and the authorization information corresponding to the information query request is legal authorization information, the information query request is responded according to the database.
In this exemplary embodiment, the information query request may be used to query the latest physical examination information of the target user, and may also be used to query all physical examination information about the target user.
In this exemplary embodiment, the authorization information includes an identity information field of the user, and the identity information field includes at least one of a mobile phone number, an identification number, a name, a block address, a zip code, and a mailbox; optionally, the method further comprises the following steps:
detecting the consistency degree of the authorization information corresponding to the information query request and the authorization information corresponding to the user information;
and if the consistency degree is greater than the preset degree, judging that the authorization information corresponding to the information inquiry request is legal authorization information. If the consistency degree is not greater than the preset degree, the process is ended.
In the present exemplary embodiment, the degree of coincidence and the preset degree are used to indicate the same proportion of the parts of the information, e.g., 80% identical. If the preset degree indicates that 80% of the two pieces of information are the same, and the consistency degree indicates that 80% of the two pieces of information are the same, it can be determined that the authorization information corresponding to the information query request is legal authorization information.
In this example embodiment, the authorization information may be a combination of at least two kinds of information in the identity information field, such as a mobile phone number + an identity card number + a block address, a name, a block address, a zip code, and a mailbox. In addition, the authorization information may further include a key field of the user, and the key field may include a private key of the user or a custom password or a combination of the private key and the custom password, which is not limited in the embodiments of the disclosure.
In this exemplary embodiment, the manner of responding to the information query request by the database may specifically be: and returning one or more pieces of user information corresponding to the information query request to the user or the client of the third party.
Therefore, by implementing the optional embodiment, the required user information can be acquired from the database through the authorization information, so that the safety of the user information is improved, and the risk of stealing the user information is reduced.
In this exemplary embodiment, optionally, responding to the information query request according to the database includes:
traversing the database according to data in the information query request to determine target user information;
if the query authority corresponding to the information query request is the first query authority, returning the target user information; and if the inquiry authority is the second inquiry authority, determining specific information in the target user information according to the second inquiry authority and returning.
In this example embodiment, the first query right may be a right allowing to obtain complete user information; the second query right may be a right to allow acquisition of a part of the user information. Wherein, if the physical examination result in the user information comprises: myopia, lumbar disc herniation, glaucoma, cervical spondylosis, and gynecological disorders. The specific information may be myopia, lumbar disc herniation, glaucoma, and cervical spondylosis among user information specified by the user. Because the privacy of the gynecological disease is stronger than that of other examination results, the user can not obtain the examination result by specifying the specific information, so that the privacy is protected.
Therefore, by implementing the optional embodiment, different results can be returned through different query authorities, and privacy protection on user information is further improved.
Therefore, by implementing the information query request response method based on the blockchain network shown in fig. 3, the problem that an organization cannot verify the authenticity of information provided by a user can be overcome to a certain extent, and further the risk degree of identity verification or transaction processing is reduced; the user information can be stored through the block chain network, so that the evidence storage difficulty of the user information is reduced; and based on the time-sequence connection among the blocks, the query efficiency of the user information can be improved.
Referring to fig. 4, fig. 4 schematically shows a flowchart of an information query request response method based on a blockchain network according to another embodiment of the present disclosure. As shown in fig. 4, an information query request response method based on a blockchain network according to another embodiment includes steps S400 to S490, where:
step S400: and converting the user information into a hash value with a preset length through hash function mapping of a preset encryption mode so as to realize encryption of the user information.
Step S410: and determining the sub-generation time of each physical examination result in the user information, and determining the sub-generation time as the time stamp of each physical examination result.
Step S420: and determining the information generation time of the user information, and determining the information generation time as the time stamp of the encrypted user information.
Step S430: adding a digital signature to the user information after the time stamp and generating a data block.
Step S440: and checking the chain to which the current node corresponding to the data block belongs, and synchronizing the data block to other nodes in the block chain network if the checking is successful.
Step S450: and updating a database for information query according to the user information in the block chain network.
Step S460: and detecting the consistency degree of the authorization information corresponding to the received information inquiry request and the authorization information corresponding to the user information, if so, executing the step S470, and if not, ending the process.
Step S470: and judging that the authorization information corresponding to the information inquiry request is legal authorization information.
Step S480: and traversing the database according to the data in the information query request to determine the target user information.
Step S490: if the query authority corresponding to the information query request is the first query authority, returning the target user information; and if the inquiry authority is the second inquiry authority, determining specific information in the target user information according to the second inquiry authority and returning.
Specifically, the user information may be converted into a hash value of a preset length (e.g., 256 bits) by hash function mapping in a preset encryption manner; the preset encryption mode may include a user key in addition to the hash function mapping, that is, the encryption mode for encrypting the user information may be encryption through the hash function mapping, or encryption through a public key in the user key, and the embodiment of the present disclosure is not limited.
Furthermore, the sub-generation time of each physical examination result in the user information can be determined, and the sub-generation time is respectively determined as the time stamp of each physical examination result; if the user information is physical examination information, the physical examination information can comprise a plurality of physical examination results, and the user performs the physical examinations according to the sequence, so that the sub-generation time of the physical examination results is different, and the corresponding time stamps are added to the physical examination results, so that the user or a third party can clearly know the generation time of the physical examination results when acquiring the physical examination information, and the processing efficiency of related affairs (such as handling and entering procedures) is improved. In addition, since one user can correspond to a plurality of user information at different times, for example, the physical examination information in 2010, the physical examination information in 2013, the physical examination information in 2015, and the physical examination information in 2019, the user information to be returned can be located more quickly and accurately according to the information query request when the user information is acquired by determining the information generation time of the user information, and the information query efficiency is improved.
Further, a digital signature can be added to the user information with the timestamp to generate a data block, the chain to which the current node corresponding to the data block belongs is verified, and if verification is successful, the data block is synchronized with other nodes in the block chain network. By linking the user information, the user information obtained by other nodes can be ensured to be real and reliable. Furthermore, when the information query request is received, it may be detected whether the information query request is legal, for example, the information that the information query request needs to query is the physical examination information of zhang, and the physical examination information of zhang needs to be verified by the authorization information, where the authorization information of zhang is: zusanli 12345, if the authorization information corresponding to the information query request is Zusanli 12345, the authorization information corresponding to the information query request can be considered to be consistent with the authorization information corresponding to the user information, and then the authorization information corresponding to the information query request is judged to be legal authorization information.
Further, the target user information, such as physical examination information of Zhang III, can be determined by traversing the database according to the data in the information query request. In addition, if the query authority corresponding to the information query request is the first query authority, returning the target user information; and if the inquiry authority is the second inquiry authority, determining specific information (such as biochemical results in the physical examination information) in the target user information according to the second inquiry authority and returning.
Therefore, by implementing the information query request response method based on the blockchain network shown in fig. 4, the problem that an organization cannot verify the authenticity of information provided by a user can be overcome to a certain extent, and further the risk degree of identity verification or transaction processing is reduced; the user information can be stored through the block chain network, so that the evidence storage difficulty of the user information is reduced; and based on the time-sequence connection among the blocks, the query efficiency of the user information can be improved.
Referring to fig. 5, fig. 5 schematically illustrates a physical examination information checking framework diagram based on a blockchain network according to an embodiment of the present disclosure, including steps S510 to S540, wherein:
step S510: and receiving the offline appointment performed according to the identity information such as the name, the identity card number, the mobile phone number and the like.
Step S520: and acquiring offline physical examination information in real time.
Step S530: and carrying out encryption processing on the physical examination information, stamping the physical examination information and adding an electronic signature.
Step S540: and updating a database for information query of the online check platform according to the physical examination information in the block chain network.
Specifically, the user can make an appointment for physical examination through identity information such as names, identification card numbers, mobile phone numbers and the like in an offline appointment mode, and perform offline physical examination after the appointment is successful; when the server receives the offline appointment of the user according to the identity information such as the name, the identity card number, the mobile phone number and the like, the online physical examination information of the user can be obtained in real time, and further the physical examination information can be encrypted, subjected to timestamp processing, added with an electronic signature and uploaded to a block chain network; furthermore, the database for information query in the online check platform can be updated according to the physical examination information in the blockchain network, so that the user can query the physical examination information and a third party authorized by the user can query the physical examination information.
It can be seen that, by implementing the embodiments of the present disclosure in combination with the physical examination information verification framework diagram shown in fig. 5, the problem that an organization cannot verify the authenticity of information provided by a user can be overcome to a certain extent, and further, the risk degree of identity verification or transaction processing is reduced; the user information can be stored through the block chain network, so that the evidence storage difficulty of the user information is reduced; and based on the time-sequence connection among the blocks, the query efficiency of the user information can be improved.
Further, in this example embodiment, an information query request responding apparatus based on a blockchain network is also provided. The information inquiry request responding device based on the block chain network can be applied to a server or a terminal device. Referring to fig. 6, the device 600 for responding to an information query request based on a blockchain network may include a user information processing unit 601, a data updating unit 602, and a query request responding unit 603, where:
a user information processing unit 601, configured to perform encryption processing on user information according to a preset encryption manner; according to the information generation time, adding a timestamp to the encrypted user information and uploading the user information added with the timestamp to a block chain network;
a data updating unit 602, configured to update a database for performing information query according to information of each user in the blockchain network;
the query request responding unit 603 is configured to, when the information query request is received and the authorization information corresponding to the information query request is legal authorization information, respond to the information query request according to the database.
The user information may include user physical examination information, and the user physical examination information includes physical examination results corresponding to various types of physical examination items.
Therefore, by implementing the information query request response device based on the blockchain network shown in fig. 6, the problem that an organization cannot verify the authenticity of information provided by a user can be overcome to a certain extent, and the risk degree of identity verification or transaction processing is further reduced; the user information can be stored through the block chain network, so that the evidence storage difficulty of the user information is reduced; and based on the time-sequence connection among the blocks, the query efficiency of the user information can be improved.
In an exemplary embodiment of the present disclosure, the manner in which the user information processing unit 601 performs encryption processing on the user information according to the preset encryption manner is specifically:
the user information processing unit 601 converts the user information into a hash value with a preset length through hash function mapping of a preset encryption mode to realize encryption of the user information; or,
the user information processing unit 601 encrypts the user information through a public key in a user key of a preset encryption mode, wherein the user key further comprises a private key, and the private key is used for decrypting the user information.
Therefore, by implementing the exemplary embodiment, the probability that the user information is stolen or leaked can be reduced through the encryption of the user information, and the safety of the user information is guaranteed.
In an exemplary embodiment of the present disclosure, the user information processing unit 601 time-stamps the user information after the encryption processing according to the information generation time in such a manner that:
the user information processing unit 601 determines sub-generation times of the physical examination results in the user information, and determines the sub-generation times as time stamps of the physical examination results, respectively;
the user information processing unit 601 determines an information generation time of the user information, and determines the information generation time as a time stamp of the user information after the encryption processing.
Therefore, by implementing the exemplary embodiment, the generation time of the information can be determined by stamping, and the time corresponding to various types of information is specified for the user, so that the user experience is improved.
In an exemplary embodiment of the present disclosure, the manner in which the user information processing unit 601 uploads the user information after being time-stamped to the blockchain network is as follows:
the user information processing unit 601 adds a digital signature to the user information with the timestamp and generates a data block;
the user information processing unit 601 checks the chain to which the current node corresponding to the data block belongs, and synchronizes the data block to other nodes in the block chain network if the check is successful.
Therefore, by implementing the optional embodiment, the real reliability of the user information can be improved by utilizing the non-falsification of the block chain technology, so that a third party or a user can conveniently obtain the real and reliable user information.
In an exemplary embodiment of the present disclosure, the authorization information includes an identity information field of the user, and the identity information field includes at least one of a mobile phone number, an identification number, a name, a block address, a zip code, and a mailbox; the apparatus further includes an information detection unit (not shown) and an information determination unit (not shown), wherein:
the information detection unit is used for detecting the consistency degree of the authorization information corresponding to the information inquiry request and the authorization information corresponding to the user information;
and the information judging unit is used for judging the authorization information corresponding to the information inquiry request as legal authorization information when the consistency degree is greater than the preset degree.
Therefore, by implementing the optional embodiment, the required user information can be acquired from the database through the authorization information, so that the safety of the user information is improved, and the risk of stealing the user information is reduced.
In an exemplary embodiment of the present disclosure, the manner of the query request responding unit 603 responding to the information query request according to the database is specifically:
the query request responding unit 603 traverses the database according to the data in the information query request to determine the target user information;
if the query permission corresponding to the information query request is the first query permission, the query request response unit 603 returns the target user information; if the query right is the second query right, the query request responding unit 603 determines specific information in the target user information according to the second query right and returns the specific information.
Therefore, by implementing the optional embodiment, different results can be returned through different query authorities, and privacy protection on user information is further improved.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Since each functional module of the device for responding to an information query request based on a blockchain network according to the example embodiment of the present disclosure corresponds to the step of the example embodiment of the method for responding to an information query request based on a blockchain network, please refer to the embodiment of the method for responding to an information query request based on a blockchain network according to the present disclosure for details that are not disclosed in the embodiment of the device of the present disclosure.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.