Database data query method and device based on state dictionary, electronic equipment and storage medium

By using hash calculation and verification mechanisms in the state dictionary, the problems of database response speed and resource waste under high concurrency requests are solved, enabling fast and accurate data query and feedback.

CN116303610BActive Publication Date: 2026-06-02AGRICULTURAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AGRICULTURAL BANK OF CHINA
Filing Date
2023-03-20
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Under high-concurrency data requests, existing technologies struggle to provide fast database responses and effectively filter data requests, leading to resource waste.

Method used

By receiving a data query command, the system performs hash calculations using the hash function group in the status dictionary to determine the query hash value, and searches for a matching hash value in the hash bit array to confirm whether the target data exists in the database, thereby deciding whether to send a query command to the database.

Benefits of technology

It improved the database's response speed and query accuracy, reduced resource waste, and enabled rapid response and efficient data feedback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116303610B_ABST
    Figure CN116303610B_ABST
Patent Text Reader

Abstract

The application discloses a database data query method and device based on a state dictionary, electronic equipment and a storage medium. Its features include: receiving a data query instruction for a target database, determining target query data corresponding to the data query instruction; performing hash calculation on the target query data according to a hash function group stored in the state dictionary to determine a query hash value of the target query data; if a target hash value identical to the query hash value exists in a hash bit array stored in the state dictionary, the data query instruction is sent to the target database for data query. The application realizes pre-query of data stored in the database, can filter data not existing in the database through the state dictionary, reduces the number of invalid data query to the database, and improves the query efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database querying, and more particularly to a database data querying method, apparatus, electronic device, and storage medium based on a state dictionary. Background Technology

[0002] In the information society, information interaction is ubiquitous. Users request data from servers on the application side, and servers query the corresponding data in the database system based on the user's request and then return the queried data. However, existing servers typically integrate multiple functions, have complex business logic, and experience high access volumes, with data access increasing exponentially. Low-performance databases struggle to respond promptly to high-concurrency data requests. To save hardware resources and costs, current technologies usually optimize and preprocess the information in the server-side data requests before sending the processed data requests to the database, enabling the database to respond quickly. However, while existing technologies improve database response speed, they cannot filter data requests, still requiring individual queries in the database, wasting database resources. Summary of the Invention

[0003] This invention provides a database data query method, apparatus, electronic device, and storage medium based on a state dictionary, to filter data requests to the database and improve the database response speed.

[0004] According to one aspect of the present invention, a database data query method based on a state dictionary is provided, comprising:

[0005] Receive a data query instruction for a target database and determine the target query data corresponding to the data query instruction;

[0006] The target query data is hashed according to the hash function group stored in the state dictionary to determine the query hash value of the target query data;

[0007] If the hash array stored in the status dictionary contains a target hash value that is the same as the query hash value, then the data query instruction is sent to the target database for data query.

[0008] According to another aspect of the present invention, a database data query apparatus based on a state dictionary is provided, comprising:

[0009] The data query module is used to receive a data query instruction for a target database and determine the target query data corresponding to the data query instruction.

[0010] The hash calculation module is used to perform hash calculation on the target query data according to the hash function group stored in the state dictionary, and determine the query hash value of the target query data;

[0011] The hash verification module is used to send the data query instruction to the target database to perform a data query if the hash bit array stored in the status dictionary contains a target hash value that is the same as the query hash value.

[0012] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0013] At least one processor; and

[0014] A memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the database data query method based on a state dictionary as described in any embodiment of the present invention.

[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the database data query method based on a state dictionary as described in any embodiment of the present invention.

[0017] The technical solution of this invention improves the accuracy of data queries by receiving a data query instruction for a target database and determining the target query data corresponding to the instruction before entering the database. It also improves the query accuracy by performing a hash calculation on the target query data using a hash function group stored in the status dictionary to determine the query hash value. This hash value confirms the existence of the target query data in the database, improving database response speed and reducing resource waste. If the hash bit array stored in the status dictionary contains a target hash value identical to the query hash value, the data query instruction is sent to the target database for querying. By confirming the existence of the target query data in the database using the status dictionary and sending the data query instruction to the target database, the system achieves rapid database response, improves database speed, solves the technical problem of filtering database data requests in the prior art, improves database feedback efficiency, and saves database resources.

[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart of a database data query method based on a state dictionary provided in Embodiment 1 of the present invention;

[0021] Figure 2 This is a schematic diagram of a state dictionary disclosed in an embodiment of the present invention;

[0022] Figure 3 This is a schematic diagram of a counting linked list disclosed in an embodiment of the present invention;

[0023] Figure 4 This is a flowchart of another database data query method based on a state dictionary provided in Embodiment 2 of the present invention;

[0024] Figure 5 This is a flowchart of another database data query method based on a state dictionary provided in Embodiment 3 of the present invention;

[0025] Figure 6 This is a schematic diagram illustrating the relationship between prediction success rate, preset expansion coefficient, and the number of hash functions disclosed in an embodiment of the present invention.

[0026] Figure 7 This is a schematic diagram illustrating the updating of a status dictionary when adding data to a target database, as disclosed in an embodiment of the present invention.

[0027] Figure 8 This is a schematic diagram illustrating the updating of a status dictionary when deleting data in a target database, as disclosed in an embodiment of the present invention.

[0028] Figure 9 This is a schematic diagram of the structure of a database data query device based on a state dictionary provided in Embodiment 3 of the present invention;

[0029] Figure 10 This is a schematic diagram of the structure of an electronic device that implements the database data query method based on a state dictionary according to an embodiment of the present invention. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0031] Example 1

[0032] Figure 1 This is a flowchart of a database data query method based on a state dictionary, provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where a server queries a database. The method can be executed by a database data query device based on a state dictionary, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0033] S110. Receive a data query instruction for the target database and determine the target query data corresponding to the data query instruction.

[0034] The target database is the database used to store and manage data requested by the server; it can be a MySQL database, SQL Server (Structured Query Language), MongoDB, or at least one other non-relational database.

[0035] Among them, the data query instruction can be a query instruction from the client to the server to request the target query data; the data query instruction is used to obtain the target query data from the database through the server.

[0036] Optionally, the server provides services and resources to the client. The server can be a physical server or any program capable of providing services. The server and client can reside on the same device.

[0037] The target query data can be the data requested by the client. It should be noted that, in this embodiment of the invention, when the client requests the target query data from the server, neither the client nor the server can know whether the target query data exists in the target database. The client needs to query the target database according to the target query instruction to determine whether the target query data is stored in the target database.

[0038] Specifically, when a user requests a service from the server on the client side, they send a data query command to the target server. Upon receiving the data query command, the server determines the target data to be queried.

[0039] Optionally, upon receiving a data query instruction, the server can parse the instruction to determine the target data to be queried and the corresponding target database.

[0040] S120. Perform hash calculation on the target query data according to the hash function group stored in the status dictionary to determine the query hash value of the target query data.

[0041] The hash function group can be multiple hash functions stored in the state dictionary. The hash function group can be used to calculate the hash value of the target query data. The hash function algorithm used in this embodiment of the invention can be at least one of the following: MD5 algorithm, secure hash algorithm, direct addressing method, digital analysis method, folding method, mid-square method, subtraction method, radix conversion method, division remainder method, random multiplier method, and string numerical hashing method.

[0042] The state dictionary can be a data structure created on the server side to record data in the target database. Optionally, in this embodiment of the invention, the state dictionary consists of three parts: a hash function group, a hash bit array, and a counting list. The state dictionary, hash bit array, and counting list have the same length. The hash bit array can be a bit array that records hash values, and it can be a one-dimensional array. The counting list can be a linked list that records the number of bits in each bit of the hash bit array, and it can be a two-dimensional array.

[0043] For example, Figure 2 This is a schematic diagram of a state dictionary disclosed in an embodiment of the present invention. Figure 3 This is a schematic diagram of a counting linked list disclosed in an embodiment of the present invention. Figure 2 and Figure 3 As shown, the length of the state dictionary is represented by L. The lengths of the hash bit array and the counting list are the same as the length of the state dictionary, and both are L. The counting list is a two-dimensional array, represented by Count_List.

[0044] The query hash value can be a hash value calculated from the target query data using a hash function; the query hash value is used to determine whether the target query data exists in the target database.

[0045] Specifically, the server sends the target query data to the status dictionary. The hash function group stored in the status dictionary performs hash calculation on the target query data to obtain the query hash value corresponding to the target query data.

[0046] S130. If the hash bit array stored in the status dictionary contains a target hash value that is the same as the query hash value, then the data query instruction is sent to the target database for data query.

[0047] The target hash value can be a hash value stored in a hash bit array; the target hash value can also be used to determine whether the target query data exists in the target database. Optionally, in this embodiment of the invention, the existence of a target hash value with the same name as the query hash value is queried in the hash bit array. The position of the data in the hash bit array is determined based on the query hash value. If the data at the position corresponding to the query hash value already exists, it is considered that a target hash value with the same name as the query hash value exists in the hash bit array; conversely, if the data at the position corresponding to the query hash value does not exist, it is considered that a target hash value with the same name as the query hash value does not exist in the hash bit array.

[0048] Specifically, the query hash value corresponding to the target query data is obtained from the status dictionary. The query hash value is then passed into the hash bit array. It is determined whether there is a target hash value in the hash bit array that is the same as the query hash value. If there is a target hash value in the hash bit array that is the same as the query hash value, it is determined that the target query data exists in the target database, and then the data query command is sent to the target database for data query. If there is no target hash value in the hash bit array that is the same as the query hash value, it is determined that there is no target query data in the target database, and then the server is returned that the target database does not contain the target query data.

[0049] The technical solution of this invention improves the accuracy of data queries by receiving a data query instruction for a target database and determining the target query data corresponding to the instruction before entering the database. It also improves the query accuracy by performing a hash calculation on the target query data using a hash function group stored in the status dictionary to determine the query hash value. This hash value confirms the existence of the target query data in the database, improving database response speed and reducing resource waste. If the hash bit array stored in the status dictionary contains a target hash value identical to the query hash value, the data query instruction is sent to the target database for querying. By confirming the existence of the target query data in the database using the status dictionary and sending the data query instruction to the target database, the system achieves rapid database response, improves database speed, solves the technical problem of filtering database data requests in the prior art, improves database feedback efficiency, and saves database resources.

[0050] Example 2

[0051] Figure 4This is a flowchart of another database data query method based on a state dictionary provided in Embodiment 2 of the present invention. The relationship between this embodiment and the above embodiments is that this is a specific method for calculating the query hash value through a group of hash functions. Figure 4 As shown, this database data query method based on a state dictionary includes:

[0052] S210. Receive a data query instruction for the target database and determine the target query data corresponding to the data query instruction.

[0053] S220. Determine the target query character corresponding to the target query data based on the target query data; divide the target query data into multiple target query sub-data based on the target query character; perform hash calculation on the multiple target query sub-data based on the hash function to determine the query hash value of the target query data.

[0054] The hash function group includes at least one hash function. At least one hash function can be set in the state dictionary according to the needs of hash calculation.

[0055] The target query character can be multiple characters corresponding to the target query data. It should be noted that the target query data is usually composed of multiple characters, and the corresponding target query character is determined based on the target query data. These characters include letters, numbers, operators, punctuation marks, and other symbols.

[0056] Among them, the target query sub-data can be data composed of each character of the target query data.

[0057] Optionally, in this embodiment of the invention, after obtaining the target query data target query character, the target query data is divided according to each character, and each character is divided into a target query sub-data, resulting in multiple target query sub-data.

[0058] Optionally, embodiments of the present invention may further set the number of characters per unit of the target query data, and divide the target query data according to the number of characters per unit, dividing it into multiple target query sub-data with the number of characters per unit. Wherein, the number of characters per unit is at least one character.

[0059] Specifically, the state dictionary obtains the target query data, determines the target query character corresponding to the target query data, divides the target query data into multiple target query sub-data based on the target query character, and then performs hash calculation on the multiple target query sub-data using a hash function to determine the query hash value of the target query data.

[0060] Optionally, in another optional embodiment of the present invention, the query hash value includes at least one hash bit value; the step of performing hash calculation on the plurality of target query sub-data according to the hash function to determine the query hash value of the target query data includes:

[0061] Multidimensional random numbers are generated based on the number of hash functions and the number of target query sub-data according to a preset random number generation method; wherein, the number of dimensions of the multidimensional random number is used to indicate the number of hash functions, and the number of random numbers in each dimension of the multidimensional random number is used to indicate the number of target query sub-data.

[0062] For each hash function, hash calculation is performed based on the multidimensional random number corresponding to the dimension of the hash function and multiple target query sub-data to determine the hash bit value corresponding to each hash function;

[0063] The query hash value of the target query data is determined based on the hash bit value corresponding to each hash function.

[0064] The preset random number generation method can be a pre-set method for generating random numbers.

[0065] Multidimensional random numbers can be multiple sets of random numbers of the same quantity. It should be noted that there is no correlation between the random numbers, and they are unpredictable. Multidimensional random numbers can improve the randomness of hash calculations and increase the accuracy of queries.

[0066] The number of dimensions in the multidimensional random number indicates the number of hash functions, and the number of random numbers in each dimension of the multidimensional random number indicates the number of target query sub-data. Optionally, when generating multidimensional random numbers using a preset random number generation method, since the multidimensional random numbers participate in the calculation of the hash functions, and each target query sub-data requires a random number, the number of random numbers in each dimension of the multidimensional random number needs to be equal to the number of target query sub-data. Each hash function can perform hash calculation using a random number in one dimension and the target query sub-data, thus the dimension of the multidimensional random number is the same as the number of hash functions in the hash function group.

[0067] The hash bit value indicates the position of the hash bit in the hash bit array. It should be noted that the hash bit array is a one-dimensional binary array, where each bit has a value of 1 or 0. The hash bit value indicates the corresponding bit position in the hash bit array, and its value can be retrieved by looking up the value of that bit position.

[0068] Optionally, in this embodiment of the invention, a hash function is used to perform hash calculations on a multidimensional random number and multiple target query sub-data to determine the multidimensional random number corresponding to each target query sub-data. For each target query sub-data, the product of the target query sub-data and the corresponding multidimensional random number is determined. The products of all target query sub-data are summed to obtain the hash bit value of the hash function. The formula for calculating the hash bit value using the hash function is shown in the following formula (1):

[0069] hash=X i Key[i]+X i-1 Key[i-1]+...+X1Key[1]

[0070] Where hash is the hash bit value obtained from the hash calculation; X i Let i be the i-th random number, and Key[i] be the i-th target query sub-data.

[0071] Specifically, for multiple target query sub-data of the target query data, a multidimensional random number is generated according to a preset random number generation method. The number of dimensions is equal to the number of hash functions, and the number of random numbers in each dimension is equal to the number of target query sub-data. Each hash function performs hash calculation on the multidimensional random number corresponding to one dimension and multiple target query sub-data to determine the hash bit value corresponding to each hash function. The query hash value of the target query data is determined according to the hash bit value corresponding to each hash function.

[0072] S230. If the hash bit array stored in the status dictionary contains a target hash value that is the same as the query hash value, then the data query instruction is sent to the target database for data query.

[0073] The technical solution of this invention receives a data query instruction for a target database, determines the target query data corresponding to the data query instruction, determines the target query character corresponding to the target query data, divides the target query data into multiple target query sub-data based on the target query character, performs hash calculation on the multiple target query sub-data according to the hash function, and determines the query hash value of the target query data. By dividing the target query data into characters and adding multi-dimensional random numbers, the randomness of the hash function calculation is improved, resulting in a more accurate query hash value and improving the accuracy of the state dictionary in determining the target query data. If the hash bit array stored in the state dictionary contains a target hash value that is the same as the query hash value, the data query instruction is sent to the target database for data query. This achieves a fast database response, improves the database response speed, solves the technical problem of difficulty in filtering database data requests in the prior art, improves the database feedback efficiency, and saves database resources.

[0074] Example 3

[0075] Figure 5 This is a flowchart of another database data query method based on a state dictionary provided in Embodiment 3 of the present invention. The relationship between this embodiment and the above embodiments is that, before performing data query through the state dictionary, it also includes creating a state dictionary corresponding to the target server on the server side. Figure 5 As shown, the method includes:

[0076] S310. Obtain the maximum storage capacity of the target database.

[0077] The maximum storage capacity refers to the maximum amount of data that the target database can store; the maximum storage capacity can be the maximum storage capacity estimated by the database administrator when creating the target database.

[0078] Specifically, when creating the state dictionary on the server side, the maximum storage capacity of the target database is obtained.

[0079] S320. Determine the number of hash functions in the state dictionary and the preset expansion coefficient according to the preset prediction success rate requirements.

[0080] The preset expansion factor can be a pre-set expansion factor. The preset expansion factor can be used to determine whether the target database needs to be expanded.

[0081] The prediction success rate requirement can be a pre-set requirement for judging the success rate of state dictionary queries. It should be noted that, in this embodiment of the invention, when a data query instruction arrives at the state dictionary, the state dictionary is used to determine whether the target query data corresponding to the data query instruction exists in the database. The prediction success rate requirement is used to constrain the success rate of the state dictionary's judgment.

[0082] Specifically, the system obtains the server-preset prediction success rate requirement, and selects the preset expansion coefficient and number of hash functions that meet the prediction success rate requirement based on the correlation between the prediction success rate requirement, the preset expansion coefficient, and the number of hash functions.

[0083] Optionally, in this embodiment of the invention, the relationship between prediction success rate, dictionary length, and maximum storage capacity is shown in the following formula (2):

[0084]

[0085] Where P_true is the prediction success rate; M is the amount of data added to the target database; n is the number of hash functions; L is the length of the state dictionary; and e is the expected value of the prediction. Furthermore, to ensure the accuracy of the state dictionary and the reasonableness of its memory usage, the length of the state dictionary needs to meet the limitations of the maximum storage capacity, the number of hash functions, and the preset expansion coefficient. The relationship between the length of the state dictionary and the maximum storage capacity, the number of hash functions, and the preset expansion coefficient is shown in the following formula (3):

[0086] L = max * n * k

[0087] Where max is the maximum storage capacity; k is the preset expansion coefficient.

[0088] Assuming that the amount of data added to the target database is always less than the maximum storage capacity of the target database, the relationship between the prediction success rate, the preset expansion coefficient, and the number of hash functions can be calculated using the above formulas (2) and (3), as shown in formula (4):

[0089]

[0090] Figure 6 This is a schematic diagram illustrating the relationship between prediction success rate, preset expansion coefficient, and the number of hash functions disclosed in an embodiment of the present invention. Figure 6 As shown, based on formula (4), when the amount of data in the input target database is less than the maximum storage capacity of the target database, and the maximum storage capacity and the amount of data in the input target database are fixed values, the number of preset expansion coefficients and hash functions will affect the prediction success rate of the state dictionary. By the correlation between the prediction success rate, the number of preset expansion coefficients and the number of hash functions, the number of preset expansion coefficients and hash functions can be determined according to the prediction success rate requirements.

[0091] S330. Determine the dictionary length of the state dictionary based on the number of hash functions, the maximum storage capacity, and the preset expansion coefficient.

[0092] The dictionary length can be the length of the state dictionary.

[0093] Specifically, the length of the state dictionary is determined based on the number of hash functions, the maximum storage capacity, and the preset expansion factor.

[0094] S340. Set the state dictionary according to the dictionary length and the number of hash functions.

[0095] Specifically, the length of the state dictionary and the number of hash functions are obtained, and the state dictionary is set according to the dictionary length and the number of hash functions.

[0096] Optionally, in another optional embodiment of the present invention, setting the state dictionary according to the dictionary length and the number of hash functions includes:

[0097] Set up a hash bit array and a counting list according to the dictionary length, set up hash functions according to the preset hash processing algorithm and the number of hash functions, and determine the hash function group; set up the state dictionary according to the preset hash function group, the hash bit array and the counting list.

[0098] Wherein, the length of the hash bit array and the length of the counting linked list are the same as the length of the state dictionary;

[0099] The hash processing algorithm can be a pre-defined hash algorithm used in the hash function. The hash processing algorithm may include at least one of the following: MD5 algorithm, secure hash algorithm, direct addressing method, digit analysis method, folding method, mid-square method, subtraction method, radix conversion method, division remainder method, random multiplier method, and string numerical hashing method.

[0100] Specifically, the dictionary length of the state dictionary and the number of hash functions are obtained. A hash bit array and a counting list with the same length as the dictionary are set according to the dictionary length. Hash functions are set according to a preset hash processing algorithm and the number of hash functions. The hash function group of the state dictionary is determined. The state dictionary is set according to the preset hash function group, hash bit array and counting list.

[0101] Optionally, in another alternative embodiment of the present invention, the method further includes:

[0102] Obtain the target update data from the target database; perform hash calculation on the target update data according to the hash function group to determine the update hash value of the target update data; update the hash bit array and the counting list according to the update hash value.

[0103] The target updated data can be the data updated by the server in the target database. It should be noted that there are two situations when the server updates the target database. The first situation is adding data to the target database. When adding data on the server, the added data is the target updated data. The second situation is deleting data from the target database. When deleting data on the server, the deleted data is the target updated data.

[0104] The update hash value is the hash value of the updated data calculated using a hash function.

[0105] Specifically, when adding or deleting data in the target database on the server side, the target updated data is obtained, and the target updated data is hashed using a hash function group to obtain the updated hash value of the target updated data. The hash bit array and the counting list are then updated based on the updated hash value.

[0106] Optionally, in another optional embodiment of the present invention, the updated hash value includes at least one hash bit value; the step of updating the hash bit array and the counting list according to the updated hash value includes:

[0107] Query the corresponding binary bit value in the hash bit array based on the hash bit value;

[0108] If the binary bit value is a preset value, then the corresponding count value in the counting chain is updated according to the hash bit value.

[0109] The binary bit value can be the value recorded by each bit in the hash bit array; the hash bit array is a one-dimensional binary array, where each bit has a value of 1 or 0, and the hash bit value is used to indicate the corresponding bit in the hash bit array.

[0110] The preset value can be a pre-set binary bit value used to determine whether the binary bit value needs to be updated. For example, the hash bit array is usually set to 1.

[0111] The count value can be the count value of each record in the counting list. The count value can be used to record the number of times the binary bit value is preset.

[0112] Specifically, the update hash value is obtained, and the corresponding binary bit value in the hash bit array is queried based on the hash bit value in the update hash value; it is determined whether the binary bit value is a preset value. If the binary bit value is a preset value, the corresponding count value in the counting chain is updated based on the hash bit value; if the binary bit value is not a preset value, the hash bit value is updated to the preset value.

[0113] For example, Figure 7 This is a schematic diagram illustrating the updating of a status dictionary when adding data to a target database, as disclosed in an embodiment of the present invention. Figure 7As shown: Add data to the target database, obtain the added target updated data as data one, and calculate the corresponding updated hash value through the three hash functions in the hash function group. The updated hash value includes three hash bit values ​​Hash1(), Hash2(), and Hash3(). When updating the state dictionary, there are three cases from top to bottom: First case: When the three target bit values ​​corresponding to Hash1(), Hash2(), and Hash3() in the hash bit array are all 0, then adjust the three target bit values ​​to 1 respectively; Second case: When the hash bit array H... If the three target bit values ​​corresponding to ash1(), Hash2(), and Hash3() are 0, 0, and 1 respectively, then the target bit value of 0 is adjusted to 1, and the count value in the counting chain corresponding to the target bit value of 1 is adjusted to 1. In the third case, if the three target bit values ​​corresponding to Hash1() and Hash3() in the hash bit array are 1 and 1 respectively, then the count value of 0 in the counting chain corresponding to the target bit value of 1 and the count value of 0 is adjusted to 1, and the count value in the counting chain corresponding to the target bit value of 1 and the count value of 1 is adjusted from 1 to 2.

[0114] For example, Figure 8 This is a schematic diagram illustrating the updating of a status dictionary when deleting data in a target database, as disclosed in an embodiment of the present invention. Figure 8 As shown: Data is deleted from the target database. The deleted target updated data is obtained as data one. The corresponding updated hash value is calculated using the three hash functions in the hash function group. The updated hash value includes three hash bit values: Hash1(), Hash2(), and Hash3(). When updating the state dictionary, there are three cases from top to bottom: Case 1: When the three target bit values ​​corresponding to Hash1(), Hash2(), and Hash3() in the hash bit array are 1, 1, and 1 respectively, the corresponding count values ​​in the calculation list are determined to be 1, 3, and 5 respectively, and the corresponding count values ​​in the calculation list are adjusted to 0, 2, and 4. Case 2: When the three target bit values ​​corresponding to Hash1(), Hash2(), and Hash3() in the hash bit array are respectively 1, 1, and 1, the corresponding count values ​​in the calculation list are determined to be 1, 3, and 5 respectively, and the corresponding count values ​​in the calculation list are adjusted to 0, 2, and 4. Case 3: When the three target bit values ​​corresponding to Hash1(), Hash2(), and Hash3() in the hash bit array are respectively 1, 1, and 1, the corresponding count values ​​in the calculation list are adjusted to 0, 2, and 4 respectively. When the three target bit values ​​are 1, 1, and 1, the corresponding count values ​​in the calculation list are determined to be 0, 1, and 4 respectively. The target bit value with a target bit value of 1 and a count value of 0 is adjusted to 0. The count value in the counting list corresponding to the target bit value with a target bit value of 1 and a count value of 1 is adjusted to 0. The count value in the counting list corresponding to the target bit value with a target bit value of 1 and a count value of 4 is adjusted to 3. In the third case, when the two target bit values ​​corresponding to Hash1() and Hash3() in the hash bit array are 1 and 1 respectively, the calculated values ​​corresponding to the two target bit values ​​are determined to be 0 and 3. The target bit value corresponding to the target bit value with a target bit value of 1 and a count value of 0 is adjusted from 1 to 0. The count value corresponding to the target bit value with a target bit value of 1 and a count value of 3 is adjusted from 3 to 2.

[0115] The technical solution of this invention obtains the maximum storage capacity of the target database; based on the storage capacity of the target database, it can determine a state dictionary that better matches the target database, improving the performance of the state dictionary and reducing its space; it determines the number of hash functions and a preset expansion coefficient in the state dictionary according to a preset prediction success rate requirement; based on the expected success rate of the state dictionary, it can determine the preset expansion coefficient of the target database, further improving the database performance and the response speed of the state dictionary; it determines the dictionary length of the state dictionary based on the number of hash functions, the maximum storage capacity, and the preset expansion coefficient; setting an appropriate dictionary length ensures the accuracy of the state dictionary and the reasonable use of memory. By setting the state dictionary according to the dictionary length and the number of hash functions, it realizes the creation of a corresponding state dictionary for the target database, further improving the database response speed, solving the technical problem of difficulty in filtering database data requests in the prior art, improving the database feedback efficiency, and saving database resources.

[0116] Optionally, embodiments of the present invention disclose another database data query method based on a state dictionary, wherein the method includes:

[0117] S1. Create a state dictionary Dist for the target database. The initial length of the state dictionary Dist is L, and the lengths of the hash array Bloom and the counting list Count_List are both L. The data structure of the state dictionary is as follows: Figure 2 As shown, it is internally represented in binary, where Bloom is a one-dimensional array and Count_List is a two-dimensional array, as shown in the attached diagram. Figure 3 As shown. At the same time, a group of independent hash functions, Hash_Group(), also needs to be determined.

[0118] Optionally, the specific process of creating a state dictionary Dist is as follows:

[0119] To ensure the accuracy of the state dictionary and the reasonable use of memory, the initial length L of its state dictionary Dise can follow formula (3):

[0120] L = max * n * k

[0121] Furthermore, the relationship between prediction success rate, dictionary length L, and maximum storage capacity max is shown in the following formula (2):

[0122]

[0123] Where P_true is the prediction success rate; M is the amount of data added to the target database; n is the number of hash functions; L is the length of the state dictionary; and e is the expected value of the prediction.

[0124] Assuming that the amount of data added to the target database is always less than the maximum storage capacity of the target database, the relationship between the prediction success rate, the preset expansion coefficient, and the number of hash functions can be calculated using the above formulas (2) and (3), as shown in formula (4):

[0125]

[0126] Figure 6 This is a schematic diagram illustrating the relationship between prediction success rate, preset expansion coefficient, and the number of hash functions disclosed in an embodiment of the present invention. Figure 6 As shown, based on formula (4), when the amount of data in the input target database is definitely less than the maximum storage capacity of the target database, and the maximum storage capacity and the amount of data in the input target database are fixed values, the preset expansion coefficient and the number of hash functions will affect the prediction success rate of the state dictionary. By understanding the correlation between the prediction success rate, the preset expansion coefficient, and the number of hash functions, the preset expansion coefficient and the number of hash functions are determined according to the prediction success rate requirement. Then, the dictionary length of the state dictionary is determined according to the number of hash functions, the maximum storage capacity, and the preset expansion coefficient. The dictionary length of the state dictionary and the number of hash functions are obtained, and the state dictionary is set according to the dictionary length and the number of hash functions.

[0127] S2. When adding or deleting data in the database, the internal data of the status dictionary is also updated.

[0128] Specifically, when adding a new data update status dictionary to the database, the new target update data is hashed in Hash_Group(), and the calculated update hash value is shown in formula (5):

[0129]

[0130] Where, {N1,N2,...N n} represents the updated hash value obtained from the hash calculation, and N1, N2, ..., Nn represent the hash bit values. The Bloom array of hash bits and the counting list in the state dictionary are updated based on the hash bit values.

[0131] Query the target bit value at the position in the hash bit array corresponding to the hash bit value. If the target bit value was originally 0, update it to 1. If it is already 1, update the value of the counting list at that position by 1. Finally, obtain the updated bit array Bloom{L,0 / 1} and the counting list Count_List{L,N|N>=0}.

[0132] When deleting data update status dictionary from the database, the target update data data to be deleted is hashed in Hash_Group(), and the calculated update hash value is shown in formula (5):

[0133]

[0134] Where, {N1,N2,...N n} represents the updated hash value obtained from the hash calculation, and N1, N2, ..., Nn represent the hash bit values. The Bloom array of hash bits and the counting list in the state dictionary are updated based on the hash bit values.

[0135] Query the target bit value at the position in the hash array that the hash bit value maps to, and query the count value of the count list Count_List corresponding to the target bit value. If the count value is greater than 0, decrement it by 1. If the count value is 0, update the Bloom value of the target bit value in the hash array corresponding to the count value to 0, and obtain the updated state dictionary.

[0136] S3. When querying target data through the status dictionary, first check if the target data exists in the target database. If it does not exist, return null directly; otherwise, query the target database.

[0137] Specifically, the target query data is first hashed in Hash_Group() to obtain the query hash value, as shown in formula (5):

[0138]

[0139] Where, {N1,N2,...N n} is the query hash value obtained by hash calculation. Then, it is determined whether there is a target hash value in the hash bit array that is exactly the same as the query hash value. The formula for the determination is shown in the following formula (6):

[0140] Res=Bloom(N1)&Bloom(N2)&...&Bloom(N n )

[0141] Where, N n Represents the Nth bit in the hash array nThe value of the bit, Res, represents the calculation result. If the result Res equals 1, it means that the target query data data may exist in the target database. If Res equals 0, it means that the target query data data definitely does not exist in the target database. If it is determined that the target query data data may exist in the target database, then the query will proceed to the target database. If it is determined that the target query data data does not exist in the target database, then null will be returned directly.

[0142] The technical solution of this invention enables rapid database response, improves database response speed, solves the technical problem of difficulty in filtering database data requests in the prior art, improves database feedback efficiency, and saves database resources.

[0143] Example 4

[0144] Figure 9 This is a schematic diagram of a database data query device based on a state dictionary provided in Embodiment 3 of the present invention. Figure 9 As shown, the device includes: a data query module 910, a hash calculation module 920, and a hash verification module 930, wherein,

[0145] Data query module 910 is used to receive a data query instruction for a target database and determine the target query data corresponding to the data query instruction;

[0146] The hash calculation module 920 is used to perform hash calculation on the target query data according to the hash function group stored in the state dictionary, and determine the query hash value of the target query data;

[0147] The hash verification module 930 is used to send the data query instruction to the target database to perform a data query if the hash bit array stored in the status dictionary contains a target hash value that is the same as the query hash value.

[0148] The technical solution of this invention improves the accuracy of data queries by receiving a data query instruction for a target database and determining the target query data corresponding to the instruction before entering the database. It also improves the query accuracy by performing a hash calculation on the target query data using a hash function group stored in the status dictionary to determine the query hash value. This hash value confirms the existence of the target query data in the database, improving database response speed and reducing resource waste. If the hash bit array stored in the status dictionary contains a target hash value identical to the query hash value, the data query instruction is sent to the target database for querying. By confirming the existence of the target query data in the database using the status dictionary and sending the data query instruction to the target database, the system achieves rapid database response, improves database speed, solves the technical problem of filtering database data requests in the prior art, improves database feedback efficiency, and saves database resources.

[0149] Optionally, the hash function group includes at least one hash function; the hash calculation module is specifically used to: determine the target query character corresponding to the target query data based on the target query data;

[0150] The target query data is divided into multiple target query sub-data based on the target query characters;

[0151] The hash function is used to perform hash calculations on multiple target query sub-data to determine the query hash value of the target query data.

[0152] Optionally, the query hash value includes at least one hash bit value; the hash calculation module is further used for:

[0153] Multidimensional random numbers are generated based on the number of hash functions and the number of target query sub-data according to a preset random number generation method; wherein, the number of dimensions of the multidimensional random number is used to indicate the number of hash functions, and the number of random numbers in each dimension of the multidimensional random number is used to indicate the number of target query sub-data.

[0154] For each hash function, hash calculation is performed based on the multidimensional random number corresponding to the dimension of the hash function and multiple target query sub-data to determine the hash bit value corresponding to each hash function;

[0155] The query hash value of the target query data is determined based on the hash bit value corresponding to each hash function.

[0156] Optionally, the device further includes: a state dictionary setting module; the state dictionary setting module is specifically used for: a data acquisition unit, used to acquire the maximum storage capacity of the target database; a parameter calculation unit, used to determine the number of hash functions and a preset expansion coefficient in the state dictionary according to a preset prediction success rate requirement; a dictionary length calculation unit, used to determine the dictionary length of the state dictionary according to the number of hash functions, the maximum storage capacity and the preset expansion coefficient; and a dictionary setting unit, used to set the state dictionary according to the dictionary length and the number of hash functions.

[0157] Optionally, the state dictionary setting module is further used for:

[0158] A hash bit array and a counting list are set according to the dictionary length, wherein the length of the hash bit array and the length of the counting list are the same as the length of the state dictionary;

[0159] Set the hash functions according to the preset hash processing algorithm and the number of hash functions, and determine the hash function group;

[0160] The state dictionary is set according to the preset hash function group, the hash bit array, and the counting list.

[0161] Optionally, the apparatus further includes: a state dictionary update module and a hash update module; wherein,

[0162] The status dictionary update module is used to obtain the target update data of the target database.

[0163] The hash calculation module is further configured to perform hash calculation on the target update data according to the hash function group to determine the update hash value of the target update data;

[0164] The hash update module is used to update the hash bit array and the counting list according to the updated hash value.

[0165] Optionally, the updated hash value includes at least one hash bit value; the hash update module is specifically used for:

[0166] Query the corresponding binary bit value in the hash bit array based on the hash bit value;

[0167] If the binary bit value is a preset value, then the corresponding count value in the counting chain is updated according to the hash bit value.

[0168] The database data query device based on the state dictionary provided in this embodiment of the invention can execute the database data query method based on the state dictionary provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0169] Example 4

[0170] Figure 10 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0171] like Figure 10 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0172] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0173] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a database data query method based on a state dictionary.

[0174] In some embodiments, the state dictionary-based database data query method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the state dictionary-based database data query method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the state dictionary-based database data query method by any other suitable means (e.g., by means of firmware).

[0175] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0176] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0177] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0178] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0179] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0180] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0181] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0182] Example 5

[0183] This embodiment provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the program implements the database data query method steps based on a state dictionary as provided in any embodiment of the present invention. The method includes:

[0184] Receive a data query instruction for a target database and determine the target query data corresponding to the data query instruction;

[0185] The target query data is hashed according to the hash function group stored in the state dictionary to determine the query hash value of the target query data;

[0186] If the hash array stored in the status dictionary contains a target hash value that is the same as the query hash value, then the data query instruction is sent to the target database for data query.

[0187] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0188] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0189] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0190] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0191] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0192] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0193] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A database data query method based on a state dictionary, characterized in that, include: Receive a data query instruction for a target database and determine the target query data corresponding to the data query instruction; The target query data is hashed according to the hash function group stored in the state dictionary to determine the query hash value of the target query data; If the hash bit array stored in the status dictionary contains a target hash value that is the same as the query hash value, then the data query instruction is sent to the target database for data query. The hash function group includes at least one hash function; The step of performing hash calculations on the target query data based on the hash function group stored in the state dictionary to determine the query hash value of the target query data includes: Determine the target query character corresponding to the target query data based on the target query data; The target query data is divided into multiple target query sub-data based on the target query characters; The hash function is used to perform hash calculations on multiple target query sub-data to determine the query hash value of the target query data. The query hash value includes at least one hash bit value; the step of performing hash calculations on multiple target query sub-data according to the hash function to determine the query hash value of the target query data includes: Multidimensional random numbers are generated based on the number of hash functions and the number of target query sub-data according to a preset random number generation method; wherein, the number of dimensions of the multidimensional random number is used to indicate the number of hash functions, and the number of random numbers in each dimension of the multidimensional random number is used to indicate the number of target query sub-data. For each hash function, hash calculation is performed based on the multidimensional random number corresponding to the dimension of the hash function and multiple target query sub-data to determine the hash bit value corresponding to each hash function; The query hash value of the target query data is determined based on the hash bit value corresponding to each hash function.

2. The method according to claim 1, characterized in that, Before receiving the data query instruction for the target database and determining the target query data corresponding to the data query instruction, the method further includes: Get the maximum storage capacity of the target database; The number of hash functions in the state dictionary and the preset expansion coefficient are determined based on the preset prediction success rate requirements. The dictionary length of the state dictionary is determined based on the number of hash functions, the maximum storage capacity, and the preset expansion coefficient. The state dictionary is set according to the dictionary length and the number of hash functions.

3. The method according to claim 2, characterized in that, Setting the state dictionary according to the dictionary length and the number of hash functions includes: A hash bit array and a counting list are set according to the dictionary length, wherein the length of the hash bit array and the length of the counting list are the same as the length of the state dictionary; Set the hash functions according to the preset hash processing algorithm and the number of hash functions, and determine the hash function group; The state dictionary is set according to the preset hash function group, the hash bit array, and the counting list.

4. The method according to claim 3, characterized in that, The method further includes: Obtain the target update data from the target database; The target update data is hashed according to the hash function group to determine the update hash value of the target update data; The hash bit array and the counting list are updated based on the updated hash value.

5. The method according to claim 4, characterized in that, The updated hash value includes at least one hash bit value; updating the hash bit array and the counting list according to the updated hash value includes: Query the corresponding binary bit value in the hash bit array based on the hash bit value; If the binary bit value is a preset value, then the corresponding count value in the counting chain is updated according to the hash bit value.

6. A database data query device based on a state dictionary, characterized in that, include: The data query module is used to receive data query instructions for the target database and determine the target query data corresponding to the data query instructions. The hash calculation module is used to perform hash calculations on the target query data according to a preset set of hash functions to determine the query hash value of the target query data. The hash verification module is used to send the data query instruction to the target database to perform a data query if the hash bit array stored in the status dictionary contains a target hash value that is the same as the query hash value. The hash function group includes at least one hash function; The hash calculation module is specifically used to: determine the target query character corresponding to the target query data based on the target query data; The target query data is divided into multiple target query sub-data based on the target query characters; The hash function is used to perform hash calculations on multiple target query sub-data to determine the query hash value of the target query data. The query hash value includes at least one hash bit value; the hash calculation module is further used for: Multidimensional random numbers are generated based on the number of hash functions and the number of target query sub-data according to a preset random number generation method; wherein, the number of dimensions of the multidimensional random number is used to indicate the number of hash functions, and the number of random numbers in each dimension of the multidimensional random number is used to indicate the number of target query sub-data. For each hash function, hash calculation is performed based on the multidimensional random number corresponding to the dimension of the hash function and multiple target query sub-data to determine the hash bit value corresponding to each hash function; The query hash value of the target query data is determined based on the hash bit value corresponding to each hash function.

7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the database data query method based on a state dictionary as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the database data query method based on a state dictionary as described in any one of claims 1-5.