WO2024046352A2 - Data query method and apparatus, and computer device and storage medium - Google Patents

Data query method and apparatus, and computer device and storage medium Download PDF

Info

Publication number
WO2024046352A2
WO2024046352A2 PCT/CN2023/115734 CN2023115734W WO2024046352A2 WO 2024046352 A2 WO2024046352 A2 WO 2024046352A2 CN 2023115734 W CN2023115734 W CN 2023115734W WO 2024046352 A2 WO2024046352 A2 WO 2024046352A2
Authority
WO
WIPO (PCT)
Prior art keywords
data
query
queried
candidate
bitmap
Prior art date
Application number
PCT/CN2023/115734
Other languages
French (fr)
Chinese (zh)
Other versions
WO2024046352A3 (en
Inventor
刘伟
冯显敬
董念
梁志彪
严向东
Original Assignee
顺丰科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 顺丰科技有限公司 filed Critical 顺丰科技有限公司
Publication of WO2024046352A2 publication Critical patent/WO2024046352A2/en
Publication of WO2024046352A3 publication Critical patent/WO2024046352A3/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Definitions

  • This application relates to the field of data processing technology, and specifically to a data query method, device, computer equipment and storage medium.
  • Log Structured Merge Tree is a database index structure that is often used in non-relational databases.
  • data is usually stored in the form of index fields-numeric values. Sorting queries show good query efficiency when processing massive amounts of data. Therefore, they are widely used in storage systems based on LSM trees.
  • the sorting query method in the related art needs to traverse all the data to be queried, so the query time is long and the response speed is slow.
  • Embodiments of the present application provide a data query method, device, computer equipment and storage medium, which can avoid traversing all data to be queried, shorten data query time, and improve data query response speed.
  • this application provides a data query method, which includes: obtaining a data query instruction for a data storage list, wherein the data query instruction includes a first data query condition and a second data query condition; according to the data query instruction Determine a plurality of data to be queried from the data storage list; determine the first image data of each data to be queried in the plurality of data to be queried, wherein the first image data is used to characterize the data to be queried.
  • determining a plurality of data to be queried from the data storage list according to the data query instruction includes: obtaining an index field in the data query instruction, and the index field is the Fields in the data storage list associated with the plurality of data to be queried; according to the index field, multiple data to be queried are determined from the data storage list.
  • determining the first image data of each of the plurality of data to be queried includes: filtering out a number of second candidate data from the plurality of data to be queried, Wherein, the plurality of second candidate data are the data matching the first data query condition among the plurality of data to be queried; the preset first value is determined as each of the plurality of second candidate data.
  • filtering out a number of second candidate data from the plurality of data to be queried includes: determining from the data storage list the data corresponding to the plurality of data to be queried based on the data query instruction. Multiple associated data associated with the data, wherein the multiple associated data are used to filter the multiple data to be queried; filter out a number of associations that match the data query instructions from the multiple associated data Data; determining a number of data to be queried associated with the number of associated data as the number of second candidate data.
  • determining the second bitmap data of the data to be queried includes: obtaining the plurality of data to be queried. the maximum value and the minimum value in the data, and determine the average value of the plurality of data to be queried based on the maximum value and the minimum value; determine the preset third value as the value in the plurality of data to be queried is greater than The second bitmap data of the mean value of the data to be queried; determine the preset fourth value as the second bitmap data of the data to be queried whose value in the plurality of data to be queried is less than or equal to the mean value of the data to be queried.
  • filtering out a number of first candidate data from the plurality of data to be queried based on the first bitmap data and the second bitmap data includes: Bitmap data and the second bitmap data are subjected to bit operations to obtain the target bitmap data of the data to be queried, wherein the target bitmap data is used to represent whether the data to be queried satisfies the third requirement at the same time.
  • a data query condition and the second data query condition based on the target bitmap data, filter out the first candidate data from the plurality of data to be queried.
  • performing bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of the data to be queried includes: converting the preset The first value and the preset second value are combined with the preset third value and the preset fourth value to obtain the target bitmap data.
  • determining a plurality of data to be queried from a data storage list according to a data query instruction includes: obtaining an index field in the data query instruction, and the index field is in the data storage list. Fields associated with the plurality of data to be queried; determining the plurality of data to be queried from the data storage list according to the index field.
  • the data query instruction includes querying the amount of data
  • determining the query result corresponding to the data query instruction based on the plurality of first candidate data includes: obtaining the plurality of first candidate data. the initial data amount, and compare the initial data amount with the query data amount; when the initial data amount is greater than the query data amount, query several first target data from the first candidate data , wherein the data amount of the first target data is the query data amount, and the first target data is the data in the first candidate data that matches the data query instruction; Several first target data are determined as query results corresponding to the data query instruction.
  • the data query instruction includes querying the amount of data
  • determining the query result corresponding to the data query instruction based on the plurality of first candidate data includes: obtaining the plurality of first candidate data. the initial data amount, and compare the initial data amount with the query data amount; when the initial data amount is less than the query data amount, select a number of second targets from the plurality of data to be queried data, wherein the plurality of second target data are the plurality of data to be queried except For data other than the first candidate data and matching the data query instruction, the sum of the data volume of the first candidate data and the data volume of the second target data is the query data volume. ; Determine the plurality of second target data and the plurality of first candidate data as query results corresponding to the data query instruction.
  • the data query instruction includes querying the amount of data
  • determining the query result corresponding to the data query instruction based on the plurality of first candidate data includes: obtaining the plurality of first candidate data. the initial data amount, and compare the initial data amount with the query data amount; when the initial data amount is equal to the query data amount, determine the several first candidate data as the data query instruction corresponding query results.
  • the present application provides a data query device, including: an instruction acquisition unit, configured to obtain a data query instruction for a data storage list, wherein the data query instruction includes a first data query condition and a second data query condition;
  • the first determination unit is used to determine a plurality of data to be queried from the data storage list according to the data query instruction;
  • the second determination unit is used to determine the third data of each of the data to be queried in the plurality of data to be queried.
  • One bit of map data wherein the first bit of map data is used to characterize whether the data to be queried matches the first data query condition; a third determination unit is used to determine the second bit of the data to be queried graph data, wherein the second bitmap data is used to characterize whether the data to be queried matches the second data query condition; a data filtering unit is configured to based on the first graph data and the second Bitmap data is used to filter out a number of first candidate data from the plurality of data to be queried; a data query unit is used to determine the query result corresponding to the data query instruction based on the several first candidate data.
  • the present application also provides a computer device, including: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory, and configured to be executed by the processor to implement the data query method described in any one of the first aspects.
  • the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute any of the data query methods described in the first aspect.
  • multiple data to be queried are respectively filtered based on the first bitmap data and the second bitmap data to filter out a number of first candidate data from the multiple data to be queried, Based on several first candidate data, the query result corresponding to the data query instruction can be determined, thereby avoiding traversing all the data to be queried.
  • the plurality of first candidate data are data filtered out from the plurality of data to be queried based on the first bitmap data and the second bitmap data, the data volume of the plurality of first candidate data is smaller than the data volume of the plurality of data to be queried. , Therefore, performing data query based on several first candidate data can shorten the data query time and improve the data query response speed.
  • Figure 1 is a schematic scenario diagram of a data query system provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of the data query method provided by the embodiment of the present application.
  • FIG. 3 is a schematic flowchart of the data query method provided by the embodiment of the present application.
  • Figure 4 is a schematic structural diagram of a data query device provided by an embodiment of the present application.
  • Figure 5 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the process of sorting query is: given multiple data items, select multiple data to be queried that match the query conditions, and then traverse all the data to be queried to return the query results. Since all the data to be queried needs to be traversed, the query time of this sorted query method is long and the response speed is slow.
  • Embodiments of the present application provide a data query method, device, computer equipment and storage medium, which will be described in detail below.
  • FIG. 1 is a schematic diagram of a data query system provided by an embodiment of the present application.
  • the data query system may include a computer device 100 and a memory 200 .
  • the memory 200 is a warehouse built on a computer storage device that supports organizing, storing and managing data according to a data structure.
  • the loader memory is not limited to 200 computer storage device implementation.
  • the memory 200 is used to store data, such as data query instructions, such as "query the top three scores among boys", “query the bottom three scores among boys”, “query the top three scores among girls”, etc., such as multiple Data to be queried, such as scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54), etc.
  • the computer device 100 may be an independent server, or a server network or server cluster composed of servers.
  • the computer device 100 described in the embodiment of the present application includes, but is not limited to, a computer, a network A host, a single network server, a set of multiple network servers, or a cloud server composed of multiple servers.
  • Cloud servers consist of a large number of computers or network servers based on cloud computing.
  • the computer device 100 used in the embodiment of the present application may be a device that includes both receiving and transmitting hardware, that is, a device with receiving and transmitting hardware capable of performing two-way communication on a two-way communication link.
  • Such devices may include cellular or other communications devices with a single line display or a multi-line display or a cellular or other communications device without a multi-line display.
  • the computer device 100 may be a desktop terminal or a mobile terminal, and the computer device 100 may also be one of a mobile phone, a tablet computer, a notebook computer, etc.
  • a communication connection may be established between the computer device 100 and the memory 200, which may be a wired or wireless network connection.
  • the computer device 100 and the memory 200 can be deployed on the same physical device for implementation, or they can be deployed on different physical devices for implementation.
  • the computer device 100 and the storage 200 are deployed on different physical devices, they can be deployed in the same local area network or in different local area networks.
  • the computer device 100 obtains the data query instruction of the data storage list, where the data query instruction includes a first data query condition and a second data query condition.
  • the computer device 100 then communicates with the memory 200 to retrieve the data from the memory 200 according to the data query instruction. Get multiple data to be queried from the storage list.
  • the following steps are performed: determining the first image data of each data to be queried in the multiple data to be queried, wherein the first image data is used to characterize each data to be queried.
  • the second bitmap data of each data to be queried determines the second bitmap data of each data to be queried, where the second bitmap data is used to characterize whether each of the data to be queried matches the second data query condition; based on The first bitmap data and the second bitmap data are used to select a number of first candidate data from a plurality of data to be queried; based on a number of first candidate data, the query result corresponding to the data query instruction is determined.
  • the computer device 100 performs data query, there is no need to traverse all the data to be queried, thus shortening the data query time and improving the data query response speed.
  • a data query device may be integrated into the computer device 100, and the data query device is used to execute the above data query method provided by the embodiment of the present application.
  • FIG. 1 is only one application scenario of the solution of the present application and does not constitute a limitation on the application scenarios of the solution of the present application.
  • Other application environments may also include those shown in Figure 1 More or fewer computer devices are shown.
  • only one computer device is shown in Figure 1.
  • the data query system may also include one or more other devices, and the details are not limited here.
  • scenario diagram of the data query system shown in Figure 1 is only an example.
  • the data query system and scenarios described in the embodiments of this application are for the purpose of more clearly explaining the technical solutions of the embodiments of this application and do not constitute a
  • those of ordinary skill in the art will know that with the evolution of data query systems and the emergence of new business scenarios, the technical solutions provided by the embodiments of this application are equally applicable to similar technical problems.
  • FIG. 2 is a schematic flowchart of a data query method provided by an embodiment of the present application.
  • the data query method can be executed by the computer device 100 shown in FIG. 1 .
  • the data query method may include the following steps 301 to 306, specifically as follows:
  • the data storage list is a data list where the data to be queried is located.
  • the data storage list can be a data storage list in a storage system based on an LSM tree.
  • the data storage list includes multiple data items, and each data item is indexed by a field-value. Therefore, based on a specific index field, the value corresponding to the index field can be queried from the data storage list.
  • the data storage list shown in Table 1 includes three data items, namely student number and its corresponding value, gender and its corresponding value, and score and its corresponding value. Based on the index field "score", you can Query the value corresponding to "score" from the data storage list.
  • the data query instruction is a data query request for the data storage list issued by the user to the computer device.
  • the data query instruction includes but is not limited to touch instructions, mouse instructions, remote control instructions, voice instructions, etc.
  • the user wants to query the gender in Table 1 When it is a boy and the score is among the top three, directly enter "query the top three scores among boys" on the touch screen, or the user issues a voice command such as "query the top three scores among boys".
  • the user can send the data query instruction of the data storage list to the computer device. After receiving the data query instruction, the computer device will perform the corresponding data query based on the data query instruction. .
  • the data query instruction may include a first data query condition and a second data query condition.
  • the first data query condition may be understood as the basic query condition of the data query instruction
  • the second data query condition may be understood as the additional query condition of the data query instruction.
  • the data query instruction is "query the top three scores among boys”
  • the first data query condition is a query condition related to gender
  • the second data query condition is a query condition related to scores.
  • the embodiment of the present application does not specifically limit the first data query condition and the second data query condition. With different data query instructions, the first data query condition and the second data query condition will also be different.
  • the data storage list includes multiple data items, and the multiple data to be queried are the values of the data items that are to be queried based on the data query instruction. For example, taking Table 1 as an example, when the data query instruction is "Query among boys" "Top three scores", multiple data to be queried are values corresponding to "scores", that is, scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54).
  • the computer device determines multiple data to be queried from the data storage list according to the data query instruction, so that in subsequent steps, data query can be performed based on the multiple data to be queried.
  • determining multiple data to be queried from the data storage list according to the data query instruction in step S302 may include the following steps S401 and S402, specifically as follows:
  • S402. Determine multiple data to be queried from the data storage list according to the index field.
  • the data query instruction includes an index field, which is a field in the data storage list that is associated with multiple data to be queried. For example, taking Table 1 as an example, when the data query instruction is "query the top three scores among boys", The index field is "score".
  • the index field in the data query instruction is first obtained, and then the value corresponding to the index field is obtained from the data storage list according to the index field. The values corresponding to the fields are multiple data to be queried.
  • index field "score” For example, after obtaining the index field "score", you can retrieve it from the data storage shown in Table 1 Multiple data to be queried are determined in the list as scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54).
  • S303 Determine the first image data of each of the plurality of data to be queried, where the first image data is used to represent whether the data to be queried matches the first data query condition.
  • the first bit map data is data represented by a bitmap data structure (Bitmap) and is used to represent whether each data to be queried matches the first data query condition.
  • the first bit map data can be a preset first value or a predetermined value. Assume the second value.
  • the first image data is the first value, it means that the data to be queried matches the first data query condition.
  • the first image data is the second value, it means that the data to be queried matches the first data.
  • the query conditions do not match.
  • the first value and the second value are 1 and 0 respectively.
  • the first image data is 1, it means that the data to be queried matches the first data query condition.
  • the first image data is 0, it means that the data to be queried is 0.
  • the data does not match the first data query condition.
  • this embodiment further determines the first image data of each data to be queried in the multiple data to be queried, so that data query can be performed based on the first image data in subsequent steps.
  • determining the first image data of each of the plurality of data to be queried in step S303 may include the following steps S403 to S405, specifically as follows:
  • S405. Determine the preset second value as the first image data of each of the plurality of data to be queried except for the plurality of second candidate data.
  • the plurality of second candidate data are the data that match the first data query condition among the plurality of data to be queried.
  • the plurality of second candidate data are the plurality of data to be queried.
  • a plurality of second candidate data are part of the plurality of data to be queried.
  • the first numerical value and the second numerical value are preset numerical values used to represent the status of multiple data to be queried.
  • the first image data is the first value, it means that the data to be queried matches the first data query condition.
  • the bitmap data is the second value, it means that the data to be queried does not match the first data query condition.
  • the first value can be 1 and the second value can be 0.
  • first image data of each data to be queried when determining the first image data of each data to be queried, several second candidate data are first screened out from multiple data to be queried, and then the preset first value is determined as each of the plurality of second candidate data.
  • first image data of the second candidate data and determine the preset second value as the first image data of each of the plurality of data to be queried except for several second candidate data.
  • multiple data to be queried are scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54).
  • Second candidate data filtered out from multiple data to be queried are scores (72, 60, 65, 92, 76, 54, 32, 87, 63, 54), then several second candidates are selected from multiple data to be queried
  • Data other than data are fractions (90, 43, 86, 80, 75, 47), and 1 is determined as each data in the fraction (72, 60, 65, 92, 76, 54, 32, 87, 63, 54)
  • the first bit of image data determine 0 as the first bit of image data for each data in the score (90, 43, 86, 80, 75, 47).
  • the associated data of each data to be queried can first be determined from the data storage list based on the data query instruction, and the associated data is data Store the data associated with each to-be-queried data in the list for filtering multiple to-be-queried data. For example, taking Table 1 as an example, when the data query instruction is "query the top three scores among boys", multiple The associated data is gender (male, female, male, male, female, female, male, male, male, female, male, male, female, male, male, female, male, female, male, female, male, male, female, male, male, female, male, male).
  • the plurality of associated data are compared with the data query instructions, a number of associated data matching the data query instructions are filtered out from the multiple associated data, and a number of data to be queried associated with a number of associated data are determined to be a number of second candidate data.
  • the first data query condition is which scores correspond to boys.
  • the first data query condition is the basic query condition of the data query instruction, that is to say, the basic query condition can completely reflect the purpose of the data query instruction.
  • the data query instruction is "query the top three scores among boys”.
  • the first data query condition is which scores correspond to boys. By determining which scores correspond to boys, the query can be directly targeted to the purpose of the data query instruction. That is, query for boys.
  • multiple data to be queried are scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54), and multiple associations
  • the data is gender (male, female, male, male, female, female, male, male, male, female, male, male, female, male, male, female, male, female, male, female, male, female, male, female, male, female, male, female, male, male), then the scores in the multiple data to be queried are (72, 60, 65, 92, 76, 54, 32, 87, 63, 54) matches the first data query condition.
  • S304 Determine the second bitmap data of the data to be queried, where the second bitmap data is used to characterize whether the data to be queried matches the second data query condition.
  • the second bitmap data is data represented by a bitmap data structure (Bitmap), and is used to represent whether each data to be queried matches the second data query condition.
  • the second data query condition is a query condition related to numerical values
  • the second data query condition may be which scores are greater than or not greater than the average value of multiple data to be queried. That is to say, based on the second bitmap data, data that is greater than or not greater than the mean value of the multiple data to be queried can be filtered out from multiple data to be queried.
  • the second bitmap data can be a preset third value or a preset fourth value. When the second bitmap data is the third value, it means that the data to be queried is less than (or greater than) the average of multiple data to be queried.
  • the second bitmap data is a fourth numerical value, it means that the data to be queried is not less than (or not greater than) the average value of multiple data to be queried.
  • the third value and the fourth value are 1 and 0 respectively.
  • the second bitmap data is 1, it means that the data to be queried is greater than the average of multiple data to be queried, that is, the data to be queried matches the second data query condition.
  • the first image data is 0, it means that the data to be queried is not greater than the average of multiple data to be queried, that is, the data to be queried does not match the second data query condition.
  • the second bitmap data of each data to be queried is further determined, so that data query can be performed based on the first bitmap data and the second bitmap data in subsequent steps. .
  • the second data query condition is an additional query condition of the data query instruction. Whether the additional query condition can fully reflect the purpose of the data query instruction also depends on the data query instruction. For example, the data query instruction is "query the scores among boys whose scores are greater than the average score". The second data query item The items are which scores are greater than the average of multiple data to be queried. By determining which scores are greater than the average, the query can be directly positioned to the purpose of the data query instruction, that is, the query score is greater than the average score, that is, the second data query Conditions can fully reflect the purpose of data query instructions.
  • the data query instruction is "query the top three scores among boys" and the second data query condition is which scores are greater than the average of multiple data to be queried.
  • the query can be positioned to the score that is greater than the average score. score, and then query again on the basis of the score greater than the average score to complete the purpose of the data query instruction.
  • the second data query condition can only assist in completing the purpose of the data query instruction. It does not fully reflect the purpose of the data query command.
  • a number of first candidate data changes with different data query instructions. For example, when the data query instruction is "query multiple top-ranked data of boys", a number of first candidate data are the boy's and multiple data to be queried. Data whose score is greater than the mean of multiple data to be queried; for another example, when the data query instruction is "query multiple data in the lower order", some of the first candidate data are boys in multiple data to be queried and the score is not greater than The average data of multiple data to be queried.
  • a number of first candidate data are further selected from multiple data to be queried based on the first map data and the second bitmap data.
  • the data may include the following steps S406 and S407, specifically as follows:
  • S406 Perform bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of each data to be queried, where the target bitmap data is used to characterize the data to be queried. Query whether the data satisfies both the first data query condition and the second data query condition;
  • the target bitmap data is also data represented by a bitmap data structure (Bitmap). It is the data obtained by performing bit operations on the first bitmap data and the second bitmap data.
  • the target bitmap data is used to represent the data to be queried. Whether it satisfies both the first data query condition and the second data query condition.
  • the representational meaning of the target bitmap data changes with different data query instructions. For example, when the data query instruction is "query multiple data in the top order", the target bitmap data is used to represent boys whose scores are greater than those of multiple candidates. Query the average score of the data; for another example, when the data query instruction is "query multiple data in the lower order", the target bitmap data is used to represent the score of boys and the score is not greater than the average of multiple data to be queried.
  • the target bitmap data when the target bitmap data is 1, it means that the data to be queried matches the first data query condition and is greater than the average value of the multiple data to be queried ( That is, matches the second data query condition), when the target bitmap data is 0, it means that the data to be queried does not match the first data query condition or is not greater than the average of multiple data to be queried (that is, matches the second data query condition condition does not match).
  • bit operations are first performed on the first bitmap data and the second bitmap data to obtain each target bitmap data of the data to be queried, and then based on the target bitmap data of each data to be queried, from multiple to-be-queried data
  • a number of first candidate data are screened out from the query data. For example, taking Table 1 as an example, multiple data to be queried are scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54).
  • the first image data of the data to be queried are (1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1) corresponding to gender.
  • the second bitmap data of the data to be queried are respectively (1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0) corresponding to the mean scores.
  • Perform bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of multiple data to be queried which are (1, 0, 0, 1, 0, 0, 1, 1 corresponding to gender and mean score , 0, 0, 0, 1, 0, 1, 0, 0), filter out the data whose target bitmap data is 1 from multiple data to be queried, that is, the score (75, 65, 92, 76, 87, 63 ), as several first candidate data.
  • the query result is the final data query result queried from the data storage list according to the data query instruction.
  • the data query instruction is "query the top three scores among boys", then the query result is (92 , 87, 72).
  • the query result corresponding to the data query instruction is determined based on the several first candidate data. Since the query result is determined based on several first candidate data, it is avoided to traverse multiple to-be-queried data to determine the query result, and since several first candidate data are data filtered out from multiple to-be-queried data, several first candidate data It is smaller than the data volume of multiple data to be queried. Therefore, determining the query result set based on several first candidate data can shorten the data query time and improve the data query response rate.
  • the data query instruction includes the amount of query data.
  • the query result corresponding to the data query instruction is determined, specifically as follows:
  • the second data query condition is an additional query condition of the data query instruction
  • whether the additional query condition can fully reflect the purpose of the data query instruction also depends on the data query instruction. Therefore, the data obtained based on the second data query condition Not all of the first candidate data may match the data query instruction, so some first target data can be screened from the first candidate data again. At this time, the first target data is the data that matches the data query instruction.
  • the data query instruction includes the query data amount, which is the data amount of the data in the query result. For example, if the data query instruction is "query the top three scores among boys", the query data amount is 3.
  • the initial data amount is the data amount of several first candidate data. For example, if it is determined that several first candidate data are scores (75, 65, 92, 76, 87, 63), then the initial data amount is 6.
  • the data amount of some first target data is the query data amount, and the number of first target data changes with different data query instructions.
  • the number of first target data Rank among several first candidate data For example, when the data query instruction is to query multiple data in the lower order, some first target data are the lower order data among the plurality of first candidate data.
  • the query instruction when determining the query result corresponding to the data query instruction based on several first candidate data, first obtain the initial data volume of several first candidate data, and then compare the initial data volume with the query data volume.
  • the initial data volume When the initial data volume
  • a plurality of first target data are queried from the first candidate data, and a plurality of first target data are determined as query data corresponding to the data query instruction.
  • the query instruction is "query the top three scores among boys"
  • several first candidate data are scores (72, 65, 92, 76, 87, 63)
  • the initial data amount 6 is larger than the query
  • the amount of data is 3.
  • Query some first target data that is, scores (92, 87, 76)
  • from several first candidate data and determine some first target data, that is, scores (92, 87, 76), as the query result.
  • the initial data amount is ha and the query data amount is k.
  • the calculation amount to determine the query result is (logk)*ha+ha
  • the calculation amount of the traditional sorting query method is (logk)*h+h
  • h is the data volume of multiple data to be queried. Since h>ha, then (logk)*h+h>(logk)*ha+ha, that is, compared with the traditional sorting query method for data query using the solution of this application, The amount of calculation is reduced.
  • steps S411 to S413 may be included, specifically as follows:
  • a plurality of third candidate data are data other than a plurality of first candidate data among the plurality of data to be queried.
  • the plurality of data to be queried are scores (72, 90, 60, 65, 43, 86, 92, 76, 54 , 80, 32, 87, 75, 63, 47, 54)
  • some first candidate data are scores (72, 65, 92, 76, 87, 63)
  • some third candidate data are scores (90, 60, 43, 86, 54, 80, 32, 75, 47, 54).
  • the data volume of some second target data is the difference between the query data volume and the initial data volume. For example, if the query data volume is 8 and the initial data volume is 6, then the data volume of some second target data is 2.
  • the plurality of second target data changes with different data query instructions. For example, when the data query instruction is "query multiple data that are ranked first", the plurality of second target data is the data that is ranked first among the plurality of third candidate data. ; For another example, when the data query instruction is "query multiple lower-ranked data", the plurality of second target data are the lower-ranked data among the plurality of third candidate data.
  • Sorting refers to sorting according to the numerical value of several second target data. It can be sorted according to the numerical value of several second target data from large to small, or it can also be sorted according to the numerical value of several second target data from small to large.
  • the initial data amount is less than the query data amount, it means that several first candidate data obtained based on the first data query condition and the second data query condition cannot meet the demand of the query data amount.
  • a number of second target data are queried as a score of 60, and a number of second target data are queried as scores 60.
  • the target data and several first candidate data that is, the scores (72, 65, 92, 76, 87, 63, 60), are determined as the query results.
  • the calculation amount to determine the query result is (log(k-ha))*(h-ha)+(logk)*ha+h
  • determining the second bitmap data of the data to be queried in step S304 may include the following steps S414 to S416, specifically as follows:
  • the maximum value is the largest data among multiple data to be queried, and the minimum value is the smallest data among multiple data to be queried.
  • the multiple data to be queried in Table 1 are scores (72, 90, 60, 65, 43, 86 , 92, 76, 54, 80, 32, 87, 75, 63, 47, 54), the maximum value of multiple data to be queried is the score 92, the minimum value is the score 32, and the mean is between the maximum value and the minimum value
  • the average, that is, the mean is 62.
  • the maximum value and the minimum value of the multiple data to be queried can be obtained, and then the maximum value and the minimum value are averaged to obtain multiple data to be queried.
  • the mean value of the data is then compared with the mean value respectively to obtain the comparison result of each data to be queried.
  • the second bitmap data of each data to be queried is determined based on the comparison result of each data to be queried.
  • the comparison results include two situations: the data to be queried is greater than the mean value and the data to be queried is less than or equal to the mean value.
  • the preset third value is determined as the second bitmap data of the data to be queried, and when the data to be queried is less than or equal to the mean
  • the preset fourth numerical value is determined as the second bitmap data of the data to be queried.
  • the third value is 1 and the fourth value is 0.
  • the score of the data to be queried is 72, which is greater than the mean value of 62. Determine 1 as the second bitmap data of the score 72 of the data to be queried.
  • the score 60 is less than the mean value 62, and 0 is determined as the second bitmap data of the score 60 of the data to be queried.
  • the fourth The numerical value is determined as the second bitmap data of the data to be queried.
  • the third numerical value is determined as the second bitmap data of the data to be queried.
  • the third value is 1 and the fourth value is 0.
  • the score of the data to be queried is 72, which is greater than the mean value of 62, and 0 is determined as the data to be queried.
  • the second bitmap data of the score 72, the score 60 of the data to be queried is less than the mean value 62, and 1 is determined as the second bitmap data of the score 60 of the data to be queried.
  • the preset third value can be directly determined as the value in the multiple data to be queried that is greater than the average value.
  • the specific value of the preset fourth value is not limited and can be adjusted adaptively.
  • FIG 4 is a schematic structural diagram of a data query device provided by an embodiment of the present application. As shown in Figure 4, the data query device 600 includes:
  • Instruction acquisition unit 601 is used to acquire data query instructions for the data storage list, where the data query instructions include first data query conditions and second data query conditions;
  • the first determining unit 602 is configured to determine a plurality of data to be queried from the data storage list according to the data query instruction;
  • the second determining unit 603 is used to determine the first image data of each data to be queried in the plurality of data to be queried, wherein the first image data is used to characterize whether the data to be queried is consistent with the data to be queried.
  • the first data query condition matches;
  • the third determination unit 604 is used to determine the second bitmap data of the data to be queried, where the second bitmap data is used to characterize whether the data to be queried matches the second data query condition;
  • the data filtering unit 605 is configured to filter out a number of first candidate data from the plurality of data to be queried based on the first bitmap data and the second bitmap data;
  • the data query unit 606 is configured to determine the query result corresponding to the data query instruction based on the plurality of first candidate data.
  • the query result corresponding to the data query instruction is determined based on a number of first candidate data, which can avoid traversing all the data to be queried, and because the number of first candidate data is based on the first bitmap data and the second bitmap data.
  • the data volume of several first candidate data is smaller than the data volume of multiple data to be queried. Therefore, data query based on several first candidate data can shorten the data query time and improve the data query response. speed.
  • the first determining unit 602 is specifically configured to: obtain an index field in the data query instruction, where the index field is associated with the plurality of data to be queried in the data storage list. fields; determine multiple data to be queried from the data storage list according to the index field.
  • the second determination unit 603 is specifically configured to filter out a number of second candidate data from the plurality of data to be queried, wherein the number of second candidate data is the plurality of second candidate data. Data in the data to be queried that matches the first data query condition; determine the preset first value as the first image data of each second candidate data in the plurality of second candidate data; set the preset first value The second numerical value is determined as the first image data of each of the plurality of data to be queried except the plurality of second candidate data.
  • the second determination unit 603 when filtering out a number of second candidate data from the plurality of data to be queried, is specifically configured to: select the data from the data storage list based on the data query instruction. Determine multiple associated data associated with the multiple data to be queried, wherein the multiple associated data are used to filter the multiple data to be queried; filter out the multiple associated data from the multiple associated data. A plurality of associated data matched by the data query instruction; a plurality of data to be queried associated with the plurality of associated data are determined to be the plurality of second candidate data.
  • the third determination unit 604 is specifically configured to: obtain the maximum value and the minimum value among the plurality of data to be queried. value, and determine the average value of the plurality of data to be queried based on the maximum value and the minimum value; determine the preset third value as the value to be queried in the plurality of data to be queried that is greater than the average value
  • the second bitmap data of the data determine the preset fourth value as the second bitmap data of the data to be queried whose value in the plurality of data to be queried is less than or equal to the average value.
  • the data filtering unit 605 is specifically configured to: perform bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of the data to be queried, Wherein, the target bitmap data is used to represent whether the data to be queried satisfies the first data query condition and the second data query condition at the same time; based on the target bitmap data, from the plurality of data to be queried Several first candidate data are screened out from the data.
  • the data filtering unit 605 when the data filtering unit 605 performs bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of the data to be queried, it specifically uses In: performing a pull operation on the preset first value and the preset second value, and the preset third value and the preset fourth value to obtain the target bitmap data .
  • the data query instruction also includes querying the data amount.
  • the data query unit 606 is specifically configured to: obtain the initial data amount of the several first candidate data, and compare the initial data amount with The query data volume is compared; when the initial data volume is greater than the query data volume, several first target data are queried from the first candidate data, wherein the data volume of the several first target data is the amount of query data, and the plurality of first target data is the data in the first candidate data that matches the data query instruction; the plurality of first target data is determined as the data query instruction corresponding query results.
  • the data query unit 606 is specifically configured to: when the initial data amount is less than the query data amount, filter out a number of second target data from the plurality of data to be queried, wherein, the plurality of second target data are data in the plurality of data to be queried other than the plurality of first candidate data and matching the data query instruction, and the data amount of the plurality of first candidate data is The sum of the data amounts of the plurality of second target data and the plurality of second target data is the query data amount; the plurality of second target data and the plurality of first candidate data are determined as query results corresponding to the data query instruction.
  • the data query unit 606 is specifically configured to: when the initial data amount is equal to the query data amount, determine the plurality of first candidate data as corresponding to the data query instruction. search result.
  • An embodiment of the present application also provides a computer device, as shown in FIG. 5 , which shows a schematic structural diagram of the computer device involved in the embodiment of the present application.
  • the computer device may include components such as a processor 701 of one or more processing cores, one or more memories 702 having computer-readable storage media, a power supply 703, and an input unit 704.
  • a processor 701 of one or more processing cores one or more memories 702 having computer-readable storage media
  • a power supply 703 a power supply 703
  • the processor 701 is the control center of the computer equipment, using various interfaces and lines to connect various parts of the entire computer equipment, by running or executing software programs and/or modules stored in the memory 702, and calling software programs stored in the memory 702. Data, perform various functions of the computer equipment and process the data to conduct overall monitoring of the computer equipment.
  • the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 701.
  • the memory 702 can be used to store software programs and modules.
  • the processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702 .
  • the memory 702 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store a program based on Data created by the use of computer equipment, etc.
  • memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702 .
  • the computer equipment also includes a power supply 703 that supplies power to various components.
  • the power supply 703 can be logically connected to the processor 701 through a power management system, so that functions such as charging, discharging, and power consumption management can be implemented through the power management system.
  • Power supply 703 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
  • the computer device may also include an input unit 704 operable to receive input numeric or character information and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and functional controls.
  • an input unit 704 operable to receive input numeric or character information and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and functional controls.
  • the computer device may also include a display unit and the like, which will not be described again here.
  • the processor 701 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 will run the executable files stored in
  • the application program in the memory 702 is used to implement the steps in the data query method described in any of the above embodiments.
  • the processor implements the following steps: obtaining a data query instruction for a data storage list, where the data query instruction includes a first data query condition and a second data query condition; and obtaining a data query instruction from the data storage list according to the data query instruction.
  • embodiments of the present application provide a computer-readable storage medium, which may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc. .
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or optical disk etc.
  • a computer program is stored thereon, and the computer program is loaded by the processor to execute the steps in any of the data query methods provided by the embodiments of this application.
  • the computer program loaded by the processor may perform the following steps: obtain a data query instruction for a data storage list, wherein the data query instruction includes a first data query condition and a second data query condition; according to the data query The instruction determines a plurality of data to be queried from the data storage list; determines the first image data of each data to be queried in the plurality of data to be queried, wherein the first image data is used to characterize the Whether the data to be queried matches the first data query condition; determine the second bitmap data of the data to be queried, wherein the second bitmap data is used to characterize whether the data to be queried matches the second data query condition.
  • Matching data query conditions based on the first bitmap data and the second bitmap data, screening out a number of first candidate data from the plurality of data to be queried; based on the several first candidate data, determining the Query results corresponding to the above data query instructions.
  • each of the above units or structures can be implemented as an independent entity, or can be combined in any way and implemented as the same or several entities.
  • each of the above units or structures please refer to the previous method embodiments. Here No longer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed in the present application are a data query method and apparatus, and a computer device and a storage medium. The method comprises: acquiring a data query instruction for a data storage list, which data query instruction comprises a first data query condition and a second data query condition; according to the data query instruction, determining, from the data storage list, a plurality of pieces of data to be queried; determining first bitmap data of each piece of said data, wherein the first bitmap data is used for representing whether each piece of said data matches the first data query condition; determining second bitmap data of each piece of said data, wherein the second bitmap data is used for representing whether each piece of said data matches the second data query condition; on the basis of the first bitmap data and the second bitmap data, screening several pieces of first candidate data from said data; and on the basis of the several pieces of first candidate data, determining a query result of the data query instruction. In the method of the present application, it is not necessary to traverse all data to be queried, such that the data query time can be shortened, and the data query response speed is increased.

Description

数据查询方法、装置、计算机设备及存储介质Data query method, device, computer equipment and storage medium 技术领域Technical field
本申请涉及数据处理技术领域,具体涉及一种数据查询方法、装置、计算机设备及存储介质。This application relates to the field of data processing technology, and specifically to a data query method, device, computer equipment and storage medium.
发明背景Background of the invention
日志结构合并树(Log Structured Merge Tree,LSM)是一种数据库索引结构,经常被应用于非关系型数据库,在基于LSM树的存储系统中,数据通常是以索引字段-数值的形式进行存储。排序查询在处理海量的数据时显示出很好的查询效率,因此,被广泛应用于基于LSM树的存储系统中。Log Structured Merge Tree (LSM) is a database index structure that is often used in non-relational databases. In LSM tree-based storage systems, data is usually stored in the form of index fields-numeric values. Sorting queries show good query efficiency when processing massive amounts of data. Therefore, they are widely used in storage systems based on LSM trees.
然而,相关技术中的排序查询方式由于需要遍历所有待查询数据,所以查询时间长,响应速度慢。However, the sorting query method in the related art needs to traverse all the data to be queried, so the query time is long and the response speed is slow.
发明内容Contents of the invention
本申请实施例提供一种数据查询方法、装置、计算机设备及存储介质,可以避免遍历所有待查询数据,缩短数据查询时间,提高数据查询响应速度。Embodiments of the present application provide a data query method, device, computer equipment and storage medium, which can avoid traversing all data to be queried, shorten data query time, and improve data query response speed.
第一方面,本申请提供一种数据查询方法,包括:获取数据存储列表的数据查询指令,其中,所述数据查询指令包括第一数据查询条件和第二数据查询条件;根据所述数据查询指令从所述数据存储列表中确定多个待查询数据;确定所述多个待查询数据中每个待查询数据的第一位图数据,其中,所述第一位图数据用于表征所述待查询数据是否与所述第一数据查询条件匹配;确定所述待查询数据的第二位图数据,其中,所述第二位图数据用于表征所述待查询数据是否与所述第二数据查询条件匹配;基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据;基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果。In a first aspect, this application provides a data query method, which includes: obtaining a data query instruction for a data storage list, wherein the data query instruction includes a first data query condition and a second data query condition; according to the data query instruction Determine a plurality of data to be queried from the data storage list; determine the first image data of each data to be queried in the plurality of data to be queried, wherein the first image data is used to characterize the data to be queried. Query whether the data matches the first data query condition; determine the second bitmap data of the data to be queried, wherein the second bitmap data is used to characterize whether the data to be queried matches the second data Query conditions match; based on the first bitmap data and the second bitmap data, select several first candidate data from the plurality of data to be queried; based on the several first candidate data, determine the Query results corresponding to data query instructions.
在本申请一些实施方案中,所述根据所述数据查询指令从所述数据存储列表中确定多个待查询数据,包括:获取所述数据查询指令中的索引字段,所述索引字段为所述数据存储列表中与所述多个待查询数据关联的字段;根据所述索引字段,从所述数据存储列表中确定多个待查询数据。In some embodiments of the present application, determining a plurality of data to be queried from the data storage list according to the data query instruction includes: obtaining an index field in the data query instruction, and the index field is the Fields in the data storage list associated with the plurality of data to be queried; according to the index field, multiple data to be queried are determined from the data storage list.
在本申请一些实施方案中,所述确定所述多个待查询数据中每个待查询数据的第一位图数据,包括:从所述多个待查询数据中筛选出若干第二候选数据,其中,所述若干第二候选数据为所述多个待查询数据中与所述第一数据查询条件匹配的数据;将预设的第一数值确定为所述若干第二候选数据中每个第二候选数据的第一位图数据;将预设的第二数值确定为所述多个待查询数据中除所述若干第二候选数据以外的每个待查询数据的第一位图数据。 In some embodiments of the present application, determining the first image data of each of the plurality of data to be queried includes: filtering out a number of second candidate data from the plurality of data to be queried, Wherein, the plurality of second candidate data are the data matching the first data query condition among the plurality of data to be queried; the preset first value is determined as each of the plurality of second candidate data. The first image data of the two candidate data; determine the preset second value as the first image data of each of the plurality of data to be queried except the plurality of second candidate data.
在本申请一些实施方案中,所述从所述多个待查询数据中筛选出若干第二候选数据,包括:基于所述数据查询指令从所述数据存储列表中确定与所述多个待查询数据相关联的多个关联数据,其中,所述多个关联数据用于对所述多个待查询数据进行筛选;从所述多个关联数据中筛选出与所述数据查询指令匹配的若干关联数据;确定与所述若干关联数据相关联的若干待查询数据为所述若干第二候选数据。In some embodiments of the present application, filtering out a number of second candidate data from the plurality of data to be queried includes: determining from the data storage list the data corresponding to the plurality of data to be queried based on the data query instruction. Multiple associated data associated with the data, wherein the multiple associated data are used to filter the multiple data to be queried; filter out a number of associations that match the data query instructions from the multiple associated data Data; determining a number of data to be queried associated with the number of associated data as the number of second candidate data.
在本申请一些实施方案中,当所述第二数据查询条件为与数值相关的查询条件时,所述确定所述待查询数据的第二位图数据,包括:获取所述多个待查询数据中的最大值和最小值,并基于所述最大值和所述最小值确定所述多个待查询数据的均值;将预设的第三数值确定为所述多个待查询数据中的数值大于所述均值的待查询数据的第二位图数据;将预设的第四数值确定为所述多个待查询数据中的数值小于或等于所述均值的待查询数据的第二位图数据。In some embodiments of the present application, when the second data query condition is a query condition related to a numerical value, determining the second bitmap data of the data to be queried includes: obtaining the plurality of data to be queried. the maximum value and the minimum value in the data, and determine the average value of the plurality of data to be queried based on the maximum value and the minimum value; determine the preset third value as the value in the plurality of data to be queried is greater than The second bitmap data of the mean value of the data to be queried; determine the preset fourth value as the second bitmap data of the data to be queried whose value in the plurality of data to be queried is less than or equal to the mean value of the data to be queried.
在本申请一些实施方案中,所述基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据,包括:对所述第一位图数据和所述第二位图数据进行位运算,得到所述待查询数据的目标位图数据,其中,所述目标位图数据用于表征所述待查询数据是否同时满足所述第一数据查询条件和所述第二数据查询条件;基于所述目标位图数据,从所述多个待查询数据中筛选出所述若干第一候选数据。In some embodiments of the present application, filtering out a number of first candidate data from the plurality of data to be queried based on the first bitmap data and the second bitmap data includes: Bitmap data and the second bitmap data are subjected to bit operations to obtain the target bitmap data of the data to be queried, wherein the target bitmap data is used to represent whether the data to be queried satisfies the third requirement at the same time. A data query condition and the second data query condition; based on the target bitmap data, filter out the first candidate data from the plurality of data to be queried.
在本申请一些实施方案中,所述对所述第一位图数据和所述第二位图数据进行位运算,得到所述待查询数据的目标位图数据,包括:将所述预设的第一数值和所述预设的第二数值,与所述预设的第三数值和所述预设的第四数值进行拉运算,得到所述目标位图数据。In some embodiments of the present application, performing bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of the data to be queried includes: converting the preset The first value and the preset second value are combined with the preset third value and the preset fourth value to obtain the target bitmap data.
在本申请一些实施方案中,所述根据数据查询指令从数据存储列表中确定多个待查询数据,包括:获取所述数据查询指令中的索引字段,所述索引字段为所述数据存储列表中与所述多个待查询数据关联的字段;根据所述索引字段,从所述数据存储列表中确定所述多个待查询数据。In some embodiments of the present application, determining a plurality of data to be queried from a data storage list according to a data query instruction includes: obtaining an index field in the data query instruction, and the index field is in the data storage list. Fields associated with the plurality of data to be queried; determining the plurality of data to be queried from the data storage list according to the index field.
在本申请一些实施方案中,所述数据查询指令包括查询数据量,所述基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果,包括:获取所述若干第一候选数据的初始数据量,并将所述初始数据量与所述查询数据量进行比较;当所述初始数据量大于所述查询数据量时,从所述第一候选数据中查询出若干第一目标数据,其中,所述若干第一目标数据的数据量为所述查询数据量,且所述若干第一目标数据为所述第一候选数据中的与所述数据查询指令匹配的数据;将所述若干第一目标数据确定为所述数据查询指令对应的查询结果。In some embodiments of the present application, the data query instruction includes querying the amount of data, and determining the query result corresponding to the data query instruction based on the plurality of first candidate data includes: obtaining the plurality of first candidate data. the initial data amount, and compare the initial data amount with the query data amount; when the initial data amount is greater than the query data amount, query several first target data from the first candidate data , wherein the data amount of the first target data is the query data amount, and the first target data is the data in the first candidate data that matches the data query instruction; Several first target data are determined as query results corresponding to the data query instruction.
在本申请一些实施方案中,所述数据查询指令包括查询数据量,所述基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果,包括:获取所述若干第一候选数据的初始数据量,并将所述初始数据量与所述查询数据量进行比较;当所述初始数据量小于所述查询数据量时,从所述多个待查询数据中筛选出若干第二目标数据,其中,所述若干第二目标数据为所述多个待查询数据中除 所述若干第一候选数据之外的且与所述数据查询指令匹配的数据,所述若干第一候选数据的数据量和所述若干第二目标数据的数据量之和为所述查询数据量;将所述若干第二目标数据及所述若干第一候选数据确定为所述数据查询指令对应的查询结果。In some embodiments of the present application, the data query instruction includes querying the amount of data, and determining the query result corresponding to the data query instruction based on the plurality of first candidate data includes: obtaining the plurality of first candidate data. the initial data amount, and compare the initial data amount with the query data amount; when the initial data amount is less than the query data amount, select a number of second targets from the plurality of data to be queried data, wherein the plurality of second target data are the plurality of data to be queried except For data other than the first candidate data and matching the data query instruction, the sum of the data volume of the first candidate data and the data volume of the second target data is the query data volume. ; Determine the plurality of second target data and the plurality of first candidate data as query results corresponding to the data query instruction.
在本申请一些实施方案中,所述数据查询指令包括查询数据量,所述基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果,包括:获取所述若干第一候选数据的初始数据量,并将所述初始数据量与所述查询数据量进行比较;当所述初始数据量等于所述查询数据量时,将所述若干第一候选数据确定为所述数据查询指令对应的查询结果。In some embodiments of the present application, the data query instruction includes querying the amount of data, and determining the query result corresponding to the data query instruction based on the plurality of first candidate data includes: obtaining the plurality of first candidate data. the initial data amount, and compare the initial data amount with the query data amount; when the initial data amount is equal to the query data amount, determine the several first candidate data as the data query instruction corresponding query results.
第二方面,本申请提供一种数据查询装置,包括:指令获取单元,用于获取数据存储列表的数据查询指令,其中,所述数据查询指令包括第一数据查询条件和第二数据查询条件;第一确定单元,用于根据所述数据查询指令从所述数据存储列表中确定多个待查询数据;第二确定单元,用于确定所述多个待查询数据中每个待查询数据的第一位图数据,其中,所述第一位图数据用于表征所述待查询数据是否与所述第一数据查询条件匹配;第三确定单元,用于确定所述待查询数据的第二位图数据,其中,所述第二位图数据用于表征所述待查询数据是否与所述第二数据查询条件匹配;数据筛选单元,用于基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据;数据查询单元,用于基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果。In a second aspect, the present application provides a data query device, including: an instruction acquisition unit, configured to obtain a data query instruction for a data storage list, wherein the data query instruction includes a first data query condition and a second data query condition; The first determination unit is used to determine a plurality of data to be queried from the data storage list according to the data query instruction; the second determination unit is used to determine the third data of each of the data to be queried in the plurality of data to be queried. One bit of map data, wherein the first bit of map data is used to characterize whether the data to be queried matches the first data query condition; a third determination unit is used to determine the second bit of the data to be queried graph data, wherein the second bitmap data is used to characterize whether the data to be queried matches the second data query condition; a data filtering unit is configured to based on the first graph data and the second Bitmap data is used to filter out a number of first candidate data from the plurality of data to be queried; a data query unit is used to determine the query result corresponding to the data query instruction based on the several first candidate data.
第三方面,本申请还提供一种计算机设备,包括:一个或多个处理器;存储器;以及一个或多个应用程序,其中,所述一个或多个应用程序被存储于所述存储器中,并配置为由所述处理器执行,以实现第一方面中任一项所述的数据查询方法。In a third aspect, the present application also provides a computer device, including: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory, and configured to be executed by the processor to implement the data query method described in any one of the first aspects.
第四方面,本申请还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器进行加载,以执行第一方面任一项所述的数据查询方法。In a fourth aspect, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute any of the data query methods described in the first aspect.
在本申请实施例提供的数据查询方法中,基于第一位图数据和第二位图数据,分别对多个待查询数据进行筛选,以从多个待查询数据筛选出若干第一候选数据,基于若干第一候选数据,能够确定数据查询指令对应的查询结果,从而避免了遍历所有待查询数据。此外,由于若干第一候选数据是基于第一位图数据和第二位图数据从多个待查询数据中筛选出的数据,若干第一候选数据的数据量小于多个待查询数据的数据量,因此,基于若干第一候选数据进行数据查询,可以缩短数据查询时间,提高数据查询响应速度。In the data query method provided by the embodiment of the present application, multiple data to be queried are respectively filtered based on the first bitmap data and the second bitmap data to filter out a number of first candidate data from the multiple data to be queried, Based on several first candidate data, the query result corresponding to the data query instruction can be determined, thereby avoiding traversing all the data to be queried. In addition, since the plurality of first candidate data are data filtered out from the plurality of data to be queried based on the first bitmap data and the second bitmap data, the data volume of the plurality of first candidate data is smaller than the data volume of the plurality of data to be queried. , Therefore, performing data query based on several first candidate data can shorten the data query time and improve the data query response speed.
附图简要说明Brief description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一 些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions in the embodiments of the present application more clearly, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only part of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1是本申请实施例提供的数据查询系统的场景示意图。Figure 1 is a schematic scenario diagram of a data query system provided by an embodiment of the present application.
图2是本申请实施例提供的数据查询方法的流程示意图。Figure 2 is a schematic flowchart of the data query method provided by the embodiment of the present application.
图3是本申请实施例提供的数据查询方法的流程示意图。Figure 3 is a schematic flowchart of the data query method provided by the embodiment of the present application.
图4是本申请实施例提供的数据查询装置的结构示意图。Figure 4 is a schematic structural diagram of a data query device provided by an embodiment of the present application.
图5是本申请实施例提供的计算机设备的结构示意图。Figure 5 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
实施本发明的方式Ways to practice the invention
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts fall within the scope of protection of this application.
在本申请的描述中,需要理解的是,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、“第三”的特征可以明示或者隐含地包括一个或者更多个特征。在本申请的描述中,“多个”和“若干”的含义是两个或两个以上,除非另有明确具体的限定。In the description of the present application, it should be understood that the terms "first", "second" and "third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated. Number of technical features. Thus, features defined as “first”, “second”, and “third” may explicitly or implicitly include one or more features. In the description of this application, "plurality" and "several" mean two or more than two, unless otherwise clearly and specifically limited.
在本申请中,“示例性”一词用来表示“用作例子、例证或说明”。本申请中被描述为“示例性”的任何实施例不一定被解释为比其它实施例更优选或更具优势。为了使本领域任何技术人员能够实现和使用本申请,给出了以下描述。在以下描述中,为了解释的目的而列出了细节。应当明白的是,本领域普通技术人员可以认识到,在不使用这些特定细节的情况下也可以实现本申请。在其它实例中,不会对公知的结构和过程进行详细阐述,以避免不必要的细节使本申请的描述变得晦涩。因此,本申请并非旨在限于所示的实施例,而是与符合本申请所公开的原理和特征的最广范围相一致。In this application, the word "exemplary" is used to mean "serving as an example, illustration, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the present application. In the following description, details are set forth for the purpose of explanation. It will be understood that one of ordinary skill in the art will recognize that the present application may be practiced without these specific details. In other instances, well-known structures and processes have not been described in detail to avoid obscuring the description of the application with unnecessary detail. Thus, this application is not intended to be limited to the embodiments shown but is to be accorded the widest scope consistent with the principles and features disclosed herein.
需要说明的是,本申请实施例方法由于是在计算机设备中执行,各计算机设备的处理对象均以数据或信息的形式存在,例如时间,实质为时间信息,可以理解的是,后续实施例中若提及数量、位置等,均为对应的数据存在,以便计算机设备进行处理,具体此处不作赘述。It should be noted that since the method in the embodiments of the present application is executed in a computer device, the processing objects of each computer device exist in the form of data or information, such as time, which is essentially time information. It can be understood that in subsequent embodiments, If quantity, location, etc. are mentioned, the corresponding data exists for processing by computer equipment, and the details will not be described here.
在相关技术中,排序查询的过程为:给定多个数据项,从中选出与查询条件相匹配的多个待查询数据,然后遍历所有待查询数据返回查询结果。由于需要遍历所有待查询数据,所以该排序查询的方式的查询时间长,响应速度慢。In related technologies, the process of sorting query is: given multiple data items, select multiple data to be queried that match the query conditions, and then traverse all the data to be queried to return the query results. Since all the data to be queried needs to be traversed, the query time of this sorted query method is long and the response speed is slow.
本申请实施例提供一种数据查询方法、装置、计算机设备及存储介质,以下分别进行详细说明。Embodiments of the present application provide a data query method, device, computer equipment and storage medium, which will be described in detail below.
请参阅图1,图1为本申请实施例提供的数据查询系统的场景示意图,该数据查询系统可以包括计算机设备100和存储器200。Please refer to FIG. 1 , which is a schematic diagram of a data query system provided by an embodiment of the present application. The data query system may include a computer device 100 and a memory 200 .
本申请实施例中,存储器200是建立在计算机存储设备上,支持按照数据结构来组织、存储和管理数据的仓库。在本申请实施例中,并不限定承载存储器 200的计算机存储设备的实现形式。存储器200用于存储数据,如数据查询指令,例如“查询男生中排名前三的分数”、“查询男生中排名后三的分数”、“查询女生中排名前三的分数”等,如多个待查询数据,例如分数(72,90,60,65,43,86,92,76,54,80,32,87,75,63,47,54)等。In the embodiment of the present application, the memory 200 is a warehouse built on a computer storage device that supports organizing, storing and managing data according to a data structure. In the embodiment of this application, the loader memory is not limited to 200 computer storage device implementation. The memory 200 is used to store data, such as data query instructions, such as "query the top three scores among boys", "query the bottom three scores among boys", "query the top three scores among girls", etc., such as multiple Data to be queried, such as scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54), etc.
本申请实施例中,该计算机设备100可以是独立的服务器,也可以是服务器组成的服务器网络或服务器集群,例如,本申请实施例中所描述的计算机设备100,其包括但不限于计算机、网络主机、单个网络服务器、多个网络服务器集或多个服务器构成的云服务器。云服务器由基于云计算(Cloud Computing)的大量计算机或网络服务器构成。In the embodiment of the present application, the computer device 100 may be an independent server, or a server network or server cluster composed of servers. For example, the computer device 100 described in the embodiment of the present application includes, but is not limited to, a computer, a network A host, a single network server, a set of multiple network servers, or a cloud server composed of multiple servers. Cloud servers consist of a large number of computers or network servers based on cloud computing.
可以理解的是,本申请实施例中所使用的计算机设备100可以是既包括接收和发射硬件的设备,即具有能够在双向通信链路上,执行双向通信的接收和发射硬件的设备。这种设备可以包括:蜂窝或其他通信设备,其具有单线路显示器或多线路显示器或没有多线路显示器的蜂窝或其他通信设备。计算机设备100可以是台式终端或移动终端,计算机设备100还可以是手机、平板电脑或笔记本电脑等中的一种。It can be understood that the computer device 100 used in the embodiment of the present application may be a device that includes both receiving and transmitting hardware, that is, a device with receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such devices may include cellular or other communications devices with a single line display or a multi-line display or a cellular or other communications device without a multi-line display. The computer device 100 may be a desktop terminal or a mobile terminal, and the computer device 100 may also be one of a mobile phone, a tablet computer, a notebook computer, etc.
计算机设备100与存储器200之间可以建立通信连接,该通信连接可以是有线或无线网络连接。可选的,在部署实现上,计算机设备100与存储器200可以部署在同一物理设备上实现,也可以部署在不同物理设备上实现。当计算机设备100与存储器200部署在不同物理设备上实现时,两者可以部署同一局域网内,也可以部署在不同局域网内。A communication connection may be established between the computer device 100 and the memory 200, which may be a wired or wireless network connection. Optionally, in terms of deployment and implementation, the computer device 100 and the memory 200 can be deployed on the same physical device for implementation, or they can be deployed on different physical devices for implementation. When the computer device 100 and the storage 200 are deployed on different physical devices, they can be deployed in the same local area network or in different local area networks.
下面结合本申请方案和图1所示的数据查询系统,对数据查询的过程进行详细说明。The data query process will be described in detail below based on the application plan and the data query system shown in Figure 1.
计算机设备100获取数据存储列表的数据查询指令,其中,数据查询指令包括第一数据查询条件和第二数据查询条件,计算机设备100再与存储器200进行通信,以根据数据查询指令从存储器200的数据存储列表中获取多个待查询数据。在计算机设备100获取到多个待查询数据后,执行如下步骤:确定多个待查询数据中每个待查询数据的第一位图数据,其中,第一位图数据用于表征每个待查询数据是否与第一数据查询条件匹配;确定每个待查询数据的第二位图数据,其中,第二位图数据用于表征所述每个待查询数据是否与第二数据查询条件匹配;基于第一位图数据和第二位图数据,从多个待查询数据中筛选出若干第一候选数据;基于若干第一候选数据,确定数据查询指令对应的查询结果。在计算机设备100进行数据查询时,无需遍历所有待查询数据,缩短数据查询时间,提高数据查询响应速度。The computer device 100 obtains the data query instruction of the data storage list, where the data query instruction includes a first data query condition and a second data query condition. The computer device 100 then communicates with the memory 200 to retrieve the data from the memory 200 according to the data query instruction. Get multiple data to be queried from the storage list. After the computer device 100 obtains a plurality of data to be queried, the following steps are performed: determining the first image data of each data to be queried in the multiple data to be queried, wherein the first image data is used to characterize each data to be queried. Whether the data matches the first data query condition; determine the second bitmap data of each data to be queried, where the second bitmap data is used to characterize whether each of the data to be queried matches the second data query condition; based on The first bitmap data and the second bitmap data are used to select a number of first candidate data from a plurality of data to be queried; based on a number of first candidate data, the query result corresponding to the data query instruction is determined. When the computer device 100 performs data query, there is no need to traverse all the data to be queried, thus shortening the data query time and improving the data query response speed.
在一示例中,在计算机设备100中可以集成有数据查询装置,该数据查询装置用于执行本申请实施例提供的上述数据查询方法。In one example, a data query device may be integrated into the computer device 100, and the data query device is used to execute the above data query method provided by the embodiment of the present application.
本领域技术人员可以理解,图1中示出的应用环境,仅仅是本申请方案的一种应用场景,并不构成对本申请方案应用场景的限定,其他的应用环境还可以包括比图1中所示更多或更少的计算机设备,例如图1中仅示出1个计算机设备,可以理解的,该数据查询系统还可以包括一个或多个其他设备,具体此处不作限定。 Those skilled in the art can understand that the application environment shown in Figure 1 is only one application scenario of the solution of the present application and does not constitute a limitation on the application scenarios of the solution of the present application. Other application environments may also include those shown in Figure 1 More or fewer computer devices are shown. For example, only one computer device is shown in Figure 1. It can be understood that the data query system may also include one or more other devices, and the details are not limited here.
需要说明的是,图1所示的数据查询系统的场景示意图仅仅是一个示例,本申请实施例描述的数据查询系统以及场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着数据查询系统的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。It should be noted that the scenario diagram of the data query system shown in Figure 1 is only an example. The data query system and scenarios described in the embodiments of this application are for the purpose of more clearly explaining the technical solutions of the embodiments of this application and do not constitute a As for the limitations of the technical solutions provided by the embodiments of this application, those of ordinary skill in the art will know that with the evolution of data query systems and the emergence of new business scenarios, the technical solutions provided by the embodiments of this application are equally applicable to similar technical problems.
下面结合图2和3,对本申请实施例提供的数据查询方法进行更为详细的举例说明。The following is a more detailed example of the data query method provided by the embodiment of the present application with reference to Figures 2 and 3.
图2为本申请实施例提供的数据查询方法的流程示意图,该数据查询方法可以由图1所示的计算机设备100来执行。该数据查询方法可以包括如下步骤301~306,具体如下:FIG. 2 is a schematic flowchart of a data query method provided by an embodiment of the present application. The data query method can be executed by the computer device 100 shown in FIG. 1 . The data query method may include the following steps 301 to 306, specifically as follows:
S301、获取数据存储列表的数据查询指令,其中,所述数据查询指令包括第一数据查询条件和第二数据查询条件。S301. Obtain a data query instruction for the data storage list, where the data query instruction includes a first data query condition and a second data query condition.
数据存储列表为待查询数据所在的数据列表,数据存储列表可以是基于LSM树的存储系统中的一个数据存储列表,在数据存储列表中包括多个数据项,每个数据项以索引字段-数值的形式进行存储,因此,基于具体的索引字段可以从数据存储列表中查询出该索引字段对应的数值。例如,如表1所示的数据存储列表,包括三个数据项,分别为学号及其对应的数值、性别及其对应的数值、分数及其对应的数值,基于索引字段“分数”,可以从数据存储列表中查询出“分数”对应的数值。The data storage list is a data list where the data to be queried is located. The data storage list can be a data storage list in a storage system based on an LSM tree. The data storage list includes multiple data items, and each data item is indexed by a field-value. Therefore, based on a specific index field, the value corresponding to the index field can be queried from the data storage list. For example, the data storage list shown in Table 1 includes three data items, namely student number and its corresponding value, gender and its corresponding value, and score and its corresponding value. Based on the index field "score", you can Query the value corresponding to "score" from the data storage list.
表1数据存储列表

Table 1 Data storage list

数据查询指令为用户向计算机设备发出的针对数据存储列表的数据查询请求,该数据查询指令包括但不限于触摸指令、鼠标指令、遥控指令、语音指令等,例如,用户想要查询表1中性别为男生且排名前三的分数时,直接在触摸屏上输入“查询男生中排名前三的分数”,或者用户发出“查询男生中排名前三的分数”的语音指令等。用户需要对数据存储列表中的某个数据项进行数据查询时,可以向计算机设备发送数据存储列表的数据查询指令,计算机设备接收到该数据查询指令后,会基于数据查询指令进行相应的数据查询。The data query instruction is a data query request for the data storage list issued by the user to the computer device. The data query instruction includes but is not limited to touch instructions, mouse instructions, remote control instructions, voice instructions, etc. For example, the user wants to query the gender in Table 1 When it is a boy and the score is among the top three, directly enter "query the top three scores among boys" on the touch screen, or the user issues a voice command such as "query the top three scores among boys". When the user needs to perform data query on a certain data item in the data storage list, the user can send the data query instruction of the data storage list to the computer device. After receiving the data query instruction, the computer device will perform the corresponding data query based on the data query instruction. .
该数据查询指令可以包括第一数据查询条件和第二数据查询条件,第一数据查询条件可以理解为数据查询指令的基础查询条件,第二数据查询条件可以理解为数据查询指令的附加查询条件。例如,当数据查询指令为“查询男生中排名前三的分数”时,则第一数据查询条件为与性别相关的查询条件,第二数据查询条件为与分数相关的查询条件。但是本申请实施例对第一数据查询条件和第二数据查询条件不做具体限定,随着数据查询指令的不同,第一数据查询条件和第二数据查询条件也会不同。The data query instruction may include a first data query condition and a second data query condition. The first data query condition may be understood as the basic query condition of the data query instruction, and the second data query condition may be understood as the additional query condition of the data query instruction. For example, when the data query instruction is "query the top three scores among boys", the first data query condition is a query condition related to gender, and the second data query condition is a query condition related to scores. However, the embodiment of the present application does not specifically limit the first data query condition and the second data query condition. With different data query instructions, the first data query condition and the second data query condition will also be different.
S302、根据所述数据查询指令从所述数据存储列表中确定多个待查询数据。S302. Determine multiple data to be queried from the data storage list according to the data query instruction.
数据存储列表中包括多个数据项,多个待查询数据为基于数据查询指令确定的想要进行数据查询的数据项的数值,例如,以表1为例,当数据查询指令为“查询男生中排名前三的分数”时,多个待查询数据为“分数”对应的数值,即分数(72,90,60,65,43,86,92,76,54,80,32,87,75,63,47,54)。计算机设备获取数据存储列表的数据查询指令后,根据数据查询指令从数据存储列表中确定多个待查询数据,以便后续步骤中基于多个待查询数据进行数据查询。The data storage list includes multiple data items, and the multiple data to be queried are the values of the data items that are to be queried based on the data query instruction. For example, taking Table 1 as an example, when the data query instruction is "Query among boys" "Top three scores", multiple data to be queried are values corresponding to "scores", that is, scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54). After obtaining the data query instruction of the data storage list, the computer device determines multiple data to be queried from the data storage list according to the data query instruction, so that in subsequent steps, data query can be performed based on the multiple data to be queried.
在一具体实施方式中,如图3所示,步骤S302中所述根据所述数据查询指令从所述数据存储列表中确定多个待查询数据,可以包括如下步骤S401和S402,具体如下:In a specific implementation, as shown in Figure 3, determining multiple data to be queried from the data storage list according to the data query instruction in step S302 may include the following steps S401 and S402, specifically as follows:
S401、获取所述数据查询指令中的索引字段,所述索引字段为所述数据存储列表中与所述多个待查询数据关联的字段;S401. Obtain the index field in the data query instruction, where the index field is a field associated with the plurality of data to be queried in the data storage list;
S402、根据所述索引字段,从所述数据存储列表中确定多个待查询数据。S402. Determine multiple data to be queried from the data storage list according to the index field.
数据查询指令中包括索引字段,索引字段为数据存储列表中与多个待查询数据关联的字段,例如,以表1为例,当数据查询指令为“查询男生中排名前三的分数”时,索引字段为“分数”。本实施例根据数据查询指令从数据存储列表中确定多个待查询数据时,首先获取数据查询指令中的索引字段,然后根据索引字段,从数据存储列表中获取该索引字段对应的数值,该索引字段对应的数值即为多个待查询数据。例如,获取索引字段“分数”后,即可从表1所示的数据存储 列表中确定多个待查询数据为分数(72,90,60,65,43,86,92,76,54,80,32,87,75,63,47,54)。The data query instruction includes an index field, which is a field in the data storage list that is associated with multiple data to be queried. For example, taking Table 1 as an example, when the data query instruction is "query the top three scores among boys", The index field is "score". In this embodiment, when multiple data to be queried are determined from the data storage list according to the data query instruction, the index field in the data query instruction is first obtained, and then the value corresponding to the index field is obtained from the data storage list according to the index field. The values corresponding to the fields are multiple data to be queried. For example, after obtaining the index field "score", you can retrieve it from the data storage shown in Table 1 Multiple data to be queried are determined in the list as scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54).
S303、确定所述多个待查询数据中每个待查询数据的第一位图数据,其中,所述第一位图数据用于表征待查询数据是否与所述第一数据查询条件匹配。S303. Determine the first image data of each of the plurality of data to be queried, where the first image data is used to represent whether the data to be queried matches the first data query condition.
第一位图数据为采用位图数据结构(Bitmap)表示的数据,用于表征每个待查询数据是否与第一数据查询条件匹配,第一位图数据可以为预设的第一数值或预设的第二数值,当第一位图数据为第一数值时,表示待查询数据与第一数据查询条件匹配,当第一位图数据为第二数值时,表示待查询数据与第一数据查询条件不匹配。例如,第一数值和第二数值分别为1和0,当第一位图数据为1时,表示待查询数据与第一数据查询条件匹配,当第一位图数据为0时,表示待查询数据与第一数据查询条件不匹配。本实施例确定多个待查询数据后,进一步确定多个待查询数据中每个待查询数据的第一位图数据,以便后续步骤中基于第一位图数据进行数据查询。The first bit map data is data represented by a bitmap data structure (Bitmap) and is used to represent whether each data to be queried matches the first data query condition. The first bit map data can be a preset first value or a predetermined value. Assume the second value. When the first image data is the first value, it means that the data to be queried matches the first data query condition. When the first image data is the second value, it means that the data to be queried matches the first data. The query conditions do not match. For example, the first value and the second value are 1 and 0 respectively. When the first image data is 1, it means that the data to be queried matches the first data query condition. When the first image data is 0, it means that the data to be queried is 0. The data does not match the first data query condition. After determining multiple data to be queried, this embodiment further determines the first image data of each data to be queried in the multiple data to be queried, so that data query can be performed based on the first image data in subsequent steps.
在一具体实施方式中,如图3所示,步骤S303中所述确定所述多个待查询数据中每个待查询数据的第一位图数据,可以包括如下步骤S403~S405,具体如下:In a specific implementation, as shown in Figure 3, determining the first image data of each of the plurality of data to be queried in step S303 may include the following steps S403 to S405, specifically as follows:
S403、从所述多个待查询数据中筛选出若干第二候选数据,其中,所述若干第二候选数据为所述多个待查询数据中与所述第一数据查询条件匹配的数据;S403. Screen out a number of second candidate data from the plurality of data to be queried, where the plurality of second candidate data are data matching the first data query condition among the plurality of data to be queried;
S404、将预设的第一数值确定为所述若干第二候选数据中每个第二候选数据的第一位图数据;S404. Determine the preset first value as the first bit image data of each second candidate data among the plurality of second candidate data;
S405、将预设的第二数值确定为所述多个待查询数据中除所述若干第二候选数据以外的每个待查询数据的第一位图数据。S405. Determine the preset second value as the first image data of each of the plurality of data to be queried except for the plurality of second candidate data.
若干第二候选数据为多个待查询数据中与第一数据查询条件匹配的数据,当多个待查询数据均与第一数据查询条件匹配时,若干第二候选数据即为多个待查询数据,当多个待查询数据中只有一部分数据与第一数据查询条件匹配时,若干第二候选数据为多个待查询数据中的部分数据。第一数值和第二数值为预先设置的用于表征多个待查询数据的状态的数值,当第一位图数据为第一数值时,表示待查询数据与第一数据查询条件匹配,当第一位图数据为第二数值时,表示待查询数据与第一数据查询条件不匹配,例如,第一数值可以为1,第二数值可以为0。The plurality of second candidate data are the data that match the first data query condition among the plurality of data to be queried. When the plurality of data to be queried all match the first data query condition, the plurality of second candidate data are the plurality of data to be queried. , when only a part of the plurality of data to be queried matches the first data query condition, a plurality of second candidate data are part of the plurality of data to be queried. The first numerical value and the second numerical value are preset numerical values used to represent the status of multiple data to be queried. When the first image data is the first value, it means that the data to be queried matches the first data query condition. When the bitmap data is the second value, it means that the data to be queried does not match the first data query condition. For example, the first value can be 1 and the second value can be 0.
本实施例确定每个待查询数据的第一位图数据时,首先从多个待查询数据中筛选出若干第二候选数据,然后将预设的第一数值确定为若干第二候选数据中每个第二候选数据的第一位图数据,并将预设的第二数值确定为多个待查询数据中除若干第二候选数据以外的每个待查询数据的第一位图数据。例如,以表1为例,多个待查询数据为分数(72,90,60,65,43,86,92,76,54,80,32,87,75,63,47,54),从多个待查询数据中筛选出的若干第二候选数据为分数(72,60,65,92,76,54,32,87,63,54),则多个待查询数据中除若干第二候选数据以外的数据为分数(90,43,86,80,75,47),将1确定为分数(72,60,65,92,76,54,32,87,63,54)中每个数据的第一位图数据,将0确定为分数(90,43,86,80,75,47)中每个数据的第一位图数据。 In this embodiment, when determining the first image data of each data to be queried, several second candidate data are first screened out from multiple data to be queried, and then the preset first value is determined as each of the plurality of second candidate data. first image data of the second candidate data, and determine the preset second value as the first image data of each of the plurality of data to be queried except for several second candidate data. For example, taking Table 1 as an example, multiple data to be queried are scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54). From Several second candidate data filtered out from multiple data to be queried are scores (72, 60, 65, 92, 76, 54, 32, 87, 63, 54), then several second candidates are selected from multiple data to be queried Data other than data are fractions (90, 43, 86, 80, 75, 47), and 1 is determined as each data in the fraction (72, 60, 65, 92, 76, 54, 32, 87, 63, 54) The first bit of image data, determine 0 as the first bit of image data for each data in the score (90, 43, 86, 80, 75, 47).
从多个待查询数据中筛选出若干第二候选数据时,需要确定多个待查询数据是否与第一数据查询条件匹配。在一具体实现方式中,确定多个待查询数据是否与第一数据查询条件匹配时,可以首先基于数据查询指令从所述数据存储列表中确定每个待查询数据的关联数据,关联数据为数据存储列表中与每个待查询数据关联的用于对多个待查询数据进行筛选的数据,例如,以表1为例,当数据查询指令为“查询男生中排名前三的分数”时,多个关联数据为性别(男,女,男,男,女,女,男,男,男,女,男,男,女,男,女,男)。然后将多个关联数据与数据查询指令进行比较,从多个关联数据中筛选出与数据查询指令匹配的若干关联数据,确定与若干关联数据相关联的若干待查询数据为若干第二候选数据。When filtering out several second candidate data from multiple data to be queried, it is necessary to determine whether the multiple data to be queried matches the first data query condition. In a specific implementation manner, when determining whether multiple data to be queried matches the first data query condition, the associated data of each data to be queried can first be determined from the data storage list based on the data query instruction, and the associated data is data Store the data associated with each to-be-queried data in the list for filtering multiple to-be-queried data. For example, taking Table 1 as an example, when the data query instruction is "query the top three scores among boys", multiple The associated data is gender (male, female, male, male, female, female, male, male, male, female, male, male, female, male, female, male). Then, the plurality of associated data are compared with the data query instructions, a number of associated data matching the data query instructions are filtered out from the multiple associated data, and a number of data to be queried associated with a number of associated data are determined to be a number of second candidate data.
应理解,在这种情况下,该第一数据查询条件则为哪些分数对应的是男生。如上所述,第一数据查询条件为数据查询指令的基础查询条件,也就是说,基础查询条件能够完全地反应数据查询指令的目的。例如,数据查询指令为“查询男生中排名前三的分数”,第一数据查询条件为哪些分数对应的是男生,通过确定哪些分数对应的是男生能够将查询直接定位到数据查询指令的目的,即,查询男生。It should be understood that in this case, the first data query condition is which scores correspond to boys. As mentioned above, the first data query condition is the basic query condition of the data query instruction, that is to say, the basic query condition can completely reflect the purpose of the data query instruction. For example, the data query instruction is "query the top three scores among boys". The first data query condition is which scores correspond to boys. By determining which scores correspond to boys, the query can be directly targeted to the purpose of the data query instruction. That is, query for boys.
当一个关联数据与第一数据查询条件匹配时,确定该关联数据相关联的待查询数据与第一数据查询条件匹配;反之,当一个关联数据与第一数据查询条件不匹配时,确定该关联数据相关联的待查询数据与第一数据查询条件不匹配。以表1为例,多个待查询数据为分数(72,90,60,65,43,86,92,76,54,80,32,87,75,63,47,54),多个关联数据为性别(男,女,男,男,女,女,男,男,男,女,男,男,女,男,女,男),则多个待查询数据中分数(72,60,65,92,76,54,32,87,63,54)与第一数据查询条件匹配。When an associated data matches the first data query condition, it is determined that the to-be-queried data associated with the associated data matches the first data query condition; conversely, when an associated data does not match the first data query condition, it is determined that the association is The data to be queried associated with the data does not match the first data query condition. Taking Table 1 as an example, multiple data to be queried are scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54), and multiple associations The data is gender (male, female, male, male, female, female, male, male, male, female, male, male, female, male, female, male), then the scores in the multiple data to be queried are (72, 60, 65, 92, 76, 54, 32, 87, 63, 54) matches the first data query condition.
S304、确定所述待查询数据的第二位图数据,其中,所述第二位图数据用于表征所述待查询数据是否与所述第二数据查询条件匹配。S304. Determine the second bitmap data of the data to be queried, where the second bitmap data is used to characterize whether the data to be queried matches the second data query condition.
第二位图数据为采用位图数据结构(Bitmap)表示的数据,用于表征每个待查询数据是否与第二数据查询条件匹配。当第二数据查询条件为与数值相关的查询条件时,第二数据查询条件可以为哪些分数大于或者不大于多个待查询数据的均值。也就是说,基于第二位图数据可以从多个待查询数据中筛选出大于或者不大于多个待查询数据的均值的数据。第二位图数据可以为预设的第三数值或预设的第四数值,当第二位图数据为第三数值时,表示待查询数据小于(或大于)多个待查询数据的均值,当第二位图数据为第四数值时,表示待查询数据不小于(或不大于)多个待查询数据的均值。例如,第三数值和第四数值分别为1和0,当第二位图数据为1时,表示待查询数据大于多个待查询数据的均值,即,待查询数据与第二数据查询条件匹配,当第一位图数据为0时,表示待查询数据不大于多个待查询数据的均值,即,待查询数据与第二数据查询条件不匹配。本实施例确定每个待查询数据的第一位图数据后,进一步确定每个待查询数据的第二位图数据,以便后续步骤中基于第一位图数据和第二位图数据进行数据查询。The second bitmap data is data represented by a bitmap data structure (Bitmap), and is used to represent whether each data to be queried matches the second data query condition. When the second data query condition is a query condition related to numerical values, the second data query condition may be which scores are greater than or not greater than the average value of multiple data to be queried. That is to say, based on the second bitmap data, data that is greater than or not greater than the mean value of the multiple data to be queried can be filtered out from multiple data to be queried. The second bitmap data can be a preset third value or a preset fourth value. When the second bitmap data is the third value, it means that the data to be queried is less than (or greater than) the average of multiple data to be queried. When the second bitmap data is a fourth numerical value, it means that the data to be queried is not less than (or not greater than) the average value of multiple data to be queried. For example, the third value and the fourth value are 1 and 0 respectively. When the second bitmap data is 1, it means that the data to be queried is greater than the average of multiple data to be queried, that is, the data to be queried matches the second data query condition. , when the first image data is 0, it means that the data to be queried is not greater than the average of multiple data to be queried, that is, the data to be queried does not match the second data query condition. In this embodiment, after determining the first bitmap data of each data to be queried, the second bitmap data of each data to be queried is further determined, so that data query can be performed based on the first bitmap data and the second bitmap data in subsequent steps. .
应理解,如上所述,第二数据查询条件为数据查询指令的附加查询条件,附加查询条件能否完全地反应数据查询指令的目的,还要取决于数据查询指令。例如,数据查询指令为“查询男生中分数大于平均分数的分数”,第二数据查询条 件为哪些分数大于多个待查询数据的均值,通过确定哪些分数大于均值能够将查询直接定位到数据查询指令的目的,即,查询分数大于平均分数的分数,也就是说,该第二数据查询条件能够完全地反应数据查询指令的目的。又如,数据查询指令为“查询男生中排名前三的分数”,第二数据查询条件为哪些分数大于多个待查询数据的均值,通过确定哪些分数大于均值能够将查询定位到分数大于平均分数的分数,而后再在分数大于平均分数的分数的基础上,进行再次查询,以完成数据查询指令的目的,也就是说,该第二数据查询条件只能够辅助性地完成数据查询指令的目的,并不能完全地反应数据查询指令的目的。It should be understood that, as mentioned above, the second data query condition is an additional query condition of the data query instruction. Whether the additional query condition can fully reflect the purpose of the data query instruction also depends on the data query instruction. For example, the data query instruction is "query the scores among boys whose scores are greater than the average score". The second data query item The items are which scores are greater than the average of multiple data to be queried. By determining which scores are greater than the average, the query can be directly positioned to the purpose of the data query instruction, that is, the query score is greater than the average score, that is, the second data query Conditions can fully reflect the purpose of data query instructions. For another example, the data query instruction is "query the top three scores among boys", and the second data query condition is which scores are greater than the average of multiple data to be queried. By determining which scores are greater than the average, the query can be positioned to the score that is greater than the average score. score, and then query again on the basis of the score greater than the average score to complete the purpose of the data query instruction. In other words, the second data query condition can only assist in completing the purpose of the data query instruction. It does not fully reflect the purpose of the data query command.
S305、基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据。S305. Based on the first bitmap data and the second bitmap data, select several first candidate data from the plurality of data to be queried.
若干第一候选数据随数据查询指令的不同而变化,例如,当数据查询指令为“查询男生的排序靠前的多个数据”时,若干第一候选数据为多个待查询数据中男生的且分数大于多个待查询数据的均值的数据;又如,当数据查询指令为“查询排序靠后的多个数据”时,若干第一候选数据为多个待查询数据中男生的且分数不大于多个待查询数据的均值的数据。A number of first candidate data changes with different data query instructions. For example, when the data query instruction is "query multiple top-ranked data of boys", a number of first candidate data are the boy's and multiple data to be queried. Data whose score is greater than the mean of multiple data to be queried; for another example, when the data query instruction is "query multiple data in the lower order", some of the first candidate data are boys in multiple data to be queried and the score is not greater than The average data of multiple data to be queried.
本实施例获取预先确定的每个待查询数据的第二位图数据后,进一步基于第一位图数据和第二位图数据,从多个待查询数据中筛选出若干第一候选数据。In this embodiment, after obtaining the predetermined second bitmap data of each data to be queried, a number of first candidate data are further selected from multiple data to be queried based on the first map data and the second bitmap data.
在一具体实施方式中,如图3所示,步骤S305中所述基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据,可以包括如下步骤S406和S407,具体如下:In a specific implementation, as shown in Figure 3, based on the first bitmap data and the second bitmap data in step S305, several first candidates are screened out from the plurality of data to be queried. The data may include the following steps S406 and S407, specifically as follows:
S406、对所述第一位图数据和所述第二位图数据进行位运算,得到所述每个待查询数据的目标位图数据,其中,所述目标位图数据用于表征所述待查询数据是否同时满足第一数据查询条件和所述第二数据查询条件;S406: Perform bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of each data to be queried, where the target bitmap data is used to characterize the data to be queried. Query whether the data satisfies both the first data query condition and the second data query condition;
S407、基于所述目标位图数据,从所述多个待查询数据中筛选出若干第一候选数据。S407. Based on the target bitmap data, select a number of first candidate data from the plurality of data to be queried.
目标位图数据也为采用位图数据结构(Bitmap)表示的数据,其为对第一位图数据和第二位图数据进行位运算后得到的数据,目标位图数据用于表征待查询数据是否同时满足与第一数据查询条件匹配且与第二数据查询条件匹配。The target bitmap data is also data represented by a bitmap data structure (Bitmap). It is the data obtained by performing bit operations on the first bitmap data and the second bitmap data. The target bitmap data is used to represent the data to be queried. Whether it satisfies both the first data query condition and the second data query condition.
目标位图数据的表征含义随数据查询指令的不同而变化,例如,当数据查询指令为“查询排序靠前的多个数据”时,目标位图数据用于表征男生的且分数大于多个待查询数据的均值的分数;又如,当数据查询指令为“查询排序靠后的多个数据”时,目标位图数据用于表征男生的且分数不大于多个待查询数据的均值的分数。例如,以数据查询指令为“查询排序靠前的多个数据”为例,当目标位图数据为1时,表示待查询数据与第一数据查询条件匹配且大于多个待查询数据的均值(即,与第二数据查询条件匹配),当目标位图数据为0时,表示待查询数据与第一数据查询条件不匹配或不大于多个待查询数据的均值(即,与第二数据查询条件不匹配)。The representational meaning of the target bitmap data changes with different data query instructions. For example, when the data query instruction is "query multiple data in the top order", the target bitmap data is used to represent boys whose scores are greater than those of multiple candidates. Query the average score of the data; for another example, when the data query instruction is "query multiple data in the lower order", the target bitmap data is used to represent the score of boys and the score is not greater than the average of multiple data to be queried. For example, taking the data query instruction as "query multiple data that are ranked first", when the target bitmap data is 1, it means that the data to be queried matches the first data query condition and is greater than the average value of the multiple data to be queried ( That is, matches the second data query condition), when the target bitmap data is 0, it means that the data to be queried does not match the first data query condition or is not greater than the average of multiple data to be queried (that is, matches the second data query condition condition does not match).
本实施例基于第一位图数据和第二位图数据从多个待查询数据中筛选出若干第一候选数据时,首先对第一位图数据和第二位图数据进行位运算,得到每个待查询数据的目标位图数据,然后基于每个待查询数据的目标位图数据,从多个待 查询数据中筛选出若干第一候选数据。例如,以表1为例,多个待查询数据为分数(72,90,60,65,43,86,92,76,54,80,32,87,75,63,47,54),多个待查询数据的第一位图数据分别为性别对应的(1,0,1,1,0,0,1,1,1,0,1,1,0,1,0,1),多个待查询数据的第二位图数据分别为均值分数对应的(1,1,0,1,0,1,1,1,0,1,0,1,1,1,0,0),对第一位图数据和第二位图数据进行位运算,得到多个待查询数据的目标位图数据为性别和均值分数对应的(1,0,0,1,0,0,1,1,0,0,0,1,0,1,0,0),从多个待查询数据中筛选出目标位图数据为1的数据,即分数(75,65,92,76,87,63),将其作为若干第一候选数据。In this embodiment, when selecting several first candidate data from multiple data to be queried based on the first bitmap data and the second bitmap data, bit operations are first performed on the first bitmap data and the second bitmap data to obtain each target bitmap data of the data to be queried, and then based on the target bitmap data of each data to be queried, from multiple to-be-queried data A number of first candidate data are screened out from the query data. For example, taking Table 1 as an example, multiple data to be queried are scores (72, 90, 60, 65, 43, 86, 92, 76, 54, 80, 32, 87, 75, 63, 47, 54). The first image data of the data to be queried are (1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1) corresponding to gender. The second bitmap data of the data to be queried are respectively (1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0) corresponding to the mean scores. Perform bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of multiple data to be queried, which are (1, 0, 0, 1, 0, 0, 1, 1 corresponding to gender and mean score , 0, 0, 0, 1, 0, 1, 0, 0), filter out the data whose target bitmap data is 1 from multiple data to be queried, that is, the score (75, 65, 92, 76, 87, 63 ), as several first candidate data.
S306、基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果。S306. Based on the plurality of first candidate data, determine the query result corresponding to the data query instruction.
查询结果为按照数据查询指令从数据存储列表中查询出的最终的数据查询结果,例如,以表1为例,数据查询指令为“查询男生中排名前三的分数”,则查询结果为(92、87、72)。The query result is the final data query result queried from the data storage list according to the data query instruction. For example, taking Table 1 as an example, the data query instruction is "query the top three scores among boys", then the query result is (92 , 87, 72).
在本实施例中,从多个待查询数据中筛选出若干第一候选数据后,基于若干第一候选数据,确定数据查询指令对应的查询结果。由于查询结果是基于若干第一候选数据确定,避免了遍历多个待查询数据来确定查询结果,并且由于若干第一候选数据是从多个待查询数据中筛选出的数据,若干第一候选数据小于多个待查询数据的数据量,因此,基于若干第一候选数据确定查询结果集,可以缩短数据查询时间,提高数据查询响应速率。In this embodiment, after a plurality of first candidate data are screened out from a plurality of data to be queried, the query result corresponding to the data query instruction is determined based on the several first candidate data. Since the query result is determined based on several first candidate data, it is avoided to traverse multiple to-be-queried data to determine the query result, and since several first candidate data are data filtered out from multiple to-be-queried data, several first candidate data It is smaller than the data volume of multiple data to be queried. Therefore, determining the query result set based on several first candidate data can shorten the data query time and improve the data query response rate.
在一具体实施方式中,所述数据查询指令中包括查询数据量,继续参照图3所示,步骤S306中所述基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果,可以包括如下步骤S408~S410,具体如下:In a specific implementation, the data query instruction includes the amount of query data. Continuing to refer to Figure 3, in step S306, based on the plurality of first candidate data, the query result corresponding to the data query instruction is determined, The following steps S408 to S410 may be included, specifically as follows:
S408、获取所述若干第一候选数据的初始数据量,将所述初始数据量与所述查询数据量进行比较;S408. Obtain the initial data volume of the several first candidate data, and compare the initial data volume with the query data volume;
S409、当所述初始数据量大于所述查询数据量时,从所述第一候选数据中查询出若干第一目标数据,其中,所述若干第一目标数据的数据量为所述查询数据量,且所述若干第一目标数据为所述第一候选数据中的与所述数据查询指令匹配的数据;S409. When the initial data amount is greater than the query data amount, query a plurality of first target data from the first candidate data, wherein the data amount of the plurality of first target data is the query data amount. , and the plurality of first target data are the data in the first candidate data that match the data query instruction;
S410、将所述若干第一目标数据,确定为所述数据查询指令对应的查询结果。S410. Determine the plurality of first target data as query results corresponding to the data query instruction.
如上所述,由于第二数据查询条件为数据查询指令的附加查询条件,附加查询条件能否完全地反应数据查询指令的目的,还要取决于数据查询指令,所以基于第二数据查询条件所获得的若干第一候选数据并不一定都与数据查询指令匹配,所以可以再次从若干第一候选数据中筛选若干第一目标数据,此时,第一目标数据就是与数据查询指令匹配的数据。As mentioned above, since the second data query condition is an additional query condition of the data query instruction, whether the additional query condition can fully reflect the purpose of the data query instruction also depends on the data query instruction. Therefore, the data obtained based on the second data query condition Not all of the first candidate data may match the data query instruction, so some first target data can be screened from the first candidate data again. At this time, the first target data is the data that matches the data query instruction.
数据查询指令包括查询数据量,查询数据量为查询结果中数据的数据量,例如,数据查询指令为“查询男生中排名前三的分数”,则查询数据量为3。初始数据量为若干第一候选数据的数据量,例如,确定若干第一候选数据为分数(75,65,92,76,87,63),则初始数据量为6。若干第一目标数据的数据量为查询数据量,且若干第一目标数据随数据查询指令的不同而变化,例如,当数据查询指令为查询排序靠前的多个数据时,若干第一目标数据为若干第一候选数据中排 序靠前的数据;又如,当数据查询指令为查询排序靠后的多个数据时,若干第一目标数据为若干第一候选数据中排序靠后的数据。The data query instruction includes the query data amount, which is the data amount of the data in the query result. For example, if the data query instruction is "query the top three scores among boys", the query data amount is 3. The initial data amount is the data amount of several first candidate data. For example, if it is determined that several first candidate data are scores (75, 65, 92, 76, 87, 63), then the initial data amount is 6. The data amount of some first target data is the query data amount, and the number of first target data changes with different data query instructions. For example, when the data query instruction is to query multiple data in the top order, the number of first target data Rank among several first candidate data For example, when the data query instruction is to query multiple data in the lower order, some first target data are the lower order data among the plurality of first candidate data.
在本实施例中,基于若干第一候选数据确定数据查询指令对应的查询结果时,首先获取若干第一候选数据的初始数据量,然后将初始数据量与查询数据量进行比较,当初始数据量大于查询数据量时,从第一候选数据中查询出若干第一目标数据,并将若干第一目标数据,确定为数据查询指令对应的查询数据。例如,以表1为例,查询指令为“查询男生中排名前三的分数”,若干第一候选数据为分数(72,65,92,76,87,63),则初始数据量6大于查询数据量3,从若干第一候选数据中查询出若干第一目标数据,即分数(92,87,76),并将若干第一目标数据,即分数(92,87,76),确定为查询结果。In this embodiment, when determining the query result corresponding to the data query instruction based on several first candidate data, first obtain the initial data volume of several first candidate data, and then compare the initial data volume with the query data volume. When the initial data volume When the amount of query data is larger than the amount of query data, a plurality of first target data are queried from the first candidate data, and a plurality of first target data are determined as query data corresponding to the data query instruction. For example, taking Table 1 as an example, the query instruction is "query the top three scores among boys", and several first candidate data are scores (72, 65, 92, 76, 87, 63), then the initial data amount 6 is larger than the query The amount of data is 3. Query some first target data, that is, scores (92, 87, 76), from several first candidate data, and determine some first target data, that is, scores (92, 87, 76), as the query result.
假设初始数据量为ha,查询数据量为k,当ha≥k时,确定查询结果的计算量为(logk)*ha+ha,而传统排序查询方式计算量为(logk)*h+h,其中,h为多个待查询数据的数据量,由于h>ha,则(logk)*h+h>(logk)*ha+ha,即采用本申请方案进行数据查询相比传统排序查询方式,计算量减少。Assume that the initial data amount is ha and the query data amount is k. When ha≥k, the calculation amount to determine the query result is (logk)*ha+ha, while the calculation amount of the traditional sorting query method is (logk)*h+h, Among them, h is the data volume of multiple data to be queried. Since h>ha, then (logk)*h+h>(logk)*ha+ha, that is, compared with the traditional sorting query method for data query using the solution of this application, The amount of calculation is reduced.
在一具体实施方式中,继续参照图3所示,步骤S408中所述将所述初始数据量与所述查询数据量进行比较之后,可以包括如下步骤S411至S413,具体如下:In a specific implementation, continuing to refer to Figure 3, after comparing the initial data amount and the query data amount in step S408, the following steps S411 to S413 may be included, specifically as follows:
S411、当所述初始数据量小于所述查询数据量时,从所述多个待查询数据中筛选出若干第三候选数据,其中,所述若干第三候选数据为所述多个待查询数据中除所述若干第一候选数据之外的数据;S411. When the initial data amount is less than the query data amount, filter out a number of third candidate data from the plurality of data to be queried, wherein the plurality of third candidate data are the plurality of data to be queried. Data other than the several first candidate data;
S412、从所述若干第三候选数据中查询出若干第二目标数据,其中,所述若干第二目标数据为所述若干第三候选数据中与所述数据查询指令匹配的数据;S412. Query a plurality of second target data from the plurality of third candidate data, wherein the plurality of second target data are data among the plurality of third candidate data that match the data query instruction;
S413、将所述若干第二目标数据及所述若干第一候选数据,确定为所述数据查询指令对应的查询结果。应当理解,除通过步骤S411至S413筛选若干第二目标数据以外,还可以从多个待查询数据中直接筛选出若干第二目标数据,本申请实施例不做具体限定。S413. Determine the plurality of second target data and the plurality of first candidate data as query results corresponding to the data query instruction. It should be understood that, in addition to filtering a number of second target data through steps S411 to S413, a number of second target data can also be directly screened from a plurality of data to be queried, which is not specifically limited in the embodiment of the present application.
若干第三候选数据为多个待查询数据中除若干第一候选数据之外的数据,例如,多个待查询数据为分数(72,90,60,65,43,86,92,76,54,80,32,87,75,63,47,54),若干第一候选数据为分数(72,65,92,76,87,63),则若干第三候选数据为分数(90,60,43,86,54,80,32,75,47,54)。若干第二目标数据的数据量为查询数据量与初始数据量的差值,例如,查询数据量为8,初始数据量为6,则若干第二目标数据的数据量为2。A plurality of third candidate data are data other than a plurality of first candidate data among the plurality of data to be queried. For example, the plurality of data to be queried are scores (72, 90, 60, 65, 43, 86, 92, 76, 54 , 80, 32, 87, 75, 63, 47, 54), some first candidate data are scores (72, 65, 92, 76, 87, 63), then some third candidate data are scores (90, 60, 43, 86, 54, 80, 32, 75, 47, 54). The data volume of some second target data is the difference between the query data volume and the initial data volume. For example, if the query data volume is 8 and the initial data volume is 6, then the data volume of some second target data is 2.
若干第二目标数据随数据查询指令的不同而变化,例如,当数据查询指令为“查询排序靠前的多个数据”时,若干第二目标数据为若干第三候选数据中排序靠前的数据;又如,当数据查询指令为“查询排序靠后的多个数据”时,若干第二目标数据为若干第三候选数据中排序靠后的数据。排序是指按照若干第二目标数据的数值大小进行排序,可以按照若干第二目标数据的数值由大到小进行排序,也可以按照若干第二目标数据的数值由小到大进行排序。The plurality of second target data changes with different data query instructions. For example, when the data query instruction is "query multiple data that are ranked first", the plurality of second target data is the data that is ranked first among the plurality of third candidate data. ; For another example, when the data query instruction is "query multiple lower-ranked data", the plurality of second target data are the lower-ranked data among the plurality of third candidate data. Sorting refers to sorting according to the numerical value of several second target data. It can be sorted according to the numerical value of several second target data from large to small, or it can also be sorted according to the numerical value of several second target data from small to large.
当初始数据量小于查询数据量时,说明基于第一数据查询条件和第二数据查询条件所获得的若干第一候选数据不能满足查询数据量的需求,在本实施例中, 可以进一步从多个待查询数据中筛选出若干第三候选数据,然后从若干第三候选数据中查询出若干第二目标数据,并将若干第二目标数据及若干第一候选数据,确定为多个待查询数据对应的查询结果。例如,以表1为例,查询指令为“查询男生中排名前七的分数”,若干第一候选数据为分数(72,65,92,76,87,63),则初始数据量6小于查询数据量7,从若干第三候选数据为分数(90,60,43,86,54,80,32,75,47,54)中查询出若干第二目标数据为分数60,并将若干第二目标数据及若干第一候选数据,即,分数(72,65,92,76,87,63,60),确定为查询结果。When the initial data amount is less than the query data amount, it means that several first candidate data obtained based on the first data query condition and the second data query condition cannot meet the demand of the query data amount. In this embodiment, It is possible to further select a plurality of third candidate data from a plurality of data to be queried, and then query a plurality of second target data from a plurality of third candidate data, and determine the plurality of second target data and the plurality of first candidate data. Query results corresponding to the data to be queried. For example, taking Table 1 as an example, the query instruction is "query the top seven scores among boys", and several first candidate data are scores (72, 65, 92, 76, 87, 63), then the initial data amount 6 is smaller than the query The amount of data is 7. From a number of third candidate data as scores (90, 60, 43, 86, 54, 80, 32, 75, 47, 54), a number of second target data are queried as a score of 60, and a number of second target data are queried as scores 60. The target data and several first candidate data, that is, the scores (72, 65, 92, 76, 87, 63, 60), are determined as the query results.
假设初始数据量为ha,查询数据量为k,当ha<k时,确定查询结果的计算量为(log(k-ha))*(h-ha)+(logk)*ha+h,而传统排序查询方式计算量为(logk)*h+h,其中,h为多个待查询数据的数据量,由于(log(k-ha))*(h-ha)+(logk)*ha+h<(logk)*(h-ha)+(logk)*ha+h=(logk)*h+h,即采用本申请方案进行数据查询相比传统排序查询方式,计算量减少。Assume that the initial data amount is ha and the query data amount is k. When ha<k, the calculation amount to determine the query result is (log(k-ha))*(h-ha)+(logk)*ha+h, and The calculation amount of the traditional sorting query method is (logk)*h+h, where h is the data volume of multiple data to be queried. Since (log(k-ha))*(h-ha)+(logk)*ha+ h<(logk)*(h-ha)+(logk)*ha+h=(logk)*h+h, that is, the data query using the solution of this application requires less calculation compared to the traditional sorting query method.
在一具体实施方式中,步骤S304中所述确定所述待查询数据的第二位图数据可以包括如下步骤S414至S416,具体如下:In a specific implementation, determining the second bitmap data of the data to be queried in step S304 may include the following steps S414 to S416, specifically as follows:
S414、获取所述多个待查询数据中的最大值和最小值,并基于所述最大值和所述最小值确定所述多个待查询数据的均值;S414. Obtain the maximum value and minimum value of the plurality of data to be queried, and determine the mean value of the plurality of data to be queried based on the maximum value and the minimum value;
S415、将所述多个待查询数据分别与所述均值进行比较,得到所述待查询数据的比较结果;S415. Compare the plurality of data to be queried with the mean value respectively to obtain the comparison result of the data to be queried;
S416、根据所述比较结果,确定所述待查询数据的第二位图数据。S416. According to the comparison result, determine the second bitmap data of the data to be queried.
最大值为多个待查询数据中的最大数据,最小值为多个待查询数据中的最小数据,例如,表1中多个待查询数据为分数(72,90,60,65,43,86,92,76,54,80,32,87,75,63,47,54),多个待查询数据的最大值为分数92,最小值为分数32,均值为最大值和最小值之间的平均值,即,均值为62。在本实施例中,在确定待查询数据的第二位图数据时,可以获取多个待查询数据中的最大值和最小值,然后对最大值和最小值求均值,得到多个待查询数据的均值,接着将多个待查询数据分别与均值进行比较,得到每个待查询数据的比较结果,最后根据每个待查询数据的比较结果,确定每个待查询数据的第二位图数据。The maximum value is the largest data among multiple data to be queried, and the minimum value is the smallest data among multiple data to be queried. For example, the multiple data to be queried in Table 1 are scores (72, 90, 60, 65, 43, 86 , 92, 76, 54, 80, 32, 87, 75, 63, 47, 54), the maximum value of multiple data to be queried is the score 92, the minimum value is the score 32, and the mean is between the maximum value and the minimum value The average, that is, the mean is 62. In this embodiment, when determining the second bitmap data of the data to be queried, the maximum value and the minimum value of the multiple data to be queried can be obtained, and then the maximum value and the minimum value are averaged to obtain multiple data to be queried. The mean value of the data is then compared with the mean value respectively to obtain the comparison result of each data to be queried. Finally, the second bitmap data of each data to be queried is determined based on the comparison result of each data to be queried.
在一具体实现方式中,比较结果包括待查询数据大于均值及待查询数据小于或等于均值这两种情况。在数据查询指令为查询排序靠前的多个数据时,当待查询数据大于均值时,将预设的第三数值确定为待查询数据的第二位图数据,当待查询数据小于或等于均值时,将预设的第四数值确定为待查询数据的第二位图数据。例如,第三数值为1,第四数值为0,以表1为例,待查询数据的分数72大于均值62,将1确定为待查询数据的分数72的第二位图数据,待查询数据的分数60小于均值62,将0确定为待查询数据的分数60的第二位图数据。In a specific implementation manner, the comparison results include two situations: the data to be queried is greater than the mean value and the data to be queried is less than or equal to the mean value. When the data query instruction is to query multiple data in the top order, when the data to be queried is greater than the mean, the preset third value is determined as the second bitmap data of the data to be queried, and when the data to be queried is less than or equal to the mean When , the preset fourth numerical value is determined as the second bitmap data of the data to be queried. For example, the third value is 1 and the fourth value is 0. Taking Table 1 as an example, the score of the data to be queried is 72, which is greater than the mean value of 62. Determine 1 as the second bitmap data of the score 72 of the data to be queried. The score 60 is less than the mean value 62, and 0 is determined as the second bitmap data of the score 60 of the data to be queried.
在另一具体实现方式中,在数据查询指令为查询排序靠后的多个数据时,与数据查询指令为查询排序靠前的多个数据时相反,当待查询数据大于均值时,将第四数值确定为待查询数据的第二位图数据,当待查询数据小于或等于均值时,将第三数值确定为待查询数据的第二位图数据。例如,第三数值为1,第四数值为0,以表1为例,待查询数据的分数72大于均值62,将0确定为待查询数据 的分数72的第二位图数据,待查询数据的分数60小于均值62,将1确定为待查询数据的分数60的第二位图数据。In another specific implementation, when the data query instruction is to query multiple data in the lower order, contrary to when the data query instruction is to query multiple data in the front, when the data to be queried is greater than the mean, the fourth The numerical value is determined as the second bitmap data of the data to be queried. When the data to be queried is less than or equal to the mean value, the third numerical value is determined as the second bitmap data of the data to be queried. For example, the third value is 1 and the fourth value is 0. Taking Table 1 as an example, the score of the data to be queried is 72, which is greater than the mean value of 62, and 0 is determined as the data to be queried. The second bitmap data of the score 72, the score 60 of the data to be queried is less than the mean value 62, and 1 is determined as the second bitmap data of the score 60 of the data to be queried.
以上只是给出两个具体实现方式,在根据比较结果,确定待查询数据的第二位图数据时,可以将预设的第三数值直接确定为多个待查询数据中的数值大于均值的待查询数据的第二位图数据,并将预设的第四数值直接确定为多个待查询数据中的数值小于或等于均值的待查询数据的第二位图数据,而预设的第三数值和预设的第四数值的具体取值做不限定,可以适应性进行调整。The above only give two specific implementation methods. When determining the second bitmap data of the data to be queried based on the comparison results, the preset third value can be directly determined as the value in the multiple data to be queried that is greater than the average value. Query the second bitmap data of the data, and directly determine the preset fourth value as the second bitmap data of the data to be queried whose values in the plurality of data to be queried are less than or equal to the mean, and the preset third value The specific value of the preset fourth value is not limited and can be adjusted adaptively.
上文结合图1至3,详细描述了本申请的方法实施例,下面结合图4和5,详细描述本申请的装置实施例。应理解,方法实施例的描述与装置实施例的描述相互对应,因此,未详细描述的部分可以参见前面方法实施例。The method embodiments of the present application are described in detail above with reference to Figures 1 to 3, and the device embodiments of the present application are described in detail below with reference to Figures 4 and 5. It should be understood that the description of the method embodiments corresponds to the description of the device embodiments. Therefore, the parts not described in detail can be referred to the previous method embodiments.
图4是本申请实施例提供的数据查询装置的结构示意图,如图4所示,所述数据查询装置600包括:Figure 4 is a schematic structural diagram of a data query device provided by an embodiment of the present application. As shown in Figure 4, the data query device 600 includes:
指令获取单元601,用于获取数据存储列表的数据查询指令,其中,所述数据查询指令包括第一数据查询条件和第二数据查询条件;Instruction acquisition unit 601 is used to acquire data query instructions for the data storage list, where the data query instructions include first data query conditions and second data query conditions;
第一确定单元602,用于根据所述数据查询指令从所述数据存储列表中确定多个待查询数据;The first determining unit 602 is configured to determine a plurality of data to be queried from the data storage list according to the data query instruction;
第二确定单元603,用于确定所述多个待查询数据中每个待查询数据的第一位图数据,其中,所述第一位图数据用于表征所述待查询数据是否与所述第一数据查询条件匹配;The second determining unit 603 is used to determine the first image data of each data to be queried in the plurality of data to be queried, wherein the first image data is used to characterize whether the data to be queried is consistent with the data to be queried. The first data query condition matches;
第三确定单元604,用于确定所述待查询数据的第二位图数据,其中,所述第二位图数据用于表征所述待查询数据是否与所述第二数据查询条件匹配;The third determination unit 604 is used to determine the second bitmap data of the data to be queried, where the second bitmap data is used to characterize whether the data to be queried matches the second data query condition;
数据筛选单元605,用于基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据;The data filtering unit 605 is configured to filter out a number of first candidate data from the plurality of data to be queried based on the first bitmap data and the second bitmap data;
数据查询单元606,用于基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果。The data query unit 606 is configured to determine the query result corresponding to the data query instruction based on the plurality of first candidate data.
本申请实施例中,基于若干第一候选数据确定数据查询指令对应的查询结果,可以避免遍历所有待查询数据,并且由于若干第一候选数据是基于第一位图数据和第二位图数据从多个待查询数据中筛选出的数据,若干第一候选数据的数据量小于多个待查询数据的数据量,因此,基于若干第一候选数据进行数据查询可以缩短数据查询时间,提高数据查询响应速度。In the embodiment of the present application, the query result corresponding to the data query instruction is determined based on a number of first candidate data, which can avoid traversing all the data to be queried, and because the number of first candidate data is based on the first bitmap data and the second bitmap data. For data filtered out from multiple data to be queried, the data volume of several first candidate data is smaller than the data volume of multiple data to be queried. Therefore, data query based on several first candidate data can shorten the data query time and improve the data query response. speed.
在本申请一些实施例中,所述第一确定单元602具体用于:获取所述数据查询指令中的索引字段,所述索引字段为所述数据存储列表中与所述多个待查询数据关联的字段;根据所述索引字段,从所述数据存储列表中确定多个待查询数据。In some embodiments of the present application, the first determining unit 602 is specifically configured to: obtain an index field in the data query instruction, where the index field is associated with the plurality of data to be queried in the data storage list. fields; determine multiple data to be queried from the data storage list according to the index field.
在本申请一些实施例中,所述第二确定单元603具体用于:从所述多个待查询数据中筛选出若干第二候选数据,其中,所述若干第二候选数据为所述多个待查询数据中与所述第一数据查询条件匹配的数据;将预设的第一数值确定为所述若干第二候选数据中每个第二候选数据的第一位图数据;将预设的第二数值确定为所述多个待查询数据中除所述若干第二候选数据以外的每个待查询数据的第一位图数据。 In some embodiments of the present application, the second determination unit 603 is specifically configured to filter out a number of second candidate data from the plurality of data to be queried, wherein the number of second candidate data is the plurality of second candidate data. Data in the data to be queried that matches the first data query condition; determine the preset first value as the first image data of each second candidate data in the plurality of second candidate data; set the preset first value The second numerical value is determined as the first image data of each of the plurality of data to be queried except the plurality of second candidate data.
在本申请一些实施例中,所述第二确定单元603在从所述多个待查询数据中筛选出若干第二候选数据时,具体用于:基于所述数据查询指令从所述数据存储列表中确定与所述多个待查询数据相关联的多个关联数据,其中,所述多个关联数据用于对所述多个待查询数据进行筛选;从所述多个关联数据中筛选出与所述数据查询指令匹配的若干关联数据;确定与所述若干关联数据相关联的若干待查询数据为所述若干第二候选数据。In some embodiments of the present application, when filtering out a number of second candidate data from the plurality of data to be queried, the second determination unit 603 is specifically configured to: select the data from the data storage list based on the data query instruction. Determine multiple associated data associated with the multiple data to be queried, wherein the multiple associated data are used to filter the multiple data to be queried; filter out the multiple associated data from the multiple associated data. A plurality of associated data matched by the data query instruction; a plurality of data to be queried associated with the plurality of associated data are determined to be the plurality of second candidate data.
在本申请一些实施例中,当所述第二数据查询条件为与数值相关的查询条件时,所述第三确定单元604具体用于:获取所述多个待查询数据中的最大值和最小值,并基于所述最大值和所述最小值确定所述多个待查询数据的均值;将预设的第三数值确定为所述多个待查询数据中的数值大于所述均值的待查询数据的第二位图数据;将预设的第四数值确定为所述多个待查询数据中的数值小于或等于所述均值的待查询数据的第二位图数据。In some embodiments of the present application, when the second data query condition is a query condition related to a numerical value, the third determination unit 604 is specifically configured to: obtain the maximum value and the minimum value among the plurality of data to be queried. value, and determine the average value of the plurality of data to be queried based on the maximum value and the minimum value; determine the preset third value as the value to be queried in the plurality of data to be queried that is greater than the average value The second bitmap data of the data; determine the preset fourth value as the second bitmap data of the data to be queried whose value in the plurality of data to be queried is less than or equal to the average value.
在本申请一些实施例中,所述数据筛选单元605具体用于:对所述第一位图数据和所述第二位图数据进行位运算,得到所述待查询数据的目标位图数据,其中,所述目标位图数据用于表征所述待查询数据是否同时满足所述第一数据查询条件和所述第二数据查询条件;基于所述目标位图数据,从所述多个待查询数据中筛选出若干第一候选数据。In some embodiments of the present application, the data filtering unit 605 is specifically configured to: perform bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of the data to be queried, Wherein, the target bitmap data is used to represent whether the data to be queried satisfies the first data query condition and the second data query condition at the same time; based on the target bitmap data, from the plurality of data to be queried Several first candidate data are screened out from the data.
在本申请一些实施例中,所述数据筛选单元605在对所述第一位图数据和所述第二位图数据进行位运算,得到所述待查询数据的目标位图数据时,具体用于:将所述预设的第一数值和所述预设的第二数值,与所述预设的第三数值和所述预设的第四数值进行拉运算,得到所述目标位图数据。In some embodiments of the present application, when the data filtering unit 605 performs bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of the data to be queried, it specifically uses In: performing a pull operation on the preset first value and the preset second value, and the preset third value and the preset fourth value to obtain the target bitmap data .
在本申请一些实施例中,所述数据查询指令还包括查询数据量,所述数据查询单元606具体用于:获取所述若干第一候选数据的初始数据量,并将所述初始数据量与所述查询数据量进行比较;当所述初始数据量大于所述查询数据量时,从所述第一候选数据中查询出若干第一目标数据,其中,所述若干第一目标数据的数据量为所述查询数据量,且所述若干第一目标数据为所述第一候选数据中的与所述数据查询指令匹配的数据;将所述若干第一目标数据,确定为所述数据查询指令对应的查询结果。In some embodiments of the present application, the data query instruction also includes querying the data amount. The data query unit 606 is specifically configured to: obtain the initial data amount of the several first candidate data, and compare the initial data amount with The query data volume is compared; when the initial data volume is greater than the query data volume, several first target data are queried from the first candidate data, wherein the data volume of the several first target data is the amount of query data, and the plurality of first target data is the data in the first candidate data that matches the data query instruction; the plurality of first target data is determined as the data query instruction corresponding query results.
在本申请一些实施例中,所述数据查询单元606具体还用于:当所述初始数据量小于所述查询数据量时,从所述多个待查询数据中筛选出若干第二目标数据,其中,所述若干第二目标数据为所述多个待查询数据中除所述若干第一候选数据之外的且与所述数据查询指令匹配的数据,所述若干第一候选数据的数据量和所述若干第二目标数据的数据量之和为所述查询数据量;将所述若干第二目标数据及所述若干第一候选数据,确定为所述数据查询指令对应的查询结果。In some embodiments of the present application, the data query unit 606 is specifically configured to: when the initial data amount is less than the query data amount, filter out a number of second target data from the plurality of data to be queried, Wherein, the plurality of second target data are data in the plurality of data to be queried other than the plurality of first candidate data and matching the data query instruction, and the data amount of the plurality of first candidate data is The sum of the data amounts of the plurality of second target data and the plurality of second target data is the query data amount; the plurality of second target data and the plurality of first candidate data are determined as query results corresponding to the data query instruction.
在本申请一些实施例中,所述数据查询单元606具体还用于:当所述初始数据量等于所述查询数据量时,将所述若干第一候选数据确定为所述数据查询指令对应的查询结果。In some embodiments of the present application, the data query unit 606 is specifically configured to: when the initial data amount is equal to the query data amount, determine the plurality of first candidate data as corresponding to the data query instruction. search result.
本申请实施例还提供一种计算机设备,如图5所示,其示出了本申请实施例所涉及的计算机设备的结构示意图。 An embodiment of the present application also provides a computer device, as shown in FIG. 5 , which shows a schematic structural diagram of the computer device involved in the embodiment of the present application.
该计算机设备可以包括一个或者一个以上处理核心的处理器701、一个或一个以上具有计算机可读存储介质的存储器702、电源703和输入单元704等部件。本领域技术人员可以理解,图5中示出的计算机设备结构并不构成对计算机设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:The computer device may include components such as a processor 701 of one or more processing cores, one or more memories 702 having computer-readable storage media, a power supply 703, and an input unit 704. Those skilled in the art can understand that the structure of the computer equipment shown in FIG. 5 does not constitute a limitation on the computer equipment, and may include more or fewer components than shown in the figure, or combine certain components, or arrange different components. in:
处理器701是该计算机设备的控制中心,利用各种接口和线路连接整个计算机设备的各个部分,通过运行或执行存储在存储器702内的软件程序和/或模块,以及调用存储在存储器702内的数据,执行计算机设备的各种功能和处理数据,从而对计算机设备进行整体监控。可选的,处理器701可包括一个或多个处理核心;优选的,处理器701可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器701中。The processor 701 is the control center of the computer equipment, using various interfaces and lines to connect various parts of the entire computer equipment, by running or executing software programs and/or modules stored in the memory 702, and calling software programs stored in the memory 702. Data, perform various functions of the computer equipment and process the data to conduct overall monitoring of the computer equipment. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, user interfaces, application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 701.
存储器702可用于存储软件程序以及模块,处理器701通过运行存储在存储器702的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器702可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机设备的使用所创建的数据等。此外,存储器702可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器702还可以包括存储器控制器,以提供处理器701对存储器702的访问。The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702 . The memory 702 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may store a program based on Data created by the use of computer equipment, etc. In addition, memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702 .
计算机设备还包括给各个部件供电的电源703,优选的,电源703可以通过电源管理系统与处理器701逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源703还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The computer equipment also includes a power supply 703 that supplies power to various components. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, so that functions such as charging, discharging, and power consumption management can be implemented through the power management system. Power supply 703 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
该计算机设备还可包括输入单元704,该输入单元704可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。The computer device may also include an input unit 704 operable to receive input numeric or character information and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and functional controls.
尽管未示出,计算机设备还可以包括显示单元等,在此不再赘述。具体在本实施例中,计算机设备中的处理器701会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器702中,并由处理器701来运行存储在存储器702中的应用程序,从而实现上述任一实施例所述的数据查询方法中的步骤。例如,所述处理器实现如下步骤:获取数据存储列表的数据查询指令,其中,所述数据查询指令包括第一数据查询条件和第二数据查询条件;根据所述数据查询指令从所述数据存储列表中确定多个待查询数据;确定所述多个待查询数据中每个待查询数据的第一位图数据,其中,所述第一位图数据用于表征所述待查询数据是否与所述第一数据查询条件匹配;确定所述待查询数据的第二位图数据,其中,所述第二位图数据用于表征所述待查询数据是否与所述第二数据查询条件匹配;基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据;基于所述若干第一候选数据,确定所述数据查询 指令对应的查询结果。本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。Although not shown, the computer device may also include a display unit and the like, which will not be described again here. Specifically, in this embodiment, the processor 701 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 will run the executable files stored in The application program in the memory 702 is used to implement the steps in the data query method described in any of the above embodiments. For example, the processor implements the following steps: obtaining a data query instruction for a data storage list, where the data query instruction includes a first data query condition and a second data query condition; and obtaining a data query instruction from the data storage list according to the data query instruction. Determine a plurality of data to be queried in the list; determine the first image data of each data to be queried in the plurality of data to be queried, wherein the first image data is used to characterize whether the data to be queried is consistent with the data to be queried. The first data query condition matches; determine the second bitmap data of the data to be queried, wherein the second bitmap data is used to characterize whether the data to be queried matches the second data query condition; based on The first bitmap data and the second bitmap data are used to select several first candidate data from the plurality of data to be queried; based on the several first candidate data, the data query is determined Query results corresponding to the command. Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium, and loaded and executed by the processor.
为此,本申请实施例提供一种计算机可读存储介质,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。其上存储有计算机程序,所述计算机程序被处理器进行加载,以执行本申请实施例所提供的任一种数据查询方法中的步骤。例如,所述计算机程序被处理器进行加载可以执行如下步骤:获取数据存储列表的数据查询指令,其中,所述数据查询指令包括第一数据查询条件和第二数据查询条件;根据所述数据查询指令从所述数据存储列表中确定多个待查询数据;确定所述多个待查询数据中每个待查询数据的第一位图数据,其中,所述第一位图数据用于表征所述待查询数据是否与所述第一数据查询条件匹配;确定所述待查询数据的第二位图数据,其中,所述第二位图数据用于表征所述待查询数据是否与所述第二数据查询条件匹配;基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据;基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果。To this end, embodiments of the present application provide a computer-readable storage medium, which may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc. . A computer program is stored thereon, and the computer program is loaded by the processor to execute the steps in any of the data query methods provided by the embodiments of this application. For example, the computer program loaded by the processor may perform the following steps: obtain a data query instruction for a data storage list, wherein the data query instruction includes a first data query condition and a second data query condition; according to the data query The instruction determines a plurality of data to be queried from the data storage list; determines the first image data of each data to be queried in the plurality of data to be queried, wherein the first image data is used to characterize the Whether the data to be queried matches the first data query condition; determine the second bitmap data of the data to be queried, wherein the second bitmap data is used to characterize whether the data to be queried matches the second data query condition. Matching data query conditions; based on the first bitmap data and the second bitmap data, screening out a number of first candidate data from the plurality of data to be queried; based on the several first candidate data, determining the Query results corresponding to the above data query instructions.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见上文针对其他实施例的详细描述,此处不再赘述。In the above embodiments, each embodiment is described with its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the above detailed descriptions of other embodiments and will not be described again here.
具体实施时,以上各个单元或结构可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单元或结构的具体实施可参见前面的方法实施例,在此不再赘述。During specific implementation, each of the above units or structures can be implemented as an independent entity, or can be combined in any way and implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments. Here No longer.
以上各个操作的具体实施可参见前面的实施例,在此不再赘述。For the specific implementation of each of the above operations, please refer to the previous embodiments and will not be described again here.
以上对本申请实施例所提供的一种数据查询方法、装置、计算机设备及存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。 The above is a detailed introduction to a data query method, device, computer equipment and storage medium provided by the embodiments of the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only It is used to help understand the methods and core ideas of this application; at the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the ideas of this application. In summary, this specification The contents should not be construed as limitations on this application.

Claims (14)

  1. 一种数据查询方法,其特征在于,包括:A data query method, characterized by including:
    获取数据存储列表的数据查询指令,其中,所述数据查询指令包括第一数据查询条件和第二数据查询条件;Obtain a data query instruction for the data storage list, wherein the data query instruction includes a first data query condition and a second data query condition;
    根据所述数据查询指令从所述数据存储列表中确定多个待查询数据;Determine a plurality of data to be queried from the data storage list according to the data query instruction;
    确定所述多个待查询数据中每个待查询数据的第一位图数据,其中,所述第一位图数据用于表征所述待查询数据是否与所述第一数据查询条件匹配;Determine the first image data of each of the plurality of data to be queried, wherein the first image data is used to characterize whether the data to be queried matches the first data query condition;
    确定所述待查询数据的第二位图数据,其中,所述第二位图数据用于表征所述待查询数据是否与所述第二数据查询条件匹配;Determine the second bitmap data of the data to be queried, wherein the second bitmap data is used to characterize whether the data to be queried matches the second data query condition;
    基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据;Based on the first bitmap data and the second bitmap data, select a number of first candidate data from the plurality of data to be queried;
    基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果。Based on the plurality of first candidate data, the query result corresponding to the data query instruction is determined.
  2. 根据权利要求1所述的数据查询方法,其特征在于,所述根据所述数据查询指令从所述数据存储列表中确定多个待查询数据,包括:The data query method according to claim 1, wherein determining a plurality of data to be queried from the data storage list according to the data query instruction includes:
    获取所述数据查询指令中的索引字段,所述索引字段为所述数据存储列表中与所述多个待查询数据关联的字段;Obtain an index field in the data query instruction, where the index field is a field in the data storage list associated with the plurality of data to be queried;
    根据所述索引字段,从所述数据存储列表中确定多个待查询数据。According to the index field, multiple data to be queried are determined from the data storage list.
  3. 根据权利要求1或2所述的数据查询方法,其特征在于,所述确定所述多个待查询数据中每个待查询数据的第一位图数据,包括:The data query method according to claim 1 or 2, characterized in that determining the first image data of each of the plurality of data to be queried includes:
    从所述多个待查询数据中筛选出若干第二候选数据,其中,所述若干第二候选数据为所述多个待查询数据中与所述第一数据查询条件匹配的数据;Filter out a plurality of second candidate data from the plurality of data to be queried, wherein the plurality of second candidate data are data matching the first data query condition among the plurality of data to be queried;
    将预设的第一数值确定为所述若干第二候选数据中每个第二候选数据的第一位图数据;Determine the preset first value as the first bit image data of each second candidate data in the plurality of second candidate data;
    将预设的第二数值确定为所述多个待查询数据中除所述若干第二候选数据以外的每个待查询数据的第一位图数据。The preset second value is determined as the first image data of each of the plurality of data to be queried except for the plurality of second candidate data.
  4. 根据权利要求3所述的数据查询方法,其特征在于,所述从所述多个待查询数据中筛选出若干第二候选数据,包括:The data query method according to claim 3, characterized in that filtering out a plurality of second candidate data from the plurality of data to be queried includes:
    基于所述数据查询指令从所述数据存储列表中确定与所述多个待查询数据相关联的多个关联数据,其中,所述多个关联数据用于对所述多个待查询数据进行筛选;A plurality of associated data associated with the plurality of data to be queried is determined from the data storage list based on the data query instruction, wherein the plurality of associated data is used to filter the plurality of data to be queried. ;
    从所述多个关联数据中筛选出与所述数据查询指令匹配的若干关联数据;Filter out a number of related data that match the data query instruction from the plurality of related data;
    确定与所述若干关联数据相关联的若干待查询数据为所述若干第二候选数据。 It is determined that some data to be queried associated with the plurality of related data are the plurality of second candidate data.
  5. 根据权利要求1至4中任一项所述的数据查询方法,其特征在于,当所述第二数据查询条件为与数值相关的查询条件时,所述确定所述待查询数据的第二位图数据,包括:The data query method according to any one of claims 1 to 4, characterized in that when the second data query condition is a query condition related to a numerical value, the second bit of the data to be queried is determined. Graph data, including:
    获取所述多个待查询数据中的最大值和最小值,并基于所述最大值和所述最小值确定所述多个待查询数据的均值;Obtain the maximum value and minimum value of the plurality of data to be queried, and determine the mean value of the plurality of data to be queried based on the maximum value and the minimum value;
    将预设的第三数值确定为所述多个待查询数据中的数值大于所述均值的待查询数据的第二位图数据;Determine the preset third value as the second bitmap data of the data to be queried whose value among the plurality of data to be queried is greater than the average value;
    将预设的第四数值确定为所述多个待查询数据中的数值小于或等于所述均值的待查询数据的第二位图数据。The preset fourth value is determined as the second bitmap data of the data to be queried whose value among the plurality of data to be queried is less than or equal to the mean value.
  6. 根据权利要求1至5中任一项所述的数据查询方法,其特征在于,所述基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据,包括:The data query method according to any one of claims 1 to 5, characterized in that, based on the first bitmap data and the second bitmap data, filtering from the plurality of data to be queried A number of first candidate data are generated, including:
    对所述第一位图数据和所述第二位图数据进行位运算,得到所述待查询数据的目标位图数据,其中,所述目标位图数据用于表征所述待查询数据是否同时满足所述第一数据查询条件和所述第二数据查询条件;Perform bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of the data to be queried, where the target bitmap data is used to represent whether the data to be queried are simultaneous Satisfy the first data query condition and the second data query condition;
    基于所述目标位图数据,从所述多个待查询数据中筛选出所述若干第一候选数据。Based on the target bitmap data, the plurality of first candidate data are filtered out from the plurality of data to be queried.
  7. 根据权利要求6所述的数据查询方法,其特征在于,所述确定所述待查询数据的第一位图数据,包括:The data query method according to claim 6, wherein determining the first image data of the data to be queried includes:
    从所述多个待查询数据中筛选出若干第二候选数据,其中,所述若干第二候选数据为所述多个待查询数据中与所述第一数据查询条件匹配的数据;将预设的第一数值确定为所述若干第二候选数据中每个第二候选数据的第一位图数据;将预设的第二数值确定为所述多个待查询数据中除所述若干第二候选数据以外的每个待查询数据的第一位图数据,A plurality of second candidate data are screened out from the plurality of data to be queried, wherein the plurality of second candidate data are data matching the first data query condition among the plurality of data to be queried; the preset The first value is determined as the first image data of each second candidate data in the plurality of second candidate data; the preset second value is determined as the first value in the plurality of data to be queried except the plurality of second candidate data. The first image data of each data to be queried except the candidate data,
    其中,当所述第二数据查询条件为与数值相关的查询条件时,所述确定所述待查询数据的第二位图数据,包括:Wherein, when the second data query condition is a query condition related to a numerical value, determining the second bitmap data of the data to be queried includes:
    获取所述多个待查询数据中的最大值和最小值,并基于所述最大值和所述最小值确定所述多个待查询数据的均值;将预设的第三数值确定为所述多个待查询数据中的数值大于所述均值的待查询数据的第二位图数据;将预设的第四数值确定为所述多个待查询数据中的数值小于或等于所述均值的待查询数据的第二位图数据,Obtain the maximum value and minimum value of the plurality of data to be queried, and determine the mean value of the plurality of data to be queried based on the maximum value and the minimum value; determine a preset third value as the plurality of data to be queried. The second bitmap data of the data to be queried whose numerical value is greater than the average value; the preset fourth value is determined to be the second bitmap data of the data to be queried whose numerical value is less than or equal to the average value among the plurality of data to be queried. second bitmap data of data,
    其中,所述对所述第一位图数据和所述第二位图数据进行位运算,得到所述待查询数据的目标位图数据,包括:Wherein, performing bit operations on the first bitmap data and the second bitmap data to obtain the target bitmap data of the data to be queried includes:
    将所述预设的第一数值和所述预设的第二数值,与所述预设的第三数值和所 述预设的第四数值进行拉运算,得到所述目标位图数据。The preset first value and the preset second value are combined with the preset third value and the preset second value. Perform a pull operation on the preset fourth numerical value to obtain the target bitmap data.
  8. 根据权利要求1至7中任一项所述的数据查询方法,其特征在于,所述根据数据查询指令从数据存储列表中确定多个待查询数据,包括:The data query method according to any one of claims 1 to 7, characterized in that determining a plurality of data to be queried from the data storage list according to the data query instruction includes:
    获取所述数据查询指令中的索引字段,所述索引字段为所述数据存储列表中与所述多个待查询数据关联的字段;Obtain an index field in the data query instruction, where the index field is a field in the data storage list associated with the plurality of data to be queried;
    根据所述索引字段,从所述数据存储列表中确定所述多个待查询数据。According to the index field, the plurality of data to be queried is determined from the data storage list.
  9. 根据权利要求1至8中任一项所述的数据查询方法,其特征在于,所述数据查询指令包括查询数据量,所述基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果,包括:The data query method according to any one of claims 1 to 8, wherein the data query instruction includes a query data amount, and the data query instruction corresponding to the data query instruction is determined based on the plurality of first candidate data. Query results include:
    获取所述若干第一候选数据的初始数据量,并将所述初始数据量与所述查询数据量进行比较;Obtain the initial data volume of the several first candidate data, and compare the initial data volume with the query data volume;
    当所述初始数据量大于所述查询数据量时,从所述第一候选数据中查询出若干第一目标数据,其中,所述若干第一目标数据的数据量为所述查询数据量,且所述若干第一目标数据为所述第一候选数据中的与所述数据查询指令匹配的数据;When the initial data amount is greater than the query data amount, query some first target data from the first candidate data, wherein the data amount of the several first target data is the query data amount, and The plurality of first target data are data in the first candidate data that match the data query instruction;
    将所述若干第一目标数据确定为所述数据查询指令对应的查询结果。The plurality of first target data are determined as query results corresponding to the data query instruction.
  10. 根据权利要求1至9中任一项所述的数据查询方法,其特征在于,所述数据查询指令包括查询数据量,所述基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果,包括:The data query method according to any one of claims 1 to 9, characterized in that the data query instruction includes a query data amount, and based on the plurality of first candidate data, it is determined that the data query instruction corresponds to Query results include:
    获取所述若干第一候选数据的初始数据量,并将所述初始数据量与所述查询数据量进行比较;Obtain the initial data volume of the several first candidate data, and compare the initial data volume with the query data volume;
    当所述初始数据量小于所述查询数据量时,从所述多个待查询数据中筛选出若干第二目标数据,其中,所述若干第二目标数据为所述多个待查询数据中除所述若干第一候选数据之外的且与所述数据查询指令匹配的数据,所述若干第一候选数据的数据量和所述若干第二目标数据的数据量之和为所述查询数据量;When the initial data amount is less than the query data amount, a plurality of second target data are screened out from the plurality of data to be queried, wherein the plurality of second target data are the plurality of data to be queried except For data other than the first candidate data and matching the data query instruction, the sum of the data volume of the first candidate data and the data volume of the second target data is the query data volume. ;
    将所述若干第二目标数据及所述若干第一候选数据确定为所述数据查询指令对应的查询结果。The plurality of second target data and the plurality of first candidate data are determined as query results corresponding to the data query instruction.
  11. 根据权利要求1至10中任一项所述的数据查询方法,其特征在于,所述数据查询指令包括查询数据量,所述基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果,包括:The data query method according to any one of claims 1 to 10, wherein the data query instruction includes a query data amount, and the data query instruction corresponding to the data query instruction is determined based on the plurality of first candidate data. Query results include:
    获取所述若干第一候选数据的初始数据量,并将所述初始数据量与所述查询数据量进行比较;Obtain the initial data volume of the several first candidate data, and compare the initial data volume with the query data volume;
    当所述初始数据量等于所述查询数据量时,将所述若干第一候选数据确定为所述数据查询指令对应的查询结果。When the initial data amount is equal to the query data amount, the plurality of first candidate data are determined as query results corresponding to the data query instruction.
  12. 一种数据查询装置,其特征在于,包括: A data query device, characterized by including:
    指令获取单元,用于获取数据存储列表的数据查询指令,其中,所述数据查询指令包括第一数据查询条件和第二数据查询条件;An instruction acquisition unit, configured to obtain data query instructions for the data storage list, wherein the data query instructions include first data query conditions and second data query conditions;
    第一确定单元,用于根据所述数据查询指令从所述数据存储列表中确定多个待查询数据;A first determination unit configured to determine a plurality of data to be queried from the data storage list according to the data query instruction;
    第二确定单元,用于确定所述多个待查询数据中每个待查询数据的第一位图数据,其中,所述第一位图数据用于表征所述待查询数据是否与所述第一数据查询条件匹配;The second determination unit is used to determine the first image data of each of the plurality of data to be queried, wherein the first image data is used to characterize whether the data to be queried is consistent with the first image data. One data query condition matches;
    第三确定单元,用于确定所述待查询数据的第二位图数据,其中,所述第二位图数据用于表征所述待查询数据是否与所述第二数据查询条件匹配;A third determination unit configured to determine the second bitmap data of the data to be queried, wherein the second bitmap data is used to characterize whether the data to be queried matches the second data query condition;
    数据筛选单元,用于基于所述第一位图数据和所述第二位图数据,从所述多个待查询数据中筛选出若干第一候选数据;A data filtering unit configured to filter out a number of first candidate data from the plurality of data to be queried based on the first bitmap data and the second bitmap data;
    数据查询单元,用于基于所述若干第一候选数据,确定所述数据查询指令对应的查询结果。A data query unit is configured to determine the query result corresponding to the data query instruction based on the plurality of first candidate data.
  13. 一种计算机设备,其特征在于,所述计算机设备包括:A computer device, characterized in that the computer device includes:
    一个或多个处理器;one or more processors;
    存储器;以及memory; and
    一个或多个应用程序,其中,所述一个或多个应用程序被存储于所述存储器中,并配置为由所述处理器执行,以实现权利要求1至11中任一项所述的数据查询方法。One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the data of any one of claims 1 to 11 Query method.
  14. 一种计算机可读存储介质,其特征在于,其上存储有计算机程序,所述计算机程序被处理器进行加载,以执行权利要求1至11中任一项所述的数据查询方法中的步骤。 A computer-readable storage medium, characterized in that a computer program is stored thereon, and the computer program is loaded by a processor to execute the steps of the data query method described in any one of claims 1 to 11.
PCT/CN2023/115734 2022-09-02 2023-08-30 Data query method and apparatus, and computer device and storage medium WO2024046352A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211073660.3A CN117688026A (en) 2022-09-02 2022-09-02 Data query method, device, computer equipment and storage medium
CN202211073660.3 2022-09-02

Publications (2)

Publication Number Publication Date
WO2024046352A2 true WO2024046352A2 (en) 2024-03-07
WO2024046352A3 WO2024046352A3 (en) 2024-04-18

Family

ID=90100380

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/115734 WO2024046352A2 (en) 2022-09-02 2023-08-30 Data query method and apparatus, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN117688026A (en)
WO (1) WO2024046352A2 (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614399B (en) * 2018-11-15 2020-12-08 金蝶软件(中国)有限公司 Bitmap data query method and device, computer equipment and storage medium
CN111367949A (en) * 2019-06-25 2020-07-03 杭州海康威视系统技术有限公司 Data query method and device, computer equipment and storage medium
CN112527824B (en) * 2019-09-17 2023-04-18 浙江宇视科技有限公司 Paging query method, paging query device, electronic equipment and computer-readable storage medium
CN111966846B (en) * 2020-06-28 2024-06-11 天津霖岳科技发展有限公司 Image query method, device, electronic equipment and storage medium
CN114238328A (en) * 2021-12-15 2022-03-25 平安科技(深圳)有限公司 Data paging query method, device, equipment and storage medium
CN114255837A (en) * 2021-12-21 2022-03-29 东软集团股份有限公司 Data query method and device, computer readable storage medium and electronic equipment
CN114840557A (en) * 2022-03-24 2022-08-02 青岛海尔科技有限公司 Data query method and device, storage medium and electronic device

Also Published As

Publication number Publication date
WO2024046352A3 (en) 2024-04-18
CN117688026A (en) 2024-03-12

Similar Documents

Publication Publication Date Title
Khasawneh et al. Sql, newsql, and nosql databases: A comparative survey
US11030247B2 (en) Layered graph data structure
CN104021161B (en) A kind of clustering storage method and device
US7177874B2 (en) System and method for generating and processing results data in a distributed system
US20080270374A1 (en) Method and system for combining ranking and clustering in a database management system
US20040186832A1 (en) System and method for controlling processing in a distributed system
US20150026145A1 (en) Information retrieval system
WO2021068689A1 (en) Data processing method and related apparatus
CN110807041B (en) Index recommendation method and device, electronic equipment and storage medium
WO2021047373A1 (en) Big data-based column data processing method, apparatus, and medium
WO2019228015A1 (en) Index creating method and apparatus based on nosql database of mobile terminal
WO2023138665A1 (en) Query optimization method and apparatus for distributed database
WO2023165343A1 (en) Data operation method and apparatus, computer device, and storage medium
US20040181524A1 (en) System and method for distributed processing in a node environment
US20120095996A1 (en) Search in a multi-relationship social network
WO2024046352A2 (en) Data query method and apparatus, and computer device and storage medium
US7725468B2 (en) Improving efficiency in processing queries directed to static data sets
CN116089417A (en) Information acquisition method, information acquisition device, storage medium and computer equipment
WO2024011855A1 (en) Method and apparatus for training data classification model, device and storage medium
CN115880508A (en) Image data processing method, device, equipment and storage medium
CN115578096A (en) Block chain parallel transaction method, device, equipment and storage medium
CN110765237A (en) Document processing method, document processing device, storage medium and electronic equipment
US20190179972A1 (en) Hybrid connectivity for reporting application
US11947822B2 (en) Maintaining a record data structure using page metadata of a bookkeeping page
CN115455010B (en) Data processing method based on milvus database, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23859381

Country of ref document: EP

Kind code of ref document: A2