Data query method and device, equipment and storage medium
By decrypting and mapping the query identifier, the original character string is obtained to query terminal data, the problem of data leakage risk in the prior art is solved and a secure terminal data query is achieved.
Patent Information
- Application Number
- CN202310632090.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2024-12-03
AI Technical Summary
The prior art cannot realize the user's terminal data query while ensuring that the data is not leaked, especially when external users need to query data based on the terminal's hash value, there is a risk of data leakage.
The query identifier is decrypted and mapped through the preset character mapping relationship to obtain the original character string, thereby determining the terminal to be queried and obtaining its data, avoiding direct use of the Hash value for querying, and reducing the risk of data leakage.
It realizes that users can effectively query terminal data without leaking data, enhancing data security.
Smart Images

Figure CN119066238A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a data query method, device, equipment and storage medium. Background Art
[0002] At present, Hash is often used to identify a characteristic value in business. For example, in the security field, a Hash value can be used to represent a unique machine terminal, and various types of data can be associated through this terminal code, so that the behavior of a certain terminal can be globally traced and its data track can be found.
[0003] Although hash values are generally used as tags for internal data, when providing services or products to external users, external users often need to query terminal data based on the hash value of the terminal. If the hash value is exposed to the outside, there is a risk of data leakage due to malicious use.
[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present invention is to provide a data query method, device, equipment and storage medium, aiming to solve the technical problem in the prior art that it is impossible to enable users to query terminal data while ensuring that data is not leaked.
[0006] To achieve the above object, the present invention provides a data query method, which comprises the following steps:
[0007] When receiving a terminal data query request sent by a user, obtaining a query identifier carried in the terminal data query request, where the query identifier is used to identify the terminal for which the user needs to query data;
[0008] Decrypt and map the query identifier according to a preset character mapping relationship to obtain an original character string corresponding to the query identifier, wherein the preset character mapping relationship stores a correspondence between a mapping character and a target character;
[0009] A terminal to be queried is determined based on the original character string, and terminal data corresponding to the terminal to be queried is acquired through the original character string.
[0010] Optionally, before the step of obtaining the query identifier carried in the terminal data query request when receiving the terminal data query request sent by the user, the method further includes:
[0011] Determining a correspondence between a mapping character and a target character, and establishing a preset character mapping relationship according to the correspondence;
[0012] Encrypting and mapping the identification string corresponding to each terminal according to the preset character mapping relationship to obtain the encrypted target identification string corresponding to each terminal;
[0013] The target identification character string is output to a user, so that the user generates a terminal data query request based on the target identification character string.
[0014] Optionally, the step of performing encryption mapping on the identification string corresponding to each terminal according to the preset character mapping relationship to obtain the encrypted target identification string corresponding to each terminal includes:
[0015] Encrypting and mapping the identification string corresponding to each terminal according to the preset character mapping relationship to obtain an encrypted identification string;
[0016] Determining the target character in the encrypted identification string according to a preset encryption method;
[0017] The encrypted identification character strings are concatenated based on the target characters to obtain encrypted target identification character strings corresponding to the terminals.
[0018] Optionally, before the step of decrypting and mapping the query identifier according to a preset character mapping relationship to obtain an original character string corresponding to the query identifier, the step further includes:
[0019] Obtaining the number of character digits corresponding to the character string in the query identifier, and determining the query mode corresponding to the query identifier according to the number of character digits;
[0020] Correspondingly, the step of decrypting and mapping the query identifier according to the preset character mapping relationship to obtain the original character string corresponding to the query identifier includes:
[0021] The query identifier is decrypted and mapped based on the query mode and a preset character mapping relationship to obtain an original character string corresponding to the query identifier.
[0022] Optionally, the query method includes: indirect query; accordingly, the step of decrypting and mapping the query identifier based on the query method and a preset character mapping relationship to obtain an original character string corresponding to the query identifier includes:
[0023] When the query mode is the indirect query, the target identification character string is deconcatenated to obtain an original identification character string corresponding to the query identification;
[0024] The original identification character string is decrypted and mapped according to a preset character mapping relationship to obtain the original character string corresponding to the query identification.
[0025] Optionally, before the step of concatenating the encrypted identification character strings based on the target characters to obtain the encrypted target identification character strings corresponding to the terminals, the step further includes:
[0026] Determine the to-be-joined position corresponding to the encrypted identification character string according to the preset encryption method;
[0027] splicing the target characters to the positions to be spliced to obtain encrypted target identification character strings corresponding to the terminals;
[0028] Correspondingly, when the query mode is the indirect query, the step of performing deconcatenation processing on the target identification string to obtain the original identification string corresponding to the query identification includes:
[0029] When the query mode is the indirect query, the target identification character string is de-spliced based on the position to be spliced to obtain the original identification character string corresponding to the query identification.
[0030] Optionally, the step of concatenating the encrypted identification character strings based on the target characters to obtain the encrypted target identification character strings corresponding to the terminals includes:
[0031] Determine the position to be spliced and the number of characters to be spliced corresponding to the encrypted identification character string according to the preset encryption method;
[0032] Splicing the target characters of the number of characters to be spliced to the positions to be spliced to obtain encrypted target identification character strings corresponding to the terminals;
[0033] Correspondingly, when the query mode is the indirect query, the step of performing deconcatenation processing on the target identification string to obtain the original identification string corresponding to the query identification includes:
[0034] When the query mode is the indirect query, the target identification character string is de-spliced based on the position to be spliced and the number of characters to be spliced to obtain an original identification character string corresponding to the query identification.
[0035] In addition, to achieve the above objectives, the present invention also proposes a data query device, which includes: a memory, a processor, and a data query program stored in the memory and executable on the processor, wherein the data query program is configured to implement the steps of the data query method described above.
[0036] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a data query program is stored, and when the data query program is executed by a processor, the steps of the data query method described above are implemented.
[0037] In addition, to achieve the above-mentioned purpose, the present invention also proposes a data query device, which includes: a query identification acquisition module, a string decryption module and a terminal data acquisition module;
[0038] The query identifier acquisition module is used to acquire the query identifier carried in the terminal data query request when receiving the terminal data query request sent by the user, wherein the query identifier is used to represent the terminal for which the user needs to perform data query;
[0039] The string decryption module is used to decrypt and map the query identifier according to a preset character mapping relationship to obtain an original string corresponding to the query identifier, wherein the preset character mapping relationship stores a correspondence between a mapping character and a target character;
[0040] The terminal data acquisition module is used to determine the terminal to be queried based on the original character string, and acquire the terminal data corresponding to the terminal to be queried through the original character string.
[0041] The present invention discloses that when a terminal data query request sent by a user is received, a query identifier carried in the terminal data query request is obtained, the query identifier is used to represent a terminal for which the user needs to perform data query; the query identifier is decrypted and mapped according to a preset character mapping relationship to obtain an original character string corresponding to the query identifier, the preset character mapping relationship stores a correspondence between a mapping character and a target character; a terminal to be queried is determined based on the original character string, and terminal data corresponding to the terminal to be queried is obtained through the original character string; because the present invention decrypts and maps the query identifier carried in the terminal data query request sent by the user according to the preset character mapping relationship, obtains the original character string corresponding to the query identifier, and obtains the terminal data corresponding to the terminal to be queried through the original character string, thereby solving the technical problem in the prior art that the user cannot perform terminal data query while ensuring that data is not leaked. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of the structure of a data query device in a hardware operating environment involved in an embodiment of the present invention;
[0043] Figure 2 This is a flow chart of a first embodiment of a data query method of the present invention;
[0044] Figure 3 This is a flow chart of a second embodiment of a data query method of the present invention;
[0045] Figure 4 This is a flow chart of a third embodiment of a data query method of the present invention;
[0046] Figure 5 This is a schematic diagram of the process of terminal data query in the third embodiment of the data query method of the present invention;
[0047] Figure 6 It is a structural block diagram of the first embodiment of the data query device of the present invention;
[0048] Figure 7 It is a structural block diagram of the second embodiment of the data query device of the present invention.
[0049] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0051] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the data query device structure of the hardware operating environment involved in the embodiment of the present invention.
[0052] like Figure 1 As shown, the data query device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0053] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the data query device, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0054] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a data query program.
[0055] exist Figure 1 In the data query device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the data query device of the present invention can be set in the data query device, and the data query device calls the data query program stored in the memory 1005 through the processor 1001, and executes the data query method provided by the embodiment of the present invention.
[0056] The embodiment of the present invention provides a data query method, referring to Figure 2 , Figure 2 Schematic diagram of the flow of the first embodiment of the data query method of the present invention.
[0057] In this embodiment, the data query method includes the following steps:
[0058] Step S10: upon receiving a terminal data query request sent by a user, obtaining a query identifier carried in the terminal data query request, wherein the query identifier is used to identify the terminal for which the user needs to query data.
[0059] It should be noted that the execution subject of the method of this embodiment can be a data query device that queries the terminal data of the machine terminal, or other data query systems that can achieve the same or similar functions and include the data query device. Here, the data query method provided in this embodiment and the following embodiments is specifically described with a data query system (hereinafter referred to as the system).
[0060] It should be understood that the above terminal data query request may be a query request sent by a user to the system when the user needs to query terminal data.
[0061] It is understandable that the above query identifier can be a unique identifier corresponding to each terminal, and this embodiment does not limit the specific identifier type. In practical applications, the query identifier can be a 32-bit hash value corresponding to the terminal, or other identification codes with the same or similar functions as the hash value, and this embodiment does not limit this.
[0062] In a specific implementation, if a user needs to query the terminal data of a certain terminal, a terminal data query request corresponding to the terminal can be generated according to the unique identifier corresponding to the terminal, and the terminal data query request is sent to the system, wherein the terminal data query request carries the query identifier of the terminal for which the user needs to query data. After receiving the terminal data query request, the system can obtain the query identifier carried in the terminal data query request.
[0063] Step S20: decrypting and mapping the query identifier according to a preset character mapping relationship to obtain an original character string corresponding to the query identifier, wherein the preset character mapping relationship stores a correspondence between a mapping character and a target character.
[0064] It should be noted that the above-mentioned preset character mapping relationship may be a mapping relationship between a character string in a preset query identifier and a corresponding original character string.
[0065] It is understandable that the original string can be a string representing the terminal to be queried corresponding to the terminal to be queried. In practical applications, the string in the query identifier can be mapped according to a preset character mapping relationship to obtain the original string corresponding to the query identifier, that is, the query identifier is decrypted and mapped.
[0066] It should be understood that the above-mentioned mapping characters and target characters can be any characters from 0 to 9 and a to f.
[0067] In a specific implementation, the mapping relationship between the mapping character and the target character can be predefined in this embodiment, and a preset character mapping relationship can be established based on the mapping relationship between the mapping character and the target character. When a user performs a terminal data query, the query identifier carried in the terminal data query request input by the user can be decrypted and mapped according to the preset character mapping relationship to obtain the original character string corresponding to the decrypted query identifier.
[0068] Step S30: determining a terminal to be queried based on the original character string, and obtaining terminal data corresponding to the terminal to be queried through the original character string.
[0069] It is understandable that the terminal to be queried may be a terminal for which the user needs to query terminal data. After obtaining the original string of the query identifier corresponding to the terminal, the system of this embodiment can determine the terminal to be queried for which the user needs to query data through the original string, and obtain the terminal data corresponding to the terminal to be queried through the original string.
[0070] In a specific implementation, in this embodiment, various types of terminal data can be associated through the terminal code corresponding to the terminal. In this embodiment, the terminal code corresponding to the terminal to be queried can be the above-mentioned original string. Therefore, after obtaining the original string corresponding to the terminal, the terminal corresponding to the original string can be determined according to the original string, that is, the above-mentioned terminal to be queried. Therefore, the behavior of the terminal to be queried can be globally traced according to the original string, and its trajectory data can be found, and the terminal data corresponding to the terminal to be queried can be fed back to the user to enable the user to query the terminal data of the terminal to be queried. In addition, since the user does not directly query through the original value of the terminal code corresponding to the terminal when querying the terminal data, but queries according to the query identifier converted from the string obtained after encrypting the terminal code, it will not cause the leakage of terminal data.
[0071] The present embodiment discloses that when a terminal data query request sent by a user is received, a query identifier carried in the terminal data query request is obtained, the query identifier is used to represent a terminal for which the user needs to perform data query; the query identifier is decrypted and mapped according to a preset character mapping relationship to obtain an original character string corresponding to the query identifier, the preset character mapping relationship stores a correspondence between a mapping character and a target character; a terminal to be queried is determined based on the original character string, and terminal data corresponding to the terminal to be queried is obtained through the original character string; because the present embodiment decrypts and maps the query identifier carried in the terminal data query request sent by the user according to the preset character mapping relationship to obtain the original character string corresponding to the query identifier, and the terminal data corresponding to the terminal to be queried is obtained through the original character string, thereby solving the technical problem in the prior art that the user cannot perform terminal data query while ensuring that data is not leaked.
[0072] refer to Figure 3 , Figure 3 Schematic diagram of the flow chart of the second embodiment of the data query method of the present invention.
[0073] Based on the first embodiment above, in order to encrypt the terminal identifier to prevent data leakage, in this embodiment, before step S10, the method further includes:
[0074] Step S01: determining a correspondence between a mapping character and a target character, and establishing a preset character mapping relationship according to the correspondence.
[0075] It should be noted that the above mapping characters and target characters can be characters from 0 to 9 and a to f, and the mapping relationships corresponding to the 16 characters are defined, for example, mapping character 0 can be mapped to target character a, mapping character 1 can be mapped to target character f, mapping character 2 can be mapped to d, etc. This embodiment does not limit the specific mapping relationship. After defining the mapping relationship of the 16 characters, a preset character mapping relationship can be established according to the mapping relationship of the 16 characters.
[0076] Step S02: Encrypt and map the identification character string corresponding to each terminal according to the preset character mapping relationship to obtain the encrypted target identification character string corresponding to each terminal.
[0077] It should be understood that the above identification string can be a unique string for the user to identify each terminal. In practical applications, the unique identification string corresponding to each terminal can be associated with various types of terminal data, so that the terminal data corresponding to each terminal can be queried according to the identification string corresponding to each terminal.
[0078] It can be understood that the above-mentioned target identification character string may be an encrypted character string of each terminal obtained by encrypting the identification character string corresponding to each terminal according to a preset character mapping relationship.
[0079] Furthermore, in actual applications, the above-mentioned users may include external users and internal users. Since internal users can obtain the original terminal code of each terminal through the company's internal channels, an erroneous decryption mapping may occur in the common search function between internal and external users, resulting in failure to query the correct terminal data. In order to avoid this situation, the step S02 may specifically include: encrypting and mapping the identification string corresponding to each terminal according to the preset character mapping relationship to obtain an encrypted identification string; determining the target character in the encrypted identification string according to a preset encryption method; and concatenating the encrypted identification string based on the target character to obtain the encrypted target identification string corresponding to each terminal.
[0080] It should be understood that the above-mentioned preset encryption method may be a method of adding characters to the encrypted identification character string obtained after encrypting the identification character string.
[0081] It is understandable that the target character may be any character in the encrypted identification string, such as the last character in the encrypted identification string, or the first character in the encrypted identification string, and this embodiment does not impose any limitation on this.
[0082] In a specific implementation, if the identification string corresponding to each terminal is a 32-bit hash value, the encrypted identification string can be obtained by encrypting the identification string according to a preset character mapping relationship, wherein the encrypted identification string is a 32-bit encrypted string. At this time, in order to distinguish the 32-bit encrypted string from the 32-bit hash value corresponding to each terminal, a string can be arbitrarily selected from the encrypted identification string as the target character, and the target character can be concatenated into the encrypted identification string to obtain the encrypted target identification string corresponding to each terminal. At this time, the target identification string is a 33-bit encrypted string, so that the encrypted target identification string corresponding to each terminal can be distinguished from its original identification string by the number of character bits.
[0083] Step S03: outputting the target identification character string to the user, so that the user generates a terminal data query request based on the target identification character string.
[0084] In a specific implementation, the encrypted target identification string corresponding to each terminal can be output to the user. When the user needs to query terminal data, the user can input the encrypted identification string corresponding to the terminal whose data needs to be queried into the search bar of the search platform to generate a terminal data query request carrying the target identification string, so that the system performs a terminal data query after receiving the terminal data query request.
[0085] This embodiment establishes a preset character mapping relationship based on the correspondence between the mapping characters and the target characters, encrypts the identification string corresponding to each terminal according to the preset character mapping relationship, and then outputs the encrypted target identification string corresponding to each terminal to the user, so that the user can generate a terminal data query request based on the target identification string to query the data, thereby ensuring that the data is not leaked while enabling the user to query the data.
[0086] refer to Figure 4 , Figure 4 Schematic diagram of the flow of the third embodiment of the data query method of the present invention.
[0087] Based on the above embodiments, in this embodiment, before step S20, the method further includes:
[0088] Step S201: obtaining the number of character digits corresponding to the character string in the query identifier, and determining the query mode corresponding to the query identifier according to the number of character digits.
[0089] It should be noted that the above query method can be a method for querying the terminal data corresponding to the terminal. The query method may include: direct query and indirect query, wherein the direct query can be to query the terminal data corresponding to the terminal directly according to the query identifier corresponding to the terminal; the indirect query can be to query the terminal data corresponding to the terminal after decrypting and mapping the query identifier corresponding to the terminal.
[0090] In a specific implementation, the identification string corresponding to each terminal in this embodiment is originally composed of 32 characters, but the character string in the query identifier carried in the terminal data query request sent by the user may be obtained by encrypting the identification string corresponding to the terminal, or it may be the original identification string of the terminal. In this embodiment, in order to distinguish the original identification string and the encrypted identification string of the terminal, the original identification string corresponding to each terminal can be encrypted into a 33-bit character string. Since the query methods corresponding to the terminal data query through the original identification string of the terminal and the encrypted identification string are different, when performing a terminal data query on the terminal to be queried, it is first necessary to determine the number of character digits corresponding to the characters in the query identifier, and determine the query method corresponding to the query identifier according to the number of character digits, so as to perform a terminal data query according to the corresponding query method, thereby improving the accuracy of the terminal data query.
[0091] Accordingly, the step S20 may include:
[0092] Step S20': decrypt and map the query identifier based on the query mode and a preset character mapping relationship to obtain an original character string corresponding to the query identifier.
[0093] In a specific implementation, if the query method corresponding to the query identifier is direct query, the character string in the query identifier can be determined as the original character string; if the query method corresponding to the query identifier is indirect query, the character string in the query identifier can be decrypted and mapped according to a preset character mapping relationship to obtain the original character string corresponding to the character string in the query identifier.
[0094] Further, the query method includes: indirect query; accordingly, the step S20' may include: when the query method is the indirect query, deconcatenating the target identification string to obtain the original identification string corresponding to the query identification; decrypting and mapping the original identification string according to a preset character mapping relationship to obtain the original string corresponding to the query identification.
[0095] It should be understood that the above de-splicing process can be a process for removing the target characters spliced in the target identification string. In practical applications, if the query method corresponding to the query identifier is an indirect query, it means that the encrypted target identification string corresponding to each terminal has been pre-spliced. At this time, the spliced characters in the target identification string can be removed by de-splicing to obtain the original identification string, and then the original identification string is decrypted and mapped according to the preset character mapping relationship to obtain the original string corresponding to the query identifier, so that the terminal data of the terminal to be queried can be queried through the original string.
[0096] Furthermore, before the step of splicing the encrypted identification string based on the target character to obtain the encrypted target identification string corresponding to each terminal, it also includes: determining the position to be spliced corresponding to the encrypted identification string according to the preset encryption method; splicing the target character to the position to be spliced to obtain the encrypted target identification string corresponding to each terminal; accordingly, when the query method is the indirect query, the step of de-splicing the target identification string to obtain the original identification string corresponding to the query identification includes: when the query method is the indirect query, de-splicing the target identification string based on the position to be spliced to obtain the original identification string corresponding to the query identification.
[0097] It should be noted that the above-mentioned position to be spliced can be the position where the target character is spliced into the encrypted identification string. In practical applications, the target character can be spliced into the position to be spliced corresponding to the encrypted identification string, and after the splicing is completed, the encrypted target identification string corresponding to each terminal is obtained, so that when the terminal data is queried for the terminal to be queried, the target character spliced in the target identification string can be removed according to the position to be spliced to obtain the original identification string corresponding to the query identification.
[0098] Furthermore, the step of performing splicing processing on the encrypted identification string based on the target characters to obtain the encrypted target identification string corresponding to each terminal includes: determining the position to be spliced and the number of characters to be spliced corresponding to the encrypted identification string according to the preset encryption method; splicing the target characters of the number of characters to be spliced to the position to be spliced to obtain the encrypted target identification string corresponding to each terminal; correspondingly, the step of performing de-splicing processing on the target identification string to obtain the original identification string corresponding to the query identification when the query method is the indirect query includes: performing de-splicing processing on the target identification string based on the position to be spliced and the number of characters to be spliced to obtain the original identification string corresponding to the query identification when the query method is the indirect query.
[0099] It should be understood that the number of characters to be spliced can be the number of target characters spliced in the encrypted identification string. The number of characters to be spliced can be one, two, or several, and the present embodiment does not limit the specific number. In practical applications, several target characters can be spliced to the positions to be spliced corresponding to the encrypted identification string, and after the splicing is completed, the encrypted target identification string corresponding to each terminal is obtained, so that when the terminal to be queried performs terminal data query, the several characters spliced in the target identification string can be removed according to the positions to be spliced to obtain the original identification string corresponding to the query identification.
[0100] It can be understood that in this embodiment, the positions to be spliced and the number of characters to be spliced corresponding to the encrypted identification strings of each terminal can be set according to actual needs, thereby improving the flexibility of encrypting and decrypting the identification strings corresponding to the terminals.
[0101] Furthermore, the query method also includes: direct query; correspondingly, after step S10, the method also includes: when the query method is the direct query, determining the terminal to be queried based on the query identifier, and obtaining terminal data corresponding to the terminal to be queried through the query identifier.
[0102] It can be understood that when the query method is direct query, the string in the query identifier is the original string of the terminal without encryption mapping. At this time, the query terminal can be directly determined by the string in the query identifier, and the terminal data corresponding to the terminal to be queried can be queried by the string in the query identifier.
[0103] Furthermore, in order to prompt the user when the terminal data query fails, after step S10, the method also includes: when the query mode is the direct query, determining whether there is a terminal to be queried corresponding to the query identifier; if not, outputting a prompt message of query failure to the user to prompt the user to enter the correct query identifier for terminal data query.
[0104] It should be noted that although the target identification string obtained after encryption mapping of the identification string corresponding to each terminal is different from the original identification string of the terminal in terms of the number of characters, the user may still have the problem of missing the string input when querying the terminal data, resulting in the input target identification string being the same as the original identification string of the terminal in terms of the number of characters. At this time, the system will determine the query method corresponding to the query identifier as direct query, and search for the terminal to be queried based on the wrong identification string. If the system finds that there is no terminal to be queried corresponding to the wrong identification string, it can output a prompt message of query failure to prompt the user to enter the correct query identifier to query the terminal data.
[0105] It should be understood that since the incorrect identification string entered by the user may also have a corresponding terminal, if there is a terminal to be queried corresponding to the query identifier, the query identifier is used to query whether there is terminal data corresponding to the terminal to be queried; if not, the prompt information is output to the user to prompt the user to enter the correct query identifier for terminal data query.
[0106] In the specific implementation, refer to Figure 5 , Figure 5 FIG. 1 is a flow chart of terminal data query in the third embodiment of the data query method of the present invention. Figure 5As shown, in the decryption query logic, when the system receives a terminal data query request sent by a user, it can obtain the Hash string of the user identification terminal carried in the terminal data query request, and obtain the number of character bits corresponding to the Hash string. If the number of character bits of the Hash string is N, it means that the Hash string is the original identification string of the terminal to be queried, and the corresponding query method is direct query, that is, the original string of the database is directly queried through the Hash value of the terminal to be queried to obtain the terminal data of the terminal to be queried. If the number of character bits in the Hash string is N+1 bits (or N+n bits), it means that the Hash string is the target identification string encrypted by the terminal to be queried, and the corresponding query method is indirect query, that is, the last character of the Hash value can be removed (at this time, it means that the position to be spliced corresponding to the encrypted identification string corresponding to the terminal is the last bit. In this embodiment, in addition to the last bit, it can also be the first bit, or any position in the string), and 16-bit character reverse mapping is performed according to the preset character mapping relationship to decrypt the Hash value, thereby obtaining an N-bit decoded Hash value, and the original string of the database is queried through the decoded Hash value to obtain the terminal data of the terminal to be queried. Before decrypting and mapping the string, the original identification string of the terminal needs to be encrypted, wherein the encryption display logic can be: first, the N-bit Hash string corresponding to each terminal is mapped to 16-bit characters according to the preset character mapping relationship to obtain an N-bit encrypted string. If the preset encryption method is to take the last bit of the encrypted string and append it to the last bit, then the last bit of the N-bit encrypted string can be appended to the last bit according to the encryption method, thereby obtaining an N+1-bit Hash string to realize the encryption of the original identification string of each terminal.
[0107] This embodiment determines the query mode corresponding to the query identifier according to the number of character digits corresponding to the string in the query identifier, and decrypts and maps the query identifier based on the query mode and the preset character mapping relationship to obtain the original string corresponding to the query identifier, thereby improving the accuracy of terminal data query. At the same time, the position to be spliced and the character data to be spliced corresponding to the encrypted identification string are determined according to the preset encryption method, and then the target characters of the number of characters to be spliced are spliced to the position to be spliced to obtain the encrypted target identification string corresponding to each terminal, and when the query mode is an indirect query, the target identification characters are de-spliced based on the position to be spliced and the number of characters to be spliced to obtain the original identification string corresponding to the query identifier, thereby improving the flexibility of encrypting and decrypting the identification string corresponding to the terminal.
[0108] In addition, an embodiment of the present invention further provides a storage medium, on which a data query program is stored. When the data query program is executed by a processor, the steps of the data query method described above are implemented.
[0109] Reference Figure 6 , Figure 6 It is a structural block diagram of the first embodiment of the data query device of the present invention.
[0110] like Figure 6 As shown, the data query device proposed in the embodiment of the present invention includes: a query identification acquisition module 601, a string decryption module 602 and a terminal data acquisition module 603;
[0111] The query identifier acquisition module 601 is used to acquire the query identifier carried in the terminal data query request when receiving the terminal data query request sent by the user, and the query identifier is used to represent the terminal for which the user needs to query data;
[0112] The string decryption module 602 is used to decrypt and map the query identifier according to a preset character mapping relationship to obtain an original string corresponding to the query identifier, wherein the preset character mapping relationship stores a correspondence between a mapping character and a target character;
[0113] The terminal data acquisition module 603 is used to determine the terminal to be queried based on the original character string, and acquire the terminal data corresponding to the terminal to be queried through the original character string.
[0114] The data query device of the present embodiment discloses that when receiving a terminal data query request sent by a user, a query identifier carried in the terminal data query request is obtained, the query identifier is used to represent the terminal for which the user needs to perform data query; the query identifier is decrypted and mapped according to a preset character mapping relationship to obtain an original character string corresponding to the query identifier, the preset character mapping relationship stores the correspondence between the mapping character and the target character; the terminal to be queried is determined based on the original character string, and the terminal data corresponding to the terminal to be queried is obtained through the original character string; because the present embodiment decrypts and maps the query identifier carried in the terminal data query request sent by the user according to the preset character mapping relationship, obtains the original character string corresponding to the query identifier, and obtains the terminal data corresponding to the terminal to be queried through the original character string, thereby solving the technical problem in the prior art that the user cannot perform terminal data query while ensuring that data is not leaked.
[0115] Based on the above-mentioned first embodiment of the data query device of the present invention, a second embodiment of the data query device of the present invention is proposed.
[0116] Reference Figure 7 , Figure 7 It is a structural block diagram of the second embodiment of the data query device of the present invention.
[0117] like Figure 7 As shown, in this embodiment, the data query device further includes: a string encryption module 600;
[0118] The string encryption module 600 is used to determine the correspondence between the mapping character and the target character, and establish a preset character mapping relationship based on the correspondence; the string encryption module 600 is also used to encrypt and map the identification string corresponding to each terminal according to the preset character mapping relationship to obtain the encrypted target identification string corresponding to each terminal; the string encryption module 600 is also used to output the target identification string to the user, so that the user generates a terminal data query request based on the target identification string.
[0119] Furthermore, the string encryption module 600 is also used to encrypt and map the identification string corresponding to each terminal according to the preset character mapping relationship to obtain an encrypted identification string; the string encryption module 600 is also used to determine the target character in the encrypted identification string according to a preset encryption method; the string encryption module 600 is also used to concatenate the encrypted identification string based on the target character to obtain the encrypted target identification string corresponding to each terminal.
[0120] This embodiment establishes a preset character mapping relationship based on the correspondence between the mapping characters and the target characters, encrypts the identification string corresponding to each terminal according to the preset character mapping relationship, and then outputs the encrypted target identification string corresponding to each terminal to the user, so that the user can generate a terminal data query request based on the target identification string to query the data, thereby ensuring that the data is not leaked while enabling the user to query the data.
[0121] Based on the above-mentioned device embodiments, a third embodiment of the data query device of the present invention is proposed.
[0122] In this embodiment, the string decryption module 602 is also used to obtain the number of character bits corresponding to the string in the query identifier, and determine the query method corresponding to the query identifier based on the number of character bits; the string decryption module 602 is also used to decrypt and map the query identifier based on the query method and a preset character mapping relationship to obtain the original string corresponding to the query identifier.
[0123] Furthermore, the query method includes: indirect query; accordingly, the string decryption module 602 is also used to deconcatenate the target identification string when the query method is the indirect query to obtain the original identification string corresponding to the query identification; the string decryption module 602 is also used to decrypt and map the original identification string according to a preset character mapping relationship to obtain the original string corresponding to the query identification.
[0124] Furthermore, the string encryption module 600 is also used to determine the position to be spliced corresponding to the encrypted identification string according to the preset encryption method; the string encryption module 600 is also used to splice the target character to the position to be spliced to obtain the encrypted target identification string corresponding to each terminal; the string decryption module 602 is also used to de-splice the target identification string based on the position to be spliced when the query method is the indirect query, so as to obtain the original identification string corresponding to the query identification.
[0125] Furthermore, the string encryption module 600 is also used to determine the position to be spliced and the number of characters to be spliced corresponding to the encrypted identification string according to the preset encryption method; the string encryption module 600 is also used to splice the target characters of the number of characters to be spliced to the position to be spliced to obtain the encrypted target identification string corresponding to each terminal; the string decryption module 602 is also used to de-splice the target identification string based on the position to be spliced and the number of characters to be spliced when the query method is the indirect query, so as to obtain the original identification string corresponding to the query identification.
[0126] Furthermore, the query method also includes: direct query; accordingly, the query identifier acquisition module 601 is also used to determine the terminal to be queried based on the query identifier when the query method is the direct query, and obtain the terminal data corresponding to the terminal to be queried through the query identifier.
[0127] This embodiment determines the query mode corresponding to the query identifier according to the number of character digits corresponding to the string in the query identifier, and decrypts and maps the query identifier based on the query mode and the preset character mapping relationship to obtain the original string corresponding to the query identifier, thereby improving the accuracy of terminal data query. At the same time, the position to be spliced and the character data to be spliced corresponding to the encrypted identification string are determined according to the preset encryption method, and then the target characters of the number of characters to be spliced are spliced to the position to be spliced to obtain the encrypted target identification string corresponding to each terminal, and when the query mode is an indirect query, the target identification characters are de-spliced based on the position to be spliced and the number of characters to be spliced to obtain the original identification string corresponding to the query identifier, thereby improving the flexibility of encrypting and decrypting the identification string corresponding to the terminal.
[0128] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0129] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0131] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
[0132] The present invention discloses A1, a data query method, the data query method comprising:
[0133] When receiving a terminal data query request sent by a user, obtaining a query identifier carried in the terminal data query request, where the query identifier is used to identify the terminal for which the user needs to query data;
[0134] Decrypt and map the query identifier according to a preset character mapping relationship to obtain an original character string corresponding to the query identifier, wherein the preset character mapping relationship stores a correspondence between a mapping character and a target character;
[0135] A terminal to be queried is determined based on the original character string, and terminal data corresponding to the terminal to be queried is acquired through the original character string.
[0136] A2. The data query method as described in A1, before the step of obtaining the query identifier carried in the terminal data query request when receiving the terminal data query request sent by the user, further comprising:
[0137] Determining a correspondence between a mapping character and a target character, and establishing a preset character mapping relationship according to the correspondence;
[0138] Encrypting and mapping the identification string corresponding to each terminal according to the preset character mapping relationship to obtain the encrypted target identification string corresponding to each terminal;
[0139] The target identification character string is output to a user, so that the user generates a terminal data query request based on the target identification character string.
[0140] A3. The data query method as described in A2, wherein the step of encrypting and mapping the identification string corresponding to each terminal according to the preset character mapping relationship to obtain the encrypted target identification string corresponding to each terminal comprises:
[0141] Encrypting and mapping the identification string corresponding to each terminal according to the preset character mapping relationship to obtain an encrypted identification string;
[0142] Determining the target character in the encrypted identification string according to a preset encryption method;
[0143] The encrypted identification character strings are concatenated based on the target characters to obtain encrypted target identification character strings corresponding to the terminals.
[0144] A4. The data query method as described in A3, before the step of decrypting and mapping the query identifier according to the preset character mapping relationship to obtain the original character string corresponding to the query identifier, further comprises:
[0145] Obtaining the number of character digits corresponding to the character string in the query identifier, and determining the query mode corresponding to the query identifier according to the number of character digits;
[0146] Correspondingly, the step of decrypting and mapping the query identifier according to the preset character mapping relationship to obtain the original character string corresponding to the query identifier includes:
[0147] The query identifier is decrypted and mapped based on the query mode and a preset character mapping relationship to obtain an original character string corresponding to the query identifier.
[0148] A5. The data query method as described in A4, wherein the query method includes: indirect query; accordingly, the step of decrypting and mapping the query identifier based on the query method and the preset character mapping relationship to obtain the original character string corresponding to the query identifier includes:
[0149] When the query mode is the indirect query, the target identification character string is deconcatenated to obtain an original identification character string corresponding to the query identification;
[0150] The original identification character string is decrypted and mapped according to a preset character mapping relationship to obtain the original character string corresponding to the query identification.
[0151] A6. The data query method as described in A5, before the step of concatenating the encrypted identification character string based on the target character to obtain the encrypted target identification character string corresponding to each terminal, further comprising:
[0152] Determine the to-be-joined position corresponding to the encrypted identification character string according to the preset encryption method;
[0153] splicing the target characters to the positions to be spliced to obtain encrypted target identification character strings corresponding to the terminals;
[0154] Correspondingly, when the query mode is the indirect query, the step of performing deconcatenation processing on the target identification string to obtain the original identification string corresponding to the query identification includes:
[0155] When the query mode is the indirect query, the target identification character string is de-spliced based on the position to be spliced to obtain the original identification character string corresponding to the query identification.
[0156] A7. In the data query method described in A5, the step of concatenating the encrypted identification character strings based on the target characters to obtain the encrypted target identification character strings corresponding to the terminals comprises:
[0157] Determine the position to be spliced and the number of characters to be spliced corresponding to the encrypted identification character string according to the preset encryption method;
[0158] Splicing the target characters of the number of characters to be spliced to the positions to be spliced to obtain encrypted target identification character strings corresponding to the terminals;
[0159] Correspondingly, when the query mode is the indirect query, the step of performing deconcatenation processing on the target identification string to obtain the original identification string corresponding to the query identification includes:
[0160] When the query mode is the indirect query, the target identification character string is de-spliced based on the position to be spliced and the number of characters to be spliced to obtain an original identification character string corresponding to the query identification.
[0161] A8. The data query method as described in A5, wherein the query mode further comprises: direct query; accordingly, after the step of obtaining the query identifier carried in the terminal data query request when receiving the terminal data query request sent by the user, the method further comprises:
[0162] When the query mode is the direct query, the terminal to be queried is determined based on the query identifier, and the terminal data corresponding to the terminal to be queried is acquired through the query identifier.
[0163] A9. The data query method as described in A8, after the step of obtaining the query identifier carried in the terminal data query request when receiving the terminal data query request sent by the user, further comprising:
[0164] When the query mode is the direct query, determining whether there is a terminal to be queried corresponding to the query identifier;
[0165] If it does not exist, a prompt message indicating that the query failed is output to the user to prompt the user to enter a correct query identifier to perform terminal data query.
[0166] A10. The data query method as described in A9, wherein when the query mode is the direct query, after the step of determining whether there is a terminal to be queried corresponding to the query identifier, the method further comprises:
[0167] If so, querying whether there is terminal data corresponding to the terminal to be queried through the query identifier;
[0168] If it does not exist, the prompt information is output to the user to prompt the user to enter a correct query identifier to perform terminal data query.
[0169] The present invention also discloses B11, a data query device, the device comprising: a memory, a processor, and a data query program stored in the memory and executable on the processor, the data query being configured to implement the steps of the data query method described above.
[0170] The present invention also discloses C12, a storage medium, on which a data query program is stored, and when the data query program is executed by a processor, the steps of the data query method described above are implemented.
[0171] The present invention also discloses D13, a data query device, which includes: a query identification acquisition module, a string decryption module and a terminal data acquisition module;
[0172] The query identifier acquisition module is used to acquire the query identifier carried in the terminal data query request when receiving the terminal data query request sent by the user, wherein the query identifier is used to represent the terminal for which the user needs to perform data query;
[0173] The string decryption module is used to decrypt and map the query identifier according to a preset character mapping relationship to obtain an original string corresponding to the query identifier, wherein the preset character mapping relationship stores a correspondence between a mapping character and a target character;
[0174] The terminal data acquisition module is used to determine the terminal to be queried based on the original character string, and acquire the terminal data corresponding to the terminal to be queried through the original character string.
[0175] D14. The data query device as described in D13, further comprising: a string encryption module;
[0176] The character string encryption module is used to determine the corresponding relationship between the mapping character and the target character, and establish a preset character mapping relationship according to the corresponding relationship;
[0177] The string encryption module is further used to encrypt and map the identification string corresponding to each terminal according to the preset character mapping relationship to obtain the encrypted target identification string corresponding to each terminal;
[0178] The character string encryption module is further used to output the target identification character string to the user, so that the user generates a terminal data query request based on the target identification character string.
[0179] D15. The data query device as described in D14, wherein the string encryption module is further used to encrypt and map the identification string corresponding to each terminal according to the preset character mapping relationship to obtain an encrypted identification string;
[0180] The character string encryption module is further used to determine the target character in the encrypted identification character string according to a preset encryption method;
[0181] The string encryption module is further used to perform concatenation processing on the encrypted identification string based on the target character to obtain the encrypted target identification string corresponding to each terminal.
[0182] D16, as described in D15, the string decryption module is further used to obtain the number of character digits corresponding to the string in the query identifier, and determine the query mode corresponding to the query identifier according to the number of character digits;
[0183] The string decryption module is further used to decrypt and map the query identifier based on the query mode and a preset character mapping relationship to obtain an original string corresponding to the query identifier.
[0184] D17, as described in D16, the data query device, the query mode includes: indirect query; correspondingly, the string decryption module is also used to deconcatenate the target identification string when the query mode is the indirect query, so as to obtain the original identification string corresponding to the query identification;
[0185] The string decryption module is further used to decrypt and map the original identification string according to a preset character mapping relationship to obtain the original string corresponding to the query identification.
[0186] D18, as described in D17, the data query device, the string encryption module is further used to determine the to-be-joined position corresponding to the encrypted identification string according to the preset encryption method;
[0187] The string encryption module is further used to splice the target character to the position to be spliced to obtain the encrypted target identification string corresponding to each terminal;
[0188] The string decryption module is further used to, when the query mode is the indirect query, de-join the target identification string based on the position to be joined, so as to obtain an original identification string corresponding to the query identification.
[0189] D19, as described in D17, the data query device, the string encryption module is further used to determine the position to be spliced and the number of characters to be spliced corresponding to the encrypted identification string according to the preset encryption method;
[0190] The character string encryption module is further used to splice the target characters of the number of characters to be spliced to the positions to be spliced, so as to obtain the encrypted target identification character strings corresponding to the terminals;
[0191] The string decryption module is further used to, when the query mode is the indirect query, de-join the target identification string based on the position to be joined and the number of characters to be joined, so as to obtain an original identification string corresponding to the query identification.
[0192] D20. In the data query device as described in D17, the query method further includes: direct query; correspondingly, the query identifier acquisition module is also used to determine the terminal to be queried based on the query identifier when the query method is the direct query, and obtain the terminal data corresponding to the terminal to be queried through the query identifier.
Claims
1. A data query method, characterized in that: The data query method comprises: When receiving a terminal data query request sent by a user, obtaining a query identifier carried in the terminal data query request, where the query identifier is used to identify the terminal for which the user needs to perform data query; Decrypt and map the query identifier according to a preset character mapping relationship to obtain an original character string corresponding to the query identifier, wherein the preset character mapping relationship stores a correspondence between a mapping character and a target character; A terminal to be queried is determined based on the original character string, and terminal data corresponding to the terminal to be queried is acquired through the original character string.
2. The data query method according to claim 1, characterized in that: Before the step of obtaining the query identifier carried in the terminal data query request when receiving the terminal data query request sent by the user, the method further includes: Determining a correspondence between a mapping character and a target character, and establishing a preset character mapping relationship according to the correspondence; Encrypting and mapping the identification string corresponding to each terminal according to the preset character mapping relationship to obtain the encrypted target identification string corresponding to each terminal; The target identification character string is output to a user, so that the user generates a terminal data query request based on the target identification character string.
3. The data query method according to claim 2, characterized in that: The step of performing encryption mapping on the identification string corresponding to each terminal according to the preset character mapping relationship to obtain the encrypted target identification string corresponding to each terminal includes: Encrypting and mapping the identification string corresponding to each terminal according to the preset character mapping relationship to obtain an encrypted identification string; Determining the target character in the encrypted identification string according to a preset encryption method; The encrypted identification character strings are concatenated based on the target characters to obtain encrypted target identification character strings corresponding to the terminals.
4. The data query method according to claim 3, characterized in that: Before the step of decrypting and mapping the query identifier according to the preset character mapping relationship to obtain the original character string corresponding to the query identifier, the step further includes: Obtaining the number of character digits corresponding to the character string in the query identifier, and determining the query mode corresponding to the query identifier according to the number of character digits; Correspondingly, the step of decrypting and mapping the query identifier according to the preset character mapping relationship to obtain the original character string corresponding to the query identifier includes: The query identifier is decrypted and mapped based on the query mode and a preset character mapping relationship to obtain an original character string corresponding to the query identifier.
5. The data query method according to claim 4, characterized in that: The query method includes: indirect query; accordingly, the step of decrypting and mapping the query identifier based on the query method and the preset character mapping relationship to obtain the original character string corresponding to the query identifier includes: When the query mode is the indirect query, the target identification character string is deconcatenated to obtain an original identification character string corresponding to the query identification; The original identification character string is decrypted and mapped according to a preset character mapping relationship to obtain the original character string corresponding to the query identification.
6. The data query method according to claim 5, characterized in that: Before the step of concatenating the encrypted identification character strings based on the target characters to obtain the encrypted target identification character strings corresponding to the terminals, the method further includes: Determine the to-be-joined position corresponding to the encrypted identification character string according to the preset encryption method; splicing the target characters to the positions to be spliced to obtain encrypted target identification character strings corresponding to the terminals; Correspondingly, when the query mode is the indirect query, the step of performing deconcatenation processing on the target identification string to obtain the original identification string corresponding to the query identification includes: When the query mode is the indirect query, the target identification character string is de-spliced based on the position to be spliced to obtain the original identification character string corresponding to the query identification.
7. The data query method according to claim 5, characterized in that: The step of concatenating the encrypted identification character strings based on the target characters to obtain the encrypted target identification character strings corresponding to the terminals includes: Determine the position to be spliced and the number of characters to be spliced corresponding to the encrypted identification character string according to the preset encryption method; Splicing the target characters of the number of characters to be spliced to the positions to be spliced to obtain encrypted target identification character strings corresponding to the terminals; Correspondingly, when the query mode is the indirect query, the step of performing deconcatenation processing on the target identification string to obtain the original identification string corresponding to the query identification includes: When the query mode is the indirect query, the target identification character string is de-spliced based on the position to be spliced and the number of characters to be spliced to obtain an original identification character string corresponding to the query identification.
8. A data query device, characterized in that: The device comprises: a memory, a processor, and a data query program stored in the memory and executable on the processor, wherein the data query is configured to implement the steps of the data query method according to any one of claims 1 to 7.
9. A storage medium, characterized in that: The storage medium stores a data query program, and when the data query program is executed by the processor, the steps of the data query method according to any one of claims 1 to 7 are implemented.
10. A data query device, characterized in that: The data query device comprises: a query identification acquisition module, a string decryption module and a terminal data acquisition module; The query identifier acquisition module is used to acquire the query identifier carried in the terminal data query request when receiving the terminal data query request sent by the user, wherein the query identifier is used to represent the terminal for which the user needs to perform data query; The string decryption module is used to decrypt and map the query identifier according to a preset character mapping relationship to obtain an original string corresponding to the query identifier, wherein the preset character mapping relationship stores a correspondence between a mapping character and a target character; The terminal data acquisition module is used to determine the terminal to be queried based on the original character string, and acquire the terminal data corresponding to the terminal to be queried through the original character string.
Citation Information
Patent Citations
Password storage method and device
CN108964903A
Data query method, device, equipment and system based on privacy information protection
CN110895611A
