Data searching method, device, storage medium and apparatus

CN115129766BActive Publication Date: 2026-08-11BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-25
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]本发明的主要目的在于提供一种数据查找方法、设备、存储介质及装置,旨在解决现有技术中无法证明外部源导入区块链的数据是未被修改的技术问题

Benefits of technology

[0064]本发明中,公开了在接收到区块链发送的数据查找请求时,根据数据查找请求进行数据查找,获得目标数据,查找可信硬件设备对应的身份私钥,并根据身份私钥对目标数据进行签名,获得待传输数据,将待传输数据发送至区块链,由区块链根据可信硬件设备对应的身份公钥对待传输数据进行验证,并在验证通过后,从待传输数据中提取目标数据;相较于现有的通过无法证明数据真实性的外部源将数据导入区块链的方式,由于本发明中在查找到数据后,先根据可信硬件设备的身份私钥对数据进行签名,再将签名后的数据发送至区块链,以使区块链根据身份私钥对数据进行真实性验证,从而克服了现有技术中无法证明外部源导入区块链的数据是未被修改的缺陷,进而能够保证数据的可靠性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115129766B_ABST
    Figure CN115129766B_ABST
Patent Text Reader

Abstract

This invention discloses a data retrieval method, device, storage medium, and apparatus. Compared to existing methods that import data into the blockchain through external sources whose authenticity cannot be proven, this invention, upon receiving a data retrieval request from the blockchain, performs a data retrieval based on the request to obtain the target data, locates the identity private key corresponding to the trusted hardware device, signs the target data based on the identity private key, obtains the data to be transmitted, and sends the data to be transmitted to the blockchain. The blockchain then verifies the data to be transmitted based on the identity public key corresponding to the trusted hardware device, and extracts the target data from the data to be transmitted after successful verification. This overcomes the deficiency in existing technologies where it is impossible to prove that data imported into the blockchain from external sources has not been modified, thereby ensuring data reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Internet technology, and in particular to a data retrieval method, device, storage medium and apparatus. Background Technology

[0002] Currently, because blockchains cannot actively acquire off-chain data, data needs to be imported into the blockchain through external sources. However, since it cannot be proven that the data obtained from external sources has not been modified, the reliability of the data cannot be guaranteed.

[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this invention is to provide a data retrieval method, device, storage medium, and apparatus, aiming to solve the technical problem in the prior art that it is impossible to prove that data imported into the blockchain from an external source has not been modified.

[0005] To achieve the above objectives, the present invention provides a data retrieval method, which includes the following steps:

[0006] Upon receiving a data lookup request from the blockchain, the system performs a data lookup based on the request to obtain the target data.

[0007] Find the identity private key corresponding to the trusted hardware device, and sign the target data according to the identity private key to obtain the data to be transmitted;

[0008] The data to be transmitted is sent to the blockchain, which verifies the data to be transmitted based on the public key of the identity corresponding to the trusted hardware device, and extracts the target data from the data to be transmitted after successful verification.

[0009] Optionally, the step of performing a data search based on the data search request to obtain the target data upon receiving a data search request from the blockchain specifically includes:

[0010] Upon receiving a data search request from the blockchain, the data search request is parsed to obtain the type of data to be searched;

[0011] Extract data from the preset storage area to obtain the stored data;

[0012] The target data is determined based on the stored data and the type of data to be searched.

[0013] Optionally, the step of determining the target data based on the stored data and the type of data to be searched specifically includes:

[0014] The stored data is classified to obtain the types of stored data;

[0015] The stored data types are matched with the data types to be searched, and the target data is determined based on the matching results.

[0016] Optionally, the step of matching the stored data type with the data type to be searched, and determining the target data based on the type matching result, specifically includes:

[0017] The stored data types are traversed, and the traversed stored data types are used as the data types to be matched;

[0018] The data types to be matched are matched with the data types to be searched to obtain the category matching results;

[0019] After traversing the stored data categories, the target data is determined based on the category matching results.

[0020] Optionally, the step of finding the identity private key corresponding to the trusted hardware device and signing the target data according to the identity private key to obtain the data to be transmitted specifically includes:

[0021] Obtain the device identification information of the trusted hardware device, and find the identity key corresponding to the trusted hardware device based on the device identification information;

[0022] The target data is signed using the identity private key to obtain the data to be transmitted.

[0023] Optionally, before the step of performing a data search based on the data search request to obtain the target data upon receiving a data search request from the blockchain, the data search method further includes:

[0024] Upon receiving a device authentication request, the hardware device to be authenticated is determined based on the device authentication request;

[0025] The hardware device to be certified is then trusted to obtain a trusted hardware device.

[0026] Optionally, the step of performing trusted authentication on the hardware device to be authenticated to obtain a trusted hardware device specifically includes:

[0027] Obtain the device information of the hardware device to be authenticated, and send the device information to a preset authentication server;

[0028] The system receives the authentication result from the preset authentication server based on the device information. When the authentication result is successful, the hardware device to be authenticated is designated as a trusted hardware device.

[0029] Optionally, before the step of performing a data search based on the data search request to obtain the target data upon receiving a data search request from the blockchain, the data search method further includes:

[0030] Upon receiving an access request from the blockchain, an encrypted communication connection is established with the blockchain;

[0031] The encrypted communication connection is used to receive data lookup requests sent by the blockchain.

[0032] Optionally, the step of establishing an encrypted communication connection with the blockchain upon receiving an access request from the blockchain specifically includes:

[0033] Upon receiving an access request from the blockchain, the system searches for the identity private key corresponding to the trusted hardware device.

[0034] An encrypted communication connection with the blockchain is established based on the identity key.

[0035] Optionally, the step of establishing an encrypted communication connection with the blockchain based on the identity key specifically includes:

[0036] The identity key is sent to the blockchain so that the blockchain can authenticate the trusted hardware device based on the identity key and generate a session key when the authentication is successful.

[0037] Receive the session key sent by the blockchain, and establish an encrypted communication connection with the blockchain based on the session key.

[0038] Optionally, after the step of sending the data to be transmitted to the blockchain, the data lookup method further includes:

[0039] Receive the verification information fed back by the blockchain, and determine whether the data to be transmitted meets the preset conditions based on the verification information;

[0040] When the data to be transmitted meets the preset conditions, the data to be transmitted is stored in the preset database.

[0041] Optionally, after the step of sending the data to be transmitted to the blockchain, the data lookup method further includes:

[0042] Receive data import information from the blockchain and generate reminder information based on the data import information;

[0043] Obtain the device information corresponding to the trusted hardware device, and determine the information display template based on the device information;

[0044] The reminder information is written into the information display template to obtain the information to be displayed, and the information to be displayed is then displayed.

[0045] Furthermore, to achieve the above objectives, the present invention also proposes a data retrieval device, which includes a memory, a processor, and a data retrieval program stored in the memory and executable on the processor, the data retrieval program being configured to implement the steps of the data retrieval method described above.

[0046] Furthermore, to achieve the above objectives, the present invention also proposes a storage medium storing a data lookup program, which, when executed by a processor, implements the steps of the data lookup method described above.

[0047] In addition, to achieve the above objectives, the present invention also proposes a data retrieval device, which includes: a retrieval module, a signature module, and a sending module;

[0048] The search module is used to perform a data search based on the data search request sent by the blockchain when it receives the data search request, and obtain the target data.

[0049] The signature module is used to find the identity private key corresponding to the trusted hardware device, and sign the target data according to the identity private key to obtain the data to be transmitted.

[0050] The sending module is used to send the data to be transmitted to the blockchain, whereby the blockchain verifies the data to be transmitted based on the public key of the identity corresponding to the trusted hardware device, and extracts the target data from the data to be transmitted after successful verification.

[0051] Optionally, the search module is further configured to parse the data search request when it receives a data search request sent by the blockchain to obtain the type of data to be searched;

[0052] The search module is also used to extract data from a preset storage area to obtain stored data;

[0053] The search module is also used to determine target data based on the stored data and the type of data to be searched.

[0054] Optionally, the search module is further configured to classify the stored data to obtain the types of stored data;

[0055] The search module is further configured to match the stored data type with the data type to be searched, and determine the target data based on the type matching result.

[0056] Optionally, the search module is further configured to traverse the stored data types and use the traversed stored data types as the data types to be matched;

[0057] The search module is also used to match the data type to be matched with the data type to be searched, and obtain a type matching result;

[0058] The search module is also used to determine the target data based on the category matching result after traversing the stored data categories.

[0059] Optionally, the signature module is further configured to obtain the device identification information of the trusted hardware device, and find the identity key corresponding to the trusted hardware device based on the device identification information;

[0060] The signature module is also used to sign the target data according to the identity private key to obtain the data to be transmitted.

[0061] Optionally, the data retrieval device further includes: an authentication module;

[0062] The authentication module is used to determine the hardware device to be authenticated based on the device authentication request when it receives a device authentication request.

[0063] The authentication module is also used to perform trusted authentication on the hardware device to be authenticated, thereby obtaining a trusted hardware device.

[0064] This invention discloses a method for performing a data search upon receiving a data search request from the blockchain. This involves searching for the target data, finding the private key corresponding to a trusted hardware device, signing the target data using the private key, obtaining the data to be transmitted, and sending the data to be transmitted to the blockchain. The blockchain then verifies the data to be transmitted using the public key corresponding to the trusted hardware device. Upon successful verification, the target data is extracted from the data to be transmitted. Compared to existing methods that import data into the blockchain from external sources whose authenticity cannot be proven, this invention, by signing the data using the private key of the trusted hardware device after finding it, and then sending the signed data to the blockchain, allows the blockchain to verify the data's authenticity using the private key. This overcomes the deficiency in existing technologies where it is impossible to prove that data imported into the blockchain from external sources has not been modified, thus ensuring data reliability. Attached Figure Description

[0065] Figure 1 This is a schematic diagram of the structure of the data retrieval device in the hardware operating environment involved in the embodiments of the present invention;

[0066] Figure 2 This is a flowchart illustrating the first embodiment of the data retrieval method of the present invention;

[0067] Figure 3 This is a flowchart illustrating the second embodiment of the data retrieval method of the present invention;

[0068] Figure 4 This is a flowchart illustrating the third embodiment of the data retrieval method of the present invention;

[0069] Figure 5 This is a structural block diagram of the first embodiment of the data retrieval device of the present invention.

[0070] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0071] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0072] Reference Figure 1 , Figure 1 This is a schematic diagram of the data retrieval device structure in the hardware operating environment involved in the embodiments of the present invention.

[0073] like Figure 1 As shown, the data retrieval device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen, and optionally, it may also include a standard wired interface or a wireless interface. In this invention, the wired interface of the user interface 1003 may be a USB interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed random access memory (RAM) or a non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0074] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the data retrieval device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0075] like Figure 1As shown, the memory 1005, which is identified as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a data retrieval program.

[0076] exist Figure 1 In the data retrieval device shown, the network interface 1004 is mainly used to connect to the backend server and communicate with the backend server; the user interface 1003 is mainly used to connect to the user equipment; the data retrieval device calls the data retrieval program stored in the memory 1005 through the processor 1001 and executes the data retrieval method provided in this embodiment of the invention.

[0077] Based on the above hardware structure, an embodiment of the data retrieval method of the present invention is proposed.

[0078] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the data retrieval method of the present invention, which presents the first embodiment of the data retrieval method of the present invention.

[0079] In the first embodiment, the data lookup method includes the following steps:

[0080] Step S10: Upon receiving a data search request from the blockchain, perform a data search according to the data search request to obtain the target data.

[0081] It should be understood that the execution subject of this embodiment is the data search device, which may be an electronic device such as a personal computer or server, or other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment, a data search server is used as an example.

[0082] It should be noted that a data lookup request can be a data lookup request issued by the blockchain through a smart contract, and this embodiment does not limit this.

[0083] It should be understood that when a data lookup request is received from the blockchain, the data lookup is performed according to the data lookup request to obtain the target data. This can be done by parsing the data lookup request, obtaining the type of data to be looked up, extracting data from a preset storage area to obtain the stored data, and determining the target data based on the stored data and the type of data to be looked up.

[0084] Furthermore, in order to pre-authenticate the trustworthiness of the hardware device, before performing a data search based on the data search request to obtain the target data upon receiving a data search request from the blockchain, the process further includes:

[0085] Upon receiving a device authentication request, the hardware device to be authenticated is determined based on the device authentication request;

[0086] The hardware device to be certified is then trusted to obtain a trusted hardware device.

[0087] It should be noted that the device authentication request can be a control request entered by the administrator of the data lookup server through the trusted storage program after the trusted storage program is deployed to the hardware device to be authenticated. The trusted storage program can be an application associated with the data lookup server, and this embodiment does not limit this.

[0088] It should be understood that determining the hardware device to be certified based on the device certification request can involve extracting the device certification request, obtaining the device identifier, and then determining the hardware device to be certified based on the device identifier.

[0089] In a specific implementation, for example, when the data lookup server receives a device authentication request sent by the administrator of the data lookup server through a trusted storage program, the data lookup server determines the hardware device to be authenticated based on the device authentication request.

[0090] It is understood that, in performing trusted authentication on the hardware device to be authenticated, obtaining a trusted hardware device can involve acquiring the device information of the hardware device to be authenticated, matching the device information with preset trusted device information, obtaining a matching result, and when the matching result is successful, designating the hardware device to be authenticated as a trusted hardware device. The preset trusted devices can be pre-set by the administrator of the data lookup server; this embodiment does not impose any restrictions on this.

[0091] Furthermore, to improve the reliability of trusted authentication, the step of performing trusted authentication on the hardware device to be authenticated to obtain a trusted hardware device includes:

[0092] Obtain the device information of the hardware device to be authenticated, and send the device information to a preset authentication server;

[0093] The system receives the authentication result from the preset authentication server based on the device information. When the authentication result is successful, the hardware device to be authenticated is designated as a trusted hardware device.

[0094] It should be noted that the device information can be device hardware information, such as device model information, etc., and this embodiment does not limit it.

[0095] The preset authentication server can be a pre-set Certificate Authority (CA), and this embodiment does not limit this.

[0096] In a practical implementation, for example, a trusted storage program is placed on the hardware machine to be authenticated. When the information storage server corresponding to the trusted storage program receives a device authentication request, it can perform the following steps:

[0097] When the data lookup server receives a device authentication request, it determines the hardware device to be authenticated based on the device authentication request, obtains the hardware information of the hardware device to be authenticated, generates a private key and a public key for identity, and sends the hardware information and the public key to the preset authentication center.

[0098] The preset authentication center authenticates the hardware device to be authenticated based on the hardware device. When the hardware device to be authenticated passes the authentication, it is regarded as a trusted hardware device, and its identity public key is stored in the preset blockchain to generate an authentication certificate. The device information of the trusted hardware device and the authentication certificate are sent to the data lookup server.

[0099] Upon receiving device information and authentication certificates, the data lookup server recognizes the hardware device to be authenticated as a trusted hardware device and stores the device information and authentication certificates accordingly. This information is then used to prove the security of the hardware when data is subsequently stored on the blockchain.

[0100] Step S20: Locate the identity private key corresponding to the trusted hardware device, and sign the target data according to the identity private key to obtain the data to be transmitted.

[0101] It is understandable that finding the identity private key corresponding to the trusted hardware device and signing the target data based on the identity private key to obtain the data to be transmitted can be done by obtaining the device identification information of the trusted hardware device, finding the identity key corresponding to the trusted hardware device based on the device identification information, signing the target data based on the identity private key, and obtaining the data to be transmitted.

[0102] Step S30: Send the data to be transmitted to the blockchain, whereby the blockchain verifies the data to be transmitted based on the public key of the identity corresponding to the trusted hardware device, and extracts the target data from the data to be transmitted after successful verification.

[0103] It should be understood that sending data to the blockchain can be done through a Secure Socket Layer (SSL) communication connection, and this embodiment does not limit this.

[0104] In the specific implementation, after the blockchain smart contract receives the data to be transmitted, it looks up the identity public key corresponding to the trusted hardware device, and verifies the data to be transmitted based on the identity public key. After the verification is successful, the data to be transmitted is extracted to obtain the target data, and the target data is aggregated and imported into the blockchain.

[0105] Furthermore, in order to notify the administrators of the data retrieval server that the data import was successful, after step S30, the following steps are also included:

[0106] The system receives data import information from the blockchain and generates reminder information based on the data import information. It also obtains device information corresponding to the trusted hardware device, determines an information display template based on the device information, writes the reminder information into the information display template, obtains the information to be displayed, and displays the information to be displayed.

[0107] In the first embodiment, upon receiving a data lookup request from the blockchain, a data lookup is performed according to the request to obtain the target data. The identity private key corresponding to the trusted hardware device is then located, and the target data is signed using the identity private key to obtain the data to be transmitted. This data is then sent to the blockchain, where it is verified using the identity public key corresponding to the trusted hardware device. Upon successful verification, the target data is extracted from the data to be transmitted. Compared to existing methods that import data into the blockchain from external sources whose authenticity cannot be proven, this embodiment, by first signing the data using the identity private key of the trusted hardware device after finding it, and then sending the signed data to the blockchain, allows the blockchain to verify the data's authenticity using the identity private key. This overcomes the deficiency in existing technologies where it is impossible to prove that data imported into the blockchain from external sources has not been modified, thus ensuring data reliability.

[0108] Reference Figure 3 , Figure 3 This is a flowchart illustrating the second embodiment of the data retrieval method of the present invention, based on the above. Figure 2 The first embodiment shown presents a second embodiment of the data retrieval method of the present invention.

[0109] In the second embodiment, step S10 includes:

[0110] Step S101: Upon receiving a data search request from the blockchain, the data search request is parsed to obtain the type of data to be searched.

[0111] It should be noted that a data lookup request can be a data lookup request issued by the blockchain through a smart contract, and this embodiment does not limit this.

[0112] The type of data to be searched can be weather data, product price data, etc., and this embodiment does not limit this.

[0113] It should be understood that parsing a data search request to obtain the type of data to be searched can be done by extracting the identifier of the data search request, obtaining the data identifier, and determining the type of data to be searched based on the data identifier.

[0114] Step S102: Extract data from the preset storage area to obtain the stored data.

[0115] It should be noted that the preset storage area can be a storage area pre-configured in a trusted hardware device for storing Internet data, and this embodiment does not limit this.

[0116] Step S103: Determine the target data based on the stored data and the type of data to be searched.

[0117] It should be understood that determining the target data based on the stored data and the type of data to be searched can be done by searching for the data corresponding to the type of data to be searched in the stored data and using the found data as the target data.

[0118] Furthermore, to improve the accuracy of data retrieval, step S103 includes:

[0119] The stored data is classified to obtain the types of stored data;

[0120] The stored data types are matched with the data types to be searched, and the target data is determined based on the matching results.

[0121] It should be understood that determining the target data based on the category matching result can be done by using the stored data corresponding to the category of the stored data that has a successful category matching result as the target data, and this embodiment does not limit this.

[0122] Furthermore, in order to ensure that all stored data is searched, the step of matching the stored data type with the data type to be searched, and determining the target data based on the type matching result, includes:

[0123] The stored data types are traversed, and the traversed stored data types are used as the data types to be matched;

[0124] The data types to be matched are matched with the data types to be searched to obtain the category matching results;

[0125] After traversing the stored data categories, the target data is determined based on the category matching results.

[0126] It should be understood that traversing the types of stored data can be done randomly or in a preset order, and this embodiment does not limit this.

[0127] It is understandable that, after traversing the types of stored data, determining the target data based on the type matching result can be done by taking the stored data corresponding to the type of stored data that has a successful type matching result as the target data. This embodiment does not limit this.

[0128] In the second embodiment, when a data search request is received from the blockchain, the data search request is parsed to obtain the type of data to be searched, data is extracted from the preset storage area to obtain the stored data, and the target data is determined based on the stored data and the type of data to be searched, thereby improving the accuracy of the target data.

[0129] In the second embodiment, step S20 includes:

[0130] Step S201: Obtain the device identification information of the trusted hardware device, and find the identity key corresponding to the trusted hardware device based on the device identification information.

[0131] It should be noted that the device identification information can be any information used to identify the device, and this embodiment does not limit it.

[0132] It should be understood that finding the identity key corresponding to a trusted hardware device based on device identification information can be done by searching for the identity key corresponding to the device identification information in a preset key library. The preset key library includes the correspondence between device identification information and identity keys, and this correspondence can be automatically entered during feasible authentication of the hardware device; this embodiment does not impose any limitations on this.

[0133] Step S202: Sign the target data according to the identity private key to obtain the data to be transmitted.

[0134] It should be understood that signing the target data with the identity private key to obtain the data to be transmitted can be achieved by generating a data signature based on the identity private key and then signing the target data based on the data signature to obtain the data to be transmitted.

[0135] In the second embodiment, by obtaining the device identification information of the trusted hardware device, finding the identity key corresponding to the trusted hardware device based on the device identification information, and signing the target data based on the identity private key, the data to be transmitted can be obtained, thereby improving the reliability of the identity key.

[0136] Reference Figure 4 , Figure 4 This is a flowchart illustrating the third embodiment of the data retrieval method of the present invention, based on the above. Figure 3 The second embodiment shown presents a third embodiment of the data retrieval method of the present invention.

[0137] In the third embodiment, before step S10, the method further includes:

[0138] Step S01: Upon receiving an access request from the blockchain, establish an encrypted communication connection with the blockchain.

[0139] It should be noted that the access request can be a request issued by the blockchain through a smart contract, and this embodiment does not limit this.

[0140] It should be understood that the encrypted communication connection can be a Secure Socket Layer (SSL) communication connection, and this embodiment does not limit it to this.

[0141] Furthermore, to improve the security of the encrypted communication connection, step S01 includes:

[0142] Upon receiving an access request from the blockchain, the system searches for the identity private key corresponding to the trusted hardware device.

[0143] An encrypted communication connection with the blockchain is established based on the identity key.

[0144] It should be understood that finding the identity key corresponding to a trusted hardware device can be done by searching for the corresponding identity key in a preset key library. This preset key library includes the correspondence between trusted hardware devices and identity keys. This correspondence can be automatically entered during the feasible authentication of the hardware device; this embodiment does not impose any limitations on this.

[0145] Furthermore, to improve the reliability of the encrypted communication connection, establishing an encrypted communication connection with the blockchain based on the identity key includes:

[0146] The identity key is sent to the blockchain so that the blockchain can authenticate the trusted hardware device based on the identity key and generate a session key when the authentication is successful.

[0147] Receive the session key sent by the blockchain, and establish an encrypted communication connection with the blockchain based on the session key.

[0148] It should be understood that since the blockchain cannot actively obtain off-chain data, sending the identity key to the blockchain so that the blockchain can authenticate the trusted hardware device based on the identity key can essentially mean sending the identity key to the corresponding smart contract of the blockchain, and the smart contract authenticating the trusted hardware device based on the identity key.

[0149] Understandably, a smart contract can verify a trusted hardware device based on an identity key by extracting the identity key to obtain the identity private key, searching for the corresponding identity public key of the trusted hardware device in the blockchain, and verifying the identity private key based on the identity public key. If the verification is successful, the trusted hardware device is deemed to have passed authentication.

[0150] Step S02: Receive the data search request sent by the blockchain through the encrypted communication connection.

[0151] It should be understood that receiving a data lookup request sent by the blockchain via an encrypted communication connection can be receiving a data query request sent by the blockchain via a smart contract via an encrypted communication connection, and this embodiment does not limit this.

[0152] In the third embodiment, by establishing an encrypted communication connection with the blockchain upon receiving an access request from the blockchain, and receiving the data search request from the blockchain through the encrypted communication connection, the communication security between the data search server and the blockchain can be improved.

[0153] In the third embodiment, after step S30, the method further includes:

[0154] Step S40: Receive the verification information fed back by the blockchain, and determine whether the data to be transmitted meets the preset conditions based on the verification information.

[0155] It should be noted that the verification information can be the result of a blockchain smart contract verifying the authenticity of the transmitted data, and this embodiment does not impose any restrictions on it.

[0156] It should be understood that determining whether the data to be transmitted meets the preset conditions based on the verification information can mean that if the verification result is successful, the data to be transmitted meets the preset conditions; if the verification result is unsuccessful, the data to be transmitted does not meet the preset conditions.

[0157] Step S50: When the data to be transmitted meets the preset conditions, the data to be transmitted is stored in the preset database.

[0158] It should be noted that the preset database can be pre-set by the administrator of the data query server, and this embodiment does not impose any restrictions on this.

[0159] In the third embodiment, by receiving verification information from the blockchain and determining whether the data to be transmitted meets the preset conditions based on the verification information, the data to be transmitted is stored in the preset database when the data meets the preset conditions, so that the data that meets the conditions can be stored in the database for subsequent use.

[0160] Furthermore, embodiments of the present invention also propose a storage medium storing a data lookup program, which, when executed by a processor, implements the steps of the data lookup method described above.

[0161] In addition, refer to Figure 5 The present invention also proposes a data retrieval device, which includes: a retrieval module 10, a signature module 20 and a sending module 30;

[0162] The search module 10 is used to perform a data search according to the data search request when it receives a data search request sent by the blockchain, and obtain the target data.

[0163] It should be noted that a data lookup request can be a data lookup request issued by the blockchain through a smart contract, and this embodiment does not limit this.

[0164] It should be understood that when a data lookup request is received from the blockchain, the data lookup is performed according to the data lookup request to obtain the target data. This can be done by parsing the data lookup request, obtaining the type of data to be looked up, extracting data from a preset storage area to obtain the stored data, and determining the target data based on the stored data and the type of data to be looked up.

[0165] Furthermore, in order to pre-authenticate the trustworthiness of the hardware device, the data lookup device includes: an authentication module;

[0166] The authentication module is used to determine the hardware device to be authenticated based on the device authentication request when it receives a device authentication request, perform trusted authentication on the hardware device to be authenticated, and obtain a trusted hardware device.

[0167] It should be noted that the device authentication request can be a control request entered by the administrator of the data lookup server through the trusted storage program after the trusted storage program is deployed to the hardware device to be authenticated. The trusted storage program can be an application associated with the data lookup server, and this embodiment does not limit this.

[0168] It should be understood that determining the hardware device to be certified based on the device certification request can involve extracting the device certification request, obtaining the device identifier, and then determining the hardware device to be certified based on the device identifier.

[0169] In a specific implementation, for example, when the data lookup server receives a device authentication request sent by the administrator of the data lookup server through a trusted storage program, the data lookup server determines the hardware device to be authenticated based on the device authentication request.

[0170] It is understood that, in performing trusted authentication on the hardware device to be authenticated, obtaining a trusted hardware device can involve acquiring the device information of the hardware device to be authenticated, matching the device information with preset trusted device information, obtaining a matching result, and when the matching result is successful, designating the hardware device to be authenticated as a trusted hardware device. The preset trusted devices can be pre-set by the administrator of the data lookup server; this embodiment does not impose any restrictions on this.

[0171] Furthermore, in order to improve the reliability of trusted authentication, the authentication module is also used to obtain the device information of the hardware device to be authenticated, send the device information to a preset authentication server, receive the authentication result fed back by the preset authentication server based on the device information, and when the authentication result is successful, designate the hardware device to be authenticated as a trusted hardware device.

[0172] It should be noted that the device information can be device hardware information, such as device model information, etc., and this embodiment does not limit it.

[0173] The preset authentication server can be a pre-set Certificate Authority (CA), and this embodiment does not limit this.

[0174] In a practical implementation, for example, a trusted storage program is placed on the hardware machine to be authenticated. When the information storage server corresponding to the trusted storage program receives a device authentication request, it can perform the following steps:

[0175] When the data lookup server receives a device authentication request, it determines the hardware device to be authenticated based on the device authentication request, obtains the hardware information of the hardware device to be authenticated, generates a private key and a public key for identity, and sends the hardware information and the public key to the preset authentication center.

[0176] The preset authentication center authenticates the hardware device to be authenticated based on the hardware device. When the hardware device to be authenticated passes the authentication, it is regarded as a trusted hardware device, and its identity public key is stored in the preset blockchain to generate an authentication certificate. The device information of the trusted hardware device and the authentication certificate are sent to the data lookup server.

[0177] Upon receiving device information and authentication certificates, the data lookup server recognizes the hardware device to be authenticated as a trusted hardware device and stores the device information and authentication certificates accordingly. This information is then used to prove the security of the hardware when data is subsequently stored on the blockchain.

[0178] The signature module 20 is used to find the identity private key corresponding to the trusted hardware device, and sign the target data according to the identity private key to obtain the data to be transmitted.

[0179] It is understandable that finding the identity private key corresponding to the trusted hardware device and signing the target data based on the identity private key to obtain the data to be transmitted can be done by obtaining the device identification information of the trusted hardware device, finding the identity key corresponding to the trusted hardware device based on the device identification information, signing the target data based on the identity private key, and obtaining the data to be transmitted.

[0180] The sending module 30 is used to send the data to be transmitted to the blockchain, whereby the blockchain verifies the data to be transmitted based on the identity public key corresponding to the trusted hardware device, and extracts the target data from the data to be transmitted after successful verification.

[0181] It should be understood that sending data to the blockchain can be done through a Secure Socket Layer (SSL) communication connection, and this embodiment does not limit this.

[0182] In the specific implementation, after the blockchain smart contract receives the data to be transmitted, it looks up the identity public key corresponding to the trusted hardware device, and verifies the data to be transmitted based on the identity public key. After the verification is successful, the data to be transmitted is extracted to obtain the target data, and the target data is aggregated and imported into the blockchain.

[0183] Furthermore, in order to notify the administrators of the data search server that the data import has been successful, the data search device further includes: a display module, which is used to receive the data import information fed back by the blockchain, generate reminder information based on the data import information, obtain the device information corresponding to the trusted hardware device, determine the information display template based on the device information, write the reminder information into the information display template, obtain the information to be displayed, and display the information to be displayed.

[0184] In this embodiment, upon receiving a data lookup request from the blockchain, a data lookup is performed to obtain the target data. The identity private key corresponding to the trusted hardware device is then located, and the target data is signed using the identity private key to obtain the data to be transmitted. This data is then sent to the blockchain, where it is verified using the identity public key corresponding to the trusted hardware device. Upon successful verification, the target data is extracted from the data to be transmitted. Compared to existing methods that import data into the blockchain from external sources whose authenticity cannot be proven, this embodiment, by first signing the data using the identity private key of the trusted hardware device after finding it, and then sending the signed data to the blockchain, allows the blockchain to verify the data's authenticity using the identity private key. This overcomes the deficiency in existing technologies where it is impossible to prove that data imported into the blockchain from external sources has not been modified, thus ensuring data reliability.

[0185] Other embodiments or specific implementations of the data search device described in this invention can be found in the above-described method embodiments, and will not be repeated here.

[0186] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0187] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the unit claims listing several devices, several of these devices may be embodied by the same hardware item. The use of the terms first, second, and third, etc., does not indicate any order and can be interpreted as names.

[0188] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as a read-only memory image (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0189] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A data search method, characterized by, The data retrieval method includes the following steps: Upon receiving a data lookup request from the blockchain, the system performs a data lookup based on the request to obtain the target data. Find the identity private key corresponding to the trusted hardware device, and sign the target data according to the identity private key to obtain the data to be transmitted; The data to be transmitted is sent to the blockchain, which verifies the data to be transmitted based on the identity public key corresponding to the trusted hardware device, and extracts the target data from the data to be transmitted after the verification is successful. The step of receiving a data lookup request from the blockchain and performing a data lookup based on the request to obtain the target data further includes: Upon receiving a device authentication request, the hardware device to be authenticated is determined based on the device authentication request; The hardware information of the hardware device to be authenticated is obtained, and a private key and a public key are generated. The hardware information and the public key are then sent to a preset authentication center. The preset authentication center authenticates the hardware device to be authenticated based on the hardware information. When the hardware device to be authenticated passes the authentication, it is designated as a trusted hardware device, and the public key is stored in a preset blockchain. An authentication certificate is generated, and the device information of the trusted hardware device and the authentication certificate are sent to a data lookup server. Upon receiving device information and authentication certificates, the hardware device to be authenticated is designated as a trusted hardware device, and the device information and authentication certificates are stored accordingly. Upon receiving an access request from the blockchain, the system searches for the private key corresponding to the trusted hardware device; sends the private key to the blockchain so that the blockchain's smart contract can search for the public key corresponding to the trusted hardware device in the blockchain; authenticates the trusted hardware device using the public key; and generates a session key upon successful authentication. The system then receives the session key from the blockchain and establishes an encrypted communication connection with the blockchain based on the session key. Finally, it receives data search requests from the blockchain through the encrypted communication connection.

2. The data lookup method of claim 1, wherein, The step of performing a data search based on the data search request to obtain the target data upon receiving a data search request from the blockchain specifically includes: Upon receiving a data search request from the blockchain, the data search request is parsed to obtain the type of data to be searched; Extract data from the preset storage area to obtain the stored data; The target data is determined based on the stored data and the type of data to be searched.

3. The data lookup method of claim 2, wherein, The step of determining the target data based on the stored data and the type of data to be searched specifically includes: The stored data is classified to obtain the types of stored data; The stored data types are matched with the data types to be searched, and the target data is determined based on the matching results.

4. The data lookup method of claim 3, wherein, The step of matching the stored data type with the data type to be searched, and determining the target data based on the type matching result, specifically includes: The stored data types are traversed, and the traversed stored data types are used as the data types to be matched; The data types to be matched are matched with the data types to be searched to obtain the category matching results; After traversing the stored data categories, the target data is determined based on the category matching results.

5. The data lookup method of claim 1, wherein, The step of finding the identity private key corresponding to the trusted hardware device and signing the target data according to the identity private key to obtain the data to be transmitted specifically includes: Obtain the device identification information of the trusted hardware device, and find the identity key corresponding to the trusted hardware device based on the device identification information; The target data is signed using the identity private key to obtain the data to be transmitted.

6. The data lookup method of any one of claims 1-5, wherein, After the step of sending the data to be transmitted to the blockchain, the data retrieval method further includes: Receive the verification information fed back by the blockchain, and determine whether the data to be transmitted meets the preset conditions based on the verification information; When the data to be transmitted meets the preset conditions, the data to be transmitted is stored in the preset database.

7. The data retrieval method according to any one of claims 1-5, characterized in that, After the step of sending the data to be transmitted to the blockchain, the data retrieval method further includes: Receive data import information from the blockchain and generate reminder information based on the data import information; Obtain the device information corresponding to the trusted hardware device, and determine the information display template based on the device information; The reminder information is written into the information display template to obtain the information to be displayed, and the information to be displayed is then displayed.

8. A data retrieval device, characterized in that, The data search device includes: a memory, a processor, and a data search program stored in the memory and executable on the processor, wherein the data search program, when executed by the processor, implements the steps of the data search method as described in any one of claims 1 to 7.

9. A storage medium, characterized in that, The storage medium stores a data lookup program, which, when executed by a processor, implements the steps of the data lookup method as described in any one of claims 1 to 7.

10. A data retrieval device, characterized in that, The data retrieval device includes: a retrieval module, a signature module, and a sending module; The search module is used to perform a data search based on the data search request sent by the blockchain when it receives the data search request, and obtain the target data. The signature module is used to find the identity private key corresponding to the trusted hardware device, and sign the target data according to the identity private key to obtain the data to be transmitted. The sending module is used to send the data to be transmitted to the blockchain, whereby the blockchain verifies the data to be transmitted based on the identity public key corresponding to the trusted hardware device, and extracts the target data from the data to be transmitted after successful verification. The data retrieval device further includes: an authentication module; The authentication module is configured to, upon receiving a device authentication request, determine the hardware device to be authenticated based on the request; acquire the hardware information of the hardware device to be authenticated, generate a private key and a public key, and send the hardware information and the public key to a preset authentication center. The preset authentication center authenticates the hardware device to be authenticated based on the hardware information. When the hardware device to be authenticated passes authentication, it is designated as a trusted hardware device, its public key is stored in a preset blockchain, an authentication certificate is generated, and the device information of the trusted hardware device and the authentication certificate are sent to a data lookup server. Upon receiving the device information and the authentication certificate, the module further configures the authentication process. The authenticated hardware device is designated as a trusted hardware device, and its device information and authentication certificate are stored accordingly. Upon receiving an access request from the blockchain, the system searches for the private key corresponding to the trusted hardware device. This private key is then sent to the blockchain, enabling the blockchain's smart contract to search for the public key corresponding to the trusted hardware device within the blockchain. The system then authenticates the trusted hardware device using the public key, and generates a session key upon successful authentication. The system receives the session key from the blockchain and establishes an encrypted communication connection with the blockchain based on the session key. Finally, it receives data search requests from the blockchain through this encrypted communication connection.

11. The data retrieval device as described in claim 10, characterized in that, The search module is also used to parse the data search request when it receives a data search request sent by the blockchain to obtain the type of data to be searched. The search module is also used to extract data from a preset storage area to obtain stored data; The search module is also used to determine target data based on the stored data and the type of data to be searched.

12. The data retrieval device as described in claim 11, characterized in that, The search module is also used to classify the stored data to obtain the types of stored data; The search module is further configured to match the stored data type with the data type to be searched, and determine the target data based on the type matching result.

13. The data retrieval device as described in claim 12, characterized in that, The search module is also used to traverse the stored data types and use the traversed stored data types as the data types to be matched. The search module is also used to match the data type to be matched with the data type to be searched, and obtain a type matching result; The search module is also used to determine the target data based on the category matching result after traversing the stored data categories.

14. The data retrieval device as described in claim 10, characterized in that, The signature module is also used to obtain the device identification information of the trusted hardware device and to find the identity key corresponding to the trusted hardware device based on the device identification information; The signature module is also used to sign the target data according to the identity private key to obtain the data to be transmitted.

Citation Information

Patent Citations

  • Retrieving public data for blockchain networks using trusted execution environments

    CN110832519A