Data query method and device and electronic equipment
By determining multiple query threads in data query, used for querying ciphertext, long and plaintext data tables, the query inaccuracy problem caused by the diverse data storage methods is solved, and query efficiency and response speed are improved.
Patent Information
- Application Number
- CN202411812533.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-15
AI Technical Summary
When conducting data queries, due to the diverse data storage methods, it is difficult to conduct accurate queries, and the encrypted sensitive data leads to additional coordinate queries, which consumes a lot of resources and takes a long time.
By receiving the query request, multiple query threads are determined, which are respectively used to perform query operations in a predetermined ciphertext data table, a predetermined long data table and a predetermined plaintext data table. These threads are used to query in parallel to improve query efficiency.
Accurate data query under various data storage methods is realized, reducing query resource consumption and time, and improving query response speed.
Smart Images

Figure CN119829617A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a data query method, device and electronic equipment. Background Art
[0002] Data query is of great significance to the management of log resources. At present, the query of log content mainly adopts the method of recording data row coordinates and determining the data content by searching the row coordinates. For example, when using this method to search for sensitive data, there are technical problems such as extra coordinate query due to encryption of sensitive data, large query resource consumption and long query time.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a data query method, device and electronic device to at least solve the technical problem in the related art that it is difficult to perform accurate query due to various data storage methods when performing data query.
[0005] According to one aspect of an embodiment of the present invention, a data query method is provided, comprising: receiving a query request, wherein the query request carries a query keyword; in response to the query request, determining a plurality of query threads, wherein the plurality of query threads include a first thread, a second thread, and a third thread, wherein the first thread is used to perform a query operation in a predetermined ciphertext data table, the second thread is used to perform a query operation in a predetermined long data table, and the third thread is used to perform a query operation in a predetermined plaintext data table, the data stored in the predetermined long data table is data having a data length greater than a predetermined threshold, the data stored in the predetermined ciphertext data table is data obtained by encrypting sensitive data, and the predetermined plaintext data table, the predetermined ciphertext data table and the predetermined long data table are stored in a target database; according to the query keyword, determining query programs corresponding to the plurality of query threads respectively; executing the query programs corresponding to the plurality of query threads respectively, querying in the target database to obtain a plurality of query results; and obtaining a target query result according to the plurality of query results.
[0006] Optionally, executing query programs corresponding to the multiple query threads respectively, querying in the target database, and obtaining multiple query results, further includes: obtaining original data; the log agent class of the business server determines first data and second data from the original data, wherein the first data is data in the original data whose data length exceeds the predetermined threshold, and the second data is data in the original data whose data length does not exceed the predetermined threshold; determining first target data and second target data from the first data based on the sensitive attribute name, and determining third target data and fourth target data from the second data based on the sensitive attribute name, wherein the first target data and the third target data are both sensitive data, and the second target data and the fourth target data are both non-sensitive data; determining predetermined ciphertext data based on the first target data and the third target data, and determining predetermined plaintext data based on the fourth target data, and determining predetermined long data based on the first target data and the second target data; determining the predetermined plaintext data table, the predetermined ciphertext data table, and the predetermined long data table based on the predetermined plaintext data, the predetermined ciphertext data, and the predetermined long data.
[0007] Optionally, determining predetermined length data based on the first target data and the second target data includes: determining a first identification code of the first target data, and a second identification code corresponding to the second target data; determining first ciphertext data corresponding to the first target data; determining the predetermined length data based on the first ciphertext data, the first identification code corresponding to the first target data, and the second target data, the second identification code corresponding to the second target data.
[0008] Optionally, determining predetermined ciphertext data based on the first target data and the third target data includes: when the predetermined ciphertext data includes the first predetermined ciphertext data, segmenting the first target data to obtain multiple segmented data, wherein the multiple segmented data and the first target data are provided with the same identification code; determining the third identification codes and long data associated identification codes respectively corresponding to the multiple segmented data, wherein the multiple long data associated identification codes are the same as the first identification code; determining the first ciphertext data corresponding to the first target data, and the sub-ciphertext data respectively corresponding to the multiple segmented data; determining the first predetermined ciphertext data based on multiple sub-ciphertext data and the identification codes respectively corresponding to the multiple sub-ciphertext data.
[0009] Optionally, determining the predetermined ciphertext data based on the first target data and the third target data includes: when the predetermined ciphertext data includes second predetermined ciphertext data, encrypting the second target data to obtain second ciphertext data; determining a fourth identification code corresponding to the second ciphertext data; determining the second predetermined ciphertext data based on the second ciphertext data and the fourth identification code corresponding to the second ciphertext data.
[0010] Optionally, determining the predetermined plaintext data table, the predetermined ciphertext data table, and the predetermined long data based on the predetermined plaintext data, the predetermined ciphertext data, and the predetermined long data includes: storing the predetermined plaintext data and the plaintext type identifier in the target database to obtain the predetermined plaintext data table, storing the predetermined ciphertext data and the ciphertext type identifier in the target database to obtain the predetermined ciphertext data table, and storing the predetermined long data and the long data type identifier in the target database to obtain the predetermined long data table.
[0011] Optionally, obtaining a target query result based on the multiple query results includes: when duplicate data exists in the multiple query results, deleting the duplicate data to obtain the target query result.
[0012] According to one aspect of an embodiment of the present invention, a data query device is provided, comprising: a receiving module, configured to receive a query request, wherein the query request carries a query keyword; a first determining module, configured to determine a plurality of query threads in response to the query request, wherein the plurality of query threads include a first thread, a second thread, and a third thread, wherein the first thread is configured to perform a query operation in a predetermined ciphertext data table, the second thread is configured to perform a query operation in a predetermined long data table, and the third thread is configured to perform a query operation in a predetermined plaintext data table, wherein the data stored in the predetermined long data table is data having a data length greater than a predetermined threshold, and the data stored in the predetermined ciphertext data table is data obtained by encrypting sensitive data, and the predetermined plaintext data table, the predetermined ciphertext data table, and the predetermined long data table are stored in a target database; a second determining module, configured to determine query programs corresponding to the plurality of query threads respectively according to the query keyword; a query module, configured to execute query programs corresponding to the plurality of query threads respectively, query the target database, and obtain a plurality of query results; and a third determining module, configured to obtain a target query result according to the plurality of query results.
[0013] According to one aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor; and a storage repository for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement any one of the above data query methods.
[0014] According to one aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any of the above data query methods.
[0015] In an embodiment of the present invention, a query request is received, wherein the query request carries a query keyword; in response to the query request, multiple query threads are determined, wherein the multiple query threads include a first thread, a second thread, and a third thread, wherein the first thread is used to perform a query operation in a predetermined ciphertext data table, the second thread is used to perform a query operation in a predetermined long data table, and the third thread is used to perform a query operation in a predetermined plaintext data table, the data stored in the predetermined long data table is data whose data length is greater than a predetermined threshold, the data stored in the predetermined ciphertext data table is data obtained after encrypting sensitive data, and the predetermined plaintext data table, the predetermined ciphertext data table and the predetermined long data table are stored in a target database; according to the query keyword, query programs corresponding to the multiple query threads are determined; query programs corresponding to the multiple query threads are executed, query is performed in the target database, and multiple query results are obtained; and target query results are obtained according to the multiple query results. By executing the query programs corresponding to the multiple query threads, query is performed in the target database, and multiple query results are obtained, the purpose of obtaining the target query result according to the multiple query results is achieved. Since multiple query threads are executed, the required data can be directly queried in the predetermined ciphertext data table, the predetermined plaintext data table and the predetermined long data table at the same time, and the multiple query results obtained can directly reflect the data content, thereby determining the target query results, thereby solving the technical problem of difficulty in accurate query due to various data storage methods when performing data query in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0017] Figure 1 is a flow chart of a data query method according to an embodiment of the present invention;
[0018] Figure 2 It is a module diagram of a log data processing solution provided by an optional embodiment of the present invention;
[0019] Figure 3 is a flow chart of log query provided by an optional implementation manner of the present invention;
[0020] Figure 4is a flow chart of log processing provided by an optional implementation manner of the present invention;
[0021] Figure 5 is a structural block diagram of a data query device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] Example 1
[0025] According to an embodiment of the present invention, an embodiment of a data query method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0026] Figure 1 is a flow chart of a data query method according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0027] Step S102: receiving a query request, wherein the query request carries a query keyword.
[0028] In step S102 provided in the present application, a data query request is received.
[0029] Among them, query requests are involved. Query requests refer to requests received from users or operation and maintenance personnel. The request aims to obtain log data that meets specific conditions and is usually sent through the network.
[0030] Among them, query keywords are involved. Query keywords refer to key information in the query request and are used to specify the content to be searched.
[0031] In this step, a query request carrying a query keyword is received. This is the basic step to start a data query. The query content can be quickly located in the log record through the query keyword.
[0032] Step S104, in response to the query request, determining multiple query threads, wherein the multiple query threads include a first thread, a second thread, and a third thread, the first thread is used to perform query operations in a predetermined ciphertext data table, the second thread is used to perform query operations in a predetermined long data table, and the third thread is used to perform query operations in a predetermined plaintext data table, the data stored in the predetermined long data table is data having a data length greater than a predetermined threshold, the data stored in the predetermined ciphertext data table is data obtained by encrypting sensitive data, and the predetermined plaintext data table, the predetermined ciphertext data table, and the predetermined long data table are stored in the target database.
[0033] In step S104 provided in the present application, multiple query threads are determined in response to the query request.
[0034] Among them, query threads are involved. Query threads refer to different execution units used to process query requests in parallel. Multiple query threads can query different data tables at the same time to improve query efficiency.
[0035] Among them, a first thread is involved, and the first thread refers to a thread used to query encrypted sensitive data.
[0036] Here, a second thread is involved, and the second thread refers to a thread used to query long data whose length exceeds a threshold.
[0037] Among them, a third thread is involved, and the third thread refers to a thread used to query plaintext data.
[0038] Among them, a predetermined ciphertext data table is involved, and the predetermined ciphertext data table refers to a database table storing encrypted sensitive data.
[0039] Among them, a predetermined long data table is involved, and the predetermined long data table refers to a database table storing long log data whose data length exceeds a predetermined threshold.
[0040] Among them, a predetermined plaintext data table is involved, and the predetermined plaintext data table refers to a database table of plaintext log data that has not been desensitized or encrypted.
[0041] Among them, sensitive data is involved. Sensitive data refers to data that can directly or indirectly identify a specific individual, involve personal privacy, corporate secrets, financial information, health records, or other types of information that need to be protected. Once this data is leaked, illegally accessed, or improperly used, it may cause serious consequences to individuals, companies, or society. Therefore, this part of the data in the log needs to be desensitized when stored or printed.
[0042] Among them, a predetermined threshold is involved, and the predetermined threshold refers to the data length threshold. Data exceeding the predetermined threshold is considered as long data and needs to be processed when stored or printed.
[0043] Among them, the target database is involved. The target database refers to a database system used to store predetermined ciphertext data tables, predetermined long data tables and predetermined plaintext data tables, which can centrally store various types of log data for unified management and query.
[0044] In this step, after responding to the query request, multiple query threads are determined. Since sensitive data is encrypted during storage to protect user privacy and data security, the first thread needs to be used to access the predetermined ciphertext data table; long logs contain a large amount of information, which is specially stored to save storage space, and the second thread needs to be used to access the predetermined long data table; in order to maintain the compatibility and integrity of the query logic, the third thread is used to access the predetermined plaintext data table.
[0045] Through this step, query threads for encrypted sensitive data, long log data, and plaintext data are determined respectively, forming more efficient parallel query threads to process different types of log data at the same time. At the same time, different threads take into account the query requirements of different types of data, and can locate the query results more accurately.
[0046] It should be noted that strict query security controls can be implemented, such as access rights verification, query frequency limits, and operation audits, to ensure that only authorized users can initiate queries, while also recording query operations for subsequent security audits and behavioral analysis.
[0047] Step S106, determining query programs corresponding to the plurality of query threads respectively according to the query keyword.
[0048] In step S106 provided in the present application, query programs corresponding to the plurality of query threads are determined according to the query keyword.
[0049] Among them, the query program is involved. The query program refers to the software code or script that executes the specific query logic and defines how to find data matching the query keywords in the database.
[0050] In this step, the query programs corresponding to the multiple query threads are determined according to the query keywords. In the first thread, first, the query keyword provided by the user is converted into the corresponding ciphertext form, then the query condition is constructed based on the keyword after the ciphertext conversion, and finally, the query is performed in the predetermined ciphertext data table. In the second thread, first, it is determined whether the keyword is an abbreviation of the long log, or whether it can be directly used for the query of the long log, then the query condition is constructed, and finally a fuzzy query is performed in the predetermined long data table. In the third thread, the query is directly performed in the predetermined plaintext data table based on the query keyword.
[0051] Through this step, the query programs corresponding to the three query threads are determined, and the plaintext data, ciphertext data, and long log data corresponding to the query keywords are searched simultaneously. On the one hand, the content to be queried can be accurately located at one time, reducing the system's occupation of CPU and memory resources. On the other hand, multiple query threads can run simultaneously, significantly improving the query response speed and greatly reducing waiting time.
[0052] Step S108, executing query programs corresponding to the multiple query threads respectively, querying in the target database, and obtaining multiple query results.
[0053] In step S108 provided in the present application, query programs corresponding to the multiple query threads are executed, and queries are performed in the target database to obtain multiple query results.
[0054] Among them, the query result is involved, which refers to the result set returned by different query threads after executing the query program. Each query thread will return corresponding data records or information according to its query type and query keyword.
[0055] In this step, based on the query keyword, the above-determined query program is executed, the query keyword ciphertext is performed in the predetermined ciphertext data table, a fuzzy query is performed in the predetermined long data table, and a query is directly performed based on the query keyword in the predetermined plaintext data table to obtain multiple query results.
[0056] Through this step, parallel queries can be performed and results can be returned quickly, reducing user waiting time. At the same time, dedicated query threads and programs are allocated to different types of data, and query results for sensitive data, long logs, and ordinary logs are provided at the same time, which can more accurately locate and retrieve data and reduce false positives and negatives.
[0057] It should be noted that the query results are displayed in a user-friendly form, such as highlighting keywords, providing contextual information or generating downloadable reports, to help users quickly understand the meaning and background of the query results; provide a visual display of the query results, such as charts, keyword clouds or time series analysis, to help users quickly understand the patterns and anomalies in the log data; at the same time, the analysis tools can support data clustering, anomaly detection and trend prediction to deeply explore the value of log data.
[0058] Step S110, obtaining a target query result according to the multiple query results.
[0059] In step S110 provided in the present application, a target query result is obtained based on multiple query results.
[0060] Among them, the target query result is involved. The target query result refers to a set of data that is most relevant to the query request and is finally presented to the user after aggregating and processing multiple query results. This result is intended to provide a complete and non-repetitive set of log information to meet the user's query needs.
[0061] Through this step, the query results returned by each thread are integrated and deduplicated, and the results are sorted according to the relevance of the query results, timestamp or other user-defined criteria, with the most relevant information placed in front, to form a unified and final query result.
[0062] Through the above steps S102-S110, a query request can be received, wherein the query request carries a query keyword; in response to the query request, multiple query threads are determined, wherein the multiple query threads include a first thread, a second thread, and a third thread, the first thread is used to perform a query operation in a predetermined ciphertext data table, the second thread is used to perform a query operation in a predetermined long data table, and the third thread is used to perform a query operation in a predetermined plaintext data table, the data stored in the predetermined long data table is data with a data length greater than a predetermined threshold, the data stored in the predetermined ciphertext data table is data obtained after encrypting sensitive data, and the predetermined plaintext data table, the predetermined ciphertext data table and the predetermined long data table are stored in a target database; according to the query keyword, the query programs corresponding to the multiple query threads are determined; the query programs corresponding to the multiple query threads are executed to query in the target database to obtain multiple query results; according to the multiple query results, the target query result is obtained. By executing the query programs corresponding to the multiple query threads, querying in the target database to obtain multiple query results, the purpose of obtaining the target query result according to the multiple query results is achieved. Since multiple query threads are executed, the required data can be directly queried in the predetermined ciphertext data table, the predetermined plaintext data table and the predetermined long data table at the same time, and the multiple query results obtained can directly reflect the data content, thereby determining the target query results, thereby solving the technical problem of difficulty in accurate query due to various data storage methods when performing data query in related technologies.
[0063] As an optional embodiment, before executing the query programs corresponding to the multiple query threads, querying in the target database, and obtaining multiple query results, it also includes: obtaining the original data; the log agent class of the business server determines the first data and the second data from the original data, wherein the first data is the data whose data length in the original data exceeds the predetermined threshold, and the second data is the data whose data length in the original data does not exceed the predetermined threshold; according to the sensitive attribute name, the first target data and the second target data are determined from the first data, and according to the sensitive attribute name, the third target data and the fourth target data are determined from the second data, wherein the first target data and the third target data are both sensitive data, and the second target data and the fourth target data are both non-sensitive data; according to the first target data and the third target data, the predetermined ciphertext data are determined, and according to the fourth target data, the predetermined plaintext data are determined, and according to the first target data and the second target data, the predetermined long data are determined. According to the predetermined plaintext data, the predetermined ciphertext data, and the predetermined long data, a predetermined plaintext data table, a predetermined ciphertext data table, and a predetermined long data table are determined.
[0064] In this embodiment, specific steps of determining a predetermined plaintext data table, a predetermined ciphertext data table and a predetermined long data table are described.
[0065] Among them, the original data is involved. The original data refers to all the detailed data information generated during the operation of the application without any processing.
[0066] Among them, the business server is involved. The business server refers to a server that integrates log generation, log processing, log transmission and log printing functions. Implementing efficient log processing strategies can effectively improve the security of log data, query efficiency and system resource utilization efficiency.
[0067] Among them, the log proxy class is involved. The log proxy class refers to a class introduced to intercept, process and proxy the log printing operations on the business server to achieve specific log management and security goals.
[0068] Among them, the first data is involved, and the first data refers to the data in the original data whose length exceeds the threshold (ie, long data).
[0069] Among them, the second data is involved, and the second data refers to the data in the original data whose length does not exceed the threshold (ie, non-long data).
[0070] Among them, sensitive attribute names are involved. Sensitive attribute names refer to attributes or field names that may leak sensitive information in the original data, such as user names, passwords, phone numbers, etc. These attribute names are used to determine whether the data contains sensitive information.
[0071] Among them, the first target data is involved, and the first target data refers to the data containing sensitive information in the long data.
[0072] Among them, the second target data is involved, and the second target data refers to the data that does not contain sensitive information in the long data.
[0073] Among them, the third target data is involved, and the third target data refers to the data containing sensitive information in the non-long data.
[0074] Among them, the fourth target data is involved, and the fourth target data refers to data that does not contain sensitive information in non-long data.
[0075] Among them, non-sensitive data is involved. Non-sensitive data refers to data in the original data that does not contain sensitive information.
[0076] Among them, predetermined ciphertext data is involved, and the predetermined ciphertext data refers to data obtained after encryption processing based on the first target data and the third target data.
[0077] Among them, predetermined plaintext data is involved, and the predetermined plaintext data refers to data determined based on the fourth target data.
[0078] Among them, predetermined long data is involved. The predetermined long data refers to the data obtained after processing based on the first target data and the second target data. When printing logs for this part of long data, only simplified log information is printed, such as method name, parameter name, parameter type and parameter length, etc., to reduce memory usage and speed up the printing process.
[0079] In this step, first, the log information without any processing is captured to obtain the original data; secondly, the agent class classifies the original data, and divides the data into first data (long data) and second data (non-long data) according to the comparison between the data length and the predetermined threshold; thereafter, for the first data and the second data, the sensitive attribute name is used to further analyze the data, and the first target data and the third target data containing sensitive information, as well as the non-sensitive second target data and the fourth target data are identified; finally, according to the processed data type, the predetermined plaintext data table, the predetermined ciphertext data table and the predetermined long data table stored in the target database are determined.
[0080] Through this step, sensitive data is encrypted before storage, reducing the risk of data leakage; for long data, the database storage structure is optimized to avoid the impact of long data on database performance. At the same time, the classified storage of data allows targeted access to specific data tables during query, avoiding full-volume search, thereby improving query efficiency.
[0081] It should be noted that considering the security and integrity of data, it is necessary to formulate effective data recovery and backup strategies, especially for sensitive data and long data, to prevent data loss.
[0082] As an optional embodiment, determining predetermined length data based on first target data and second target data includes: determining a first identification code of the first target data, and a second identification code corresponding to the second target data; determining first ciphertext data corresponding to the first target data; determining the predetermined length data based on the first ciphertext data, the first identification code corresponding to the first target data, and the second target data, the second identification code corresponding to the second target data.
[0083] In this embodiment, the specific steps of determining the predetermined length data are described.
[0084] Among them, the first identification code is involved. The first identification code refers to the code used to uniquely identify the first target data (a long data segment containing sensitive information), which helps the log server to index the first target data during storage and retrieval.
[0085] Among them, the second identification code is involved. The second identification code refers to the code used to uniquely identify the second target data (a data segment that does not contain sensitive information but is longer in length). It helps the log server to index the second target data during storage and retrieval.
[0086] Among them, the first ciphertext data is involved, and the first ciphertext data refers to the encrypted data corresponding to the long data containing sensitive information.
[0087] In this step, first, a first identification code is determined for the first target data, and a second identification code is determined for the second target data. Then, the first target data is encrypted to obtain first ciphertext data. Finally, the first ciphertext data and the corresponding first identification code, as well as the second target data and its corresponding second identification code are stored to obtain data of predetermined length.
[0088] Through this step, identification codes are used to link sensitive and non-sensitive long data fragments. When searching, the identification codes can be used to quickly locate and reorganize data, which improves query efficiency and result accuracy. The use of identification codes and classified storage of data make the log system easier to maintain.
[0089] It should be noted that an efficient and secure identification code generation mechanism can be established to ensure the uniqueness and security of the identification code. At the same time, a corresponding identification code management strategy is required, such as regularly cleaning up invalid identification codes to maintain the cleanliness of the database and query performance.
[0090] As an optional embodiment, determining predetermined ciphertext data based on the first target data and the third target data includes: when the predetermined ciphertext data includes the first predetermined ciphertext data, segmenting the first target data to obtain multiple segmented data, wherein the multiple segmented data and the first target data are provided with the same identification code; determining the third identification codes and long data associated identification codes corresponding to the multiple segmented data respectively, wherein the multiple long data associated identification codes are the same as the first identification code; determining the first ciphertext data corresponding to the first target data, and the sub-ciphertext data corresponding to the multiple segmented data respectively; determining the first predetermined ciphertext data based on the multiple sub-ciphertext data and the identification codes corresponding to the multiple sub-ciphertext data respectively.
[0091] In this embodiment, specific steps of determining predetermined ciphertext data based on first target data are described.
[0092] Among them, the first predetermined ciphertext data is involved, and the first predetermined ciphertext data refers to data determined based on multiple sub-ciphertext data and identification codes corresponding to the multiple sub-ciphertext data, that is, the ciphertext data corresponding to the first target data.
[0093] Among them, segmented data is involved, and segmented data refers to each smaller data segment obtained by segmenting the first target data according to the sensitive attribute name.
[0094] Among them, the third identification code is involved. The third identification code refers to the code used to uniquely identify the segmented data, which helps the log server to index the segmented data during storage and retrieval.
[0095] Among them, a long data association identification code is involved. The long data association identification code refers to a code used to uniquely identify the first target data associated with the segmented data, which indicates that the segmented data comes from the first target data.
[0096] Among them, sub-ciphertext data is involved, and sub-ciphertext data refers to the corresponding data after the split data is encrypted.
[0097] In this step, first, the first target data that is too long and contains sensitive information is divided into multiple smaller data fragments; secondly, each divided data fragment will generate a third identification code, and at the same time, in order to maintain the association with the first target data, a long data associated identification code will be generated for these divided data, and the long data associated identification codes of all divided data are the same as the first identification code of the first target data; then, the divided data fragments will be encrypted to generate multiple sub-ciphertext data, and these ciphertext data are used for secure storage and query; finally, based on the divided sub-ciphertext data and its identification code, the first predetermined ciphertext data is determined.
[0098] Through this step, overly long sensitive data are segmented and stored. First, the volume of a single log record is avoided to be too large, reducing the storage pressure of the database; second, all segmented data are associated with the first target data through the same identification code. When querying, only the first identification code needs to be located to obtain the complete original sensitive data, avoiding the complexity of secondary query and time consumption during query; third, the accurate association of the segmented data is ensured by associating the third identification code with the long data identification code, so that the user can obtain all data fragments related to the sensitive information when querying, thereby improving the integrity of the query results.
[0099] As an optional embodiment, predetermined ciphertext data is determined based on the first target data and the third target data, including: when the predetermined ciphertext data includes second predetermined ciphertext data, encrypting the second target data to obtain second ciphertext data; determining a fourth identification code corresponding to the second ciphertext data; determining the second predetermined ciphertext data based on the second ciphertext data and the fourth identification code corresponding to the second ciphertext data.
[0100] In this embodiment, the specific steps of determining the third target data and the predetermined ciphertext data are described.
[0101] Among them, the second predetermined ciphertext data is involved, and the second predetermined ciphertext data refers to the predetermined ciphertext data determined based on the second ciphertext data and the fourth identification code.
[0102] Among them, second ciphertext data is involved, and the second ciphertext data refers to the ciphertext data obtained after encrypting the second target data.
[0103] Among them, the fourth identification code is involved. The fourth identification code refers to the code used to uniquely identify the second ciphertext data, which helps the log server to index the second ciphertext data during storage and retrieval.
[0104] In this step, first, when the second target data is identified, it is encrypted to generate second ciphertext data, and a fourth identification code is assigned to the ciphertext data. The identification code is used to establish a unique association with the second ciphertext data, which is convenient for storage and subsequent query retrieval in the log server; then, the second predetermined ciphertext data is determined and stored based on the second ciphertext data and its corresponding fourth identification code.
[0105] Through this step, the second target data is encrypted to protect sensitive information from being directly leaked, thereby ensuring user privacy and system security; a fourth identification code is assigned to the second ciphertext data, and it is stored as the second predetermined ciphertext data, which can effectively organize and manage the ciphertext data in the database, reduce the storage space occupied, and improve storage efficiency; by using the association between the fourth identification code and the second ciphertext data, developers can quickly locate the encrypted sensitive information when querying, provide accurate query results, simplify the query process, and improve query efficiency.
[0106] It should be noted that when encrypting data, you can consider using a symmetric encryption algorithm, such as AES (Advanced Encryption Standard), because it has fast encryption and decryption speeds and is suitable for processing smaller amounts of data, and adopts a dynamic key management strategy. Use a different key each time you encrypt data, and the generation, distribution, and storage of keys should follow a secure key management process to further enhance data security. At the same time, during the encryption and storage of ciphertext data, the system should record detailed logs, including the time, user, encryption method, and other information of the encryption operation, to provide a basis for security audits. These logs should also be protected to prevent unauthorized access.
[0107] As an optional embodiment, a predetermined plaintext data table, a predetermined ciphertext data table, and a predetermined long data table are determined based on predetermined plaintext data, predetermined ciphertext data, and predetermined long data, including: storing the predetermined plaintext data and a plaintext type identifier in a target database to obtain a predetermined plaintext data table, storing the predetermined ciphertext data and a ciphertext type identifier in the target database to obtain a predetermined ciphertext data table, and storing the predetermined long data and a long data type identifier in the target database to obtain a predetermined long data table.
[0108] In this embodiment, the specific steps of determining a predetermined plaintext data table, a predetermined ciphertext data table, and a predetermined long data table based on predetermined plaintext data, predetermined ciphertext data, and predetermined long data are described.
[0109] Among them, the plaintext type identifier is involved, which refers to the label or code used to mark ordinary log data.
[0110] Among them, the ciphertext type identification is involved, and the ciphertext type identification refers to the label or code used to mark the ciphertext data corresponding to the sensitive data.
[0111] Among them, the long data type identifier is involved. The long data type identifier refers to the label or code used to mark data that is too long.
[0112] In this step, the pre-selected plaintext data that does not contain sensitive information is stored in the target database together with its plaintext type identifier to form a pre-selected plaintext data table; the pre-selected ciphertext data that contains sensitive information and needs to be kept confidential is stored in the target database together with its ciphertext type identifier to create a pre-selected ciphertext data table; for the pre-selected long data, they are stored in the target database together with the long data type identifier to generate a pre-selected long data table. Through this step, the data is divided into three types: plaintext, ciphertext and long data, and stored in the corresponding tables, so that the log system can manage and retrieve log data more effectively.
[0113] As an optional embodiment, obtaining a target query result based on multiple query results includes: when duplicate data exists in the multiple query results, deleting the duplicate data to obtain the target query result.
[0114] In this embodiment, specific steps of obtaining a target query result based on multiple query results are described.
[0115] Among them, duplicate data is involved. Duplicate data refers to the same or almost the same data that appears multiple times in multiple query results due to the correlation of the data.
[0116] In this step, the predetermined plaintext data table, the predetermined ciphertext data table and the predetermined long data table are queried simultaneously according to the query keyword. Therefore, due to data association, there may be a situation where the query keyword has matching query results in multiple data tables. At this time, multiple query results are compared and analyzed, duplicate records are identified, and one instance is retained, so as to finally obtain a deduplicated and clearer target query result.
[0117] Through this step, a more concise result set is obtained after deduplication. Users do not need to face a large amount of duplicate information and can browse and understand the query results more efficiently, which improves the clarity and readability of data display.
[0118] It should be noted that data structures such as hash tables and Bloom filters can be used to quickly identify and filter duplicate data, especially in large data query scenarios, where efficient algorithms can significantly improve deduplication efficiency. At the same time, a mechanism is also provided to allow users to restore or view the complete data set before deduplication when needed to support more in-depth data analysis needs.
[0119] Based on the above embodiments and optional embodiments, an optional implementation is provided, which is described in detail below.
[0120] An optional implementation of the present invention proposes a log data processing solution. Figure 2 is a module diagram of a log data processing solution provided by an optional embodiment of the present invention, such as Figure 2 As shown in FIG. 1 , the log processing system includes three modules: business server, log server and log query. The three modules are introduced in detail below.
[0121] Business server: a server for normal business. After the development and access of this solution framework, when printing on the server, it will determine whether the line of log contains sensitive information or the log is too long through the configuration on the dynamic naming and configuration service (nacos). If sensitive information exists, the sensitive part will be printed with a mask and sent to the log server for processing. If the log is too long, the extra long part will be shortened and printed and sent to the log server for processing.
[0122] When printing log data, in many cases, traditional log printing is done through aspect-oriented programming (aop). Aop generally prints the input and output parameters of the method. Generally, the log prints the class name, method name, input class name, attribute values in the input class, return class name, attribute values in the return class, etc. The format of attribute values in the input class or return class is usually two (taking the input class name as the parameter Param, and the attribute names in it as the user name name and user number mobileNo as an example):
[0123] Param(name=zhangsan, mobileNo=13912345678)
[0124] ["param":{"name":"zhangsan","mobileNo":"13912345678"}]
[0125] Therefore, in the optional implementation method of the present invention, when nacos configures name (name is considered to be a sensitive attribute name), the business server will make a judgment in the following form during the inspection:
[0126] "name=", "name:", ""name":", ""name"=", "'name'="
[0127] If included, the following fields are sensitive information and will be intercepted and special operations will be performed to print logs.
[0128] After intercepting the log, the business server will do the following to the log:
[0129] (1) Processing of excessively long judgments.
[0130] The system will obtain the excessively long threshold in nacos (if not, the default is 1000), and obtain the long log parameter name from nacos (users can dynamically configure, such as file file, file list fileList, etc., which are similar to the names of file streams or obvious long collections).
[0131] When the log string exceeds the threshold configured by nacos, or there are long log parameters, the long log logic is met and special processing is performed:
[0132] a. Shorten the printing. Only the length of the log or the number of the set is printed in the log file of the business server.
[0133] b. Asynchronously send a message notification to the log server, and send the application name, message mask (if sensitive information is present) and other information to the log server.
[0134] (2) Sensitive character judgment and processing.
[0135] In traditional methods, sensitive characters are filtered using regular expressions. However, this method is prone to triggering misses, resulting in incorrect log records and inaccurate queries, or sensitive information is present but not found.
[0136] In the optional implementation method of the present invention, the business server adopts the method of directly hitting parameters by nacos. When printing logs, through nacos, dynamic configuration requires desensitized parameter names, hit rules, overlong parameter names, etc., and it will first query whether the printed log string contains the sensitive field.
[0137] When the hit contains sensitive fields, special processing will be performed:
[0138] a. Mask printing: After desensitizing the attribute values corresponding to the sensitive attribute names in the log file, replace the previous plain text operations and then print them.
[0139] b. Asynchronously send a message notification to the log server, and send the application name, the original text of the message, the masked log information and other information to the log server.
[0140] The manual access rights of the business server can only be queried by business-related groups and are independent of the rights of the log server.
[0141] Log server: handles the storage of original log information sent by the business server, as well as query requests from the log query module. When receiving a sensitive log request from the business server, the sensitive data will be encrypted and stored in a dedicated log database. When receiving a log that is too long from the business server, if no sensitive information is detected in the long log, only one line will be stored. If sensitive information is also found in the query, it will be split. After storing a long log, other sensitive information storage records will point to the long log record for subsequent queries.
[0142] The log database here is recommended to use the open source highly scalable distributed full-text search engine (es) for storage, because es will provide faster query speed when querying.
[0143] When the log server receives an asynchronous message from the business server, it will parse the information in the message. If it is a sensitive type of log, it will be encrypted first and then stored in es for subsequent query.
[0144] The relevant permissions for the log server and es are exclusively reserved for the company's operations personnel, who are not the same group of people as those for the business server.
[0145] Table 1 is an important column structure table in es provided by an optional implementation manner of the present invention. As shown in Table 1, es includes identification code ID, system identification code SYSTEM, type identification TYPE, original text ORIGINAL_TEXT, long data association identification code RELATION_LONG_LOG_ID and line mask text LINE_MASK_TEXT.
[0146] Table 1
[0147]
[0148]
[0149] Log query: A display module where users can query the specific information of the log row using keywords. This module will send the keywords and application names entered by the user to the log server, which will query the corresponding mask text based on sensitive information, long logs, etc. After the query, it will sort out the relevant log data, return the query results, and render them.
[0150] Figure 3 is a flow chart of log query provided by an optional implementation manner of the present invention, such as Figure 3 As shown, the log data query method is explained in detail.
[0151] Take the long log as an example:
[0152] Assume that long log data has been stored in es. The original text is: [{name: "Zhang San", phone: "13900000001"}, {name: "Li Si", phone: "13900000002"}, {name: "Wang Wu", phone: "13900000003"}.....], where name represents the user's name and phone represents the user's mobile phone number.
[0153] Table 2 is an es storage content table provided by an optional implementation manner of the present invention. As shown in Table 2, es stores user names and user mobile phone numbers.
[0154] Table 2
[0155]
[0156]
[0157] The query keyword is "Zhang San" and the system identification code is redbag (specific system identification code).
[0158] S1. Receive a query request, wherein the query request carries a query keyword.
[0159] When users need to query logs, they first need to select the application name and enter the required query keywords.
[0160] S2. In response to the query request, determine multiple query threads.
[0161] When the log server receives the keyword, it will concurrently query three situations: sensitive query (same as the first thread above), long log query (same as the second thread above) and original log query (same as the third thread above).
[0162] S3. Determine query programs corresponding to the multiple query threads respectively according to the query keyword.
[0163] S4. Execute query programs corresponding to the multiple query threads respectively, perform queries in the target database, and obtain multiple query results.
[0164] A1. Execute the query program corresponding to the first thread.
[0165] Convert Zhang San into ciphertext to form "Zhang San (ciphertext)", and query through system identification code SYSTEM=redbag (specific system identification code), type identification TYPE=sensitive, original text ORIGINAL_TEXT=Zhang San (ciphertext), and obtain data with identification code ID 2 and 2002.
[0166] A2. Execute the query program corresponding to the second thread.
[0167] According to the fact that the long data association identification code RELATION_LONG_LOG_ID corresponding to the data with identification code ID 2 is 1, the log is a long log and the long log contains sensitive characters. Then the row mask text with identification code ID 1 will be one of the results.
[0168] The long data association identification code RELATION_LONG_LOG_ID corresponding to the data with ID 2002 is empty, but the line mask text LINE_MASK_TEXT has a value, which will also result in another result.
[0169] Using the system identification code SYSTEM=redbag (specific system identification code), type identification TYPE=long log, and Zhang San's original text, a fuzzy search was performed on the line mask text LINE_MASK_TEXT, but the original text was not found.
[0170] A3. Execute the query program corresponding to the third thread.
[0171] In order to maintain the original log query logic, the keyword "Zhang San" will also be searched in the original log file.
[0172] S5. Obtain a target query result based on the multiple query results.
[0173] After the search for the above three situations is completed, the above results are deduplicated and then output and displayed, so that the correct original log information can be queried for both sensitive and long logs.
[0174] Before executing the query programs corresponding to the multiple query threads in S4 and querying in the target database to obtain multiple query results, the received original log data needs to be processed, such as log printing and data storage.
[0175] Figure 4 is a flow chart of log processing provided by an optional implementation manner of the present invention, such as Figure 4 As shown, a log proxy class is generated when the system starts through the proxy method. In addition to the original log printing method, the proxy class will add sensitive processing logic and send corresponding log information to the log server, and organize the log information output to the server.
[0176] The following is the specific process of raw log data processing.
[0177] S6. Obtain original data.
[0178] The original log text is: [{name:"Zhang San", phone:"13900000001"}, {name:"Li Si", phone:"13900000002"}, {name:"Wang Wu", phone:"13900000003"}.....], assuming that the original log text contains 2000 user names and user mobile phone numbers.
[0179] S7. The log agent class of the business server determines the first data and the second data from the original data, that is, first determines whether the log is a long log (same as the first data mentioned above).
[0180] Judging from the original text of the above log, this log is a long log.
[0181] S8. Determine the first target data and the second target data from the first data based on the sensitive attribute name.
[0182] That is, if it is a long log, the long log will be queried for sensitive information to determine the first target data and the second target data.
[0183] Judging from the above long log, it contains sensitive information, which belongs to the first target data.
[0184] S9. Determine the third target data and the fourth target data from the second data based on the sensitive attribute name.
[0185] That is, if it is not a long log, the log will be queried for sensitive information to determine the third target data and the fourth target data.
[0186] S10. Determine predetermined ciphertext data based on the first target data and the third target data, determine predetermined plaintext data based on the fourth target data, and determine predetermined long data based on the first target data and the second target data.
[0187] B1. Determine first ciphertext data corresponding to the first target data.
[0188] The sensitive information of the long log is masked, and after masking, we get [{name: "Zhang*", phone: "1*1"}, {name: "Li*", phone: "1*2"}, {name: "Wang*", phone: "1*3"}.....].
[0189] B2. Determine the segmentation data.
[0190] The long log is split into [{Zhang San}, {13900000001}, {Li Si}, {13900000002}.....].
[0191] B3. Determine the sub-ciphertext data.
[0192] When sensitive information is retrieved, for example, the original text is: The user's information is: {"name": "Zhang San", "phone": "13900000001"}, the method will split it into the set [{Zhang San}, {13900000001}] and transmit the masked text of the data: The user's information is: {"name": "Zhang*", "phone": "1************1"}.
[0193] S11. Determine a predetermined plaintext data table, a predetermined ciphertext data table, and a predetermined long data table based on the predetermined plaintext data, the predetermined ciphertext data, and the predetermined long data.
[0194] The above information is sent to the log server. The log server inserts one long log message and the remaining 2000 sensitive information into es based on the above information. Table 3 is another es storage content table (same as the above-mentioned predetermined long data table) provided by an optional implementation manner of the present invention. Table 4 is another es storage content table (same as the above-mentioned predetermined ciphertext data table) provided by an optional implementation manner of the present invention. As shown in Table 3, es stores user names and user mobile phone numbers.
[0195] Table 3
[0196]
[0197]
[0198] As shown in Table 4, es stores the user's name and mobile phone number.
[0199] Table 4
[0200]
[0201]
[0202] Through the above optional implementation, at least the following beneficial effects can be achieved:
[0203] (1) Add sensitive log query function. When developers query through some sensitive information such as user mobile phone numbers, they can effectively hit the relevant logs, increase the sensitive information identification hit rate, and add dynamic control methods;
[0204] (2) The query function after the growth log is intercepted can be used to query the long original text containing sensitive words by keywords;
[0205] (3) Reduce the problem of server disk being occupied too quickly due to too many long logs, and reduce the problem of excessive server CPU resources being occupied by log cleaning scripts.
[0206] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0207] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention 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 storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0208] Example 2
[0209] According to an embodiment of the present invention, a device for implementing the above data query method is also provided. Figure 5 is a structural block diagram of a data query device according to an embodiment of the present invention. Figure 5 As shown, the device includes: a receiving module 502, a first determining module 504, a second determining module 506, a query module 508 and a third determining module 510. The device is described in detail below.
[0210] The receiving module 502 is used to receive a query request, wherein the query request carries a query keyword; the first determining module 504 is connected to the above-mentioned receiving module 502, and is used to determine multiple query threads in response to the query request, wherein the multiple query threads include a first thread, a second thread, and a third thread, the first thread is used to perform a query operation in a predetermined ciphertext data table, the second thread is used to perform a query operation in a predetermined long data table, and the third thread is used to perform a query operation in a predetermined plaintext data table, the data stored in the predetermined long data table is data with a data length greater than a predetermined threshold, and the data stored in the predetermined ciphertext data table is The data obtained after encrypting the sensitive data, the predetermined plaintext data table, the predetermined ciphertext data table and the predetermined long data table are stored in the target database; the second determination module 506 is connected to the above-mentioned first determination module 504, and is used to determine the query programs corresponding to multiple query threads respectively according to the query keywords; the query module 508 is connected to the above-mentioned second determination module 506, and is used to execute the query programs corresponding to the multiple query threads respectively, perform queries in the target database, and obtain multiple query results; the third determination module 510 is connected to the above-mentioned query module 508, and is used to obtain the target query result based on the multiple query results.
[0211] It should be noted here that the above-mentioned receiving module 502, first determination module 504, second determination module 506, query module 508 and third determination module 510 correspond to steps S102 to S110 in implementing the data query method, and the instances and application scenarios implemented by the multiple modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.
[0212] Example 3
[0213] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor; and a storage repository for storing processor-executable instructions, wherein the processor is configured to execute instructions to implement any of the above data query methods.
[0214] Example 4
[0215] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute any of the above data query methods.
[0216] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0217] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0218] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0219] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0220] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0221] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0222] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A data query method, characterized in that: include: receiving a query request, wherein the query request carries a query keyword; In response to the query request, a plurality of query threads are determined, wherein the plurality of query threads include a first thread, a second thread, and a third thread, the first thread is used to perform a query operation in a predetermined ciphertext data table, the second thread is used to perform a query operation in a predetermined long data table, and the third thread is used to perform a query operation in a predetermined plaintext data table, the data stored in the predetermined long data table is data having a data length greater than a predetermined threshold, the data stored in the predetermined ciphertext data table is data obtained by encrypting sensitive data, and the predetermined plaintext data table, the predetermined ciphertext data table, and the predetermined long data table are stored in a target database; Determining query programs corresponding to the plurality of query threads respectively according to the query keyword; Executing query programs corresponding to the multiple query threads respectively, querying the target database, and obtaining multiple query results; A target query result is obtained according to the multiple query results.
2. The method according to claim 1, characterized in that: Before executing the query programs corresponding to the plurality of query threads, performing queries in the target database, and obtaining a plurality of query results, the method further includes: Get the original data; The log agent class of the business server determines first data and second data from the original data, wherein the first data is data in the original data whose data length exceeds the predetermined threshold, and the second data is data in the original data whose data length does not exceed the predetermined threshold; Determine first target data and second target data from the first data according to the sensitive attribute name, and determine third target data and fourth target data from the second data according to the sensitive attribute name, wherein the first target data and the third target data are both sensitive data, and the second target data and the fourth target data are both non-sensitive data; Determining predetermined ciphertext data according to the first target data and the third target data, determining predetermined plaintext data according to the fourth target data, and determining predetermined long data according to the first target data and the second target data; The predetermined plaintext data table, the predetermined ciphertext data table, and the predetermined long data table are determined according to the predetermined plaintext data, the predetermined ciphertext data, and the predetermined long data.
3. The method according to claim 2, characterized in that Determining predetermined long data according to the first target data and the second target data includes: Determine a first identification code of the first target data and a second identification code corresponding to the second target data; Determining first ciphertext data corresponding to the first target data; The predetermined length data is determined based on the first ciphertext data, a first identification code corresponding to the first target data, and the second target data and a second identification code corresponding to the second target data.
4. The method according to claim 3, characterized in that Determining predetermined ciphertext data according to the first target data and the third target data includes: In a case where the predetermined ciphertext data includes first predetermined ciphertext data, segmenting the first target data to obtain a plurality of segmented data, wherein the plurality of segmented data and the first target data are provided with the same identification code; Determine third identification codes and long data associated identification codes respectively corresponding to the plurality of segmented data, wherein the plurality of long data associated identification codes are all the same as the first identification code; Determine first ciphertext data corresponding to the first target data, and sub-ciphertext data corresponding to the plurality of segmented data respectively; The first predetermined ciphertext data is determined according to a plurality of sub-ciphertext data and identification codes respectively corresponding to the plurality of sub-ciphertext data.
5. The method according to claim 4, characterized in that Determining the predetermined ciphertext data according to the first target data and the third target data includes: In a case where the predetermined ciphertext data includes second predetermined ciphertext data, encrypting the second target data to obtain second ciphertext data; Determining a fourth identification code corresponding to the second ciphertext data; The second predetermined ciphertext data is determined according to the second ciphertext data and a fourth identification code corresponding to the second ciphertext data.
6. The method according to claim 2, characterized in that Determining the predetermined plaintext data table, the predetermined ciphertext data table, and the predetermined long data table according to the predetermined plaintext data, the predetermined ciphertext data, and the predetermined long data includes: The predetermined plaintext data and the plaintext type identifier are stored in the target database to obtain the predetermined plaintext data table, the predetermined ciphertext data and the ciphertext type identifier are stored in the target database to obtain the predetermined ciphertext data table, and the predetermined long data and the long data type identifier are stored in the target database to obtain the predetermined long data table.
7. The method according to any one of claims 1 to 6, characterized in that Obtaining a target query result based on the multiple query results includes: In the case where duplicate data exists in the multiple query results, the duplicate data is deleted to obtain the target query result.
8. A data query device, characterized in that: include: A receiving module, configured to receive a query request, wherein the query request carries a query keyword; A first determination module is used to determine a plurality of query threads in response to the query request, wherein the plurality of query threads include a first thread, a second thread, and a third thread, the first thread is used to perform a query operation in a predetermined ciphertext data table, the second thread is used to perform a query operation in a predetermined long data table, and the third thread is used to perform a query operation in a predetermined plaintext data table, the data stored in the predetermined long data table is data whose data length is greater than a predetermined threshold, the data stored in the predetermined ciphertext data table is data obtained by encrypting sensitive data, and the predetermined plaintext data table, the predetermined ciphertext data table, and the predetermined long data table are stored in a target database; A second determining module, configured to determine query programs corresponding to the plurality of query threads respectively according to the query keyword; A query module, used to execute query programs corresponding to the plurality of query threads respectively, query the target database, and obtain a plurality of query results; The third determining module is used to obtain a target query result according to the multiple query results.
9. An electronic device, characterized in that: include: processor; a storage repository for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the data query method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data query method as claimed in any one of claims 1 to 7.