Data fuzzy query method and related device

In the data encryption scenario in the financial field, the fuzzy query field is encrypted using a single-character digest encryption algorithm and the extended field storage ciphertext is generated, which solves the problem of low fuzzy query efficiency in the existing technology, and achieves an efficient and reliable fuzzy query effect.

CN119597796APending Publication Date: 2025-03-11AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411743773.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-30
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The prior art has low fuzzy query efficiency in the data encryption scenarios in the financial field, especially in large data volumes and complex business scenarios, resulting in low retrieval efficiency and degradation of performance.

Method used

The single-character digest encryption algorithm is used to encrypt the plain text field values ​​of the fuzzy query field, and the extended field is generated to store the single-character ciphertext field values. During query, the target ciphertext query value is used to query the extended field to realize fuzzy query of encrypted data.

Benefits of technology

It improves the reliability and query efficiency of data fuzzy query results, reduces query restrictions, and ensures data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597796A_ABST
    Figure CN119597796A_ABST
Patent Text Reader

Abstract

The invention discloses a data fuzzy query method and a related device, and relates to the technical field of big data, and the method comprises the steps: obtaining to-be-encrypted data, carrying out the single-character encryption of a plaintext field value of each fuzzy query field through employing a preset single-character abstract encryption algorithm, obtaining a single-character ciphertext field value of the fuzzy query field, and storing the single-character ciphertext field value of the fuzzy query field; generating an extended field of the fuzzy query field, and storing each single-character ciphertext field value to the extended field of the fuzzy query field; obtaining a target query statement; querying an extended field of the target fuzzy query field based on each single-character ciphertext in the target ciphertext query value to obtain a ciphertext query result; and decrypting the ciphertext query result to obtain a plaintext query result. According to the method, the target ciphertext query value in the target query statement is utilized to query the expansion field, the target ciphertext query value comprises the single-character ciphertext, the fuzzy query function of the encrypted data is achieved, the query efficiency is improved, and the query limitation is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a data fuzzy query method and related devices. Background Art

[0002] As data leakage incidents emerge in an endless stream in the era of big data, and with the development of new network forms, new technologies, and new application scenarios in the industry, new data types, data production methods, and data processing methods continue to emerge, and data security challenges are also intensifying. Data encryption is one of the important means to protect information security. Data encryption is one of the important means to protect information security. It can prevent unauthorized access and leakage, and ensure the confidentiality and integrity of data. The commonly used encryption strategy is to encrypt and store the entire string stored in the database, and then decrypt and return it when querying. This method requires full-text matching when retrieving encrypted data. Given the characteristics of large bank data volume and complex business, the full-text matching requirement will lead to low retrieval efficiency. Summary of the invention

[0003] In view of the above problems, the present application provides a data fuzzy query method and related devices to achieve the purpose of improving the reliability of data fuzzy query results. The specific scheme is as follows:

[0004] The first aspect of the present application provides a data fuzzy query method, comprising:

[0005] Acquire data to be encrypted, wherein the data to be encrypted includes a field to be encrypted and a corresponding plaintext field value, wherein the field to be encrypted includes a preset fuzzy query field;

[0006] Using a preset single-character digest encryption algorithm, single-character encryption is performed on the plaintext field value of each of the fuzzy query fields to obtain a single-character ciphertext field value of the fuzzy query field, an extended field of the fuzzy query field is generated, and each of the single-character ciphertext field values ​​is stored in the extended field of the fuzzy query field;

[0007] Obtain a target query statement; the target query statement includes an extended field of a target fuzzy query field and a target ciphertext query value, and the target ciphertext query value includes at least one single-character ciphertext;

[0008] querying the extended fields of the target fuzzy query field based on each single-character ciphertext in the target ciphertext query value to obtain a ciphertext query result; the ciphertext query result includes a plurality of single-character ciphertext field values ​​of the target fuzzy query field that hit at least one single-character ciphertext;

[0009] The ciphertext query result is decrypted to obtain a plaintext query result.

[0010] In a possible implementation, the field to be encrypted also includes a common field, and the data fuzzy query method further includes:

[0011] Use a preset encryption algorithm to encrypt the plaintext field value of each common field as a whole to obtain the overall ciphertext field value of each common field, and store each overall ciphertext field value in the common field.

[0012] In a possible implementation, obtaining the target query statement includes:

[0013] Receiving a target SQL statement, parsing the target SQL statement to determine a statement type of the target SQL statement;

[0014] If the statement type of the target SQL statement is a query statement, generating an update SQL statement of the target SQL statement according to a first update rule;

[0015] The first updating rule includes:

[0016] Identifying a fuzzy query field in the target SQL statement as a target fuzzy query field based on a preset extended field library;

[0017] Using the single-character digest encryption algorithm, encrypt the target query value of each target fuzzy query field by single characters to obtain the single-character ciphertext field value of the target fuzzy query field as the target ciphertext query value;

[0018] The target fuzzy query field in the target SQL statement is replaced with an extended field of the target fuzzy query field, and the target query value of the target fuzzy query field is replaced with a target ciphertext query value to obtain the target query statement.

[0019] In a possible implementation, the data fuzzy query method further includes:

[0020] If the statement type of the target SQL statement is a statement of the data insertion type, generating an update SQL statement of the target SQL statement according to the second update rule;

[0021] The second update rule includes:

[0022] Acquire the fields to be inserted and the corresponding plaintext field values ​​in the target SQL statement, and identify the fuzzy query field in the fields to be inserted as the fuzzy query field to be inserted based on the extended field library;

[0023] Obtain the overall ciphertext field value of the field to be inserted;

[0024] Using the single-character digest encryption algorithm, single-character encryption is performed on each plaintext field value to be inserted into the fuzzy query field to obtain the single-character ciphertext field value to be inserted into the fuzzy query field;

[0025] The plaintext field value of the field to be inserted is replaced with the overall ciphertext field value, and the extended field of the fuzzy query field to be inserted and the corresponding single-character ciphertext field value are added.

[0026] In a possible implementation, the data fuzzy query method further includes:

[0027] If the target SQL statement is a statement for updating data, determine whether the field to be updated is in the update column or the search condition column;

[0028] If the to-be-updated field is located in the update column, generating an update SQL statement of the target SQL statement based on the second update rule;

[0029] If the to-be-updated field is located in the search condition column, generating an update SQL statement of the target SQL statement based on a preset third update rule;

[0030] The third updating rule includes:

[0031] Get the fields to be updated and the corresponding plaintext field values;

[0032] Identify the fuzzy query field to be updated in the field to be updated based on the extended field library,

[0033] Using the single-character digest encryption algorithm, single-character encryption is performed on the plaintext field value of each of the fuzzy query fields to be updated, so as to obtain the single-character ciphertext field value of the fuzzy query field to be updated;

[0034] The to-be-updated fuzzy query field is replaced with an extended field of the to-be-updated fuzzy query field, and the plaintext field value of the to-be-updated fuzzy query field is replaced with a single-character ciphertext field value.

[0035] In a possible implementation, the single-character digest encryption algorithm is used to single-character encrypt the plaintext field value of the target field to obtain the single-character ciphertext field value of the target field, wherein the target field includes the fuzzy query field to be updated, the fuzzy query field to be inserted, and the fuzzy query field, including:

[0036] Splitting each plaintext field value of the target field according to the length of a single character to obtain a character set of each plaintext field value of the target field as a character set to be encrypted;

[0037] Encrypt each character to be encrypted in the set of characters to be encrypted using the single-character digest encryption algorithm to obtain a single-character ciphertext of each character to be encrypted;

[0038] The single-character ciphertext of each character to be encrypted is concatenated to obtain the single-character ciphertext field value of the target field.

[0039] A second aspect of the present application provides a data fuzzy query device, comprising:

[0040] A basic data acquisition unit, used to acquire data to be encrypted, wherein the data to be encrypted includes a field to be encrypted and a corresponding plaintext field value, and the field to be encrypted includes a preset fuzzy query field;

[0041] A single-character encryption unit, used to use a preset single-character digest encryption algorithm to perform single-character encryption on the plaintext field value of each of the fuzzy query fields, obtain the single-character ciphertext field value of the fuzzy query field, generate an extended field of the fuzzy query field, and store each of the single-character ciphertext field values ​​in the extended field of the fuzzy query field;

[0042] A statement parsing unit, configured to obtain a target query statement; the target query statement includes an extended field of a target fuzzy query field and a target ciphertext query value, wherein the target ciphertext query value includes at least one single-character ciphertext;

[0043] A query unit, configured to query the extended field of the target fuzzy query field based on each single-character ciphertext in the target ciphertext query value, to obtain a ciphertext query result; the ciphertext query result includes a plurality of single-character ciphertext field values ​​of the target fuzzy query field that hit at least one single-character ciphertext;

[0044] The decryption unit decrypts the ciphertext query result to obtain a plaintext query result.

[0045] A third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the data fuzzy query method of the first aspect or any implementation of the first aspect.

[0046] A fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0047] The memory is used to store computer programs;

[0048] The processor is used to execute the computer program so that the electronic device can implement the data fuzzy query method of the above-mentioned first aspect or any implementation method of the first aspect.

[0049] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can use the data fuzzy query method of the above-mentioned first aspect or any implementation of the first aspect.

[0050] By means of the above technical scheme, the present application provides a data fuzzy query method and related device, which obtains data to be encrypted, the data to be encrypted includes a field to be encrypted and a corresponding plaintext field value, and the field to be encrypted includes a preset fuzzy query field. Use a preset single-character digest encryption algorithm to encrypt the plaintext field value of each fuzzy query field by single character, obtain the single-character ciphertext field value of the fuzzy query field, generate an extended field of the fuzzy query field, and store each single-character ciphertext field value in the extended field of the fuzzy query field. Obtain a target query statement. The target query statement includes an extended field of the target fuzzy query field and a target ciphertext query value, and the target ciphertext query value includes at least one single-character ciphertext. The extended field of the target fuzzy query field is queried based on each single-character ciphertext in the target ciphertext query value to obtain a ciphertext query result. The ciphertext query result includes multiple single-character ciphertext field values ​​of the target fuzzy query field that hit at least one single-character ciphertext. Decrypt the ciphertext query result to obtain a plaintext query result. The plaintext field value corresponding to the to-be-encrypted field in the to-be-encrypted data is encrypted using a single-character digest encryption method, and an extension field is added for each fuzzy query field, and the single-character ciphertext field value is stored in the extension field. During fuzzy retrieval, the target ciphertext query value in the target query statement is used to query the extension field, and the target ciphertext query value includes a single-character ciphertext. Therefore, the fuzzy query function for encrypted data is realized, the query efficiency is improved, and the query restrictions are reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0052] Figure 1 A schematic diagram of the data fuzzy query system architecture provided for this application;

[0053] Figure 2 A schematic diagram of the hardware structure of a terminal provided in this application;

[0054] Figure 3 A schematic diagram of the hardware structure of a server provided for this application;

[0055] Figure 4A schematic diagram of a data fuzzy query method provided in an embodiment of the present application;

[0056] Figure 5 A specific implementation flow chart of a data fuzzy query method provided in an embodiment of the present application;

[0057] Figure 6 An example of a physical representation in a database is given;

[0058] Figure 7 A schematic diagram of the structure of a data fuzzy query device provided in an embodiment of the present application;

[0059] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0060] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0061] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0062] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0063] The present application can be applied in the field of big data technology, and specifically can be applied to scenarios where abnormal data is obtained in data fuzzy query scenarios. A data fuzzy query method provided in an embodiment of the present application can be applied to a data fuzzy query system, and the data fuzzy query method can be implemented through a terminal or a server in the data fuzzy query system, or through the interaction between a terminal and a server in the data fuzzy query system.

[0064] See also Figure 1 , Figure 1A schematic diagram of a data fuzzy query system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers ( Figure 1 In the example, a server is included, and the server 200 can provide the method provided in the embodiment of the present application for one or more terminals.

[0065] Among them, a query application can be installed on the terminal 100, and the above application and web page can provide an interface. The terminal 100 can receive relevant parameters entered by the user on the query interface and send the above parameters to the server 200. The server 200 can obtain processing results based on the received parameters and return the processing results to the terminal 100.

[0066] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters by itself without the cooperation of the server, and the embodiments of the present application are not limited to this.

[0067] Next describe Figure 1 The product form of the mid-terminal 100;

[0068] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any limitation on this.

[0069] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.

[0070] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2 These are merely examples of terminals or multi-function devices and do not constitute limitations on the terminals or multi-function devices, which may include more or fewer components than those shown in the figures, or combinations of certain components, or different components.

[0071] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the portable multifunctional device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0072] Among them, the input device 132 can receive input data and the like.

[0073] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the terminal 100, interactive interfaces, file display and / or playback of any multimedia file. In the embodiment of the present application, the display unit 140 can be used to display the interface of the data fuzzy query, processing results, etc.

[0074] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.

[0075] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.

[0076] Among them, the memory 120 can be used to store software codes related to the data fuzzy query method, the processor 170 can execute the steps of the data fuzzy query method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to achieve corresponding functions.

[0077] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.

[0078] In this embodiment of the present application, the RF unit 110 can send data to the server 200 and receive processing results sent by the server 200.

[0079] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.

[0080] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0081] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .

[0082] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.

[0083] Next describe Figure 1 The product form of the server 200;

[0084] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.

[0085] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0086] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0087] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0088] The memory 204 may be used to store software codes related to the data fuzzy query method, the processor 202 may execute the steps of the data fuzzy query method of the chip, and may also schedule other units to implement corresponding functions.

[0089] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.

[0090] At present, fuzzy queries in data encryption scenarios in the financial field mostly adopt the strategy of word segmentation combination encryption and storage. The main difference lies in the word segmentation strategy and the encryption strategy for the word segmentation.

[0091] For example, an existing fuzzy query method is to establish two databases, use the first database to store the encrypted results of the plaintext field, segment, salt, and encrypt the fuzzy query keywords, store the segmentation and encryption results in the second database, and then associate the segmentation results of the second database with the ciphertext data in the first database through an index to achieve fuzzy query on the encrypted data. However, the solution of establishing two sets of databases can ensure data security to a certain extent, but it increases the overhead of storage resources, and cross-database queries will also lead to performance degradation, especially when a large amount of data is involved or the network delay is large, the performance problem will be more significant.

[0092] For another example, another existing fuzzy query method divides the plaintext into specified lengths, applies the GCM encryption algorithm to encrypt and store the word segmentation results, and implements fuzzy query on encrypted data by matching the search conditions with the ciphertext index set. The word segmentation encryption strategy based on the GCM encryption mode divides the plaintext into many small fields for encryption to form a fuzzy query search set. If this method is to cover all word segmentation combinations, the resulting set will far exceed the capacity of the encrypted data content itself, and the storage and computational complexity are very large, which puts a lot of pressure on database performance.

[0093] In order to solve the above problems, the embodiment of the present application provides a data fuzzy query method. The purpose is to support fuzzy retrieval of data and improve query efficiency under the premise of ensuring data security. The data fuzzy query method of the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0094] Reference Figure 4 , Figure 4 A process diagram of a data fuzzy query method provided in an embodiment of the present application is shown as follows: Figure 4 As shown, a data fuzzy query method provided in an embodiment of the present application may include the following steps:

[0095] S401, obtaining data to be encrypted.

[0096] In this embodiment, the data to be encrypted includes a field to be encrypted and a corresponding plaintext field value, and the field to be encrypted includes a preset fuzzy query field.

[0097] S402, using a preset single-character digest encryption algorithm, single-character encryption is performed on the plaintext field value of each fuzzy query field to obtain a single-character ciphertext field value of the fuzzy query field, an extended field of the fuzzy query field is generated, and each single-character ciphertext field value is stored in the extended field of the fuzzy query field.

[0098] S403: Obtain a target query statement.

[0099] In this embodiment, the target query statement includes an extended field of the target fuzzy query field and a target ciphertext query value.

[0100] The target ciphertext query value includes at least one single-character ciphertext.

[0101] S404: Use each single-character ciphertext to query the extended field of the target fuzzy query field to obtain a ciphertext query result.

[0102] In this embodiment, the ciphertext query result includes multiple single-character ciphertext field values ​​of the target fuzzy query field that hits at least one single-character ciphertext.

[0103] S405: Decrypt the ciphertext query result to obtain the plaintext query result.

[0104] It can be seen from the above technical scheme that the embodiment of the present application provides a data fuzzy query method, which encrypts the plaintext field value corresponding to the to-be-encrypted field in the to-be-encrypted data using a single-character digest encryption method, and adds an extension field for each fuzzy query field, and stores the single-character ciphertext field value in the extension field. During fuzzy retrieval, the target ciphertext query value in the target query statement is used to query the extension field, and the target ciphertext query value includes a single-character ciphertext. Therefore, the fuzzy query function of the encrypted data is realized, the query efficiency is improved, and the query restrictions are reduced.

[0105] Therefore, the present invention comprehensively considers data security and the practicality of fuzzy retrieval function, and proposes a fuzzy query method for single-character encryption and decryption algorithm, which realizes encrypted storage of data and fuzzy query of encrypted data. While ensuring data security, it maximizes the satisfaction of business fuzzy query needs and improves query efficiency and flexibility.

[0106] It should be noted that a data fuzzy query method provided in an embodiment of the present application can be applied to a query system, which includes an application, a data encryption and decryption interceptor, a data processing device, and a database, wherein the data encryption and decryption interceptor, the data processing device, and the database can be configured on the server side, the application is used to receive user instructions to generate a target SQL statement, the data encryption and decryption interceptor is used to modify the target SQL statement to generate an update SQL statement, send the update SQL statement to the data processing device, the data processing device executes the update SQL statement in the database, and returns the query result, and the data encryption and decryption interceptor is also used to intercept the query result, decrypt the query result and return it to the application. In this way, operations such as data insertion, update, and query are realized.

[0107] Figure 5 A specific implementation flow chart of a data fuzzy query method provided in an embodiment of the present application is as follows: Figure 5 As shown, this method specifically includes:

[0108] S501: The data processing device obtains data to be encrypted.

[0109] In this embodiment, the data to be encrypted includes a field to be encrypted and a corresponding plaintext field value. The field to be encrypted includes multiple fields in the data to be encrypted, and the field to be encrypted is divided into a fuzzy query field and a common field. For example, the field to be encrypted includes a name field, an address field, an ID field, etc., wherein the address field is a fuzzy query field, and the name field and the ID field are common fields. The field to be encrypted corresponds to multiple plaintext field values, for example, the name field includes multiple names, and the address field includes multiple address information.

[0110] In a data table, the first row of cells is used to store fields, and the columns corresponding to the fields are used to store the field values ​​corresponding to the fields.

[0111] S502. The data processing device uses a preset encryption algorithm to encrypt the plaintext field value of each field to be encrypted as a whole, obtains a first ciphertext field value of each field to be encrypted, and stores each first ciphertext field value in the original column of the field to be encrypted.

[0112] S503: The data processing device splits each plaintext field value of the fuzzy query field according to the length of a single character to obtain a character set of each plaintext field value of the fuzzy query field as a character set to be encrypted.

[0113] In this embodiment, the character set includes a plurality of characters to be encrypted obtained by splitting the plaintext field value of the field to be encrypted.

[0114] S504: The data processing device encrypts each character to be encrypted in the character set to be encrypted using a single-character digest encryption algorithm to obtain a single-character ciphertext of each character to be encrypted.

[0115] In this embodiment, the single-character digest encryption algorithm is used to encrypt the characters to be encrypted based on the idea of ​​a one-way hash function, specifically including:

[0116] Based on the idea of ​​one-way hash function, pre-configure the offset , binary mask (also known as mask code) and a dictionary table of commonly used Chinese characters. After adding the offset to the unicode code of the character to be encrypted, perform a logical AND operation with the binary mask to obtain the operation result.

[0117] If the character to be encrypted is a number or a letter, the calculation result is directly used as the single-character ciphertext of the character to be encrypted.

[0118] If the character to be encrypted is a Chinese character, the operation result is used as an index to retrieve the corresponding ciphertext Chinese character in the common Chinese character dictionary table as the single-character ciphertext of the character to be encrypted. The common Chinese character dictionary table is used to indicate the correspondence between the preset binary string and the ciphertext Chinese character, that is, the binary string is used as the index and the ciphertext Chinese character is used as the index value.

[0119] S505: The data processing device concatenates the single-character ciphertext of each character to be encrypted to obtain a second ciphertext field value of the fuzzy query field, and stores each second ciphertext field value in an extension field of the fuzzy query field.

[0120] In this embodiment, the first ciphertext field value is the overall ciphertext field value, and the second ciphertext field value is the single-character ciphertext field value. The field columns of each field to be encrypted in the physical table are pre-constructed, and an extended column is added for the fuzzy query field. The field column of the field to be encrypted is used to store each first ciphertext field value of the field to be encrypted, and the extended column of the fuzzy query field is used to store each second ciphertext field value of the fuzzy query field.

[0121] Figure 6 An example of a physical representation in a database is shown below. Figure 6 As shown, the physical table Table includes fields field1, field2, field3, etc., where field1 is the primary key PK. For example, field1 is the user ID, other fields are attribute fields, field2 is the fuzzy query field, and the extended column of field2 is configured, that is, the column corresponding to field_t.

[0122] S506. The data processing device configures the extended field library to the data encryption and decryption interceptor.

[0123] In this embodiment, the extended field library includes all fuzzy query fields and corresponding extended fields.

[0124] S501-506 is an optional initial data table generation method, which provides a specific method for adding a batch of data to be encrypted into a pre-configured data table and configuring the fuzzy query field and the corresponding extension field in the data table.

[0125] S507: The data encryption and decryption interceptor receives the target SQL statement sent by the application program, and parses the target SQL statement to determine the statement type of the target SQL statement.

[0126] In this embodiment, the statement types include insert data (INSERT) statements, update data (UPDATE) statements, and query (SELECT) statements.

[0127] S508. If the target SQL statement is a data insert statement, the data encryption and decryption interceptor obtains the field to be inserted and the corresponding plaintext field value, identifies the fuzzy query field in the field to be inserted based on the extended field library, obtains the first ciphertext field value of the field to be encrypted, and the second ciphertext field value of the fuzzy query field to be inserted.

[0128] In this embodiment, when the target SQL statement is a data insert statement, the target SQL statement is used to encrypt the plaintext field value of the field to be inserted and then insert it into the field to be encrypted corresponding to the primary key.

[0129] In this embodiment, the field to be encrypted is encrypted according to S501 to S505.

[0130] S509: The data encryption and decryption interceptor generates an update SQL statement for the target SQL statement.

[0131] In this embodiment, the target SQL statement is an insert data statement, so the plaintext field value of the field to be inserted is replaced with the first ciphertext field value, and the extended field of the fuzzy query field to be inserted and the corresponding second ciphertext field value are added.

[0132] That is, the update SQL statement includes the primary key, the field to be inserted and the corresponding first ciphertext field value, and the extended field and second ciphertext field value of the fuzzy query field to be inserted. The update SQL statement is used to fill the first ciphertext field value corresponding to the field to be inserted into the column of the field to be inserted, and fill the second ciphertext field value corresponding to the fuzzy query field to be inserted into the extended column of the fuzzy query field to be inserted, that is, the column corresponding to the extended field of the fuzzy query field to be inserted. In the data table, the original column of the field to be inserted is identified by the identifier of the field to be inserted, and the extended column of the field to be inserted is identified by the identifier of the extended field of the field to be inserted.

[0133] For example, if the target SQL statement is an INSERT SQL statement, the target SQL statement before processing is:

[0134] INSERT INTO TABLE(field1,field2,...) VALUES ('123','abc',...);

[0135] The processed target SQL statement (update SQL statement) is:

[0136] INSERT INTO TABLE(field1,field2,...,filed2_t) VALUES ('123','xxx',...,'a@u').

[0137] Among them, field1 is the primary key, field2 is the fuzzy query field to be inserted, filed2_t is the extended field of field2, "abc" in the target SQL statement before processing represents the plaintext field value to be inserted into field2, and in the target SQL statement after processing, "xxx" represents the first ciphertext field value to be inserted into field2, and a@u represents the second ciphertext field value of field2.

[0138] In summary, the target SQL statement is used to insert the first ciphertext field value of the field to be inserted into the field to be encrypted corresponding to the primary key, and insert the second ciphertext field value of the field to be inserted into the extended field of the field to be encrypted corresponding to the primary key.

[0139] S510: If the target SQL statement is an UPDATE statement, determine whether the field to be updated is located in the update column or the search condition column.

[0140] S511. If the field to be updated is in the update column, the data encryption and decryption interceptor generates an update SQL statement of the target SQL statement based on S508-509.

[0141] For example, if the target SQL statement is an UPDATE SQL statement, and the field to be updated is in the update column, the target SQL statement before processing is:

[0142] UPDATE TABLE SET field2 = 'bcd' WHERE field1 = '123';

[0143] The processed target SQL statement (update SQL statement) is:

[0144] UPDATE TABLE SET field2 = 'xxx', field2_t = 'a@u' WHERE field1 = '123'.

[0145] Among them, field2 is the fuzzy query field to be updated, filed2_t is the extended field of field2, "bcd" in the target SQL statement before processing represents the plaintext field value of the field field2 to be updated, and in the target SQL statement after processing, "xxx" represents the first ciphertext field value of the field field2 to be updated, and a@u represents the second ciphertext field value of field2, that is, the field value that needs to be filled in the extended field field2_t.

[0146] S512: If the field to be updated is in the search condition column, the data encryption and decryption interceptor identifies the fuzzy query field in the field to be updated based on the extended field library, obtains the second ciphertext field value of the fuzzy query field, replaces the fuzzy query field in the target SQL statement with the extended field of the fuzzy query field, and replaces the plaintext field value of the fuzzy query field with the second ciphertext field value.

[0147] For example, if the target SQL statement is an UPDATE SQL statement, and the field to be updated is in the search condition column, the target SQL statement before processing is:

[0148] UPDATE TABLE SET field1 = '123' WHERE field2 = 'abc';

[0149] The processed target SQL statement (update SQL statement) is:

[0150] UPDATE TABLE SET field1 = '123' WHERE field_t = 'a@u'.

[0151] Among them, field2 is the fuzzy query field to be updated, filed2_t is the extended field of field2, "bcd" in the target SQL statement before processing represents the plaintext field value of the field2 to be updated, and in the target SQL statement after processing, a@u represents the second ciphertext field value of field2.

[0152] S513. If the target SQL statement is a query (SELECT) statement, the data encryption and decryption interceptor identifies the fuzzy query field in the target query field based on the extended field library, and obtains the second ciphertext field value of the target query value of the fuzzy query field.

[0153] S514: Generate an update SQL statement of the target SQL statement.

[0154] In this embodiment, the fuzzy query field in the target SQL statement is replaced with an extended field of the fuzzy query field, and the target query value of the fuzzy query field is replaced with a second ciphertext field value to obtain an updated SQL statement of the target SQL statement.

[0155] In this embodiment, when the target SQL statement is a query type (SELECT) statement, it is used to query the target query field with the query field value corresponding to the target query field. The target query value is at least one plain text field value.

[0156] For example, if the target SQL statement is a SELECT SQL statement, the target SQL statement before processing is:

[0157] SELECT * FROM TABLE WHERE field2 LIKE concat ('%','ab','%');

[0158] The processed target SQL statement (update SQL statement) is:

[0159] SELECT * FROM TABLE WHERE field2_t LIKE concat ('%','&v','%').

[0160] Among them, field2 is the fuzzy query field, that is, the target fuzzy query field, filed2_t is the extended field of field2, and the "ab" in ('%','ab','%') in the target SQL statement before processing represents the target query value of the target query field field2. In the target SQL statement after processing, the "&v" in concat ('%','&v','%') represents the second ciphertext field value of the target query value of field2, that is, the target ciphertext query value.

[0161] In summary, the data encryption and decryption interceptor automatically transforms SQL statements in the process of interacting with the database, uses the first update rule to update query statements, uses the second update rule to update insert statements and update statements whose fields to be updated are located in the update column, and uses the third update rule to update update statements whose fields to be updated are located in the search condition column, so as to achieve word segmentation encryption of plaintext data under different operations without any perception or impact on the business links.

[0162] S515. The data processing device executes an update SQL statement of the target SQL statement. When the target SQL statement is a SELECT-type SQL statement, the data processing device returns the ciphertext query result of the update SQL statement to the data encryption and decryption interceptor.

[0163] S515. The data encryption and decryption interceptor uses a decryption algorithm corresponding to the single-character digest encryption algorithm to decrypt each single-character ciphertext in the second ciphertext field value in the ciphertext query result to obtain a plaintext field value of the fuzzy query field.

[0164] In this embodiment, when the target SQL statement is a SELECT-type SQL statement, the ciphertext query result of the update SQL statement obtained is the query result obtained by querying the extended field of the fuzzy query field with the single-character ciphertext in each target ciphertext query value as the query word, that is, the second ciphertext field value of the fuzzy query field that hits at least one query word.

[0165] S516. The data encryption and decryption interceptor generates a plaintext query result and returns the plaintext query result to the application.

[0166] It can be seen from the above technical scheme that this scheme, based on the data segmentation and encryption storage, splits the data to be encrypted into single characters, encrypts each character using a single-character summary encryption method, and then concatenates the ciphertext to obtain a ciphertext mapping column of the same length as the original text. While storing the ciphertext, an extension column is added to each ciphertext field, and the ciphertext mapping column is stored in the extension column. During fuzzy retrieval, the single character of the search condition is encrypted and matched with the ciphertext mapping column, so as to realize the fuzzy query function of the encrypted data and reduce the storage pressure of the database as much as possible. Since single-character encryption of input data is realized, the limitation of the query condition length of the fuzzy query scheme in the existing encryption scenario is broken, and the scenario where the search condition is a single character during fuzzy query of encrypted data is supported, and the practicality of fuzzy query is improved while ensuring data security.

[0167] Furthermore, the data encryption and decryption interceptor automatically transforms SQL statements during the interaction with the database, and encrypts the plaintext data through word segmentation, without any perception or impact on the business process.

[0168] A data fuzzy query method provided in an embodiment of the present application is introduced above, and a device for executing the above data fuzzy query method will be introduced below.

[0169] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of a data fuzzy query device provided in an embodiment of the present application. Figure 7 As shown, the data fuzzy query device 700 includes:

[0170] The basic data acquisition unit 701 is used to acquire data to be encrypted, wherein the data to be encrypted includes a field to be encrypted and a corresponding plaintext field value, wherein the field to be encrypted includes a preset fuzzy query field;

[0171] The single-character encryption unit 702 is used to use a preset single-character digest encryption algorithm to perform single-character encryption on the plaintext field value of each fuzzy query field to obtain the single-character ciphertext field value of the fuzzy query field, generate an extended field of the fuzzy query field, and store each single-character ciphertext field value in the extended field of the fuzzy query field;

[0172] The statement parsing unit 703 is used to obtain a target query statement; the target query statement includes an extended field of a target fuzzy query field and a target ciphertext query value, and the target ciphertext query value includes at least one single-character ciphertext;

[0173] A query unit 704 is configured to query the extended field of the target fuzzy query field based on each single-character ciphertext in the target ciphertext query value to obtain a ciphertext query result; the ciphertext query result includes a plurality of single-character ciphertext field values ​​of the target fuzzy query field that hit at least one single-character ciphertext;

[0174] The decryption unit 705 decrypts the ciphertext query result to obtain a plaintext query result.

[0175] In a possible implementation, the field to be encrypted also includes a common field, and the data fuzzy query device further includes:

[0176] The overall encryption unit is used to use a preset encryption algorithm to encrypt the plaintext field value of each common field as a whole, obtain the overall ciphertext field value of each common field, and store each overall ciphertext field value in the common field.

[0177] In a possible implementation, when the statement parsing unit is used to obtain the target query statement, it is specifically used to:

[0178] Receiving a target SQL statement, parsing the target SQL statement to determine a statement type of the target SQL statement;

[0179] If the statement type of the target SQL statement is a query statement, generating an update SQL statement of the target SQL statement according to a first update rule;

[0180] The first updating rule includes:

[0181] Identifying a fuzzy query field in the target SQL statement as a target fuzzy query field based on a preset extended field library;

[0182] Using the single-character digest encryption algorithm, encrypt the target query value of each target fuzzy query field by single characters to obtain the single-character ciphertext field value of the target fuzzy query field as the target ciphertext query value;

[0183] The target fuzzy query field in the target SQL statement is replaced with an extended field of the target fuzzy query field, and the target query value of the target fuzzy query field is replaced with a target ciphertext query value to obtain the target query statement.

[0184] In a possible implementation, the statement parsing unit is further used for:

[0185] If the statement type of the target SQL statement is a statement of the data insertion type, generating an update SQL statement of the target SQL statement according to the second update rule;

[0186] The second update rule includes:

[0187] Acquire the fields to be inserted and the corresponding plaintext field values ​​in the target SQL statement, and identify the fuzzy query field in the fields to be inserted as the fuzzy query field to be inserted based on the extended field library;

[0188] Obtain the overall ciphertext field value of the field to be inserted;

[0189] Using the single-character digest encryption algorithm, single-character encryption is performed on each plaintext field value to be inserted into the fuzzy query field to obtain the single-character ciphertext field value to be inserted into the fuzzy query field;

[0190] The plaintext field value of the field to be inserted is replaced with the overall ciphertext field value, and the extended field of the fuzzy query field to be inserted and the corresponding single-character ciphertext field value are added.

[0191] In a possible implementation, the statement parsing unit is further used for:

[0192] If the target SQL statement is a statement for updating data, determine whether the field to be updated is in the update column or the search condition column;

[0193] If the to-be-updated field is located in the update column, generating an update SQL statement of the target SQL statement based on the second update rule;

[0194] If the to-be-updated field is located in the search condition column, generating an update SQL statement of the target SQL statement based on a preset third update rule;

[0195] The third updating rule includes:

[0196] Get the fields to be updated and the corresponding plaintext field values;

[0197] Identify the fuzzy query field to be updated in the field to be updated based on the extended field library,

[0198] Using the single-character digest encryption algorithm, single-character encryption is performed on the plaintext field value of each of the fuzzy query fields to be updated, so as to obtain the single-character ciphertext field value of the fuzzy query field to be updated;

[0199] The to-be-updated fuzzy query field is replaced with an extended field of the to-be-updated fuzzy query field, and the plaintext field value of the to-be-updated fuzzy query field is replaced with a single-character ciphertext field value.

[0200] In a possible implementation, the single-character encryption unit is used to use the single-character digest encryption algorithm to perform single-character encryption on the plaintext field value of the target field to obtain the single-character ciphertext field value of the target field, wherein the target field includes the fuzzy query field to be updated, the fuzzy query field to be inserted, and the fuzzy query field, and is specifically used to:

[0201] Splitting each plaintext field value of the target field according to the length of a single character to obtain a character set of each plaintext field value of the target field as a character set to be encrypted;

[0202] Encrypt each character to be encrypted in the set of characters to be encrypted using the single-character digest encryption algorithm to obtain a single-character ciphertext of each character to be encrypted;

[0203] The single-character ciphertext of each character to be encrypted is concatenated to obtain the single-character ciphertext field value of the target field.

[0204] The present application also provides an electronic device in an embodiment. Figure 8 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 8The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0205] like Figure 8 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 to a random access memory (RAM) 803. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0206] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a memory card, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0207] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the data fuzzy query methods provided in the embodiments of the present application.

[0208] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any data fuzzy query method provided in the embodiment of the present application.

[0209] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0210] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0211] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0212] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A data fuzzy query method, characterized in that: include: Acquire data to be encrypted, wherein the data to be encrypted includes a field to be encrypted and a corresponding plaintext field value, wherein the field to be encrypted includes a preset fuzzy query field; Using a preset single-character digest encryption algorithm, single-character encryption is performed on the plaintext field value of each of the fuzzy query fields to obtain a single-character ciphertext field value of the fuzzy query field, an extended field of the fuzzy query field is generated, and each of the single-character ciphertext field values ​​is stored in the extended field of the fuzzy query field; Obtain a target query statement; the target query statement includes an extended field of a target fuzzy query field and a target ciphertext query value, and the target ciphertext query value includes at least one single-character ciphertext; Querying the extended field of the target fuzzy query field based on each single-character ciphertext in the target ciphertext query value to obtain a ciphertext query result; The ciphertext query result includes a plurality of single-character ciphertext field values ​​of the target fuzzy query field that hits at least one single-character ciphertext; The ciphertext query result is decrypted to obtain a plaintext query result.

2. The data fuzzy query method according to claim 1 is characterized in that: The field to be encrypted also includes a common field, and the data fuzzy query method also includes: Use a preset encryption algorithm to encrypt the plaintext field value of each common field as a whole to obtain the overall ciphertext field value of each common field, and store each overall ciphertext field value in the common field.

3. The data fuzzy query method according to claim 1, characterized in that: The obtaining target query statement includes: Receiving a target SQL statement, parsing the target SQL statement to determine a statement type of the target SQL statement; If the statement type of the target SQL statement is a query statement, generating an update SQL statement of the target SQL statement according to a first update rule; The first updating rule includes: Identifying a fuzzy query field in the target SQL statement as a target fuzzy query field based on a preset extended field library; Using the single-character digest encryption algorithm, single-character encryption is performed on the target query value of each target fuzzy query field to obtain the single-character ciphertext field value of the target fuzzy query field as the target ciphertext query value; The target fuzzy query field in the target SQL statement is replaced with an extended field of the target fuzzy query field, and the target query value of the target fuzzy query field is replaced with a target ciphertext query value to obtain the target query statement.

4. The data fuzzy query method according to claim 3 is characterized in that: The data fuzzy query method also includes: If the statement type of the target SQL statement is a statement of the data insertion type, generating an update SQL statement of the target SQL statement according to the second update rule; The second update rule includes: Acquire the field to be inserted and the corresponding plaintext field value in the target SQL statement, and identify the fuzzy query field in the field to be inserted as the fuzzy query field to be inserted based on the extended field library; Obtain the overall ciphertext field value of the field to be inserted; Using the single-character digest encryption algorithm, single-character encryption is performed on each plaintext field value to be inserted into the fuzzy query field to obtain the single-character ciphertext field value to be inserted into the fuzzy query field; The plaintext field value of the field to be inserted is replaced with the overall ciphertext field value, and the extended field of the fuzzy query field to be inserted and the corresponding single-character ciphertext field value are added.

5. The data fuzzy query method according to claim 4 is characterized in that: The data fuzzy query method also includes: If the target SQL statement is a statement for updating data, determine whether the field to be updated is in the update column or the search condition column; If the to-be-updated field is located in the update column, generating an update SQL statement of the target SQL statement based on the second update rule; If the to-be-updated field is located in the search condition column, generating an update SQL statement of the target SQL statement based on a preset third update rule; The third updating rule includes: Get the fields to be updated and the corresponding plaintext field values; Identify the fuzzy query field to be updated in the field to be updated based on the extended field library, Using the single-character digest encryption algorithm, single-character encryption is performed on the plaintext field value of each of the fuzzy query fields to be updated, so as to obtain the single-character ciphertext field value of the fuzzy query field to be updated; The to-be-updated fuzzy query field is replaced with an extended field of the to-be-updated fuzzy query field, and the plaintext field value of the to-be-updated fuzzy query field is replaced with a single-character ciphertext field value.

6. The data fuzzy query method according to claim 5 is characterized in that: Using the single-character digest encryption algorithm, the plaintext field value of the target field is single-character encrypted to obtain the single-character ciphertext field value of the target field, wherein the target field includes the fuzzy query field to be updated, the fuzzy query field to be inserted, and the fuzzy query field, including: Splitting each plaintext field value of the target field according to the length of a single character to obtain a character set of each plaintext field value of the target field as a character set to be encrypted; Encrypt each character to be encrypted in the set of characters to be encrypted using the single-character digest encryption algorithm to obtain a single-character ciphertext of each character to be encrypted; The single-character ciphertext of each character to be encrypted is concatenated to obtain the single-character ciphertext field value of the target field.

7. A data fuzzy query device, characterized in that: include: A basic data acquisition unit, used to acquire data to be encrypted, wherein the data to be encrypted includes a field to be encrypted and a corresponding plaintext field value, and the field to be encrypted includes a preset fuzzy query field; A single-character encryption unit, used to use a preset single-character digest encryption algorithm to perform single-character encryption on the plaintext field value of each of the fuzzy query fields, obtain the single-character ciphertext field value of the fuzzy query field, generate an extended field of the fuzzy query field, and store each of the single-character ciphertext field values ​​in the extended field of the fuzzy query field; A statement parsing unit, configured to obtain a target query statement; the target query statement includes an extended field of a target fuzzy query field and a target ciphertext query value, wherein the target ciphertext query value includes at least one single-character ciphertext; A query unit, configured to query the extended field of the target fuzzy query field based on each single-character ciphertext in the target ciphertext query value to obtain a ciphertext query result; The ciphertext query result includes a plurality of single-character ciphertext field values ​​of the target fuzzy query field that hits at least one single-character ciphertext; The decryption unit decrypts the ciphertext query result to obtain a plaintext query result.

8. A computer program product, characterized in that It includes computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the data fuzzy query method as described in any one of claims 1 to 6.

9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the data fuzzy query method as described in any one of claims 1 to 6.

10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the data fuzzy query method as described in any one of claims 1 to 6.