CN111639108A - Data query method and device, electronic equipment and computer readable storage medium - Google Patents

Data query method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN111639108A
CN111639108A CN202010462072.3A CN202010462072A CN111639108A CN 111639108 A CN111639108 A CN 111639108A CN 202010462072 A CN202010462072 A CN 202010462072A CN 111639108 A CN111639108 A CN 111639108A
Authority
CN
China
Prior art keywords
target data
identification information
query request
terminal device
block chain
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.)
Pending
Application number
CN202010462072.3A
Other languages
Chinese (zh)
Inventor
熊潇
雷刚
邹浩
洪蜀宁
刘俊杰
黄发培
胡伟
余昌龙
李诗寰
彭聪
钱程
尹涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202010462072.3A priority Critical patent/CN111639108A/en
Publication of CN111639108A publication Critical patent/CN111639108A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a data query method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: sending a first query request for identification information corresponding to the target data to the blockchain, so that the blockchain queries the identification information based on the first query request; receiving identification information returned by the block chain, and generating a second query request of the target data based on the identification information; sending a second query request to the block chain, so that the block chain forwards the second query request to a second terminal device storing target data, and so that the second terminal device returns the target data to the block chain; target data returned by the blockchain is received. Based on the scheme, the safety of the target data is guaranteed, and the safety requirement of the data can be met. Because the identification information is shared on the block chain, compared with the data quantity of the shared target data, the data quantity is less, and the processing pressure and the storage pressure of the block chain link points are reduced.

Description

Data query method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of block chain technology, and in particular, to a data query method, apparatus, electronic device, and computer-readable storage medium.
Background
The block chain is a novel decentralized protocol, and data of all nodes in the block chain are synchronous, so that the block chain can keep consistency of stored data.
At present, most of the data sharing in the blockchain is to encrypt the data and then place the encrypted data on the blockchain. Each blockchain node on the blockchain has encrypted data, and although the data is stored in an encrypted manner, a certain risk of data leakage still exists. Therefore, for some data with higher security requirements, the existing block chain data sharing method cannot meet the security requirements.
In addition, when some data with a large data amount is shared on the blockchain, data consensus and data transmission among the blockchain nodes and data storage at the blockchain nodes are stressed greatly.
Disclosure of Invention
The present application aims to solve at least one of the above technical drawbacks. The technical scheme adopted by the application is as follows:
in a first aspect, an embodiment of the present application provides a data query method, where the method includes:
sending a first query request for identification information corresponding to the target data to the blockchain, so that the blockchain queries the identification information based on the first query request;
receiving identification information returned by the block chain, and generating a second query request of the target data based on the identification information;
sending a second query request to the block chain, so that the block chain forwards the second query request to a second terminal device storing target data, and so that the second terminal device returns the target data to the block chain;
target data returned by the blockchain is received.
Optionally, the identification information and the second terminal device have a corresponding relationship.
Optionally, the second query request carries a public key, and the target data returned to the blockchain by the second terminal device is encrypted by the public key, and the method further includes:
the target data is decrypted by a private key corresponding to the public key.
Optionally, the identification information is encrypted by means of irreversible encryption on the blockchain.
In a second aspect, an embodiment of the present application provides another data query method, where the method includes:
when a first query request for identification information corresponding to target data, which is sent by first terminal equipment, is received, querying the identification information and returning the identification information to the first terminal equipment;
receiving a second query request for the target data, which is generated by the first terminal device based on the identification information, and forwarding the second query request to the second terminal device storing the target data;
and receiving the target data returned by the second terminal equipment, and returning the target data to the first terminal equipment.
Optionally, the second query request carries a public key, and the received target data returned by the second terminal device is encrypted by the public key.
In a third aspect, an embodiment of the present application provides a data query apparatus, including:
the first query request sending module is used for sending a first query request for the identification information corresponding to the target data to the blockchain so that the blockchain queries the identification information based on the first query request;
the second query request generation module is used for receiving the identification information returned by the block chain and generating a second query request of the target data based on the identification information;
the second query request sending module is used for sending a second query request to the block chain, so that the block chain forwards the second query request to a second terminal device in which target data are stored, and the second terminal device returns the target data to the block chain;
and the target data receiving module is used for receiving the target data returned by the block chain.
Optionally, the identification information and the second terminal device have a corresponding relationship.
Optionally, the second query request carries a public key, and the target data returned to the blockchain by the second terminal device is encrypted by the public key, where the apparatus further includes:
and the decryption module is used for decrypting the target data through a private key corresponding to the public key.
Optionally, the identification information is encrypted by means of irreversible encryption on the blockchain.
In a fourth aspect, an embodiment of the present application provides another data query apparatus, including:
the identification information returning module is used for inquiring the identification information and returning the identification information to the first terminal equipment when receiving a first inquiry request which is sent by the first terminal equipment and corresponds to the identification information of the target data;
the second query request forwarding module is used for receiving a second query request for the target data, which is generated by the first terminal device based on the identification information, and forwarding the second query request to the second terminal device storing the target data;
and the target data returning module is used for receiving the target data returned by the second terminal equipment and returning the target data to the first terminal equipment.
Optionally, the second query request carries a public key, and the received target data returned by the second terminal device is encrypted by the public key.
In a fifth aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;
a memory for storing operating instructions;
a processor, configured to execute the data query method as shown in any implementation manner of the first aspect of the present application by calling an operation instruction.
In a sixth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the data query method shown in any implementation manner of the first aspect of the present application.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
according to the scheme, a first query request for identification information corresponding to target data is sent to a block chain by a first terminal device, the block chain queries the identification information based on the first query request and sends the identification information returned to the first terminal device, so that the first terminal device generates a second query request for the target data based on the identification information and sends the second query request to the block chain, the block chain forwards the second query request to a second terminal device stored with the target data, the second terminal device returns the target data to the block chain, and the first terminal device receives the target data returned by the block chain. In the scheme, the target data are inquired based on the identification information shared on the block chain, and the target data are stored in the second terminal device and are not uploaded to the block chain, so that even if data leakage occurs on a node of the block chain, the leakage of the target data cannot be caused, the safety of the target data is ensured, and the safety requirement of the data can be met. Because the identification information is shared on the block chain, compared with the data quantity of the shared target data, the data quantity is less, and the processing pressure and the storage pressure of the block chain link points are reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a data query method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of another data query method according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a data query device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another data query device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 shows a flowchart of a data query method provided in an embodiment of the present application, where the method is applied to a first terminal device, and as shown in fig. 1, the method mainly includes:
step S110: and sending a first query request for the identification information corresponding to the target data to the blockchain, so that the blockchain queries the identification information based on the first query request.
Step S120: and receiving the identification information returned by the blockchain, and generating a second query request of the target data based on the identification information.
Step S130: and sending a second query request to the block chain, so that the block chain forwards the second query request to a second terminal device storing the target data, and so that the second terminal device returns the target data to the block chain.
Step S140: target data returned by the blockchain is received.
In the embodiment of the present application, the target data, that is, the data to be queried, may be blacklist data, user personal credit data, and the like, for example.
In the block chain sharing method provided by the embodiment of the application, the target data is not stored in the block chain, but the identification information corresponding to the target data is stored in the block chain. The user may query the block chain for the identification information corresponding to the target data first, and then query the target data based on the identification information.
The user can send out a first query request for the identification information of the target data through the first terminal device. The first terminal device sends the first query request to the blockchain, that is, the first terminal device sends the first query request to the corresponding first blockchain node in the blockchain, and since the identification information is synchronized by each node on the blockchain, the first blockchain node can query the identification information corresponding to the target data and return the identification information to the first terminal device.
In the embodiment of the application, the identification information corresponds to the target data, and the second query request for the target data can be generated based on the identification information.
In the embodiment of the present application, the second query request is sent to the blockchain, that is, the first terminal device sends the second query request to the first blockchain node, and the second query request is synchronized in the blockchain. Because the identification information corresponds to the target data, when the node on the blockchain receives the second query request generated based on the identification information, the second terminal device holding the target data can be determined according to the corresponding relationship between the target data and the identification information.
The block chain forwards the second query request to the second terminal device, that is, the second block chain node on the block chain corresponding to the second terminal device forwards the second query request to the second terminal device. The second terminal device inquires the target data and sends the target data to the second block chain node, then the target data is synchronized on the block chain, and the first block chain node sends the target data to the first terminal device after receiving the target data.
In the embodiment of the application, the target data is stored in the second terminal device and cannot be directly uploaded to the block chain, the identification information corresponding to the target data is uploaded to the block chain, and even if data leakage occurs in the block chain link points, the identification information is leaked, the leakage of the target data cannot be caused, and the safety of the target data is ensured.
In addition, when the data volume of the target data is possibly large, the target data is stored in the second terminal device, so that data consensus and data transmission among the block chain nodes and data storage at the block chain nodes when the target data is uploaded to the block chain are omitted, and the processing pressure and the storage pressure of the nodes on the block chain are reduced.
According to the method, a first query request for identification information corresponding to target data is sent to a block chain by a first terminal device, the block chain queries the identification information based on the first query request and sends the identification information returned to the first terminal device, so that the first terminal device generates a second query request for the target data based on the identification information and sends the second query request to the block chain, the block chain forwards the second query request to a second terminal device stored with the target data, the second terminal device returns the target data to the block chain, and the first terminal device receives the target data returned by the block chain. In the scheme, the target data are inquired based on the identification information shared on the block chain, and the target data are stored in the second terminal device and are not uploaded to the block chain, so that even if data leakage occurs on a node of the block chain, the leakage of the target data cannot be caused, the safety of the target data is ensured, and the safety requirement of the data can be met. Because the identification information is shared on the block chain, compared with the data quantity of the shared target data, the data quantity is less, and the processing pressure and the storage pressure of the block chain link points are reduced.
In an optional manner of the embodiment of the present application, there is a correspondence between the identification information and the second terminal device.
According to the embodiment of the application, the identification information can also have a corresponding relation with the second terminal device, so that the second terminal device can be determined quickly based on the identification information, and therefore the target data can be obtained from the second terminal device.
As an example, the user a performs malicious operations and is marked as a blacklisted user, and the target data is blacklisted data corresponding to the user a. The specific form of the identification information may be: the hash value of the blacklist client mark, the hash value of the blacklist type mark, the hash value of the data provider mark and the hash value of the blacklist overall detail data.
The blacklist client sign hash value is used for identifying the user a, and the user a may correspond to a plurality of pieces of identification information. The blacklist type flag is used to identify a data type of the target data. The data provider flag is used to identify the second terminal device. And the hash value of the blacklist overall detail data is used for identifying the target data.
When searching the blacklist data corresponding to the user A, sending a first query request for the identification information of the blacklist data of the user A through the first terminal device, after receiving the first query request, querying the identification information corresponding to the user A through the blacklist client mark hash value of the user A by the first block chain node, and returning the identification information corresponding to the user A to the first terminal device. The first terminal device generates a second query request of the blacklist data of the user A according to the identification information corresponding to the user A, and sends the second query request to the first block link node, and the first block link node can determine a second terminal device based on the data provider mark in the identification information of the user A, so that the second query request is forwarded to the second terminal device by the corresponding second block link node of the second terminal device. The second terminal device can determine the type of the inquired target data through the blacklist type mark, and determine the blacklist data corresponding to the user A through the hash value of the whole blacklist detail data. And then the second terminal equipment returns the blacklist data corresponding to the user A to the second block chain node, and the first block chain node returns the blacklist data corresponding to the user A to the first terminal equipment.
In an optional manner of the embodiment of the application, the second query request carries a public key, and the target data returned to the blockchain by the second terminal device is encrypted by the public key, and the method further includes:
the target data is decrypted by a private key corresponding to the public key.
In an optional manner of the embodiment of the application, the first terminal device may maintain a public and private key pair used for encrypting the target data, and make the second query request carry a public key, the second terminal device encrypts the target data through the public key and then sends the encrypted target data to the block chain, and the first terminal device decrypts the encrypted target data through the private key.
By encrypting and uploading the target data, the safety of the target data can be improved.
In the embodiment of the application, only the queried target data is uploaded to the blockchain, but not the full target data, so that even if data leakage occurs to a blockchain node, only a small part of data is leaked, and the data security can be improved.
In an optional manner of the embodiment of the present application, the identification information is encrypted in an irreversible encryption manner on the block chain.
In the embodiment of the application, the identification information can be encrypted in an irreversible encryption mode, so that the safety of the identification information is ensured.
Fig. 2 is a schematic flowchart illustrating another data query method provided in an embodiment of the present application, where the method is applied to a first blockchain, and as shown in fig. 2, the method mainly includes:
step S210: when a first query request for identification information corresponding to target data, which is sent by first terminal equipment, is received, querying the identification information and returning the identification information to the first terminal equipment;
step S, 220: receiving a second query request for the target data, which is generated by the first terminal device based on the identification information, and forwarding the second query request to the second terminal device storing the target data;
step S230: and receiving the target data returned by the second terminal equipment, and returning the target data to the first terminal equipment.
In the embodiment of the application, each blockchain node on a blockchain stores identification information of target data. After receiving a first query request sent by the first terminal device, a first block chain node corresponding to the first terminal device in the block chain queries the identification information and returns the queried identification information to the first terminal device. The first terminal device generates a second query request of the target data based on the identification information, the second query request is sent to the first block chain node, then the second query request is synchronous in the block chain, after the second block chain node corresponding to the second terminal device receives the second query request, the second query request is sent to the second terminal device, the second terminal device returns the target data to the second block chain node, then the target data is synchronous in the block chain, and the first block chain node sends the target data to the first terminal device.
When a first query request for identification information corresponding to target data, sent by a first terminal device, is received, the identification information is queried and returned to the first terminal device; receiving a second query request for the target data, which is generated by the first terminal device based on the identification information, and forwarding the second query request to a second terminal device storing the target data, wherein the second terminal device returns the target data to the block chain; and receiving the target data returned by the second terminal equipment, and returning the target data to the first terminal equipment. In the scheme, the target data are inquired based on the identification information shared on the block chain, and the target data are stored in the second terminal device and are not uploaded to the block chain, so that even if data leakage occurs on a node of the block chain, the leakage of the target data cannot be caused, the safety of the target data is ensured, and the safety requirement of the data can be met. Because the identification information is shared on the block chain, compared with the data quantity of the shared target data, the data quantity is less, and the processing pressure and the storage pressure of the block chain link points are reduced.
In an optional manner of the embodiment of the application, the second query request carries a public key, and the received target data returned by the second terminal device is encrypted by the public key.
In the embodiment of the application, the first terminal device may maintain a public and private key pair for encrypting the target data, and make the second query request carry a public key, the second terminal device encrypts the target data through the public key and then sends the encrypted target data to the blockchain, and the first terminal device decrypts the encrypted target data through the private key after receiving the encrypted target data.
Based on the same principle as the method shown in fig. 1, fig. 3 shows a schematic structural diagram of a data query device provided by an embodiment of the present application, and as shown in fig. 3, the data query device 30 may include:
a first query request sending module 310, configured to send a first query request for identification information corresponding to target data to a blockchain, so that the blockchain queries the identification information based on the first query request;
a second query request generating module 320, configured to receive the identification information returned by the blockchain, and generate a second query request for the target data based on the identification information;
a second query request sending module 330, configured to send a second query request to the blockchain, so that the blockchain forwards the second query request to a second terminal device storing target data, and so that the second terminal device returns the target data to the blockchain;
and a target data receiving module 340, configured to receive target data returned by the blockchain.
According to the scheme, a first query request for identification information corresponding to target data is sent to a block chain by a first terminal device, the block chain queries the identification information based on the first query request and sends the identification information returned to the first terminal device, so that the first terminal device generates a second query request for the target data based on the identification information and sends the second query request to the block chain, the block chain forwards the second query request to a second terminal device stored with the target data, the second terminal device returns the target data to the block chain, and the first terminal device receives the target data returned by the block chain. In the scheme, the target data are inquired based on the identification information shared on the block chain, and the target data are stored in the second terminal device and are not uploaded to the block chain, so that even if data leakage occurs on a node of the block chain, the leakage of the target data cannot be caused, the safety of the target data is ensured, and the safety requirement of the data can be met. Because the identification information is shared on the block chain, compared with the data quantity of the shared target data, the data quantity is less, and the processing pressure and the storage pressure of the block chain link points are reduced.
Optionally, the identification information and the second terminal device have a corresponding relationship.
Optionally, the second query request carries a public key, and the target data returned to the blockchain by the second terminal device is encrypted by the public key, where the apparatus further includes:
and the decryption module is used for decrypting the target data through a private key corresponding to the public key.
Optionally, the identification information is encrypted by means of irreversible encryption on the blockchain.
It is understood that the above modules of the data query apparatus in this embodiment have functions of implementing the corresponding steps of the data query method in the embodiment shown in fig. 1. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the data query apparatus, reference may be specifically made to the corresponding description of the data query method in the embodiment shown in fig. 1, and details are not repeated here.
Based on the same principle as the method shown in fig. 2, fig. 4 shows a schematic structural diagram of a data query device provided by an embodiment of the present application, and as shown in fig. 4, the data query device 40 may include:
an identification information returning module 410, configured to, when receiving a first query request for identification information corresponding to target data sent by a first terminal device, query the identification information and return the identification information to the first terminal device;
a second query request forwarding module 420, configured to receive a second query request for the target data, which is generated by the first terminal device based on the identification information, and forward the second query request to the second terminal device storing the target data;
and a target data returning module 430, configured to receive the target data returned by the second terminal device, and return the target data to the first terminal device.
When a first query request for identification information corresponding to target data, sent by a first terminal device, is received, the identification information is queried and returned to the first terminal device; receiving a second query request for the target data, which is generated by the first terminal device based on the identification information, and forwarding the second query request to a second terminal device storing the target data, wherein the second terminal device returns the target data to the block chain; and receiving the target data returned by the second terminal equipment, and returning the target data to the first terminal equipment. In the scheme, the target data are inquired based on the identification information shared on the block chain, and the target data are stored in the second terminal device and are not uploaded to the block chain, so that even if data leakage occurs on a node of the block chain, the leakage of the target data cannot be caused, the safety of the target data is ensured, and the safety requirement of the data can be met. Because the identification information is shared on the block chain, compared with the data quantity of the shared target data, the data quantity is less, and the processing pressure and the storage pressure of the block chain link points are reduced.
Optionally, the second query request carries a public key, and the received target data returned by the second terminal device is encrypted by the public key.
It is understood that the above modules of the data query apparatus in the present embodiment have functions of implementing the corresponding steps of the data query method in the embodiment shown in fig. 2. The function can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules can be software and/or hardware, and each module can be implemented independently or by integrating a plurality of modules. For the functional description of each module of the data query apparatus, reference may be specifically made to the corresponding description of the data query method in the embodiment shown in fig. 2, and details are not repeated here.
The embodiment of the application provides an electronic device, which comprises a processor and a memory;
a memory for storing operating instructions;
and the processor is used for executing the data query method provided by any embodiment of the application by calling the operation instruction.
As an example, fig. 5 shows a schematic structural diagram of an electronic device to which an embodiment of the present application is applicable, and as shown in fig. 5, the electronic device 2000 includes: a processor 2001 and a memory 2003. Wherein the processor 2001 is coupled to a memory 2003, such as via a bus 2002. Optionally, the electronic device 2000 may also include a transceiver 2004. It should be noted that the transceiver 2004 is not limited to one in practical applications, and the structure of the electronic device 2000 is not limited to the embodiment of the present application.
The processor 2001 is applied to the embodiment of the present application to implement the method shown in the above method embodiment. The transceiver 2004 may include a receiver and a transmitter, and the transceiver 2004 is applied to the embodiments of the present application to implement the functions of the electronic device of the embodiments of the present application to communicate with other devices when executed.
The Processor 2001 may be a CPU (Central Processing Unit), general Processor, DSP (Digital Signal Processor), ASIC (Application specific integrated Circuit), FPGA (Field Programmable Gate Array) or other Programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 2001 may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs and microprocessors, and the like.
Bus 2002 may include a path that conveys information between the aforementioned components. The bus 2002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (extended industry Standard Architecture) bus, or the like. The bus 2002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The Memory 2003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically erasable programmable Read Only Memory), a CD-ROM (Compact disk Read Only Memory) or other optical disk storage, optical disk storage (including Compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
Optionally, the memory 2003 is used for storing application program code for performing the disclosed aspects, and is controlled in execution by the processor 2001. The processor 2001 is configured to execute the application program code stored in the memory 2003 to implement the data query method provided in any of the embodiments of the present application.
The electronic device provided by the embodiment of the application is applicable to any embodiment of the method, and is not described herein again.
Compared with the prior art, the electronic device has the advantages that the first terminal device sends the first query request for the identification information corresponding to the target data to the block chain, the block chain queries the identification information based on the first query request and returns the identification information to the first terminal device, so that the first terminal device generates the second query request for the target data based on the identification information and sends the second query request to the block chain, the block chain forwards the second query request to the second terminal device stored with the target data, the second terminal device returns the target data to the block chain, and the first terminal device receives the target data returned by the block chain. In the scheme, the target data are inquired based on the identification information shared on the block chain, and the target data are stored in the second terminal device and are not uploaded to the block chain, so that even if data leakage occurs on a node of the block chain, the leakage of the target data cannot be caused, the safety of the target data is ensured, and the safety requirement of the data can be met. Because the identification information is shared on the block chain, compared with the data quantity of the shared target data, the data quantity is less, and the processing pressure and the storage pressure of the block chain link points are reduced.
The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the data query method shown in the above method embodiment.
The computer-readable storage medium provided in the embodiments of the present application is applicable to any of the embodiments of the foregoing method, and is not described herein again.
Compared with the prior art, the embodiment of the application provides a computer-readable storage medium, a first terminal device sends a first query request for identification information corresponding to target data to a block chain, the block chain queries the identification information based on the first query request and sends the identification information returned to the first terminal device, so that the first terminal device generates a second query request for the target data based on the identification information and sends the second query request to the block chain, the block chain forwards the second query request to a second terminal device stored with the target data, the second terminal device returns the target data to the block chain, and the first terminal device receives the target data returned by the block chain. In the scheme, the target data are inquired based on the identification information shared on the block chain, and the target data are stored in the second terminal device and are not uploaded to the block chain, so that even if data leakage occurs on a node of the block chain, the leakage of the target data cannot be caused, the safety of the target data is ensured, and the safety requirement of the data can be met. Because the identification information is shared on the block chain, compared with the data quantity of the shared target data, the data quantity is less, and the processing pressure and the storage pressure of the block chain link points are reduced.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A data query method, applied to a first terminal device, the method comprising:
sending a first query request for identification information corresponding to target data to a blockchain, so that the blockchain queries the identification information based on the first query request;
receiving the identification information returned by the block chain, and generating a second query request of the target data based on the identification information;
sending the second query request to the blockchain, so that the blockchain forwards the second query request to a second terminal device storing the target data, and so that the second terminal device returns the target data to the blockchain;
and receiving the target data returned by the block chain.
2. The method of claim 1, wherein the identification information corresponds to the second terminal device.
3. The method according to claim 1, wherein the second query request carries a public key, and the target data returned to the blockchain by the second terminal device is encrypted by the public key, and the method further comprises:
and decrypting the target data through a private key corresponding to the public key.
4. A method according to any of claims 1-3, wherein the identification information is encrypted by means of irreversible encryption over the blockchain.
5. A data query method, applied to a block chain, the method comprising:
when a first query request for identification information corresponding to target data, which is sent by first terminal equipment, is received, querying the identification information and returning the identification information to the first terminal equipment;
receiving a second query request for the target data, which is generated by the first terminal device based on the identification information, and forwarding the second query request to a second terminal device storing the target data;
and receiving the target data returned by the second terminal equipment, and returning the target data to the first terminal equipment.
6. The method according to claim 5, wherein the second query request carries a public key, and the received target data returned by the second terminal device is encrypted by the public key.
7. A data query apparatus, comprising:
a first query request sending module, configured to send a first query request for identification information corresponding to target data to a blockchain, so that the blockchain queries the identification information based on the first query request;
the second query request generation module is used for receiving the identification information returned by the block chain and generating a second query request of the target data based on the identification information;
a second query request sending module, configured to send the second query request to the blockchain, so that the blockchain forwards the second query request to a second terminal device storing the target data, and so that the second terminal device returns the target data to the blockchain;
and the target data receiving module is used for receiving the target data returned by the block chain.
8. A data query apparatus, comprising:
the identification information returning module is used for inquiring the identification information and returning the identification information to the first terminal equipment when receiving a first inquiry request which is sent by the first terminal equipment and corresponds to the identification information of the target data;
a second query request forwarding module, configured to receive a second query request for the target data, which is generated by the first terminal device based on the identification information, and forward the second query request to a second terminal device in which the target data is stored;
and the target data returning module is used for receiving the target data returned by the second terminal equipment and returning the target data to the first terminal equipment.
9. An electronic device comprising a processor and a memory;
the memory is used for storing operation instructions;
the processor is used for executing the method of any one of claims 1-6 by calling the operation instruction.
10. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the method of any one of claims 1-6.
CN202010462072.3A 2020-05-27 2020-05-27 Data query method and device, electronic equipment and computer readable storage medium Pending CN111639108A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010462072.3A CN111639108A (en) 2020-05-27 2020-05-27 Data query method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010462072.3A CN111639108A (en) 2020-05-27 2020-05-27 Data query method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111639108A true CN111639108A (en) 2020-09-08

Family

ID=72329392

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010462072.3A Pending CN111639108A (en) 2020-05-27 2020-05-27 Data query method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111639108A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112883115A (en) * 2021-02-24 2021-06-01 中国工商银行股份有限公司 Information processing method and device based on block chain
CN113158247A (en) * 2021-04-27 2021-07-23 同盾控股有限公司 User query method and device, storage medium and electronic equipment
CN113535663A (en) * 2021-08-09 2021-10-22 恒安嘉新(北京)科技股份公司 Data sharing processing method, device, equipment and medium based on block chain
CN115292356A (en) * 2022-07-21 2022-11-04 中电金信软件有限公司 Data query method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109040227A (en) * 2018-07-27 2018-12-18 江西贪玩信息技术有限公司 Service request response method, device and computer equipment based on block chain
CN109325870A (en) * 2018-10-10 2019-02-12 上海保险交易所股份有限公司 The method and system of shared private data
WO2019078878A1 (en) * 2017-10-20 2019-04-25 Hewlett Packard Enterprise Development Lp Accessing information based on privileges
CN110602201A (en) * 2019-09-10 2019-12-20 腾讯科技(深圳)有限公司 Resume management method, device and system based on block chain and storage medium
CN111145850A (en) * 2019-12-23 2020-05-12 支付宝(杭州)信息技术有限公司 Medical data query method and device based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019078878A1 (en) * 2017-10-20 2019-04-25 Hewlett Packard Enterprise Development Lp Accessing information based on privileges
CN109040227A (en) * 2018-07-27 2018-12-18 江西贪玩信息技术有限公司 Service request response method, device and computer equipment based on block chain
CN109325870A (en) * 2018-10-10 2019-02-12 上海保险交易所股份有限公司 The method and system of shared private data
CN110602201A (en) * 2019-09-10 2019-12-20 腾讯科技(深圳)有限公司 Resume management method, device and system based on block chain and storage medium
CN111145850A (en) * 2019-12-23 2020-05-12 支付宝(杭州)信息技术有限公司 Medical data query method and device based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
任丽梅等: "《块创新》", 首都经济贸易大学出版社, pages: 98 - 99 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112883115A (en) * 2021-02-24 2021-06-01 中国工商银行股份有限公司 Information processing method and device based on block chain
CN113158247A (en) * 2021-04-27 2021-07-23 同盾控股有限公司 User query method and device, storage medium and electronic equipment
CN113158247B (en) * 2021-04-27 2023-03-14 同盾控股有限公司 User query method and device, storage medium and electronic equipment
CN113535663A (en) * 2021-08-09 2021-10-22 恒安嘉新(北京)科技股份公司 Data sharing processing method, device, equipment and medium based on block chain
CN115292356A (en) * 2022-07-21 2022-11-04 中电金信软件有限公司 Data query method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN111639108A (en) Data query method and device, electronic equipment and computer readable storage medium
CN107592202B (en) Application signature method, device, system, computing equipment and storage medium
CN114329599B (en) Data query method and device and storage medium
CN110689349A (en) Transaction hash value storage and search method and device in block chain
Dass et al. A secure authentication scheme for RFID systems
CN112512038B (en) Method and device for generating session key, electronic equipment and readable storage medium
CN116633701B (en) Information transmission method, apparatus, computer device and storage medium
CN113824553A (en) Key management method, device and system
CN113918982A (en) Data processing method and system based on identification information
CN116455572B (en) Data encryption method, device and equipment
CN110611568B (en) Dynamic encryption and decryption method, device and equipment based on multiple encryption and decryption algorithms
CN115567200B (en) Http interface anti-brushing method, system and related equipment
CN114969805B (en) Service query method, device, electronic equipment and storage medium
CN112862488A (en) Data signature method and device, electronic equipment and computer readable storage medium
CN114143038A (en) Key secure distribution method and device for block chain relay communication network
CN112836239A (en) Method and device for cooperatively determining target object data by two parties for protecting privacy
CN116522404B (en) Data processing method, device, equipment and computer storage medium
CN113411347B (en) Transaction message processing method and processing device
CN112235261B (en) Message encryption and decryption method and device, electronic equipment and readable storage medium
CN114884655B (en) Data processing method, device, electronic equipment and readable storage medium
US20240048385A1 (en) Sharing cryptographic material
CN116361822A (en) Encryption operation control method and device, electronic equipment and readable storage medium
CN114387104A (en) Cross-block-chain data pushing method and device
CN116305263A (en) Key acquisition method, file decryption method and related devices
CN115037511A (en) Data processing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220914

Address after: 25 Financial Street, Xicheng District, Beijing 100033

Applicant after: CHINA CONSTRUCTION BANK Corp.

Address before: 25 Financial Street, Xicheng District, Beijing 100033

Applicant before: CHINA CONSTRUCTION BANK Corp.

Applicant before: Jianxin Financial Science and Technology Co.,Ltd.