Search

CN-121996692-A - Data searching method, device, electronic equipment and storage medium

CN121996692ACN 121996692 ACN121996692 ACN 121996692ACN-121996692-A

Abstract

The application provides a data searching method, a device, electronic equipment and a storage medium, wherein the method is applied to a computer and comprises the steps of receiving a data request instruction sent by a user, obtaining an input key value in the data request instruction, determining that the key value in the input key value is a second key value if the input key value does not contain the first key value, wherein the first key value is a key value directly corresponding to target data, searching a target associated key value according to the second key value, searching target data corresponding to the first key value in a database if the target associated key value contains the first key value, and feeding the target data back to the user. The method can reduce the storage space of the database.

Inventors

  • LI JINGUO
  • WANG CHUANGCHUANG
  • QIN YU
  • WANG YITIAN
  • ZHAO ZIFENG
  • ZHANG SHAOPENG
  • JI SHENGMING
  • WANG FAN

Assignees

  • 三六零数字安全科技集团有限公司

Dates

Publication Date
20260508
Application Date
20241106

Claims (10)

  1. 1. A method of data lookup, the method comprising: receiving a data request instruction sent by a user, and acquiring an input key value in the data request instruction; If the input key value does not contain the first key value, determining that the key value in the input key value is the second key value, wherein the first key value is the key value directly corresponding to the target data; Inquiring a target associated key value according to the second key value; If the target associated key value comprises the first key value, searching target data corresponding to the first key value in a database, and feeding the target data back to the user.
  2. 2. The method of claim 1, wherein the second key comprises at least one key, and wherein querying the target associated key based on the second key comprises: Determining any key value in the second key values as a third key value, and determining whether an associated key value containing the third key value exists in associated data; if yes, determining the associated key value as the target associated key value; And if the third key value does not exist, screening the third key value from the second key value, and returning to the step of determining any key value in the second key value as the third key value, and determining whether the associated key value containing the third key value exists in the associated data until a preset condition is met, wherein the preset condition is that the associated key value containing the third key value exists in the associated data or the number of the key values in the second key value is 0.
  3. 3. The method of claim 2, wherein after querying the target associated key value according to the second key value, further comprising: if the target associated key value does not contain the first key value, determining that the key value except the third key value in the target associated key value is a fourth key value, and determining the associated key value containing the fourth key value in the associated data; and updating the associated key value containing the fourth key value into the target associated key value.
  4. 4. The method according to claim 1, characterized in that the method is preceded by: determining a plurality of key values corresponding to the same data in the database; determining a first key value corresponding to the data in the plurality of key values; and establishing associated key values between a first key value corresponding to the data and other key values corresponding to the data, and generating the associated data.
  5. 5. The method of claim 4, wherein determining the first key value corresponding to the data from the plurality of key values comprises: and acquiring the length of each key value in a plurality of key values corresponding to the same data, and determining the key value with the minimum length as a first key value corresponding to the data.
  6. 6. The method of claim 4, wherein the creating the association data by creating an association key between a first key corresponding to the data and other keys corresponding to the data comprises: acquiring a first length of a first key value corresponding to the data and a second length of other key values corresponding to the data; If any one of the second lengths is smaller than the first length, determining that the key value corresponding to the smallest second length is a fifth key value; and constructing an associated key value between the fifth key value and the first key value, and constructing an associated key value between the fifth key value and a sixth key value, wherein the sixth key value is a key value except for the fifth key value and the first key value in the key values corresponding to the data, and the associated data is generated.
  7. 7. The method of claim 1, wherein after the obtaining the input key value in the data request instruction, further comprising: If the input key value comprises a first key value, searching target data corresponding to the first key value in the database, and feeding the target data back to the user.
  8. 8. A data lookup apparatus, the apparatus comprising: the receiving unit is used for receiving a data request instruction sent by a user and acquiring an input key value in the data request instruction; The acquisition unit is used for determining that the key value in the input key value is a second key value if the input key value does not contain a first key value, wherein the first key value is a key value directly corresponding to the target data; The inquiring unit is used for inquiring the target associated key value according to the second key value; and the searching unit is used for searching target data corresponding to the first key value in a database and feeding the target data back to the user if the target associated key value comprises the first key value.
  9. 9. An electronic device, the electronic device comprising: A memory for storing executable program code; Control means for invoking and running said executable program code from said memory to cause said electronic device to perform the method of any of claims 1-7.
  10. 10. A computer readable storage medium, characterized in that the computer readable storage medium stores computer program code which, when executed, implements the method of any of claims 1 to 7.

Description

Data searching method, device, electronic equipment and storage medium Technical Field The present application relates to the field of computers, and more particularly, to a data search method, apparatus, electronic device, and storage medium in the field of computers. Background Existing Key-Value pairs (key_value, KV) typically correspond to one data (Value) per Key (Key). In the storing process, the keys are required to be stored one by one so as to find out the corresponding Value through the input keys during inquiry. However, this one-to-one storage requires a large amount of storage space. Disclosure of Invention The application provides a data searching method, a data searching device, electronic equipment and a storage medium. The first aspect provides a data searching method, which comprises the steps of receiving a data request instruction sent by a user, obtaining input key values in the data request instruction, determining that the key values in the input key values are second key values if the input key values do not contain first key values, wherein the first key values are key values directly corresponding to target data, inquiring target associated key values according to the second key values, and searching target data corresponding to the first key values in a database if the target associated key values contain the first key values, and feeding the target data back to the user. In a second aspect, there is provided an apparatus for electronic device control, the apparatus comprising: the receiving unit is used for receiving a data request instruction sent by a user and acquiring an input key value in the data request instruction; The acquisition unit is used for determining that the key value in the input key value is a second key value if the input key value does not contain a first key value, wherein the first key value is a key value directly corresponding to the target data; The inquiring unit is used for inquiring the target associated key value according to the second key value; and the searching unit is used for searching target data corresponding to the first key value in the database and feeding the target data back to the user if the target associated key value comprises the first key value. In a third aspect, an electronic device is provided, comprising a memory for storing executable program code, and a processor for calling and running the executable program code from the memory, such that the electronic device performs the method of the first aspect or any one of the possible implementation manners of the first aspect. In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing computer program code which, when run on a computer, causes the computer to perform the method of the first aspect or any one of the possible implementations of the first aspect. In the embodiment of the application, when the input key value in the request instruction sent by the user does not contain the first key value, the key value contained in the input key value is determined to be the second key value, the target associated key value is queried according to the second key value, and further the target data queried by the data request is obtained through the first key value contained in the target associated key value. Drawings FIG. 1 is a schematic flow chart of a data searching method according to an embodiment of the present application; FIG. 2 is a schematic flow chart of a data searching method according to an embodiment of the present application; FIG. 3 is a schematic flow chart of a data searching method according to an embodiment of the present application; fig. 4 is a schematic view of a scenario of a data searching method according to an embodiment of the present application; fig. 5 is a schematic view of a scenario of a data searching method according to an embodiment of the present application; fig. 6 is a schematic structural diagram of a data searching device according to an embodiment of the present application; fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Detailed Description The technical scheme of the application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiment of the present application, unless otherwise indicated, "/" means or, for example, a/B may mean a or B, "and/or" in the text is only one association relationship describing the association object, and it means that there may be three relationships, for example, a and/or B, three cases where a exists alone, a and B exist together, and B exists alone, and further, "a plurality" means two or more in the description of the embodiment of the present application. The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance