Data search method and device, computer readable storage medium and electronic equipment
By encrypting and signing the search keywords, combined with full match and fuzzy matching search, the problem of low success rate of data search in the prior art is solved, and fuzzy matching search and data security are improved.
Patent Information
- Application Number
- CN202510560715.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-08-12
AI Technical Summary
Existing data search methods can only support full match search, but cannot support fuzzy match search, resulting in a low success rate of data search.
By encrypting the keywords to be searched, the original ciphertext to be searched is generated and signed as the target ciphertext to be searched, then a full match and/or fuzzy matching search is performed in the database, and finally the historical digital signature is removed and decrypted to obtain the data search results.
Fuzzy matching search is realized, which improves the success rate of data search and improves the accuracy of search results on the basis of ensuring data security.
Smart Images

Figure CN120470041A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of big data processing technology, and in particular, to a data search method, a data search device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Existing data search methods can only support full match search but not fuzzy match search, which reduces the success rate of data search.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention
[0004] The purpose of the present disclosure is to provide a data search method, a data search device, a computer-readable storage medium, and an electronic device, thereby overcoming, at least to a certain extent, the problem of low success rate of data search caused by the limitations and defects of related technologies.
[0005] According to one aspect of the present disclosure, a data search method is provided, comprising:
[0006] Encrypting the search keyword to obtain the original ciphertext to be searched, and signing the original ciphertext to be searched to obtain the target ciphertext to be searched;
[0007] Performing a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database to obtain original ciphertext search results;
[0008] The historical digital signature in the original ciphertext search result is removed to obtain the target ciphertext search result, and the target ciphertext search result is decrypted to obtain the data search result corresponding to the keyword to be searched.
[0009] In an exemplary embodiment of the present disclosure, the keyword to be searched is encrypted to obtain the original ciphertext to be searched, including:
[0010] Performing character splitting processing on the keyword to be searched based on a preset character splitting model to obtain a first character array, and encrypting the characters to be searched included in the first character array to obtain a first ciphertext to be searched;
[0011] Based on the position of the character to be retrieved in the first character array, the first ciphertext to be retrieved is sequentially concatenated to obtain the original ciphertext to be retrieved.
[0012] In an exemplary embodiment of the present disclosure, signing the original ciphertext to be retrieved to obtain the target ciphertext to be retrieved includes:
[0013] Performing digital fingerprint generation processing on the original ciphertext to be retrieved based on a preset digital fingerprint generation model to obtain a digital fingerprint to be retrieved of the original ciphertext to be retrieved;
[0014] The digital fingerprint to be retrieved and the original ciphertext to be retrieved are concatenated to obtain the target ciphertext to be retrieved.
[0015] In an exemplary embodiment of the present disclosure, a full match search and / or a fuzzy match search is performed on the target ciphertext to be retrieved in a preset database to obtain the original ciphertext search results, including:
[0016] Sending the target ciphertext to be retrieved to a data server, and receiving original ciphertext search results obtained by the data server after performing a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database;
[0017] The full match search is implemented by traversing the historical file names included in the preset database and determining the original ciphertext search result based on the first character edit distance between the historical file name and the target ciphertext to be retrieved;
[0018] The fuzzy matching search is achieved by removing the digital fingerprint to be retrieved from the target ciphertext to be retrieved to obtain the original ciphertext to be retrieved, and determining the original ciphertext search result based on the second character edit distance between the historical file name and the original ciphertext to be retrieved.
[0019] In an exemplary embodiment of the present disclosure, determining the original ciphertext search result according to the first character edit distance between the historical file name and the target ciphertext to be retrieved includes:
[0020] Calculating a first character distance between the historical file name and the target ciphertext to be retrieved, and calculating a first difference between the first character edit distance and the number of first character digits of the digital fingerprint to be retrieved of the original ciphertext to be retrieved;
[0021] If the first difference is less than or equal to a first preset threshold, the data under the historical file name corresponding to the first character edit distance is used as the original ciphertext search result; wherein the first preset threshold is 0.
[0022] In an exemplary embodiment of the present disclosure, determining the original ciphertext search result according to the second character edit distance between the historical file name and the original ciphertext to be retrieved includes:
[0023] Calculating a second character edit distance between the historical file name and the original ciphertext to be retrieved, and calculating a second difference between the second character edit distance and the number of first character digits of the digital fingerprint to be retrieved of the original ciphertext to be retrieved;
[0024] If the difference is less than or equal to a second preset threshold, the data under the historical file name corresponding to the second character edit distance is used as the original ciphertext search result; wherein the second preset threshold is consistent with the first character digit number.
[0025] In an exemplary embodiment of the present disclosure, the history file name is obtained in the following manner:
[0026] Performing character splitting processing on the file name to be processed to obtain a historical character array, and encrypting the historical character array to obtain a historical character ciphertext;
[0027] Based on the position of the historical character ciphertext in the name of the file to be processed, the historical character ciphertext is sequentially spliced to obtain the ciphertext splicing result;
[0028] The ciphertext splicing result is subjected to digital fingerprint generation processing based on a preset digital fingerprint generation model to obtain a historical digital signature of the ciphertext splicing result, and the historical digital signature and the ciphertext splicing result are spliced to obtain the historical file name.
[0029] In an exemplary embodiment of the present disclosure, removing the historical digital signature from the original ciphertext search result to obtain the target ciphertext search result includes:
[0030] Determining the second number of characters of the historical digital signature included in the original ciphertext search results based on the first number of characters of the digital fingerprint to be retrieved of the original ciphertext to be retrieved;
[0031] Determining the starting character position and the ending character position of the historical digital signature in the original ciphertext search result according to the second character bit position;
[0032] Based on the starting character position and the ending character position, the historical digital signature is deleted from the original ciphertext search result to obtain the target ciphertext search result.
[0033] In an exemplary embodiment of the present disclosure, decrypting the target ciphertext search results to obtain data search results corresponding to the keywords to be searched includes:
[0034] Performing ciphertext splitting processing on the target ciphertext search result to obtain a first ciphertext character string;
[0035] The first ciphertext character string is decrypted to obtain first plaintext characters, and the first plaintext characters are concatenated to obtain data search results corresponding to the keyword to be searched.
[0036] According to one aspect of the present disclosure, there is provided a data search device, comprising:
[0037] The ciphertext signature module is used to encrypt the search keyword to obtain the original ciphertext to be searched, and sign the original ciphertext to be searched to obtain the target ciphertext to be searched;
[0038] A data matching search module is used to perform a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database to obtain the original ciphertext search results;
[0039] The data search result determination module is used to remove the historical digital signature in the original ciphertext search result to obtain the target ciphertext search result, and decrypt the target ciphertext search result to obtain the data search result corresponding to the keyword to be retrieved.
[0040] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the computer program implements any one of the above-mentioned data search methods.
[0041] According to one aspect of the present disclosure, there is provided an electronic device, including:
[0042] processor; and
[0043] a memory, the memory being configured to store executable instructions of the processor;
[0044] The processor is configured to execute any one of the above-mentioned data search methods by executing the executable instructions.
[0045] A data search method provided by an embodiment of the present disclosure, on the one hand, encrypts a keyword to be searched to obtain an original ciphertext to be searched, and signs the original ciphertext to be searched to obtain a target ciphertext to be searched; then, a full match search and / or a fuzzy match search is performed on the target ciphertext to be searched in a preset database to obtain an original ciphertext search result; finally, the historical digital signature in the original ciphertext search result is removed to obtain a target ciphertext search result, and the target ciphertext search result is decrypted to obtain a data search result corresponding to the keyword to be searched, thereby realizing a fuzzy match search for the ciphertext, and solving the problem of low success rate of data search in the prior art due to the inability to perform fuzzy match search; on the other hand, since the search is based on the ciphertext, the security of the data is improved.
[0046] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0048] Figure 1 The following schematically shows a flow chart of a data search method according to an exemplary embodiment of the present disclosure.
[0049] Figure 2 An exemplary diagram schematically illustrates a data search system according to an exemplary embodiment of the present disclosure.
[0050] Figure 3 The following schematically illustrates a structural example of a preset digital fingerprint generation model according to an exemplary embodiment of the present disclosure.
[0051] Figure 4 An example diagram schematically illustrates a data encryption process according to an example embodiment of the present disclosure.
[0052] Figure 5 A diagram schematically illustrates an example scenario of data splicing according to an example embodiment of the present disclosure.
[0053] Figure 6 A scenario example diagram schematically illustrates a specific determination process of a data search result according to an example embodiment of the present disclosure.
[0054] Figure 7 An exemplary diagram schematically illustrates a data search device according to an exemplary embodiment of the present disclosure.
[0055] Figure 8 Figure 1 An electronic device for implementing a data search method according to an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0056] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0057] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0058] Based on the requirements of Level 3 security protection, sensitive data must be encrypted during transmission and storage. The Level 3 security protection described here can include the following aspects: on the one hand, it refers to the graded security protection of important national information, proprietary information of legal persons, other organizations, and citizens, and public information during storage, transmission, and processing; on the other hand, it refers to the graded management of information security products used in information systems; and on the other hand, it refers to the graded response and disposal of information security incidents occurring in information systems. Under this premise, for user information data in health care scenarios, whether it is storage, transmission, or data query, it must be carried out under the premise of ciphertext.
[0059] Therefore, when storing or searching for sensitive data, the implementation of encryption algorithms is inevitably involved. However, current mainstream encryption algorithms (such as AES, DES, and RSA) can only retrieve encrypted data as a whole, and cannot fuzzy match partial data. AES (Advanced Encryption Standard) and DES (Data Encryption Standard) described here are symmetric encryption algorithms, while RSA described here is an asymmetric encryption algorithm. Furthermore, in actual applications, there is a need for fuzzy retrieval of encrypted data. Therefore, how to perform fuzzy search and matching during ciphertext search has become a technical problem that needs to be solved. In addition, since the current mainstream encryption algorithms do not support fuzzy search and matching, the following problems still exist: on the one hand, since the mainstream encryption algorithms cannot realize the fuzzy search function, they need to adopt a full matching method to implement it, which will result in a low success rate of data search; on the other hand, in some scenarios, in order to ensure user experience, the technical implementation will consider decrypting all data and loading it into the memory, and the fuzzy search will first be based on the memory data retrieval and then return the data; however, since the data is changing in real time, the consistency of the memory data and the database data must also be considered, so the accuracy of the obtained data search results is low.
[0060] Based on this, this exemplary embodiment first provides a data search method, which can be run on a terminal device; of course, those skilled in the art can also run the method disclosed in this disclosure on other platforms as needed, and this exemplary embodiment does not specifically limit this. Figure 1 As shown, the data search method may include the following steps:
[0061] Step S110: Encrypt the search keyword to obtain the original ciphertext to be searched, and sign the original ciphertext to be searched to obtain the target ciphertext to be searched;
[0062] Step S120: Perform a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database to obtain the original ciphertext search results;
[0063] Step S130: Remove the historical digital signature in the original ciphertext search result to obtain the target ciphertext search result, and decrypt the target ciphertext search result to obtain the data search result corresponding to the keyword to be searched.
[0064] In the data search method described above, on the one hand, the original ciphertext to be searched is obtained by encrypting the keyword to be searched, and the original ciphertext to be searched is signed to obtain the target ciphertext to be searched; then, a full match search and / or fuzzy match search is performed on the target ciphertext to be searched in a preset database to obtain the original ciphertext search result; finally, the historical digital signature in the original ciphertext search result is removed to obtain the target ciphertext search result, and the target ciphertext search result is decrypted to obtain the data search result corresponding to the keyword to be searched, thereby realizing a fuzzy match search of the ciphertext, and solving the problem of low success rate of data search in the prior art due to the inability to perform fuzzy match search; on the other hand, since the search is based on ciphertext, the security of the data is improved.
[0065] Hereinafter, the data search method described in the exemplary embodiments of the present disclosure will be explained and illustrated in detail with reference to the accompanying drawings.
[0066] First, the technical implementation principle of the example embodiment of the present disclosure is explained and illustrated. Specifically, in the process of actual application, during the encryption process, the original string can be split according to the characters based on the AES encryption algorithm, and then encrypted separately and then merged to determine the MD5 prefix based on the encrypted characters; during decryption, the splicing prefix is first removed, and the decrypted data can be obtained by splicing after decryption; and, since it can be split according to standard characters, it does not affect the actual character parsing, so it can support fuzzy search. Further, the example embodiment of the present disclosure solves the problem that encrypted data cannot be fuzzily searched by considering a new algorithm based on the mainstream AES encryption algorithm; at the same time, using this algorithm, after the encrypted data is stored in the database, if the data needs to be fuzzily searched, it is only necessary to encrypt the fuzzy search keywords using the current algorithm, and then the data can be searched based on the fuzzy query logic supported by the original database, and the search results can be returned without compromising on business and increasing the complexity of the technology, thereby improving the accuracy of the data search results obtained on the basis of improving the success rate of the data search.
[0067] Next, the data search system involved in the exemplary embodiment of the present disclosure is explained and illustrated. Figure 2 As shown, the data search system may include a terminal device 210 and a data server 220; wherein the terminal device may be connected to the data server via a wired network or a wireless network; in actual application, the terminal device may be used to implement the data search method described in the exemplary embodiment of the present disclosure, and the data server may be used to store data and execute the corresponding full match search process or fuzzy match search process. Furthermore, the terminal devices described herein may include but are not limited to mobile terminals (such as mobile phones or tablets, etc.), personal computers, and fixed terminals, etc., and this example does not impose any special restrictions on this.
[0068] The following will explain and illustrate the preset digital fingerprint generation model involved in the exemplary embodiments of the present disclosure. Specifically, the preset digital fingerprint generation model recorded in the exemplary embodiments of the present disclosure can be a model generated based on a corresponding digital fingerprint generation algorithm (which can also be called a digest generation algorithm), or it can be a large model. Further, taking the preset digital fingerprint generation model as a large model as an example, refer to Figure 3 As shown, the preset digital fingerprint generation model may include a first input layer 301, an embedding layer 302, a coding layer 303, a hybrid expert model layer 304 and a first output layer 305; at the same time, the specific functions that each model layer needs to perform in the digital fingerprint generation process will be described in detail later and will not be further elaborated here.
[0069] The following will be combined Figure 2 as well as Figure 3 right Figure 1 The data search method shown in is further explained and illustrated. Specifically:
[0070] In step S110 , the keyword to be searched is encrypted to obtain an original ciphertext to be searched, and the original ciphertext to be searched is signed to obtain a target ciphertext to be searched.
[0071] In this example embodiment, first, the keywords to be searched are encrypted to obtain the original ciphertext to be searched; wherein, the keywords to be searched recorded here can be manually input by the user, or can be input by voice, or determined by other methods, and this example does not impose special restrictions on this; in the medical and health care scenario, the keywords to be searched recorded here can be names or other identity information, and this example does not impose special restrictions on this; of course, in other scenarios, it can also be a company name or other information, etc., and this example does not impose special restrictions on this. Further, in the actual application process, the specific determination process of the original ciphertext to be searched can be achieved in the following way: based on a preset character splitting model, the keywords to be searched are subjected to character splitting processing to obtain a first character array, and the characters to be searched in the first character array are encrypted to obtain a first ciphertext to be searched; based on the position of the characters to be searched in the first character array, the first ciphertexts to be searched are sequentially spliced to obtain the original ciphertext to be searched. Among them, the preset character splitting model recorded here can be a simple character splitting model constructed based on a character splitting function, or a character splitting model constructed based on a neural network model. This example does not impose any special restrictions on this.
[0072] In an exemplary embodiment, taking the keyword to be retrieved as "Zhang Xiaosan" as an example, in the actual character splitting process, the keyword to be retrieved can be directly input into the character splitting model, and the output result obtained is the first character array; among them, for a specific example diagram of the character splitting scenario, reference can be made to Figure 4 as shown; at the same time, the reason for presenting in the form of a character array here is to determine the specific arrangement order of each character obtained by splitting, so as to facilitate subsequent splicing, thereby avoiding the problem of data search failure caused by incorrect splicing order.
[0073] In an exemplary embodiment, in the process of encrypting the first character array, it can be implemented based on the mainstream encryption algorithms (such as AES, DES, RSA, etc.) recorded above, or based on the corresponding data encryption model; among them, the data encryption model recorded here can be a model constructed based on a neural network model, or a large model, and this example does not make special restrictions on this. Further, taking the encryption algorithm as AES as an example, the obtained encryption result can continue to be referred to Figure 4 as shown; at the same time, it should be supplemented here that Figure 4 the encryption result shown in is only for exemplary illustration and has no other special restrictions; and, in order to facilitate the subsequent accurate splitting of the ciphertext, the number of ciphertext strings of the encryption results of each character is fixed. Further, after obtaining the first ciphertext to be retrieved, the first ciphertext to be retrieved needs to be spliced; among them, for a specific example diagram of the splicing scenario, reference can be made to Figure 5 as shown.
[0074] Secondly, sign the original ciphertext to be retrieved to obtain the target ciphertext to be retrieved; specifically, it can be implemented through the following method: generate a digital fingerprint of the original ciphertext to be retrieved based on a preset digital fingerprint generation model to obtain the digital fingerprint to be retrieved of the original ciphertext to be retrieved; splice the digital fingerprint to be retrieved and the original ciphertext to be retrieved to obtain the target ciphertext to be retrieved. That is, in the actual application process, first, a digital fingerprint to be retrieved needs to be generated; among them, the generation of the digital fingerprint to be retrieved can depend on the digital fingerprint generation model recorded here, or can be directly implemented based on the corresponding digital fingerprint generation algorithm (which can also be called a digest generation algorithm), and this example does not make special restrictions on this; secondly, splice the obtained digital fingerprint to be retrieved to obtain the target ciphertext to be retrieved; among them, in the specific splicing process, the digital fingerprint to be retrieved can be directly spliced to the starting position of the original ciphertext to be retrieved, or the digital fingerprint to be retrieved can be spliced to the end position of the original ciphertext to be retrieved, and this example does not make special restrictions on this; at the same time, for a specific example diagram of the splicing scenario, reference can continue to be made to Figure 5shown.
[0075] In an exemplary embodiment, taking the preset digital fingerprint generation model as a large model as an example, the original ciphertext to be retrieved is subjected to digital fingerprint generation processing based on the preset digital fingerprint generation model to obtain the digital fingerprint to be retrieved of the original ciphertext to be retrieved, which can be achieved in the following manner: first, basic information to be predicted is generated based on the original ciphertext to be retrieved, and context information to be predicted is generated based on preset model prompt parameters; secondly, embedding mapping processing is performed on the basic information to be predicted based on the embedding mapping layer to obtain a first ciphertext feature, and embedding mapping processing is performed on the context information to be predicted based on the embedding mapping layer to obtain a first context marker sequence; then, encoding processing is performed on the first ciphertext feature and the first context marker sequence based on the encoding layer to obtain a first context overall representation; finally, digital fingerprint generation processing is performed on the first context marker sequence and the first context overall representation based on the hybrid expert model layer to obtain the digital fingerprint to be retrieved of the original ciphertext to be retrieved. Among them, the embedding mapping layer recorded here can include an Embedding embedding mapping layer and a Bert embedding mapping layer. When performing embedding mapping processing, the basic information to be predicted can be embedded and mapped based on the Embedding embedding mapping layer to obtain the first ciphertext feature, and the context information to be predicted can be embedded and mapped based on the Bert embedding mapping layer to obtain the first context flag sequence; at the same time, the coding layer recorded here can be implemented based on a multi-layer bidirectional Transformer.
[0076] In an example embodiment, in the process of performing digital fingerprint generation processing on the first context flag sequence and the first context overall representation based on the hybrid expert model layer to obtain the digital fingerprint to be retrieved of the original ciphertext to be retrieved, it can be achieved in the following way: first, based on the gated network model in the hybrid expert model layer and according to the first context flag sequence, the model weight of the expert neural network model in the hybrid expert model layer when performing the prediction task of the digital fingerprint to be retrieved is determined; secondly, based on the model weight, the target network model required to perform the prediction task of the digital fingerprint to be retrieved is determined from the expert neural network model; then, the first context flag sequence and the first context overall representation are input into the target network model to obtain the corresponding digital fingerprint to be retrieved.
[0077] In step S120, a full match search and / or a fuzzy match search is performed on the target ciphertext to be retrieved in a preset database to obtain original ciphertext search results.
[0078] Specifically, the specific process of determining the original ciphertext search result can be achieved by: sending the target ciphertext to be retrieved to a data server, and receiving the original ciphertext search result obtained by the data server after performing a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database; wherein the full match search described herein is achieved by traversing the historical file names included in the preset database, and determining the original ciphertext search result based on the first character edit distance between the historical file names and the target ciphertext to be retrieved; further, the fuzzy match search described herein is achieved by removing the digital fingerprint to be retrieved from the target ciphertext to be retrieved to obtain the original ciphertext to be retrieved, and determining the original ciphertext search result based on the second character edit distance between the historical file names and the original ciphertext to be retrieved. Specifically, since real-time retrieval can be performed in the database based on the corresponding target ciphertext to be retrieved, the problem of low accuracy of data search results caused by fuzzy retrieval in memory data in the prior art can be solved, thereby improving the accuracy of data search results while ensuring data security.
[0079] In an exemplary embodiment, determining the original ciphertext search result based on the first character edit distance between the historical file name and the target ciphertext to be retrieved can be achieved as follows: calculating the first character edit distance between the historical file name and the target ciphertext to be retrieved, and calculating a first difference between the first character edit distance and the first character digit number of the digital fingerprint to be retrieved of the original ciphertext to be retrieved; if the first difference is less than or equal to a first preset threshold, then using the data under the historical file name corresponding to the first character edit distance as the original ciphertext search result; wherein the first preset threshold is 0. That is, in actual application, full matching requires ensuring that the target ciphertext to be retrieved and the historical file name are completely consistent; only under this premise can full matching be achieved.
[0080] In an exemplary embodiment, the original ciphertext search result is determined based on the second character edit distance between the historical file name and the original ciphertext to be retrieved, which can be achieved as follows: calculating the second character edit distance between the historical file name and the original ciphertext to be retrieved, and calculating the second difference between the second character edit distance and the first character digit number of the digital fingerprint to be retrieved of the original ciphertext to be retrieved; if the difference is less than or equal to a second preset threshold, the data under the historical file name corresponding to the second character edit distance is used as the original ciphertext search result; wherein the second preset threshold is consistent with the first character digit number. That is, in actual application, the premise of fuzzy matching is that the digital fingerprint information in the target ciphertext to be retrieved can be ignored; therefore, after removing the digital fingerprint to be retrieved, in the specific matching process, if the corresponding historical file name is matched and the second difference is consistent with the first character digit number, then it can be determined that the matching result is consistent.
[0081] In an exemplary embodiment of the present disclosure, the historical file name is obtained in the following manner: performing character splitting processing on the file name to be processed to obtain a historical character array, and encrypting the historical character array to obtain a historical character ciphertext; based on the position of the historical character ciphertext in the file name to be processed, the historical character ciphertext is sequentially spliced to obtain the ciphertext splicing result; performing digital fingerprint generation processing on the ciphertext splicing result based on a preset digital fingerprint generation model to obtain a historical digital signature of the ciphertext splicing result, and splicing the historical digital signature and the ciphertext splicing result to obtain the historical file name. That is, in the actual application process, the corresponding data can be processed on the terminal device side, and the corresponding data files can be generated, and then the data files can be stored in the database on the data server side; wherein, the historical file name recorded here can be determined based on the user's name, and the corresponding data is stored in the folder corresponding to the historical file name; for example, in the health care scenario, the data can be the user's personal information (such as residential address, contact information or some other basic information, etc.), the user's medical health information, the user's employment information, etc., and this example does not impose special restrictions on this; for example, for corporate users, the data can be the company's basic registration information, risk information, financial information and other product information, etc., and this example does not impose special restrictions on this.
[0082] In step S130, the historical digital signature in the original ciphertext search result is removed to obtain the target ciphertext search result, and the target ciphertext search result is decrypted to obtain the data search result corresponding to the keyword to be searched.
[0083] In this example embodiment, first, the historical digital signature in the original ciphertext search results is removed to obtain the target ciphertext search results. Specifically, this can be achieved by: determining the second character bit count of the historical digital signature included in the original ciphertext search results based on the first character bit count of the digital fingerprint to be retrieved of the original ciphertext to be retrieved; determining the starting character position and ending character position of the historical digital signature in the original ciphertext search results based on the second character bit count; and deleting the historical digital signature from the original ciphertext search results based on the starting character position and ending character position to obtain the target ciphertext search results. That is, in actual application, since the number of bits of the corresponding digital fingerprint is fixed, the historical digital signature in the original ciphertext search results can be deleted based on the corresponding character bit count to obtain the target ciphertext search results.
[0084] Secondly, the target ciphertext search results are decrypted to obtain data search results corresponding to the keywords to be searched; specifically, this can be achieved in the following ways: the target ciphertext search results are ciphertext split to obtain a first ciphertext string; the first ciphertext string is decrypted to obtain a first plaintext character, and the first plaintext character is spliced to obtain a data search result corresponding to the keywords to be searched. That is, in actual application, since the number of ciphertext bits obtained for each character is fixed, the target ciphertext search results can be directly ciphertext split based on the ciphertext bit number of the character to obtain the first ciphertext string for each character; then, the first ciphertext string is decrypted to obtain the corresponding plaintext character; wherein, the decryption process recorded here can be implemented based on a decryption process opposite to the encryption process, or based on a corresponding model, and this example does not impose any special restrictions on this; further, after obtaining the plaintext characters, the plaintext characters are spliced to obtain the corresponding data search results; wherein, the scenario example diagram of the specific determination process of the data search results can be referred to. Figure 6 shown.
[0085] The following are embodiments of the apparatus disclosed herein, which can be used to implement the method embodiments disclosed herein. For details not disclosed in the apparatus embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0086] The exemplary embodiment of the present disclosure also provides a data search device. Specifically, refer to Figure 7 As shown, the data search device may include a ciphertext signature module 710, a data matching search module 720, and a data search result determination module 730. Among them:
[0087] The ciphertext signature module 710 may be used to encrypt the search keyword to obtain the original ciphertext to be searched, and to sign the original ciphertext to be searched to obtain the target ciphertext to be searched;
[0088] The data matching search module 720 may be configured to perform a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database to obtain original ciphertext search results;
[0089] The data search result determination module 730 can be used to remove the historical digital signature in the original ciphertext search result to obtain the target ciphertext search result, and decrypt the target ciphertext search result to obtain the data search result corresponding to the keyword to be retrieved.
[0090] In an exemplary embodiment of the present disclosure, the keyword to be searched is encrypted to obtain the original ciphertext to be searched, including: performing character splitting processing on the keyword to be searched based on a preset character splitting model to obtain a first character array, and encrypting the characters to be searched included in the first character array to obtain a first ciphertext to be searched; based on the position of the characters to be searched in the first character array, the first ciphertext to be searched is sequentially spliced to obtain the original ciphertext to be searched.
[0091] In an exemplary embodiment of the present disclosure, the original ciphertext to be retrieved is signed to obtain the target ciphertext to be retrieved, including: performing digital fingerprint generation processing on the original ciphertext to be retrieved based on a preset digital fingerprint generation model to obtain the digital fingerprint to be retrieved of the original ciphertext to be retrieved; and splicing the digital fingerprint to be retrieved and the original ciphertext to be retrieved to obtain the target ciphertext to be retrieved.
[0092] In an exemplary embodiment of the present disclosure, a full match search and / or fuzzy match search is performed on the target ciphertext to be retrieved in a preset database to obtain an original ciphertext search result, including: sending the target ciphertext to be retrieved to a data server, and receiving the original ciphertext search result obtained by the data server after performing a full match search and / or fuzzy match search on the target ciphertext to be retrieved in the preset database; wherein the full match search is implemented in the following manner: traversing the historical file names included in the preset database, and determining the original ciphertext search result based on the first character edit distance between the historical file name and the target ciphertext to be retrieved; the fuzzy match search is implemented in the following manner: removing the digital fingerprint to be retrieved in the target ciphertext to be retrieved to obtain the original ciphertext to be retrieved, and determining the original ciphertext search result based on the second character edit distance between the historical file name and the original ciphertext to be retrieved.
[0093] In an exemplary embodiment of the present disclosure, the original ciphertext search result is determined based on the first character edit distance between the historical file name and the target ciphertext to be retrieved, including: calculating the first character distance between the historical file name and the target ciphertext to be retrieved, and calculating the first difference between the first character edit distance and the first character digit number of the digital fingerprint to be retrieved of the original ciphertext to be retrieved; if the first difference is less than or equal to a first preset threshold, the data under the historical file name corresponding to the first character edit distance is used as the original ciphertext search result; wherein, the first preset threshold is 0.
[0094] In an exemplary embodiment of the present disclosure, the original ciphertext search result is determined based on the second character edit distance between the historical file name and the original ciphertext to be retrieved, including: calculating the second character edit distance between the historical file name and the original ciphertext to be retrieved, and calculating the second difference between the second character edit distance and the first character bit number of the digital fingerprint to be retrieved of the original ciphertext to be retrieved; if the difference is less than or equal to a second preset threshold, the data under the historical file name corresponding to the second character edit distance is used as the original ciphertext search result; wherein, the second preset threshold is consistent with the first character bit number.
[0095] In an exemplary embodiment of the present disclosure, the historical file name is obtained in the following manner: performing character splitting processing on the file name to be processed to obtain a historical character array, and encrypting the historical character array to obtain a historical character ciphertext; based on the position of the historical character ciphertext in the file name to be processed, the historical character ciphertext is sequentially spliced to obtain the ciphertext splicing result; performing digital fingerprint generation processing on the ciphertext splicing result based on a preset digital fingerprint generation model to obtain a historical digital signature of the ciphertext splicing result, and splicing the historical digital signature and the ciphertext splicing result to obtain the historical file name.
[0096] In an exemplary embodiment of the present disclosure, removing the historical digital signature in the original ciphertext search result to obtain the target ciphertext search result includes: determining the second number of character bits of the historical digital signature included in the original ciphertext search result based on the first number of character bits of the digital fingerprint to be retrieved of the original ciphertext to be retrieved; determining the starting character position and the ending character position of the historical digital signature in the original ciphertext search result based on the second number of character bits; and deleting the historical digital signature from the original ciphertext search result based on the starting character position and the ending character position to obtain the target ciphertext search result.
[0097] In an exemplary embodiment of the present disclosure, the target ciphertext search result is decrypted to obtain a data search result corresponding to the keyword to be retrieved, including: performing ciphertext splitting processing on the target ciphertext search result to obtain a first ciphertext string; decrypting the first ciphertext string to obtain a first plaintext character, and performing character splicing on the first plaintext character to obtain a data search result corresponding to the keyword to be retrieved.
[0098] The specific details of each module in the above-mentioned data search device have been described in detail in the corresponding data search method, so they will not be repeated here.
[0099] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0100] Furthermore, although the steps of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0101] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. Those skilled in the art will appreciate that various aspects of the present disclosure can be implemented as a system, method, or program product. Therefore, various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to herein as a circuit, module, or system.
[0102] Refer to the following Figure 8 800 according to this embodiment of the present disclosure will be described. Figure 8 The electronic device 800 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0103] like Figure 8As shown, electronic device 800 is implemented as a general-purpose computing device. Components of electronic device 800 may include, but are not limited to, the aforementioned at least one processing unit 810, the aforementioned at least one storage unit 820, a bus 830 connecting various system components (including storage unit 820 and processing unit 810), and a display unit 840.
[0104] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps described in the "Exemplary Method" section of the present disclosure according to various exemplary embodiments. For example, the processing unit 810 can perform the following steps: Figure 1 Step S110 shown in the figure: encrypt the keyword to be searched to obtain the original ciphertext to be searched, and sign the original ciphertext to be searched to obtain the target ciphertext to be searched; step S120: perform a full match search and / or a fuzzy match search on the target ciphertext to be searched in a preset database to obtain an original ciphertext search result; step S130: remove the historical digital signature in the original ciphertext search result to obtain the target ciphertext search result, and decrypt the target ciphertext search result to obtain a data search result corresponding to the keyword to be searched.
[0105] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 8201 and / or a cache memory unit 8202 , and may further include a read-only memory unit (ROM) 8203 .
[0106] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0107] Bus 830 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0108] The electronic device 800 can also communicate with one or more external devices 900 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 800, and / or any device that enables the electronic device 800 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 850. Furthermore, the electronic device 800 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 860. As shown, the network adapter 860 communicates with other modules of the electronic device 800 via a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 800, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0109] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0110] In exemplary embodiments of the present disclosure, a computer-readable storage medium is also provided, on which is stored a program product capable of implementing the aforementioned methods of this specification. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product comprising program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to execute the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present disclosure.
[0111] A program product for implementing the above-described method according to an embodiment of the present disclosure is described. The program product may be a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0112] The program product may be implemented in any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0113] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0114] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0115] The program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0116] Furthermore, the figures above are merely illustrative of the processes included in the methods according to exemplary embodiments of the present disclosure and are not intended to be limiting. It is readily understood that the processes illustrated in the figures above do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0117] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow from the general principles of the present disclosure and include common knowledge or customary techniques in the art not invented herein. The specification and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
Claims
1. A data search method, characterized in that: include: Encrypting the search keyword to obtain the original ciphertext to be searched, and signing the original ciphertext to be searched to obtain the target ciphertext to be searched; Performing a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database to obtain original ciphertext search results; The historical digital signature in the original ciphertext search result is removed to obtain the target ciphertext search result, and the target ciphertext search result is decrypted to obtain the data search result corresponding to the keyword to be searched.
2. The data search method according to claim 1, characterized in that: The search keywords are encrypted to obtain the original ciphertext to be searched, including: Performing character splitting processing on the keyword to be searched based on a preset character splitting model to obtain a first character array, and encrypting the characters to be searched included in the first character array to obtain a first ciphertext to be searched; Based on the position of the character to be retrieved in the first character array, the first ciphertext to be retrieved is sequentially concatenated to obtain the original ciphertext to be retrieved.
3. The data search method according to claim 1, characterized in that: Signing the original ciphertext to be retrieved to obtain the target ciphertext to be retrieved includes: Performing digital fingerprint generation processing on the original ciphertext to be retrieved based on a preset digital fingerprint generation model to obtain a digital fingerprint to be retrieved of the original ciphertext to be retrieved; The digital fingerprint to be retrieved and the original ciphertext to be retrieved are concatenated to obtain the target ciphertext to be retrieved.
4. The data search method according to claim 1, characterized in that: Perform a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database to obtain the original ciphertext search results, including: Sending the target ciphertext to be retrieved to a data server, and receiving original ciphertext search results obtained by the data server after performing a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database; The full match search is implemented by traversing the historical file names included in the preset database and determining the original ciphertext search result based on the first character edit distance between the historical file name and the target ciphertext to be retrieved; The fuzzy matching search is achieved by removing the digital fingerprint to be retrieved from the target ciphertext to be retrieved to obtain the original ciphertext to be retrieved, and determining the original ciphertext search result based on the second character edit distance between the historical file name and the original ciphertext to be retrieved.
5. The data search method according to claim 4, characterized in that: Determining the original ciphertext search result according to the first character edit distance between the historical file name and the target ciphertext to be retrieved includes: Calculating a first character distance between the historical file name and the target ciphertext to be retrieved, and calculating a first difference between the first character edit distance and the number of first character digits of the digital fingerprint to be retrieved of the original ciphertext to be retrieved; If the first difference is less than or equal to a first preset threshold, the data under the historical file name corresponding to the first character edit distance is used as the original ciphertext search result; wherein the first preset threshold is 0.
6. The data search method according to claim 4, characterized in that: Determining the original ciphertext search result according to the second character edit distance between the historical file name and the original ciphertext to be searched includes: Calculating a second character edit distance between the historical file name and the original ciphertext to be retrieved, and calculating a second difference between the second character edit distance and the number of first character digits of the digital fingerprint to be retrieved of the original ciphertext to be retrieved; If the difference is less than or equal to a second preset threshold, the data under the historical file name corresponding to the second character edit distance is used as the original ciphertext search result; wherein the second preset threshold is consistent with the first character digit number.
7. The data search method according to claim 5, characterized in that: The history file name is obtained as follows: Performing character splitting processing on the file name to be processed to obtain a historical character array, and encrypting the historical character array to obtain a historical character ciphertext; Based on the position of the historical character ciphertext in the name of the file to be processed, the historical character ciphertext is sequentially spliced to obtain the ciphertext splicing result; The ciphertext splicing result is subjected to digital fingerprint generation processing based on a preset digital fingerprint generation model to obtain a historical digital signature of the ciphertext splicing result, and the historical digital signature and the ciphertext splicing result are spliced to obtain the historical file name.
8. The data search method according to claim 1, characterized in that: Removing the historical digital signature from the original ciphertext search results to obtain the target ciphertext search results includes: Determining the second number of characters of the historical digital signature included in the original ciphertext search results based on the first number of characters of the digital fingerprint to be retrieved of the original ciphertext to be retrieved; Determining the starting character position and the ending character position of the historical digital signature in the original ciphertext search result according to the second character bit position; Based on the starting character position and the ending character position, the historical digital signature is deleted from the original ciphertext search result to obtain the target ciphertext search result.
9. The data search method according to claim 1, characterized in that: Decrypt the target ciphertext search results to obtain the data search results corresponding to the search keywords, including: Performing ciphertext splitting processing on the target ciphertext search result to obtain a first ciphertext character string; The first ciphertext character string is decrypted to obtain first plaintext characters, and the first plaintext characters are concatenated to obtain data search results corresponding to the keyword to be searched.
10. A data search device, characterized in that: include: The ciphertext signature module is used to encrypt the search keyword to obtain the original ciphertext to be searched, and sign the original ciphertext to be searched to obtain the target ciphertext to be searched; A data matching search module is used to perform a full match search and / or a fuzzy match search on the target ciphertext to be retrieved in a preset database to obtain the original ciphertext search results; The data search result determination module is used to remove the historical digital signature in the original ciphertext search result to obtain the target ciphertext search result, and decrypt the target ciphertext search result to obtain the data search result corresponding to the keyword to be retrieved.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data search method according to any one of claims 1 to 9 is implemented.
12. An electronic device, characterized in that: include: processor; as well as a memory, the memory being configured to store executable instructions of the processor; The processor is configured to execute the data search method according to any one of claims 1 to 9 by executing the executable instructions.
Citation Information
Patent Citations
Simhash-based fuzzy sequencing searching method for encrypted cloud data
CN106407447A
Document repetition degree detection method, device and apparatus and readable storage medium
CN111737966A
Data encryption method, data query method, data encryption apparatus, data query apparatus, device and storage medium
WO2019178958A1