Query of encrypted data
By sorting and segmenting the dense data, determining the dense access address, and storing the corresponding relationship, the problems of complex query process and high computing resource consumption are solved, and query efficiency is improved.
Patent Information
- Application Number
- PCT/CN2024/127603
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-10-27
- Filing Date
- 2024-10-28
- Publication Date
- 2025-05-01
AI Technical Summary
In multi-party security computing scenarios, the process of querying dense data based on the dense access address is complex and consumes a large amount of computing resources. Especially when the data volume is large, the query efficiency is low.
By sorting and segmenting the dense data, the secret access address of each segment sequence is determined, and the correspondence between the segment sequence and the secret access address is stored. Only the secret data within the range of the secret key to be queried is queried during query.
Reduces resource waste when querying dense data based on the secret access address, improves query efficiency, and reduces the demand for computing resources.
Smart Images

Figure CN2024127603_01052025_PF_FP_ABST
Abstract
Description
Query of confidential data Technical Field
[0001] This specification relates to the field of computer technology, and in particular to methods, devices, storage media, and electronic devices for querying confidential data. Background Art
[0002] The data required to perform a task may come from different devices, and different devices may not trust each other. Therefore, secure multi-party computation (MPC) is required, that is, participants use private data to participate in confidential computing without disclosing their own private data to jointly complete a computing task.
[0003] In the MPC scenario, in order to prevent the address of the data to be queried from being leaked, the address is usually a confidential access address. However, the process of querying confidential data based on the confidential access address is usually more complicated and requires more computing resources. For example, if there are N data, a status identifier is usually set for each confidential data. If the status identifier is 1, the confidential data is the data to be returned. If the status identifier is 0, the confidential data is non-query data. When initializing the status identifier, it is necessary to traverse N data. When determining all the data to be returned based on the status identifier of the confidential data, it may also be necessary to traverse these N data. When the amount of data is large, the amount of data that needs to be traversed is large, and the computing resources required are also large.
[0004] Therefore, how to reduce the demand for computing resources when performing data queries based on secret access addresses and improve query efficiency is an urgent problem that needs to be solved.
[0005] Based on this, this specification provides a method for querying confidential data.
[0006] Summary of the Invention
[0007] This specification provides a method, device, storage medium and electronic device for querying confidential data to at least partially solve the above-mentioned problems existing in the prior art.
[0008] This manual adopts the following technical solutions.
[0009] This specification provides a method for querying encrypted data, which is applied to a terminal and includes:
[0010] Acquire a plurality of secret data, wherein the secret data includes a secret key and a secret value;
[0011] Sorting the plurality of secret data according to a preset secret key sorting rule to obtain a secret data sequence;
[0012] Determining a plurality of segmentation sequences according to the encrypted data sequence and a preset segmentation rule;
[0013] For each segment sequence, determining a secret access address of the segment sequence; and storing a first correspondence between the segment sequence and the secret access address;
[0014] Receive the range of secret keys to be queried sent by other terminals;
[0015] Determining, according to the range of the secret state keys to be queried, a secret state access address range corresponding to the range of the secret state keys to be queried;
[0016] Obtain a query result according to the secret access address range and the first corresponding relationship; and return the query result to the other terminal.
[0017] Optionally, according to the encrypted data sequence and a preset segmentation rule, several segmentation sequences are determined, specifically including:
[0018] Determine the amount of encrypted data in each segment sequence in a preset segmentation rule;
[0019] The encrypted data sequence is segmented according to the quantity and the encrypted keys of the encrypted data in the encrypted data sequence to obtain a plurality of segmented sequences.
[0020] Optionally, after storing the first correspondence between the segment sequence and the secret access address, the method further includes:
[0021] A second correspondence between the secret access address and the secret value of the secret data in the segment sequence is determined.
[0022] Optionally, the method further includes:
[0023] According to the second corresponding relationship and the secret state access address range, the secret state value of the secret state data in the secret state access address range is determined as a query result.
[0024] Optionally, obtaining a query result according to the confidential access address range and the first corresponding relationship specifically includes:
[0025] Determining the number of segment sequences in the secret access address range according to the secret access address range and the first corresponding relationship;
[0026] Determining the amount of secret data in the secret access address range according to the number of segment sequences in the secret access address range and the preset segmentation rule;
[0027] adding noise to the amount of secret state data in the secret state access address range to obtain the amount of disturbed secret state data, wherein the amount of disturbed secret state data is greater than the amount of secret state data in the secret state access address range;
[0028] According to the amount of the disturbed secret state data and the secret state access address range, a secret state value of the secret state data of the amount of the disturbed secret state data is obtained as a query result.
[0029] Optionally, obtaining, according to the amount of the disturbed secret state data and the secret state access address range, a secret state value of the secret state data of the amount of the disturbed secret state data as a query result, specifically includes:
[0030] Determining, according to the second correspondence and the secret state access address range, a secret state value of the secret state data in the secret state access address range as a first query result;
[0031] Determine the difference between the amount of the disturbed secret state data and the amount of the secret state data in the secret state access address range;
[0032] Obtaining, as a second query result, the secret state values of the secret state data in the segment sequence excluding the secret state access address range, wherein the number of the secret state values of the secret state data in the second query result is the difference;
[0033] A final query result is obtained based on the first query result and the second query result.
[0034] Optionally, obtaining a query result according to the confidential access address range and the first corresponding relationship specifically includes:
[0035] Determine the segment sequence corresponding to the secret access address range according to the secret access address range and the first corresponding relationship, and obtain a result segment sequence;
[0036] According to the result segment sequence, the encrypted value of the encrypted data in the result segment sequence is determined as the query result.
[0037] This specification provides a device for querying encrypted data, which is applied to a terminal and includes:
[0038] A secret data acquisition module, configured to acquire a plurality of secret data, wherein the secret data includes a secret key and a secret value;
[0039] A sorting module, configured to sort the plurality of encrypted data according to a preset encrypted key sorting rule to obtain a sequence of encrypted data;
[0040] A segmentation module, configured to determine a plurality of segmentation sequences according to the encrypted data sequence and a preset segmentation rule;
[0041] A secret access address determination module, configured to determine, for each segment sequence, a secret access address of the segment sequence; and store a first correspondence between the segment sequence and the secret access address;
[0042] A receiving module, configured to receive a range of secret keys to be queried sent by other terminals;
[0043] A first query module is configured to determine, based on the range of the secret state keys to be queried, a secret state access address range corresponding to the range of the secret state keys to be queried;
[0044] The second query module is configured to obtain a query result according to the secret access address range and the first corresponding relationship; and return the query result to the other terminal.
[0045] Optionally, the segmentation module is specifically used to determine the amount of secret data in each segmentation sequence in a preset segmentation rule; and segment the secret data sequence according to the amount and the secret key of the secret data in the secret data sequence to obtain a plurality of segmentation sequences.
[0046] Optionally, the device further comprises:
[0047] The second correspondence determination module is used to determine a second correspondence between the secret access address and the secret value of the secret data in the segment sequence.
[0048] Optionally, the device further comprises:
[0049] The third query module is configured to determine, according to the second corresponding relationship and the confidential state access address range, a confidential state value of the confidential state data in the confidential state access address range as a query result.
[0050] Optionally, the second query module is specifically used to determine the number of segmented sequences in the secret access address range based on the secret access address range and the first corresponding relationship; determine the number of secret data in the secret access address range based on the number of segmented sequences in the secret access address range and the preset segmentation rule; add noise to the number of secret data in the secret access address range to obtain the number of disturbed secret data, wherein the number of disturbed secret data is greater than the number of secret data in the secret access address range; and obtain the secret value of the secret data of the number of disturbed secret data based on the number of disturbed secret data and the secret access address range as a query result.
[0051] Optionally, the second query module is specifically used to determine the confidential value of the confidential data in the confidential access address range according to the second corresponding relationship and the confidential access address range, as the first query result; determine the difference between the number of confidential data after the disturbance and the number of confidential data in the confidential access address range; obtain the confidential value of the confidential data in the segmented sequence except the confidential access address range, as the second query result, and the number of confidential values of the confidential data in the second query result is the difference; and obtain the final query result based on the first query result and the second query result.
[0052] Optionally, the second query module is specifically used to determine the segment sequence corresponding to the confidential access address range based on the confidential access address range and the first corresponding relationship, and obtain a result segment sequence; based on the result segment sequence, determine the confidential value of the confidential data in the result segment sequence as the query result.
[0053] This specification provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned confidential data query method.
[0054] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for querying confidential data when executing the program.
[0055] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects.
[0056] As can be seen in the secret data query method provided in this specification, this method segments the secret data and obtains the secret access address for each segment sequence. During the query, the secret access address range corresponding to the secret key to be queried is determined, and the secret data within this secret access address range is queried. In other words, when querying secret data, this method can only query a portion of the secret data without traversing all the data, reducing the resource waste of querying secret data based on the secret access address and improving query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The accompanying drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The exemplary embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation of this specification.
[0058] FIG1 is a flow chart of a method for querying encrypted data provided in this specification;
[0059] FIG2 is a schematic diagram of an example of a confidential data query provided in this specification;
[0060] FIG3 is a schematic diagram of a first correspondence between a segment sequence and a secret access address provided in this specification;
[0061] FIG4 is a schematic diagram of a second correspondence between a secret access address and a secret value of secret data provided in this specification;
[0062] FIG5 is a schematic diagram of a device for querying encrypted data provided in this specification;
[0063] FIG6 is a schematic diagram of an electronic device corresponding to FIG1 provided in this specification. DETAILED DESCRIPTION
[0064] To make the purpose, technical solutions, and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in conjunction with the specific embodiments of this specification and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.
[0065] The technical solutions provided by the embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0066] FIG1 is a flow chart of a method for querying confidential data provided in this specification, which specifically includes the following steps S100 to S112 .
[0067] S100: Acquire a number of secret data, wherein the secret data includes a secret key and a secret value.
[0068] The equipment required to perform the task may contain a large amount of private information. When multiple parties interact to complete the task, for any terminal, its own real data will be converted into confidential data so that the real data will not be leaked when other terminals query. In addition, in order to prevent the address of the confidential data from being leaked when querying the confidential data, an encrypted address, that is, a confidential access address, is usually used. The traditional method of querying confidential data based on the confidential access address requires more computing resources and has low query efficiency. This is because when querying confidential data based on the confidential access address, a state identifier is also set to record whether the confidential data corresponding to each state identifier is the confidential data to be returned. In other words, the query needs to traverse all confidential data. When the amount of confidential data is large, more computing resources are required and the query speed is slow. This manual provides a method for querying confidential data. The execution subject of this manual is a terminal that stores confidential data. The terminal can be various electronic devices. This manual does not limit the type of terminal. For the sake of convenience, this manual is explained with the terminal as the execution subject.
[0069] Before querying the secret data required by other terminals, the terminal that has the secret data needs to initialize the secret data. During the initialization, several secret data are first obtained, wherein the secret data includes a secret key and a secret value.
[0070] S102: Sort the plurality of secret data according to a preset secret key sorting rule to obtain a secret data sequence.
[0071] Specifically, the terminal obtains the secret key of each secret data, and sorts all the obtained secret data according to the sorting rule of the secret keys in ascending order to obtain a secret data sequence.
[0072] FIG2 is a schematic diagram of an example of a confidential data query provided in this specification, as shown in FIG2 .
[0073] The encrypted data includes the encrypted keys of 5.1, 0.4, 2.3, 1.7, and 4.9, and the corresponding encrypted values are A, S, F, G, and H. The sorted encrypted sequence is 0.4, 1.7, 2.3, 4.9, and 5.1, and the corresponding encrypted values are S, G, F, H, and A.
[0074] S104: Determine a plurality of segmentation sequences according to the encrypted data sequence and a preset segmentation rule.
[0075] In one or more embodiments of the present specification, the terminal may segment the encrypted data sequence according to a preset segmentation rule to obtain a plurality of segment sequences.
[0076] Specifically, the terminal may determine the amount of secret data in each segment sequence in a preset segmentation rule, and segment the secret data sequence according to the amount and the secret key of the secret data in the secret data sequence to obtain a plurality of segment sequences.
[0077] Using the example in Figure 2, if the preset segmentation rule states that each segment sequence contains only one encrypted data, the resulting segment sequences are (minimum value, 0.4), (0.4, 1.7), (1.7, 2.3), (2.3, 4.9), and (4.9, 5.1). The encrypted data values in each segment sequence are S, G, F, H, and A, respectively.
[0078] S106: For each segment sequence, determine a secret access address of the segment sequence; and store a first correspondence between the segment sequence and the secret access address.
[0079] When other terminals query confidential data, they typically use the data's secret key. The querying terminal, however, needs to traverse the secret keys of all confidential data based on the secret key being queried, which consumes significant computing resources. To reduce computing resource waste and improve query efficiency, the querying terminal can convert secret key queries into secret access address queries.
[0080] Then, for each segment sequence, the querying terminal needs to determine the secret access address of the segment sequence and store the first correspondence between the segment sequence and the secret access address so that the secret data can be subsequently queried based on the secret access address. This is because if the secret data is sorted and segmented, and the secret access address of each segment sequence is determined, then during the query, only the secret data within the range of the secret key to be queried can be queried, reducing the resource waste of traversing other secret data.
[0081] It should be noted that S100 to S106 are steps for initializing the confidential data of the terminal performing the query, and this specification does not limit the form of the confidential access address.
[0082] Figure 3 is a schematic diagram of the first correspondence between segment sequences and secret access addresses provided in this specification. As shown in Figure 3, the segment sequences are (minimum value, 0.4), (0.4, 1.7), (1.7, 2.3), (2.3, 4.9), and (4.9, 5.1), and the corresponding secret access addresses are 0, 1, 2, 3, and 4, respectively.
[0083] S108: Receive the range of secret keys to be queried sent by other terminals.
[0084] S110: Determine, according to the range of the secret keys to be queried, a secret access address range corresponding to the range of the secret keys to be queried.
[0085] Specifically, the terminal can input the range of secret keys to be queried into a preset piecewise function to determine the range of secret access addresses corresponding to the range of secret keys to be queried. The piecewise function is related to the preset segmentation rules for determining the segment sequence, but the segment sequence cannot be directly obtained through the piecewise function. In other words, the piecewise function outputs the secret access addresses corresponding to the segment sequence.
[0086] Continuing with the example in Figure 3, the segmented sequences are (minimum value, 0.4), (0.4, 1.7), (1.7, 2.3), (2.3, 4.9), and (4.9, 5.1), and the corresponding secret access addresses are 0, 1, 2, 3, and 4. If the secret key range to be queried is (1.5, 5.0), then according to the preset segmented function, when the secret key is 1.5, the corresponding secret access address is 1, and when the secret key is 5.0, the corresponding secret access address is 4. Therefore, the secret access address range corresponding to the secret key range to be queried (1.5, 5.0) is (1, 4).
[0087] S112: Obtain a query result according to the secret access address range and the first corresponding relationship; and return the query result to the other terminal.
[0088] Specifically, based on the secret access address range and the first correspondence, the segment sequence corresponding to the secret access address range is determined to obtain a result segment sequence. Based on the result segment sequence, the secret value of the secret data in the result segment sequence is determined as the query result. This is because the segment sequence is segmented by the terminal, and the terminal itself contains the corresponding secret data. Therefore, the segment sequence corresponding to the secret access address range can be determined. Then, the secret value of the secret data in the segment sequence corresponding to the secret access address range is obtained to obtain the query result. Finally, the query result is returned to other querying terminals.
[0089] Based on the secret data query method shown in Figure 1, this method segments the secret data and obtains the secret access address for each segment sequence. During the query, the secret access address range corresponding to the secret key to be queried is determined, and the secret data within this secret access address range is queried. In other words, when querying secret data, this method can only query a portion of the secret data without traversing all the data, reducing the resource waste of querying secret data based on secret access addresses and improving query efficiency.
[0090] For step S106, after storing the first correspondence between the segment sequence and the secret access address, since the secret access address is only associated with the segment sequence, but the query result requires the secret value of the secret data in the segment sequence, it is also necessary to determine the second correspondence between the secret access address and the secret value of the secret data in the segment sequence and store it so that the secret value of the secret data can be obtained later according to the secret access address.
[0091] Therefore, although the secret access address can be the array subscript of the secret data or other forms, the secret access address needs to correspond to the secret value of the secret data so that the secret value of the secret data can be queried based on the correspondence and the secret access address.
[0092] After determining the second correspondence between the secret access address and the secret value of the secret data in the segmented sequence, step S110 is executed to obtain the secret access address range. The terminal then determines the secret value of the secret data in the secret access address range based on the second correspondence and the secret access address range as the query result.
[0093] Figure 4 is a schematic diagram of the second correspondence between the secret access address and the secret value of the secret data provided in this specification. As shown in Figure 4, the secret access addresses are 0, 1, 2, 3, and 4, and the secret values of the secret data are S, G, F, H, and A, respectively.
[0094] Regarding step S104, if the number of secret data items in each segmented sequence is equal and not 1, then, to prevent the disclosure of the number of secret values of the secret data items in the query results when the query is returned, more query results can be obtained during the query. For example, if the original number of items to be queried was 3 and 3 more items were queried, a total of 6 secret data items would be queried, and the query results would contain 3 more secret values of the secret data items. This prevents attackers or other non-querying terminals from knowing whether the current query results are all the desired query results, thus achieving encryption of the number of secret values of the secret data items in the query results.
[0095] Specifically, the terminal determines the number of segment sequences in the secret access address range based on the secret access address range and the first corresponding relationship, and then determines the amount of secret data in the secret access address range based on the number of segment sequences in the secret access address range and the preset segmentation rule.
[0096] Noise is added to the amount of secret data in the secret access address range to obtain the amount of disturbed secret data, wherein the amount of disturbed secret data is greater than the amount of secret data in the secret access address range.
[0097] Based on the second correspondence and the secret state access address range, the secret state value of the secret state data within the secret state access address range is determined as the first query result. The difference between the amount of the disturbed secret state data and the amount of the secret state data within the secret state access address range is determined. The secret state value of the secret state data in the segmented sequence excluding the secret state access address range is obtained as the second query result, with the number of secret state values of the secret state data in the second query result being the difference. A final query result is obtained based on the first query result and the second query result.
[0098] Continuing with the example of Figure 3, for the secret state access address range (1, 4), according to the first correspondence, the number of segmented sequences in the secret state access address range is 3, and the secret state access addresses are 1, 2, and 3, respectively. If the preset segmentation rule stipulates that each segmented sequence contains only one secret state data, then the number of secret state data in the secret state access address range (1, 4) is 3*1=3. Based on the second correspondence and the secret state access address range, the secret state values of the secret state data in the secret state access address range are determined to be G, F, and H. If the number of secret state data after disturbance is 6, and the number of secret state data in the secret state access address range (1, 4) is 3, then the difference is 3. If the secret state values of the secret state data in the segmented sequences obtained outside the secret state access address range (1, 4) are I, K, and N, then the secret state values of the secret state data in the final query result are G, F, H, I, K, and N.
[0099] It should be noted that since the query results contain the secret values of secret data that other terminals do not need, other terminals will need to filter the query results. This specification does not limit how to filter. For example, when returning the query results, the secret values of the secret data that other terminals actually need can be marked, and other terminals can then filter based on the marks.
[0100] The above is a method for querying confidential data provided in one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding device for querying confidential data, as shown in FIG5 .
[0101] Figure 5 is a schematic diagram of a confidential data query device provided in this specification. The device is applied to a terminal and includes a confidential data acquisition module 500, a sorting module 502, a segmentation module 504, a confidential access address determination module 506, a receiving module 508, a first query module 510 and a second query module 512.
[0102] The secret data acquisition module 500 is used to acquire a number of secret data, wherein the secret data includes a secret key and a secret value.
[0103] The sorting module 502 is configured to sort the plurality of encrypted data according to a preset encrypted key sorting rule to obtain an encrypted data sequence.
[0104] The segmentation module 504 is configured to determine a plurality of segmentation sequences according to the encrypted data sequence and a preset segmentation rule.
[0105] The secret access address determination module 506 is configured to determine the secret access address of each segment sequence, and store a first correspondence between the segment sequence and the secret access address.
[0106] The receiving module 508 is configured to receive a range of secret keys to be queried sent by other terminals.
[0107] The first query module 510 is configured to determine, based on the range of the secret key to be queried, a secret access address range corresponding to the range of the secret key to be queried.
[0108] The second query module 512 is configured to obtain a query result according to the secret access address range and the first corresponding relationship; and return the query result to the other terminal.
[0109] Optionally, the segmentation module 504 is specifically configured to determine the quantity of secret data in each segmentation sequence in a preset segmentation rule; and segment the secret data sequence according to the quantity and the secret key of the secret data in the secret data sequence to obtain a plurality of segmentation sequences.
[0110] Optionally, the apparatus further comprises: a second correspondence determination module 514, configured to determine a second correspondence between the secret access address and the secret value of the secret data in the segment sequence.
[0111] Optionally, the apparatus further includes: a third query module 516, configured to determine, based on the second correspondence and the confidential state access address range, a confidential state value of the confidential state data in the confidential state access address range as a query result.
[0112] Optionally, the second query module 512 is specifically used to determine the number of segmented sequences in the secret access address range based on the secret access address range and the first corresponding relationship; determine the number of secret data in the secret access address range based on the number of segmented sequences in the secret access address range and the preset segmentation rule; add noise to the number of secret data in the secret access address range to obtain the number of disturbed secret data, wherein the number of disturbed secret data is greater than the number of secret data in the secret access address range; and obtain the secret value of the secret data of the number of disturbed secret data based on the number of disturbed secret data and the secret access address range as a query result.
[0113] Optionally, the second query module 512 is specifically used to determine the confidential state value of the confidential state data in the confidential state access address range according to the second corresponding relationship and the confidential state access address range, as the first query result; determine the difference between the number of confidential state data after the disturbance and the number of confidential state data in the confidential state access address range; obtain the confidential state value of the confidential state data in the segmented sequence except the confidential state access address range, as the second query result, and the number of confidential state values of the confidential state data in the second query result is the difference; and obtain the final query result based on the first query result and the second query result.
[0114] Optionally, the second query module 512 is specifically used to determine the segment sequence corresponding to the confidential access address range based on the confidential access address range and the first corresponding relationship, and obtain a result segment sequence; based on the result segment sequence, determine the confidential value of the confidential data in the result segment sequence as the query result.
[0115] This specification also provides a computer-readable storage medium, which stores a computer program. The computer program can be used to execute the confidential data query method provided in Figure 1 above.
[0116] This specification also provides a structural diagram of the electronic device shown in Figure 6. As shown in Figure 6, at the hardware level, the unmanned driving device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the confidential data query method described in Figure 1 above. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0117] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures like diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.
[0118] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.
[0119] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0120] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0121] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0122] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0123] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0125] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0126] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0127] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0128] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0129] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Thus, this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0130] This specification may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media, including storage devices.
[0131] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0132] The foregoing is merely an embodiment of the present invention and is not intended to limit the present invention. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention are intended to be included within the scope of the claims of this application.
Claims
1. A method for querying secret data, the method being applied to a terminal, the method comprising: Acquire a number of secret data, wherein the secret data includes a secret key and a secret value; Sorting the plurality of secret data according to a preset secret key sorting rule to obtain a secret data sequence; Determine a plurality of segmentation sequences according to the encrypted data sequence and a preset segmentation rule; For each segment sequence, determine a secret access address of the segment sequence; and store a first correspondence between the segment sequence and the secret access address; Receive the range of secret keys to be queried sent by other terminals; Determine, according to the range of the secret keys to be queried, a secret access address range corresponding to the range of the secret keys to be queried; Obtain a query result according to the secret access address range and the first corresponding relationship; and return the query result to the other terminal.
2. The method according to claim 1, determining a plurality of segmentation sequences according to the secret data sequence and a preset segmentation rule, specifically comprising: Determine the amount of secret data in each segment sequence in a preset segmentation rule; According to the quantity and the secret key of the secret data in the secret data sequence, the secret data sequence is segmented to obtain a plurality of segment sequences.
3. The method according to claim 1, after storing the first correspondence between the segment sequence and the secret access address, the method further comprises: A second corresponding relationship between the secret access address and the secret value of the secret data in the segment sequence is determined.
4. The method of claim 3, further comprising: According to the second corresponding relationship and the secret state access address range, the secret state value of the secret state data in the secret state access address range is determined as a query result.
5. The method according to claim 3, obtaining a query result according to the secret access address range and the first corresponding relationship, specifically comprising: Determining the number of segment sequences in the secret access address range according to the secret access address range and the first corresponding relationship; Determining the amount of secret data in the secret access address range according to the amount of segment sequences in the secret access address range and the preset segmentation rule; Add noise to the number of secret data in the secret access address range to obtain the number of disturbed secret data, wherein the number of disturbed secret data is greater than the number of secret data in the secret access address range. quantity; According to the amount of the disturbed secret state data and the secret state access address range, the secret state value of the secret state data of the amount of the disturbed secret state data is obtained as a query result.
6. The method according to claim 5, obtaining the secret state value of the secret state data of the number of secret state data after the disturbance as the query result according to the number of secret state data after the disturbance and the secret state access address range, specifically comprising: According to the second corresponding relationship and the secret state access address range, determining the secret state value of the secret state data in the secret state access address range as the first query result; Determine the difference between the amount of the disturbed secret state data and the amount of the secret state data in the secret state access address range; Obtaining the secret state values of the secret state data in the segment sequence except the secret state access address range as the second query result, wherein the number of the secret state values of the secret state data in the second query result is the difference; A final query result is obtained according to the first query result and the second query result.
7. The method according to claim 1, obtaining a query result according to the secret access address range and the first corresponding relationship, specifically comprising: Determine the segment sequence corresponding to the secret access address range according to the secret access address range and the first corresponding relationship, and obtain a result segment sequence; According to the result segment sequence, the secret state value of the secret state data in the result segment sequence is determined as the query result.
8. A device for querying confidential data, the device being applied to a terminal, the device comprising: A secret data acquisition module, used to acquire a number of secret data, wherein the secret data includes a secret key and a secret value; A sorting module, used to sort the plurality of secret data according to a preset secret key sorting rule to obtain a secret data sequence; A segmentation module, used to determine a plurality of segmentation sequences according to the encrypted data sequence and a preset segmentation rule; A secret access address determination module, used to determine the secret access address of each segment sequence; and store a first corresponding relationship between the segment sequence and the secret access address; A receiving module, used for receiving a range of secret keys to be queried sent by other terminals; A first query module, configured to determine, according to the range of the secret state keys to be queried, a secret state access address range corresponding to the range of the secret state keys to be queried; The second query module is used to obtain a query result according to the secret access address range and the first corresponding relationship. and returning the query result to the other terminal.
9. In the device as described in claim 8, the segmentation module is specifically used to determine the number of secret data in each segmentation sequence in a preset segmentation rule; segment the secret data sequence according to the number and the secret key of the secret data in the secret data sequence to obtain a plurality of segmentation sequences.
10. The device of claim 8, further comprising: The second correspondence determination module is used to determine the second correspondence between the secret access address and the secret value of the secret data in the segment sequence.
11. The apparatus of claim 10, further comprising: The third query module is used to determine the confidentiality value of the confidentiality data in the confidentiality access address range according to the second corresponding relationship and the confidentiality access address range as a query result.
12. The device according to claim 10, wherein the second query module is specifically used to determine the number of segment sequences in the secret access address range according to the secret access address range and the first corresponding relationship; determine the number of secret data in the secret access address range according to the number of segment sequences in the secret access address range and the preset segmentation rule; add noise to the number of secret data in the secret access address range to obtain the number of disturbed secret data, wherein, The amount of the disturbed secret data is greater than the amount of the secret data in the secret access address range; according to the amount of the disturbed secret data and the secret access address range, the secret value of the secret data of the amount of the disturbed secret data is obtained as the query result.
13. The device according to claim 12, wherein the second query module is specifically configured to determine, according to the second corresponding relationship and the secret state access address range, a secret state value of the secret state data in the secret state access address range as the first query result; Determine the difference between the amount of the disturbed secret state data and the amount of the secret state data in the secret state access address range; obtain the secret state values of the secret state data in the segment sequence except the secret state access address range as the second query result, the amount of the secret state values of the secret state data in the second query result being the difference; A final query result is obtained according to the first query result and the second query result.
14. In the device as described in claim 8, the second query module is specifically used to determine the segment sequence corresponding to the confidential access address range according to the confidential access address range and the first corresponding relationship, and obtain a result segment sequence; according to the result segment sequence, determine the confidential value of the confidential data in the result segment sequence as a query result.
15. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 7.
16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the program.
Citation Information
Patent Citations
Data storage and query methods and apparatuses, electronic device and readable storage medium
CN108629196A
Statistical method and device based on secret sharing and storage medium
CN115134078A
Full-secret-state data processing method and device, equipment and medium
CN115587382A
Data query method, device and equipment based on secret state range index
CN116166693A
Cipher state data query method and device, storage medium and electronic equipment
CN117453969A