Data query method, data query device, electronic equipment and storage medium

By mapping the current query statement and historical query statements to matrices and calculating their rank, the problem of sensitive information leakage caused by differential attacks in data query methods is solved, thereby improving data security and query efficiency.

CN116860784BActive Publication Date: 2025-11-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210314887.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-28
Publication Date
2025-11-18
Estimated Expiration
2042-03-28

AI Technical Summary

Technical Problem

Existing data query methods cannot defend against differential attacks, which can easily lead to the leakage of sensitive information.

Method used

By mapping the current query statement and historical query statements to a first matrix and constructing multiple second matrices, the rank of each matrix is ​​calculated. If the rank of the first matrix is ​​not equal to the ranks of the multiple second matrices, the current query statement is executed.

Benefits of technology

Effectively defend against differential attacks, ensure data security, and improve data query efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116860784B_ABST
    Figure CN116860784B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data query method, which can be applied to the technical field of big data. The method comprises the following steps: in response to a data query request for a target data table, obtaining at least one current query statement carried in the data query request and at least one historical query statement of the target data table from a requester of the data query request; mapping the at least one current query statement and the at least one historical query statement into a first matrix; constructing a plurality of second matrices based on the first matrix; calculating the ranks of the first matrix and the plurality of second matrices respectively; and executing the current query statement in the case that the rank of the first matrix and the ranks of the plurality of second matrices are all not equal. In addition, the present disclosure also provides a data query device, an electronic device and a readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of big data technology, and more specifically, to a data query method, a data query device, an electronic device, a readable storage medium, and a computer program product. Background Technology

[0002] With the development of big data technology and the expansion of enterprise scale, most of the data generated in the enterprise production process is stored in databases, and sensitive information inevitably exists in these data.

[0003] In the process of realizing the present invention, the inventors discovered that the related technologies have at least the following problems: the data query methods in the related technologies cannot defend against differential attacks, which can easily lead to the leakage of sensitive information. Summary of the Invention

[0004] In view of the above, this disclosure provides a data query method, a data query device, an electronic device, a readable storage medium, and a computer program product.

[0005] One aspect of this disclosure provides a data query method, comprising: in response to a data query request for a target data table, obtaining at least one current query statement carried in the data query request and at least one historical query statement of the requester of the data query request for the target data table; mapping the at least one current query statement and the at least one historical query statement to a first matrix; constructing a plurality of second matrices based on the first matrix; calculating the rank of the first matrix and the plurality of second matrices respectively; and executing the current query statement if the rank of the first matrix is ​​not equal to the rank of the plurality of second matrices.

[0006] According to an embodiment of this disclosure, mapping at least one current query statement and at least one historical query statement to a first matrix includes: for each query statement in the at least one current query statement and at least one historical query statement, mapping the query statement to a query vector based on the target data table; and arranging multiple query vectors in a preset order to obtain the first matrix.

[0007] According to an embodiment of this disclosure, the above-mentioned construction of multiple second matrices based on the first matrix includes: constructing multiple unit query vectors based on the dimensions of the rows of the first matrix, wherein the multiple unit query vectors are unit vectors and are pairwise orthogonal; and for each unit query vector, merging the unit query vectors into the first matrix to obtain the second matrix.

[0008] According to embodiments of this disclosure, the above-mentioned calculation of the rank of the first matrix and the plurality of second matrices includes: for each query matrix in the first matrix and the plurality of second matrices, constructing a symmetric matrix of the query matrix; calculating the rank of the symmetric matrix; and determining the rank of the symmetric matrix as the rank of the query matrix.

[0009] According to an embodiment of this disclosure, constructing the symmetric matrix of the query matrix includes: obtaining the transpose of the query matrix; constructing the symmetric matrix based on the product of the transpose and the query matrix when the row dimension of the query matrix is ​​greater than or equal to the column dimension; and constructing the symmetric matrix based on the product of the query matrix and the transpose when the row dimension of the query matrix is ​​less than the column dimension.

[0010] According to an embodiment of this disclosure, calculating the rank of the symmetric matrix includes: loading the symmetric matrix as an input parameter into a preset execution statement; and executing the preset execution statement to obtain the rank of the symmetric matrix.

[0011] According to embodiments of this disclosure, the method further includes: obtaining the data type of the query matrix before constructing the symmetric matrix of the query matrix; and modifying the data type of the query matrix to the preset data type if the data type of the query matrix is ​​not a preset data type.

[0012] Another aspect of this disclosure provides a data query apparatus, comprising: an acquisition module, configured to, in response to a data query request for a target data table, acquire at least one current query statement carried in the data query request and at least one historical query statement of the requester of the data query request for the target data table; a mapping module, configured to map the at least one current query statement and the at least one historical query statement to a first matrix; a construction module, configured to construct a plurality of second matrices based on the first matrix; a calculation module, configured to calculate the rank of the first matrix and the plurality of second matrices respectively; and an execution module, configured to execute the current query statement when the rank of the first matrix is ​​not equal to the rank of the plurality of second matrices.

[0013] Another aspect of this disclosure provides an electronic device, including: one or more processors; and a memory for storing one or more instructions, wherein when the one or more instructions are executed by the one or more processors, the one or more processors cause the one or more processors to perform the method as described above.

[0014] Another aspect of this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when executed, are used to implement the method described above.

[0015] Another aspect of this disclosure provides a computer program product including computer-executable instructions that, when executed, are used to implement the method described above.

[0016] According to embodiments of this disclosure, when a requester initiates a data query request for a target data table, the current query statement and historical query statements for the target data table are mapped to a first matrix. Multiple second matrices are then constructed based on this first matrix. The current query statement is executed only when the rank of the first matrix is ​​unequal to the ranks of all the second matrices. Through this technical means, it is possible to determine whether the current query statement and historical query statements constitute a differential attack by judging the magnitude of the rank of the first matrix and the ranks of the multiple second matrices. Therefore, this at least partially overcomes the technical problems in related technologies where differential attacks cannot be defended against, easily leading to the leakage of sensitive information, effectively ensuring data security and improving data query efficiency. Attached Figure Description

[0017] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0018] Figure 1 An exemplary system architecture for which data query methods can be applied according to embodiments of this disclosure is illustrated.

[0019] Figure 2 A flowchart illustrating a data query method according to an embodiment of the present disclosure is shown schematically.

[0020] Figure 3 A flowchart illustrating a method for calculating the rank of a query matrix according to an embodiment of the present disclosure is shown schematically.

[0021] Figure 4 A block diagram of a data query apparatus according to an embodiment of the present disclosure is shown schematically.

[0022] Figure 5 A block diagram of an electronic device suitable for implementing a data query method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation

[0023] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0024] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0025] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0026] When using expressions such as "at least one of A, B, and C," the expression should generally be interpreted in accordance with the meaning commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.). Similarly, when using expressions such as "at least one of A, B, or C," the expression should generally be interpreted in accordance with the meaning commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, or C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0027] In related technologies, when a user queries information from a specific table in a database, they often write multiple SQL statements to query the server for that information. However, in some scenarios, differential attacks formed by combining multiple SQL statements can obtain specific information about a single field in the data table. This specific information is often considered sensitive information and cannot be disclosed.

[0028] In view of this, the embodiments of this disclosure determine privacy leakage based on the result tables generated by the user's historical SQL and the result tables generated by the latest SQL. If the result tables generated by the latest SQL, combined with the previous result tables, do not leak any sensitive information, the data query result table generated by executing the latest SQL will be sent to the user.

[0029] Specifically, embodiments of this disclosure provide a data query method, a data query apparatus, an electronic device, a readable storage medium, and a computer program product. The method includes: in response to a data query request for a target data table, obtaining at least one current query statement carried in the data query request and at least one historical query statement from the requester of the data query request for the target data table; mapping the at least one current query statement and the at least one historical query statement to a first matrix; constructing a plurality of second matrices based on the first matrix; calculating the rank of the first matrix and the plurality of second matrices respectively; and executing the current query statement if the rank of the first matrix is ​​not equal to the rank of the plurality of second matrices.

[0030] In the technical solution disclosed herein, the acquisition, storage, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.

[0031] In the technical solution disclosed herein, the user's authorization or consent is obtained before acquiring or collecting the user's personal information.

[0032] Figure 1 This illustration schematically depicts an exemplary system architecture to which data query methods can be applied according to embodiments of this disclosure. It should be noted that... Figure 1 The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.

[0033] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105.

[0034] Terminal devices 101, 102, and 103 can be any type of electronic device, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0035] Various client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social media platforms. While users are using these client applications on terminal devices 101, 102, and 103, these devices can respond to user input and directly or indirectly initiate data query requests.

[0036] Network 104 serves as a medium for providing a communication link between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired and / or wireless communication links. Users can use terminal devices 101, 102, and 103 to interact with server 105 through network 104 to perform tasks such as data querying and receiving.

[0037] Server 105 can be a server that provides various services, such as a backend server that supports data query requests initiated by terminal devices. After receiving a data query request, the backend server can parse, judge, and execute the data query request, and then send the processing results back to the terminal device.

[0038] It should be noted that the data query method provided in this embodiment can generally be executed by server 105. Correspondingly, the data query device provided in this embodiment can generally be located in server 105. The data query method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the data query device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Alternatively, the data query method provided in this embodiment can also be executed by terminal devices 101, 102, or 103, or by other terminal devices different from terminal devices 101, 102, or 103. Correspondingly, the data query device provided in this embodiment can also be located in terminal devices 101, 102, or 103, or in other terminal devices different from terminal devices 101, 102, or 103.

[0039] For example, any one of terminal devices 101, 102, or 103 (e.g., terminal device 101, but not limited thereto) may generate a data query request in response to a user's operation and execute the data query method provided in the embodiments of this disclosure locally, or send the data query request to other terminal devices, servers, or server clusters, and have the other terminal devices, servers, or server clusters that receive the image to be processed execute the data query method provided in the embodiments of this disclosure.

[0040] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0041] Figure 2 A flowchart illustrating a data query method according to an embodiment of the present disclosure is shown schematically.

[0042] like Figure 2 As shown, the method includes operations S201 to S205.

[0043] In operation S201, in response to a data query request for a target data table, at least one current query statement carried in the data query request and at least one historical query statement of the requester of the data query request for the target data table are obtained.

[0044] In operation S202, at least one current query statement and at least one historical query statement are mapped to the first matrix.

[0045] In operation S203, multiple second matrices are constructed based on the first matrix.

[0046] In operation S204, the rank of the first matrix and multiple second matrices are calculated respectively.

[0047] In operation S205, if the rank of the first matrix is ​​not equal to the ranks of any of the second matrices, execute the current query statement.

[0048] According to embodiments of this disclosure, the current query statement or historical query statement can be represented as an SQL statement. The current query statement or historical query statement can be written by the requesting party or generated by the requesting party's electronic device in response to the requesting party's operation; no limitation is made herein.

[0049] In some embodiments, the target data table can have multiple columns, that is, each field of the target data table can have multiple configuration items, and the current query statement or historical query statement can be a query statement targeting the target column of the target data table.

[0050] According to embodiments of this disclosure, the location of the data to be queried in the target data table can be determined by parsing the current query statement and historical query statements, thereby mapping the location information into a matrix to obtain a first matrix; or, the current query statement and historical query statements can be executed directly to obtain a result table, and the first matrix can be constructed based on the result table.

[0051] According to embodiments of this disclosure, determining whether a linear combination of the current query statement and historical query statements leaks privacy information is equivalent to determining whether a linear combination of the query vector mapped by the current query statement and the query vector mapped by the historical query statement can produce a unit vector with row 1 and other rows 0.

[0052] According to embodiments of this disclosure, the second matrix may be a combination of the first matrix and a unit vector whose i-th row is 1 and the other rows are 0.

[0053] According to embodiments of this disclosure, the method for calculating the rank of a matrix is ​​not limited thereto, and includes, but is not limited to, singular value decomposition, Jordan decomposition, etc.

[0054] According to embodiments of this disclosure, when the rank of the first matrix and the ranks of the multiple second matrices are not equal, the result table of the current query statement generated during the mapping operation can be returned to the requester. Alternatively, the current query statement can be executed again, and the resulting result table can be returned to the requester.

[0055] According to embodiments of this disclosure, if the rank of the first matrix is ​​equal to the rank of one of the second matrices, it is also necessary to perform desensitization processing on the result table generated by executing the current query statement, and then return the desensitized result table to the requester.

[0056] According to embodiments of this disclosure, when a requester initiates a data query request for a target data table, the current query statement and historical query statements for the target data table are mapped to a first matrix. Multiple second matrices are then constructed based on this first matrix. The current query statement is executed only when the rank of the first matrix is ​​unequal to the ranks of all the second matrices. Through this technical means, it is possible to determine whether the current query statement and historical query statements constitute a differential attack by judging the magnitude of the rank of the first matrix and the ranks of the multiple second matrices. Therefore, this at least partially overcomes the technical problems in related technologies where differential attacks cannot be defended against, easily leading to the leakage of sensitive information, effectively ensuring data security and improving data query efficiency.

[0057] The following is for reference. Figure 3 In conjunction with specific embodiments, Figure 2 The method shown will be further explained.

[0058] Taking a data table containing sensitive brand information as an example, Table 1 shows the first two columns of the data table, where the information contained in a single brand can be considered sensitive information.

[0059] Table 1

[0060] line number brand r0 a r1 b r2 a r3 b r4 c r5 a r6 d r7 c r8 d r9 c r10 c

[0061] According to embodiments of this disclosure, for a current query statement or a historical query statement, a first matrix can be mapped as follows: for each query statement in at least one current query statement and at least one historical query statement, the query statement is mapped as a query vector based on the target data table; and multiple query vectors are arranged in a preset order to obtain the first matrix.

[0062] According to embodiments of this disclosure, a method for mapping a query statement to a query vector may be to compare the result table generated after executing the query statement with the original data table, and generate a query vector based on the positional relationship.

[0063] For example, as shown in Table 2, before the requesting party initiates a data query request, it has a historical query statement SQL1 for the data table. After executing SQL1, a result table is generated, containing a group: SQL1_R1 = r0 + r1 + r5 + r6 + r7 + r10. When comparing the result table with the original data table, the result table can be set to use the i-th row of the original data table, marking that row as 1 and other unused rows as 0. Therefore, SQL1_R1 actually corresponds to a column vector: (1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1). T Similarly, the data query request initiated by the requester carries a current query statement SQL2. After executing SQL2, the result table contains only one group: SQL1_R1 = r0 + r1 + r4 + r6 + r7 + r8 + r10. Accordingly, SQL1_R1 can be mapped to a column vector: (1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1) T .

[0064] Table 2

[0065] line number brand SQL1_R1 SQL2_R2 r0 a 1 1 r1 b 1 1 r2 a 0 0 r3 b 0 0 r4 c 0 1 r5 a 1 0 r6 d 1 1 r7 c 1 1 r8 d 0 1 r9 c 0 0 r10 c 1 1

[0066] According to embodiments of this disclosure, the preset order can be set according to specific application scenarios, including but not limited to the order of query statement submission time, reverse order, etc., which are not limited here.

[0067] For example, the query statements shown in Table 2 can be sequentially constructed to obtain the first matrix A, which can be represented as: A = [SQL1_R1, SQL2_R1].

[0068] According to embodiments of this disclosure, determining whether all linear combinations of SQL1_R1 and SQL2_R1 leak sensitive information of a certain match in the original data table is equivalent to determining whether all linear combinations of SQL1_R1 and SQL2_R1 can produce a vector R with row i as 1 and all other rows as 0. i Taking i=1 as an example, the above judgment is equivalent to judging whether the system of linear equations shown in equation (1) has a solution:

[0069] SQL1 R1 ×x1+SQL2 R2 ×x2=(1,0,0,0,0,0,0,0,0,0,0,0) T (1)

[0070] According to linear algebra, equation (1) is also equivalent to determining the rank of the first matrix A and multiple second matrices B = [SQL1_R1, SQL2_R1, R]. i If the ranks of SQL1_R1 and SQL2_R1 are equal, then equation (1) has a solution. There exists a linear combination of SQL1_R1 and SQL2_R1 that can leak sensitive information.

[0071] According to embodiments of this disclosure, a method for constructing multiple second matrices B based on a first matrix A may specifically include: constructing multiple unit query vectors based on the dimensions of the rows of the first matrix, wherein the multiple unit query vectors are unit vectors and are pairwise orthogonal; and for each unit query vector, merging the unit query vectors into the first matrix to obtain a second matrix.

[0072] According to embodiments of this disclosure, the unit query vector is the vector described above where the i-th row is 1 and the other rows are 0.

[0073] According to an embodiment of this disclosure, the judgment process of equation (1) may include (m+1) rank-finding processes, that is, calculating the rank of the first matrix A and the m second matrices B respectively, where m is the dimension of the rows of the first matrix A, which is also the number of rows in the original data table.

[0074] According to embodiments of this disclosure, the traversal process for verifying whether sensitive information is leaked can be transformed into a calculation process for finding the rank of multiple matrices through several equivalent operations, thereby effectively reducing the complexity of the judgment operation and improving the efficiency of data query.

[0075] Figure 3 A flowchart illustrating a method for calculating the rank of a query matrix according to an embodiment of the present disclosure is shown schematically.

[0076] like Figure 3As shown, the method includes operations S301 to S308. In this embodiment, the query matrix can be any one of a first matrix and a plurality of second matrices.

[0077] It should be noted that, unless it is explicitly stated that there is a sequential order of execution between different operations, or that there is a sequential order of execution between different operations in terms of technical implementation, the execution order between multiple operations may not be significant, and multiple operations may be executed simultaneously.

[0078] In operation S301, the query matrix is ​​obtained. Let m be the dimension of the rows of the query matrix and n be the dimension of the columns.

[0079] In operation S302, determine whether the data type of the query matrix is ​​a preset data type. If it is determined that the data type of the query matrix is ​​not a preset data type, execute operation S303; if it is determined that the data type of the query matrix is ​​a preset data type, execute operation S304.

[0080] In operation S303, the data type of the query matrix is ​​changed to the preset data type.

[0081] In operation S304, construct the transpose of the query matrix.

[0082] In operation S305, determine whether m is greater than or equal to n. If m is greater than or equal to n, execute operation S306; if m is less than n, execute operation S307.

[0083] In operation S306, a symmetric matrix is ​​constructed based on the product of the transpose matrix and the query matrix.

[0084] In operation S307, a symmetric matrix is ​​constructed based on the product of the query matrix and the transpose matrix.

[0085] In operation S308, the rank of the calculated symmetric matrix is ​​used as the rank of the query matrix.

[0086] According to embodiments of this disclosure, a method for actually calculating a symmetric matrix may include: loading the symmetric matrix as an input parameter into a preset execution statement; and executing the preset execution statement to obtain the rank of the symmetric matrix.

[0087] According to embodiments of this disclosure, the preset execution statement can be selected based on specific application scenarios. For example, in Python, the method to calculate the rank of a matrix A is to call the module and method for calculating the rank of a matrix encapsulated in the Python third-party library NumPy. Accordingly, the preset execution statement could be numpy.linalg.matrix_rank(A). Furthermore, when matrix A is a symmetric matrix, the parameter loaded into the preset execution statement could be A, Hermitian = True.

[0088] According to embodiments of this disclosure, the preset data type can be selected based on the language environment of the specific application scenario. For example, in Python, the computation speed of converting a matrix of data type float64 to a symmetric matrix is ​​much faster than the computation speed of converting a matrix of data types int8, int32, int64, etc., to a symmetric matrix. Taking m = 100000 and n = 1000 as an example, when querying that the data type of matrix A is float64, calculating A... T The time consumed by ×A is approximately 0.5 seconds, while when the data type of the query matrix is ​​int8, the calculation of A takes longer. T ×A takes more than 30 minutes to process.

[0089] According to embodiments of this disclosure, constructing a symmetric matrix by judging the magnitudes of m and n can effectively reduce the dimension of the symmetric matrix, thereby improving the computation speed of the matrix rank.

[0090] In real-world applications, a single SQL query might generate thousands of groups, and the original data table might contain millions or tens of millions of rows. The resulting matrix mapping between the current and historical queries is also correspondingly large. Since calculating the rank of a symmetric matrix is ​​generally faster than calculating the rank of an asymmetric matrix in most programming languages, such as Python, the method described in this disclosure, which reconstructs the original query matrix into a symmetric matrix, can effectively improve the speed of rank calculation, thereby enhancing the efficiency of differential attack detection and data query efficiency.

[0091] Figure 4 A block diagram of a data query apparatus according to an embodiment of the present disclosure is shown schematically.

[0092] like Figure 4 As shown, the data query device 400 includes an acquisition module 410, a mapping module 420, a construction module 430, a calculation module 440, and an execution module 450.

[0093] The acquisition module 410 is used to, in response to a data query request for a target data table, acquire at least one current query statement carried in the data query request and at least one historical query statement of the requester of the data query request for the target data table.

[0094] The mapping module 420 is used to map at least one current query statement and at least one historical query statement into a first matrix.

[0095] Module 430 is used to construct multiple second matrices based on the first matrix.

[0096] The calculation module 440 is used to calculate the rank of the first matrix and the multiple second matrices respectively.

[0097] Execution module 450 is used to execute the current query statement when the rank of the first matrix is ​​not equal to the ranks of the multiple second matrices.

[0098] According to embodiments of this disclosure, when a requester initiates a data query request for a target data table, the current query statement and historical query statements for the target data table are mapped to a first matrix. Multiple second matrices are then constructed based on this first matrix. The current query statement is executed only when the rank of the first matrix is ​​unequal to the ranks of all the second matrices. Through this technical means, it is possible to determine whether the current query statement and historical query statements constitute a differential attack by judging the magnitude of the rank of the first matrix and the ranks of the multiple second matrices. Therefore, this at least partially overcomes the technical problems in related technologies where differential attacks cannot be defended against, easily leading to the leakage of sensitive information, effectively ensuring data security and improving data query efficiency.

[0099] According to embodiments of this disclosure, the mapping module 420 includes a first mapping unit and a second mapping unit.

[0100] The first mapping unit is used to map each query statement into a query vector based on the target data table, for each query statement in at least one current query statement and at least one historical query statement.

[0101] The second mapping unit is used to arrange multiple query vectors in a preset order to obtain the first matrix.

[0102] According to embodiments of this disclosure, the construction module 430 includes a first construction unit and a second construction unit.

[0103] The first building unit is used to construct multiple unit query vectors based on the dimensions of the rows of the first matrix, wherein the multiple unit query vectors are unit vectors and are pairwise orthogonal.

[0104] The second building unit is used to merge the unit query vectors into the first matrix for each unit query vector, thus obtaining the second matrix.

[0105] According to embodiments of this disclosure, the computing module 440 includes a first computing unit, a second computing unit, and a third computing unit.

[0106] The first computational unit is used to construct a symmetric matrix of the query matrix for each query matrix in the first matrix and a plurality of second matrices.

[0107] The second computational unit is used to calculate the rank of a symmetric matrix.

[0108] The third calculation unit is used to determine the rank of the symmetric matrix as the rank of the query matrix.

[0109] According to embodiments of this disclosure, the first computing unit includes a first computing subunit, a second computing subunit, and a third computing subunit.

[0110] The first calculation subunit is used to obtain the transpose of the query matrix.

[0111] The second computational subunit is used to construct a symmetric matrix based on the product of the transpose matrix and the query matrix when the row dimension of the query matrix is ​​greater than or equal to the column dimension.

[0112] The third computational subunit is used to construct a symmetric matrix based on the product of the query matrix and the transpose matrix when the dimension of the rows of the query matrix is ​​less than the dimension of the columns.

[0113] According to embodiments of this disclosure, the second computing unit includes a fourth computing subunit and a fifth computing subunit.

[0114] The fourth calculation subunit is used to load the symmetric matrix as an input parameter into a preset execution statement.

[0115] The fifth calculation subunit is used to execute preset execution statements to obtain the rank of the symmetric matrix.

[0116] According to embodiments of this disclosure, the computing module 440 further includes a fourth computing unit and a fifth computing unit.

[0117] The fourth calculation unit is used to obtain the data type of the query matrix before constructing the symmetric matrix of the query matrix.

[0118] The fifth calculation unit is used to modify the data type of the query matrix to the preset data type when the data type of the query matrix is ​​not the preset data type.

[0119] Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure, or at least part of the functions of any one or more of them, can be implemented in one module. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be implemented by dividing them into multiple modules. Any one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as hardware circuitry, such as Field Programmable Gate Arrays (FPGAs), Programmable Logic Arrays (PLAs), Systems-on-Chip, Systems-on-Substrate, Systems-on-Package, Application-Specific Integrated Circuits (ASICs), or implemented in hardware or firmware by any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, one or more of the modules, submodules, units, and subunits according to embodiments of the present disclosure can be at least partially implemented as computer program modules, which, when run, can perform corresponding functions.

[0120] For example, any plurality of the acquisition module 410, mapping module 420, construction module 430, calculation module 440, and execution module 450 may be combined into one module / unit / subunit, or any one of these modules / units / subunits may be split into multiple modules / units / subunits. Alternatively, at least a portion of the functionality of one or more of these modules / units / subunits may be combined with at least a portion of the functionality of other modules / units / subunits and implemented in one module / unit / subunit. According to embodiments of the present disclosure, at least one of the acquisition module 410, mapping module 420, construction module 430, calculation module 440, and execution module 450 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the acquisition module 410, mapping module 420, construction module 430, calculation module 440 and execution module 450 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.

[0121] It should be noted that the data query device part in the embodiments of this disclosure corresponds to the data query method part in the embodiments of this disclosure. The specific description of the data query device part is referred to in the data query method part, and will not be repeated here.

[0122] Figure 5 A block diagram of an electronic device suitable for implementing a data query method according to an embodiment of the present disclosure is shown schematically. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0123] like Figure 5 As shown, a computer electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage portion 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0124] RAM 503 stores various programs and data required for the operation of electronic device 500. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 502 and / or RAM 503. It should be noted that the programs may also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0125] According to embodiments of this disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.

[0126] According to embodiments of this disclosure, the method flow according to embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of embodiments of this disclosure. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0127] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0128] According to embodiments of this disclosure, the computer-readable storage medium can be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0129] For example, according to embodiments of this disclosure, a computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.

[0130] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods provided in the embodiments of this disclosure. When the computer program product is run on an electronic device, the program code is used to enable the electronic device to implement the data query method provided in the embodiments of this disclosure.

[0131] When the computer program is executed by the processor 501, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0132] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0133] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features recited in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not expressly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0135] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A data query method, comprising: In response to a data query request for a target data table, at least one current query statement carried in the data query request and at least one historical query statement of the requester of the data query request for the target data table are obtained. Map at least one current query statement and at least one historical query statement to a first matrix; Based on the row dimensions of the first matrix, multiple unit query vectors are constructed, wherein the multiple unit query vectors are unit vectors and are pairwise orthogonal; for each unit query vector, the unit query vector is merged into the first matrix to obtain a second matrix, thereby constructing multiple second matrices; Calculate the rank of the first matrix and the ranks of the plurality of second matrices respectively; and The current query statement is executed if the rank of the first matrix is ​​not equal to the rank of any of the second matrices.

2. The method according to claim 1, wherein, The step of mapping at least one current query statement and at least one historical query statement into a first matrix includes: For each query statement in at least one current query statement and at least one historical query statement, based on the target data table, the query statement is mapped to a query vector; and The first matrix is ​​obtained by arranging the multiple query vectors in a preset order.

3. The method according to claim 1, wherein, The step of calculating the rank of the first matrix and the plurality of second matrices respectively includes: For each query matrix in the first matrix and the plurality of second matrices, construct a symmetric matrix of the query matrix; Calculate the rank of the symmetric matrix; and The rank of the symmetric matrix is ​​determined as the rank of the query matrix.

4. The method according to claim 3, wherein, The construction of the symmetric matrix of the query matrix includes: Obtain the transpose of the query matrix; When the row dimension of the query matrix is ​​greater than or equal to the column dimension, the symmetric matrix is ​​constructed based on the product of the transpose matrix and the query matrix; and When the dimension of the rows of the query matrix is ​​less than the dimension of the columns, the symmetric matrix is ​​constructed based on the product of the query matrix and the transpose matrix.

5. The method according to claim 3, wherein, The calculation of the rank of the symmetric matrix includes: The symmetric matrix is ​​used as an input parameter and loaded into a preset execution statement; and The preset execution statement is executed to obtain the rank of the symmetric matrix.

6. The method according to claim 3, further comprising: Before constructing the symmetric matrix of the query matrix, obtain the data type of the query matrix; as well as If the data type of the query matrix is ​​not a preset data type, the data type of the query matrix will be modified to the preset data type.

7. A data query device, comprising: The acquisition module is used to, in response to a data query request for a target data table, acquire at least one current query statement carried in the data query request and at least one historical query statement of the requester of the data query request for the target data table. The mapping module is used to map at least one current query statement and at least one historical query statement into a first matrix; A construction module is used to construct multiple unit query vectors based on the dimension of the rows of the first matrix, wherein the multiple unit query vectors are unit vectors and are pairwise orthogonal; for each unit query vector, the unit query vector is merged into the first matrix to obtain a second matrix, thereby constructing multiple second matrices; The calculation module is used to calculate the rank of the first matrix and the plurality of second matrices respectively; and An execution module is used to execute the current query statement when the rank of the first matrix is ​​not equal to the rank of any of the second matrices.

8. An electronic device, comprising: One or more processors; Memory, used to store one or more instructions. When the one or more instructions are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method of any one of claims 1 to 6.

9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 6.

10. A computer program product comprising computer-executable instructions, which, when executed, are used to implement the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data product release method or system

    CN111971675A

  • Multi-dimensional data query method and device and electronic equipment

    CN112286953A