CN112948458B - Block chain-based query method and device - Google Patents
Block chain-based query method and device Download PDFInfo
- Publication number
- CN112948458B CN112948458B CN202110166467.3A CN202110166467A CN112948458B CN 112948458 B CN112948458 B CN 112948458B CN 202110166467 A CN202110166467 A CN 202110166467A CN 112948458 B CN112948458 B CN 112948458B
- Authority
- CN
- China
- Prior art keywords
- contract
- query
- user
- character string
- relation
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000013475 authorization Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 230000003993 interaction Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000003416 augmentation Effects 0.000 description 2
- 210000000744 eyelid Anatomy 0.000 description 2
- 238000012797 qualification Methods 0.000 description 2
- 238000002435 rhinoplasty Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2471—Distributed queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/248—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting 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
- G06F21/6227—Protecting 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 where protection concerns the structure of data, e.g. records, types, queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Bioethics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application discloses a query method and device based on a blockchain, electronic equipment and a computer readable storage medium, and relates to the technical field of blockchains. The specific implementation scheme is as follows: acquiring query information of a first user; accessing a summary contract corresponding to the first user according to the registered contract; accessing a relationship contract corresponding to the query information according to a relationship contract reference list contained in the accessed summary contract; determining a query character string corresponding to the first user according to the access rights contained in the accessed relationship contract; and acquiring a query result according to the query character string and sending the query result to the first user. The application can improve the query efficiency and the query safety.
Description
Technical Field
The application relates to the technical field of computers, in particular to the technical field of blockchain. A blockchain-based query method, apparatus, electronic device, and computer-readable storage medium are provided.
Background
With the rapid development of technology, the smart combination of big data and artificial intelligence has become the focus of attention more and more. Particularly for the medical field, how to enable a user to conveniently inquire corresponding medical data on the basis of avoiding the leakage of the medical data is important privacy data of the user, and is a technical problem to be solved urgently at present.
Disclosure of Invention
The application provides a query method, a query device, electronic equipment and a computer readable storage medium based on a blockchain, so as to improve query efficiency and query safety.
According to a first aspect of the present application, there is provided a blockchain-based query method, comprising: acquiring query information of a first user; accessing a summary contract corresponding to the first user according to the registered contract; accessing a relationship contract corresponding to the query information according to a relationship contract reference list contained in the accessed summary contract; determining a query character string corresponding to the first user according to the access rights contained in the accessed relationship contract; and acquiring a query result according to the query character string and sending the query result to the first user.
According to a second aspect of the present application, there is provided a blockchain-based querying device, comprising: the acquisition unit is used for acquiring the query information of the first user; a first access unit for accessing a summary contract corresponding to the first user according to a registered contract; a second access unit, configured to access a relationship contract corresponding to the query information according to a relationship contract reference list included in the accessed summary contract; a determining unit, configured to determine a query string corresponding to the first user according to an access right included in the accessed relationship contract; and the query unit is used for acquiring a query result according to the query character string and sending the query result to the first user.
According to a third aspect of the present application, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described above.
According to a fourth aspect of the present application there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method as described above.
According to a fifth aspect of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method as described above.
According to the technical scheme, the purpose of acquiring the query result corresponding to the user query information based on the blockchain is achieved by means of the characteristics of decentralization and tamper resistance of the blockchain through the registration contracts, the summary contracts and the relationship contracts which are deployed in the blockchain, and the query safety and the query efficiency can be improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
The drawings are included to provide a better understanding of the present application and are not to be construed as limiting the application. Wherein:
FIG. 1 is a schematic diagram of a first embodiment according to the present application;
FIG. 2 is a schematic diagram of a second embodiment according to the present application;
FIG. 3 is a block diagram of an electronic device for implementing a blockchain-based query method of embodiments of the application.
Detailed Description
Exemplary embodiments of the present application will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present application are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram according to a first embodiment of the present application. As shown in fig. 1, the blockchain-based query method of the present embodiment may specifically include the following steps:
s101, acquiring query information of a first user;
s102, accessing a summary contract corresponding to the first user according to a registration contract;
s103, accessing a relationship contract corresponding to the query information according to a relationship contract reference list contained in the accessed summary contract;
s104, determining a query character string corresponding to the first user according to the access rights contained in the accessed relationship contract;
s105, acquiring a query result according to the query character string and sending the query result to the first user.
According to the query method based on the blockchain, through the registration contracts, the summary contracts and the relationship contracts which are deployed in the blockchain, the purpose of acquiring the query result corresponding to the user query information based on the blockchain is achieved by means of the characteristics of decentralization and tamper resistance of the blockchain, and the query safety and the query efficiency are improved.
The query information acquired in S101 may be query information of the medical data of the first user, query information of medical data of other users for the first user, or query information of a medical institution for the first user.
The present embodiment executes S102 to access the summary contract corresponding to the first user according to the registered contract after executing S101 to acquire the query information of the first user.
The registration contract in this embodiment includes identification information corresponding to each participant (user, medical institution), an ethernet address, and a summary contract address; the identification information is character string of participant ID, the Ethernet address is identity information of the participant in the blockchain, and the summary contract address is blockchain address when accessing the summary contract.
Specifically, when executing S102 to access the summary contracts corresponding to the first user according to the registration contract, the present embodiment may adopt the following alternative implementation manners: determining a summarized contract address corresponding to the identification information of the first user in the registered contract; accessing the summary contracts according to the determined summary contract address. That is, the registration contract in this embodiment maps the user's identification information to another address on the blockchain for access to the summary contract.
In addition, the ethernet address of the participant included in the registration contract in this embodiment may be generated in the following manner: generating 256-bit random numbers as private keys; converting the private key to a 512-bit public key, for example using elliptic curve algorithm secp256k1 to generate the public key from the private key; converting the public key into a hexadecimal string, for example, calculating a hash value of the public key using a hash algorithm keccak 256; taking the last 40 characters of the hexadecimal character string, adding 0x at the beginning as the Ethernet address, and different users can correspond to different Ethernet addresses in the block chain.
The present embodiment, after executing S102 access to the summary contract corresponding to the first user, executes S103 access to the relationship contract corresponding to the acquired query information according to the relationship contract reference list contained in the accessed summary contract.
The summary contracts in this embodiment are used to more accurately and quickly find a corresponding query result for the user, which is located between the registered contract and the relationship contract, and connect the registered contract and the relationship contract.
In this embodiment, different summary contracts correspond to different participants, and each summary contract includes an ethernet address of a participant and a relationship contract reference list that records the interaction history of the participant between the previous participant and the current participant and other participants, as well as relationship contract addresses.
In addition, the summary contracts corresponding to the medical institution participants in the embodiment also include authentication credentials of the third party institution for the medical institution, so that the user can obtain qualification conditions of the corresponding medical institution when querying the medical institution, and the validity of information queried by the user is further ensured.
Since the relationship contract reference list records the interaction history of the first user between the previous participant and the current participant, the embodiment needs to determine which relationship contract is exactly accessed through the query information of the first user.
For example, if the first user performs the augmentation rhinoplasty operation in the medical institution a and performs the double eyelid operation in the medical institution B, if the query information of the first user is an electronic medical record for querying that the first user performed the augmentation rhinoplasty operation, the relationship contract corresponding to the medical institution a is accessed in S103; similarly, if the query information of the first user is the electronic medical record for which the double eyelid operation is performed, the relationship contract corresponding to the medical institution B is accessed by executing S103 in this embodiment.
In this embodiment, after executing S103 to access a relationship contract corresponding to the acquired query information, executing S104 determines a query string corresponding to the first user according to the access rights included in the accessed relationship contract.
The relationship contract in the embodiment is a contract between a medical institution, a user and a third party institution, the relationship contract can indicate the relationship between the medical institution and the user, and the authority of the relationship contract can be improved by adding the third party institution in the existing contract between the medical institution and the user.
For example, if the user a searches for the medical institution C through the third party institution and performs the fat reduction operation on the medical institution C, the relationship in which the user a searches for and performs the operation on the medical institution C through the third party institution may appear in the relationship contract.
The relationship contract in this embodiment includes access rights different from access rights corresponding to different users and various query strings, each query string being used to obtain a subset of the user's medical data in a corresponding database. The query string is concatenated with the hash of the subset of medical data to ensure that the data is not modified in the source file. In order to enable the user to share his medical data with other users, the relationship contract may also use a hash table to map the viewer's address to an additional list of query strings, each of which may specify that a portion of the user's medical data may be viewed by the viewer.
In this embodiment, when executing S104 to determine the query string corresponding to the first user according to the access rights included in the accessed relationship contract, the optional implementation manner may be: determining whether the first user is consistent with the initial user corresponding to the query information, for example, comparing the identification information of the first user with the identification information of the initial user corresponding to the query information to determine whether the first user is consistent with the initial user corresponding to the query information; if yes, taking the query character strings for acquiring all the medical data as the query character strings corresponding to the first user; if not, the query character string for acquiring the part of medical data is taken as the query character string corresponding to the first user, wherein the part of medical data of the user can be preset by the user.
That is, in this embodiment, when the first user queries the medical data of the first user, all the medical data of the first user is obtained as a query result, and when the first user queries the medical data of the second user, part of the medical data of the second user is obtained as a query result, so that the security of the medical data of the first user is further ensured.
In addition, after executing S104 to determine that the first user is inconsistent with the initial user corresponding to the query information, the present embodiment may further include the following: sending an authorization request to an initial user; after receiving the authorization result that the initial user returns to agree to access, the query character string for acquiring all the medical data is taken as the query character string corresponding to the first user.
That is, in this embodiment, when the first user queries the medical data of the other user, the first user can access all the medical data of the other user by sending an authorization request to the queried user, so as to refer to the first user, and ensure the authenticity and reliability.
After the execution S104 of the present embodiment determines the query string corresponding to the first user, the execution S105 obtains the query result according to the query string and sends the query result to the first user.
In general, different medical data of a user is stored separately according to different medical institutions, for example, medical data generated by the user in the medical institution a is placed in a database of the medical institution a, and medical data generated by the user in the medical institution B is placed in a database of the medical institution B. If the determined query character strings correspond to different medical institutions, different databases are required to be accessed for acquisition, so that the query speed is low and the query efficiency is low.
In this embodiment, different medical data of different users are placed in a third party database of a third party institution, all medical data of all users are stored in the same way by the preset third party database, and corresponding query results can be obtained by directly accessing the third party database through query strings, so that query speed and query efficiency can be further improved.
Therefore, in executing S105 to obtain a query result from a query string, the present embodiment may employ the following manner: accessing a preset third party database according to the query character string; medical data corresponding to the query character string in the third party database is obtained as a query result.
According to the method provided by the embodiment, the purpose of acquiring the query result corresponding to the user query information based on the blockchain is achieved through the registration contracts, the summary contracts and the relationship contracts which are deployed in the blockchain, and the query safety and the query efficiency are improved.
Fig. 2 is a schematic diagram according to a second embodiment of the present application. As shown in fig. 2, the blockchain-based query device of the present embodiment includes:
an acquiring unit 201, configured to acquire query information of a first user;
a first access unit 202, configured to access a summary contract corresponding to the first user according to a registration contract;
a second accessing unit 203, configured to access a relationship contract corresponding to the query information according to a relationship contract reference list included in the accessed summary contract;
a determining unit 204, configured to determine a query string corresponding to the first user according to an access right included in the accessed relationship contract;
and the query unit 205 is configured to obtain a query result according to the query string and send the query result to the first user.
The query information acquired by the acquiring unit 201 may be query information of the medical data of the first user, query information of medical data of other users for the first user, or query information of a medical institution for the first user.
The present embodiment, after acquiring the query information of the first user by the acquisition unit 201, executes access to the summary contract of the corresponding first user according to the registered contract by the first access unit 202.
The registration contract in this embodiment includes identification information corresponding to each participant (user, medical institution), an ethernet address, and a summary contract address; the identification information is character string of participant ID, the Ethernet address is identity information of the participant in the blockchain, and the summary contract address is blockchain address when accessing the summary contract.
Specifically, when the first access unit 202 accesses the summary contract corresponding to the first user according to the registration contract, the optional implementation manner may be: determining a summarized contract address corresponding to the identification information of the first user in the registered contract; accessing the summary contracts according to the determined summary contract address. That is, the registration contract in this embodiment maps the user's identification information to another address on the blockchain for access to the summary contract.
In addition, the ethernet address of the participant included in the registration contract in this embodiment may be generated in the following manner: generating 256-bit random numbers as private keys; converting the private key into a 512-bit public key; converting the public key into hexadecimal character strings; taking the last 40 characters of the hexadecimal character string, adding 0x at the beginning as the Ethernet address, and different users can correspond to different Ethernet addresses in the block chain.
In the present embodiment, after the first access unit 202 accesses the summary contract corresponding to the first user, the second access unit 203 accesses the relationship contract corresponding to the acquired query information according to the relationship contract reference list contained in the accessed summary contract.
The summary contracts in this embodiment are used to more accurately and quickly find a corresponding query result for the user, which is located between the registered contract and the relationship contract, and connect the registered contract and the relationship contract.
In this embodiment, different summary contracts correspond to different participants, and each summary contract includes an ethernet address of a participant and a relationship contract reference list that records the interaction history of the participant between the previous participant and the current participant and other participants, as well as relationship contract addresses.
In addition, the summary contracts corresponding to the medical institution participants in the embodiment also include authentication credentials of the third party institution for the medical institution, so that the user can obtain qualification conditions of the corresponding medical institution when querying the medical institution, and the validity of information queried by the user is further ensured.
Since the relationship contract reference list records the interaction history of the first user between the previous participant and the current participant, the embodiment needs to determine which relationship contract is exactly accessed through the query information of the first user.
In the present embodiment, after a relationship contract corresponding to the acquired query information is accessed by the second access unit 203, the query string corresponding to the first user is determined by the determination unit 204 according to the access right included in the accessed relationship contract.
The relationship contract in this embodiment is a contract between a medical institution, a user and a third party institution, and the relationship between the three can be known by the relationship contract.
The relationship contract in this embodiment includes access rights different from access rights corresponding to different users and various query strings, each query string being used to obtain a subset of the user's medical data in a corresponding database. The query string is concatenated with the hash of the subset of medical data to ensure that the data is not modified in the source file. In order to enable the user to share his medical data with other users, the relationship contract may also use a hash table to map the viewer's address to an additional list of query strings, each of which may specify that a portion of the user's medical data may be viewed by the viewer.
The determining unit 204 may determine, according to the access rights included in the accessed relationship contract, the query string corresponding to the first user, by using the following alternative implementation manners: determining whether the first user is consistent with an initial user corresponding to the query information; if yes, taking the query character strings for acquiring all the medical data as the query character strings corresponding to the first user; if not, the query character string for acquiring the part of medical data is taken as the query character string corresponding to the first user, wherein the part of medical data of the user can be preset by the user.
That is, the determining unit 204 can obtain all the medical data of the user as the query result in the case where the first user queries the medical data of the user, and obtain part of the medical data of the other user as the query result in the case where the first user queries the medical data of the other user, thereby further ensuring the security of the medical data of the user.
In addition, the determining unit 204 may further include the following after determining that the first user is inconsistent with the initial user corresponding to the query information: sending an authorization request to an initial user; after receiving the authorization result that the initial user returns to agree to access, the query character string for acquiring all the medical data is taken as the query character string corresponding to the first user.
That is, the determining unit 204 can also realize that the first user accesses all the medical data of other users by sending an authorization request to the queried user in the case that the first user queries the medical data of other users, thereby referencing the first user and ensuring the authenticity and reliability.
In this embodiment, after the determining unit 204 determines the query string corresponding to the first user, the querying unit 205 obtains the query result according to the query string and sends the query result to the first user.
The query unit 205 may, when acquiring a query result from a query string, employ the following manner: accessing a preset third party database according to the query character string; medical data corresponding to the query character string in the third party database is obtained as a query result.
According to embodiments of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.
As shown in fig. 3, a block diagram of an electronic device is provided for a blockchain-based query method in accordance with an embodiment of the application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 3, the apparatus 300 includes a computing unit 301 that may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 302 or a computer program loaded from a storage unit 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the device 300 may also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other by a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Various components in device 300 are connected to I/O interface 305, including: an input unit 306 such as a keyboard, a mouse, etc.; an output unit 307 such as various types of displays, speakers, and the like; a storage unit 308 such as a magnetic disk, an optical disk, or the like; and a communication unit 309 such as a network card, modem, wireless communication transceiver, etc. The communication unit 309 allows the device 300 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 301 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 301 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above, such as a blockchain-based query method. For example, in some embodiments, the blockchain-based query method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 308.
In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 300 via the ROM 302 and/or the communication unit 309. When the computer program is loaded into RAM 303 and executed by computing unit 301, one or more steps of the blockchain-based query method described above may be performed. Alternatively, in other embodiments, the computing unit 301 may be configured to perform the blockchain-based query method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here can be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present application may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller 30, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the present application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of the present application.
Claims (10)
1. A blockchain-based query method, comprising:
acquiring query information of a first user;
accessing a summary contract corresponding to the first user according to a registration contract, wherein the summary contract corresponds to a participant and comprises an Ethernet address and a relation contract reference list of the participant, and the summary contract is positioned between the registration contract and the relation contract and is used for connecting the registration contract and the relation contract;
accessing a relation contract corresponding to the query information according to a relation contract reference list contained in the accessed summary contract, wherein the relation contract is a contract among a medical institution, a user and a third party institution, the relation contract is used for indicating the relation among the medical institution, the user and the third party institution, the relation contract contains access rights and various query character strings, and the access rights corresponding to different users are different;
determining a query character string corresponding to the first user according to the access rights contained in the accessed relationship contract;
acquiring a query result according to the query character string and sending the query result to the first user;
wherein the determining the query string corresponding to the first user according to the access rights contained in the accessed relationship contract includes:
determining whether the first user is consistent with an initial user corresponding to the query information;
if yes, taking the query character string for acquiring all the medical data as the query character string corresponding to the first user;
if not, the query character string for acquiring part of the medical data is used as the query character string corresponding to the first user.
2. The method of claim 1, wherein the accessing the summary contract corresponding to the first user according to a registration contract comprises:
determining a summary contract address corresponding to the identification information of the first user in the registered contract;
based on the determined summary contract address, a summary contract is accessed.
3. The method of claim 1, further comprising,
after determining that the first user is inconsistent with an initial user corresponding to the query information, sending an authorization request to the initial user;
and after receiving an authorization result that the initial user returns to agree with the access, taking the query character string for acquiring all the medical data as the query character string corresponding to the first user.
4. The method of claim 1, wherein the obtaining the query result from the query string and sending to the first user comprises:
accessing a preset third party database according to the query character string;
and acquiring medical data corresponding to the query character string in the third party database as the query result.
5. A blockchain-based querying device, comprising:
the acquisition unit is used for acquiring the query information of the first user;
the first access unit is used for accessing a summary contract corresponding to the first user according to a registration contract, wherein the summary contract corresponds to a participant and comprises an Ethernet address and a relation contract reference list of the participant, and the summary contract is positioned between the registration contract and the relation contract and is used for connecting the registration contract with the relation contract;
the second access unit is used for accessing a relation contract corresponding to the query information according to a relation contract reference list contained in the accessed summary contract, wherein the relation contract is a contract among a medical institution, a user and a third party institution, the relation contract is used for indicating the contact among the medical institution, the user and the third party institution, the relation contract contains access rights and various query character strings, and the access rights corresponding to different users are different;
a determining unit, configured to determine a query string corresponding to the first user according to an access right included in the accessed relationship contract;
the query unit is used for acquiring a query result according to the query character string and sending the query result to the first user;
the determining unit determines a query string corresponding to the first user according to the access rights included in the accessed relationship contract, and specifically performs:
determining whether the first user is consistent with an initial user corresponding to the query information;
if yes, taking the query character string for acquiring all the medical data as the query character string corresponding to the first user;
if not, the query character string for acquiring part of the medical data is used as the query character string corresponding to the first user.
6. The apparatus of claim 5, wherein the first access unit, when accessing a summary contract corresponding to the first user according to a registration contract, specifically performs:
determining a summary contract address corresponding to the identification information of the first user in the registered contract;
based on the determined summary contract address, a summary contract is accessed.
7. The apparatus of claim 5, the determining unit further configured to perform,
after determining that the first user is inconsistent with an initial user corresponding to the query information, sending an authorization request to the initial user;
and after receiving an authorization result that the initial user returns to agree with the access, taking the query character string for acquiring all the medical data as the query character string corresponding to the first user.
8. The apparatus of claim 5, wherein the query unit, when acquiring a query result according to the query string and transmitting the query result to the first user, specifically performs:
accessing a preset third party database according to the query character string;
and acquiring medical data corresponding to the query character string in the third party database as the query result.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110166467.3A CN112948458B (en) | 2021-02-04 | 2021-02-04 | Block chain-based query method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110166467.3A CN112948458B (en) | 2021-02-04 | 2021-02-04 | Block chain-based query method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112948458A CN112948458A (en) | 2021-06-11 |
CN112948458B true CN112948458B (en) | 2023-08-18 |
Family
ID=76243004
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110166467.3A Active CN112948458B (en) | 2021-02-04 | 2021-02-04 | Block chain-based query method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112948458B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019032643A1 (en) * | 2017-08-08 | 2019-02-14 | Quio Technologies, Llc | Self-executing agents for gathering health information between trusted parties |
CN109522735A (en) * | 2018-11-29 | 2019-03-26 | 上海中信信息发展股份有限公司 | A kind of data permission verification method and device based on intelligent contract |
CN110729028A (en) * | 2019-10-15 | 2020-01-24 | 腾讯科技(深圳)有限公司 | Health data processing method and device, electronic equipment and storage medium |
CN111145850A (en) * | 2019-12-23 | 2020-05-12 | 支付宝(杭州)信息技术有限公司 | Medical data query method and device based on block chain |
CN111444258A (en) * | 2020-02-11 | 2020-07-24 | 江苏荣泽信息科技股份有限公司 | Medical data sharing method based on block chain |
CN111797415A (en) * | 2020-06-30 | 2020-10-20 | 远光软件股份有限公司 | Block chain based data sharing method, electronic device and storage medium |
-
2021
- 2021-02-04 CN CN202110166467.3A patent/CN112948458B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019032643A1 (en) * | 2017-08-08 | 2019-02-14 | Quio Technologies, Llc | Self-executing agents for gathering health information between trusted parties |
CN109522735A (en) * | 2018-11-29 | 2019-03-26 | 上海中信信息发展股份有限公司 | A kind of data permission verification method and device based on intelligent contract |
CN110729028A (en) * | 2019-10-15 | 2020-01-24 | 腾讯科技(深圳)有限公司 | Health data processing method and device, electronic equipment and storage medium |
CN111145850A (en) * | 2019-12-23 | 2020-05-12 | 支付宝(杭州)信息技术有限公司 | Medical data query method and device based on block chain |
CN111444258A (en) * | 2020-02-11 | 2020-07-24 | 江苏荣泽信息科技股份有限公司 | Medical data sharing method based on block chain |
CN111797415A (en) * | 2020-06-30 | 2020-10-20 | 远光软件股份有限公司 | Block chain based data sharing method, electronic device and storage medium |
Non-Patent Citations (1)
Title |
---|
张培培 等.基于区块链的电子健康档案管理***设计.电脑编程技巧与维护.2020,全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN112948458A (en) | 2021-06-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2018510410A (en) | Method and apparatus for processing address text | |
CN108846753B (en) | Method and apparatus for processing data | |
CN107133309B (en) | Method and device for storing and querying process example, storage medium and electronic equipment | |
WO2021036086A1 (en) | Transaction data processing method, apparatus and system, and computer-readable storage medium | |
WO2020215685A1 (en) | Block chain-based information processing and acquisition methods and apparatus, device, and medium | |
CN108830107B (en) | Method and device for protecting privacy information, electronic equipment and computer readable storage medium | |
JP2019530046A (en) | Collecting user information from computer systems | |
CN108564461B (en) | Resource allocation method, computer readable storage medium and terminal device | |
WO2022267769A1 (en) | Method and apparatus for generating graph data | |
CN114513350A (en) | Identity verification method, system and storage medium | |
WO2012129684A1 (en) | Transforming http requests into web services trust messages for security processing | |
CN117633835A (en) | Data processing method, device, equipment and storage medium | |
CN110020040B (en) | Method, device and system for querying data | |
US10944578B2 (en) | Identity verification | |
WO2024045725A1 (en) | Processing method for target insurance policy, electronic device and readable storage medium | |
CN115955362B (en) | Block chain-based data storage and communication method, device, equipment and medium | |
CN112948458B (en) | Block chain-based query method and device | |
CN115002211B (en) | Method, device, equipment and medium for realizing after-sale micro-service based on cloud protogenesis | |
CN115858914A (en) | Method, device and system for inquiring hiding trace, terminal equipment and storage medium | |
CN111752964A (en) | Data processing method and device based on data interface | |
TW201939415A (en) | Service verification method and device | |
CN114398678A (en) | Registration verification method and device for preventing electronic file from being tampered, electronic equipment and medium | |
WO2023024057A1 (en) | Cross-domain authorization processing method and cross-domain call processing method | |
CN116136844A (en) | Entity identification information generation method, device, medium and electronic equipment | |
CN109450781B (en) | Mail communication method based on distributed network and related device |
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 |