Data query method and device, equipment and storage medium
By building an in-memory data query table in the database and using this table for querying, the problem of low query efficiency of existing databases is solved, and more efficient query performance and shorter query delay are achieved.
Patent Information
- Application Number
- CN202411952547.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-18
AI Technical Summary
When executing query statements, the query efficiency of existing databases is low and cannot meet the actual application requirements.
By obtaining the input data query statement, it is determined whether a query can be performed from a pre-built memory data query table, which is stored in the database memory and built on disk data. When querying is possible, the query result is determined based on the query statement and the memory data query table.
This method can adaptively improve query performance, greatly shorten the latency of query data, and improve the query performance of the database.
Smart Images

Figure CN119848071A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data query technology, and in particular to a data query method, device, equipment and storage medium. Background Art
[0002] In a general database, after receiving a query statement, the database will go through a series of processes such as lexical analysis, syntax analysis, optimizer, and executor. In the process of executing query statements, most query statements can be optimized to use indexes. For statements such as equal value queries and range queries, the use of indexes can quickly obtain execution results on the database. For example, MySQL can speed up query speed and shorten query time by using primary key queries and range queries.
[0003] There are two main solutions for query optimization in the current mainstream databases. The first solution is to use result set caching. The result set of the query is cached each time the query is executed. The next time the query is executed, the result can be quickly queried. However, there are often scenarios where the result set is invalid. In this scenario, the query performance is reduced. The second solution is to build an execution plan cache. When executing a query statement, after lexical parsing and syntax analysis, the optimization stage is skipped directly and the result is directly obtained using the executor. This greatly speeds up the query and greatly improves the query performance of the database. In this scenario, there will still be scenarios where disk access to data occurs, and the query efficiency is low, which cannot meet the actual application requirements. Summary of the invention
[0004] The present invention provides a data query method, device, equipment and storage medium, which streamline the query execution process inside the database, can adaptively improve the query performance, greatly shorten the delay of querying data, and improve the query performance of the database.
[0005] According to one aspect of the present invention, a data query method is provided. The method comprises:
[0006] Get the entered data query statement;
[0007] According to the data query statement, determine whether it is possible to query from a pre-built memory data query table, wherein the memory data query table is stored in the database memory and is built based on the database disk data;
[0008] In the case where it is possible to query from the memory data query table, a data query result corresponding to the data query statement is determined according to the data query statement and the memory data query table.
[0009] According to another aspect of the present invention, a data query device is provided. The device comprises:
[0010] A query statement acquisition module is used to acquire the input data query statement;
[0011] A memory query table detection module, used to determine whether a query can be performed from a pre-built memory data query table according to the data query statement, wherein the memory data query table is stored in the database memory and is built based on the database disk data;
[0012] A query result determination module is used to determine the data query result corresponding to the data query statement according to the data query statement and the memory data query table when it is possible to query from the memory data query table.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data query method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data query method described in any embodiment of the present invention when executed.
[0018] The technical solution of the embodiment of the present invention obtains an input data query statement. According to the data query statement, it is determined whether it is possible to query from a pre-constructed memory data query table, wherein the memory data query table is stored in the database memory and is constructed based on the database disk data. In the case where it is possible to query from the memory data query table, the data query result corresponding to the data query statement is determined according to the data query statement and the memory data query table, thereby solving the problem of low query efficiency, being able to adaptively improve query performance, greatly shortening the delay of querying data, and improving the query performance of the database.
[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a flow chart of a data query method provided according to Embodiment 1 of the present invention;
[0022] Figure 2 is a schematic diagram of a data query priority implementation method provided according to Embodiment 1 of the present invention;
[0023] Figure 3 is a flow chart of a data query method provided according to Embodiment 2 of the present invention;
[0024] Figure 4 is a schematic diagram of the structure of a memory data query table provided according to Embodiment 2 of the present invention;
[0025] Figure 5 is a structural diagram of a data query device provided according to Embodiment 3 of the present invention;
[0026] Figure 6 It is a structural schematic diagram of an electronic device for implementing the data query method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1 This is a flow chart of a data query method provided in the first embodiment of the present invention. This embodiment is applicable to the case where the database query performance is improved. The method can be executed by a data query device. The data query device can be implemented in the form of hardware and / or software. The data query device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0031] S101, obtaining an input data query statement.
[0032] The data query statement may refer to a structured query command input by the query object into the database.
[0033] Specifically, to obtain the data query statement that the query object has entered into the database search box, the user's query conditions can be collected through the front-end form. The back-end receives and verifies these input parameters, and uses secure SQL construction technology (such as parameterized query) to generate the corresponding data query statement.
[0034] S102: Determine whether a query can be performed from a pre-built in-memory data query table based on the data query statement.
[0035] The memory data query table is stored in the database memory, and the memory data query table is constructed based on the database disk data.
[0036] Specifically, it is determined whether there are data results corresponding to the data query statement in the memory data query table to determine whether the query can be performed from the pre-built memory data query table. Alternatively, the availability status of the memory data query table is determined to determine whether the query can be performed from the pre-built memory data query table.
[0037] Exemplarily, determining whether a query can be performed from a pre-built memory data query table based on the data query statement includes: based on the data query statement, determining a query table mark status in the memory data query table corresponding to the data query statement; if the query table mark status is an available state, determining that a query can be performed from the memory data query table; otherwise, determining that a query cannot be performed from the memory data query table.
[0038] The query table mark state may refer to the mark state corresponding to the query result of the data query statement. The query table mark state may include an available state and an unavailable state.
[0039] Exemplarily, the query table mark state being in an unavailable state may include the following situations, such as: when the memory data query table is in a building state, the query table mark state is marked as an unavailable state; when the memory data query table is in a modifying state, the query table mark state is marked as an unavailable state; when the memory data query table is in a loading state, the query table mark state is marked as an unavailable state.
[0040] Specifically, a query table mark state corresponding to the data query statement in the memory data query table is determined, and whether the pre-built memory data query table is available is determined through the query table mark state.
[0041] S103: When it is possible to query from the memory data query table, determine a data query result corresponding to the data query statement according to the data query statement and the memory data query table.
[0042] The data query result may refer to the query result corresponding to the data query statement. Exemplarily, the query result may be data obtained by querying the data query statement, or may be empty data that cannot be queried.
[0043] It should be noted that since the memory data query table is stored in the database memory, that is, all the data in the database is placed in the memory, it can support various types of fast queries, so that various required data can be quickly queried.
[0044] Specifically, in the case where the in-memory data query table can be queried, the in-memory data query table is queried according to the data query statement to determine the data query result corresponding to the data query statement.
[0045] On the other hand, when it is impossible to query from the memory data query table, the data query result corresponding to the data query statement is determined according to the data query statement and the database disk data.
[0046] Figure 2 A schematic diagram of a data query priority implementation method provided by an embodiment of the present invention, such as Figure 2 As shown, when the query can be performed from the memory data query table, the result query is performed by means of the memory data query table. When the data cannot be queried from the memory data query table, the database disk data is queried in the manner of ordinary query, that is, referring to the data query statement to determine the data query result corresponding to the data query statement.
[0047] The technical solution of the embodiment of the present invention obtains an input data query statement. According to the data query statement, it is determined whether it is possible to query from a pre-constructed memory data query table, wherein the memory data query table is stored in the database memory and is constructed based on the database disk data. In the case where it is possible to query from the memory data query table, the data query result corresponding to the data query statement is determined according to the data query statement and the memory data query table, thereby solving the problem of low query efficiency, being able to adaptively improve query performance, greatly shortening the delay of querying data, and improving the query performance of the database.
[0048] Based on the above embodiment, the process of constructing the memory data query table includes:
[0049] Acquire storage index data from a database disk; perform granularity division processing on the storage index data to obtain memory table row data; perform index value editing and row data address division processing on the memory table row data to obtain memory table index data; store the memory table index data in a preset memory table model to obtain a memory data query table.
[0050] The storage index data may refer to the storage data stored in the database disk, and the memory table index data may refer to the storage data in the memory data query table.
[0051] Specifically, all the stored index data in the database disk is extracted and processed according to the granularity scale to obtain the memory table row data. Then, the memory table index data is stored in a preset memory table model to obtain a memory data query table.
[0052] It should be noted that in order to maintain the memory data query table, attributes can be added to the index to determine which table needs to be cached in the memory, and an operable interface is provided. The maintenance of the memory table index data in the memory data query table may include: in the modification of the stock table to support the memory table: providing a supported operation interface, which can modify the attributes of the index corresponding to the current stock table, build the memory table data, and mark the memory table as unavailable during the modification phase. In the new table to support the memory table: in the table construction phase, an operable interface is provided to mark the table as a memory table, and in the subsequent data maintenance phase, it can be distinguished according to the table attributes. In terms of maintaining the data of the memory table when modifying the data: while modifying the data, the data of the memory table needs to be maintained to ensure the consistency of the data, and the memory table is marked as unavailable during the data modification phase. In terms of maintaining the data of the memory table during the database restart phase: in the database restart phase, in order not to block the database startup, the background thread will be started internally to load the memory table data. During the data loading phase, the successfully loaded memory table is marked as available, and the incompletely loaded memory table is marked as unavailable.
[0053] Embodiment 2
[0054] Figure 3 This is a flow chart of a data query method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment further refines the data query result corresponding to the data query statement according to the data query statement and the memory data query table. Figure 3 As shown, the method includes:
[0055] S201, obtaining an input data query statement.
[0056] S202: Determine whether a query can be performed from a pre-built in-memory data query table based on the data query statement.
[0057] S203: When it is possible to query from the memory data query table, parse the data query statement to determine the data query type and query statement instruction corresponding to the data query statement.
[0058] The data query types include equivalent query and range query. Equivalent query can refer to retrieving index data that meets specific conditions. Range query can refer to determining the index range that meets the data query statement.
[0059] Specifically, parsing the data query statement can not only determine the data query type corresponding to the query statement, such as equality query, range query, fuzzy query or other types of query logic, but also clarify the specific query statement instructions, including the tables, fields, conditions, aggregate functions, sorting requirements and connection methods involved.
[0060] S204: Based on the data query type, according to the query statement instruction and the memory data query table, determine the data query result corresponding to the data query statement.
[0061] Specifically, based on the data query type corresponding to the query statement instruction, a corresponding query strategy is adopted to compare the query statement instruction with the corresponding parameters in the memory data query table, so that the data query result corresponding to the data query statement can be determined.
[0062] Exemplarily, the determining, based on the data query type, according to the query statement instruction and the memory data query table, a data query result corresponding to the data query statement includes:
[0063] In the case where the data query type is an equal value query, the query statement instruction is compared with the index value in the memory data query table to determine the target index value, and the row data corresponding to the target index value is determined as the data query result;
[0064] In the case where the data query type is a range query, the query statement instruction is matched with the row data address in the memory data query table to determine the row data address range, and the row data within the row data address range is determined as the data query result.
[0065] Figure 4 A schematic diagram of the structure of a memory data query table provided in an embodiment of the present invention. Figure 4 As shown, the memory data query table at least includes row data and an index value and a row data address corresponding to the row data.
[0066] Specifically, the memory data query table adopts a processing strategy similar to that of a HASH table. For equal value queries, the query statement instruction can be compared with the index value in the memory data query table using the index value to quickly find the row data to determine the target index value, and the row data corresponding to the target index value is determined as the data query result. For range queries, the query statement instruction is matched with the row data address in the memory data query table to determine the starting and ending points of the row data address, and the row data within the row data address range is determined as the data query result.
[0067] The technical solution of the embodiment of the present invention determines the data query type and query statement instruction corresponding to the data query statement by parsing the data query statement. Based on the data query type, different query strategies are adopted according to the query statement instruction to determine the data query result corresponding to the data query statement from the in-memory data query table, which can adaptively query and skip the execution stage, greatly reducing the execution time and improving the query performance.
[0068] Embodiment 3
[0069] Figure 5 This is a schematic diagram of the structure of a data query device provided by Embodiment 3 of the present invention. Figure 5 As shown, the device comprises:
[0070] The query statement acquisition module 301 is used to acquire the input data query statement;
[0071] A memory query table detection module 302 is used to determine whether a query can be performed from a pre-built memory data query table according to the data query statement, wherein the memory data query table is stored in the database memory and is built based on the database disk data;
[0072] The query result determination module 303 is used to determine the data query result corresponding to the data query statement according to the data query statement and the memory data query table when it is possible to query from the memory data query table.
[0073] The technical solution of the embodiment of the present invention obtains an input data query statement. According to the data query statement, it is determined whether it is possible to query from a pre-constructed memory data query table, wherein the memory data query table is stored in the database memory and is constructed based on the database disk data. In the case where it is possible to query from the memory data query table, the data query result corresponding to the data query statement is determined according to the data query statement and the memory data query table, thereby solving the problem of low query efficiency, being able to adaptively improve query performance, greatly shortening the delay of querying data, and improving the query performance of the database.
[0074] Optionally, the memory query table detection module 302 is specifically used to:
[0075] Based on the data query statement, determining a query table mark state corresponding to the data query statement in the in-memory data query table;
[0076] In the case where the query table mark state is an available state, it is determined that the query can be performed from the memory data query table; otherwise, it is determined that the query cannot be performed from the memory data query table.
[0077] Optionally, the device comprises:
[0078] When the memory data query table is in a construction state, marking the query table mark state as an unavailable state;
[0079] When the memory data query table is in a modification state, marking the query table mark state as an unavailable state;
[0080] When the memory data query table is in a loading state, the query table mark state is marked as an unavailable state.
[0081] Optionally, the query result determination module 303 is further configured to:
[0082] In the case where the query cannot be performed from the memory data query table, the data query result corresponding to the data query statement is determined according to the data query statement and the database disk data.
[0083] Optionally, the query result determination module 303 includes:
[0084] A query statement parsing unit, used to parse the data query statement and determine the data query type and query statement instruction corresponding to the data query statement, wherein the data query type includes an equal value query and a range query;
[0085] A query result determination unit is used to determine the data query result corresponding to the data query statement based on the data query type, according to the query statement instruction and the memory data query table.
[0086] Optionally, the memory data query table includes at least row data and an index value and a row data address corresponding to the row data.
[0087] Accordingly, the query result determination unit is specifically used to:
[0088] In the case where the data query type is an equal value query, the query statement instruction is compared with the index value in the memory data query table to determine the target index value, and the row data corresponding to the target index value is determined as the data query result;
[0089] In the case where the data query type is a range query, the query statement instruction is matched with the row data address in the memory data query table to determine the row data address range, and the row data within the row data address range is determined as the data query result.
[0090] Optionally, the device further includes a memory query table construction module.
[0091] Among them, the memory query table building module can be used for:
[0092] Get storage index data from database disk;
[0093] The storage index data is processed by granularity division to obtain memory table row data;
[0094] Edit the index value of the memory table row data and perform row data address division processing to obtain memory table index data;
[0095] The memory table index data is stored in a preset memory table model to obtain a memory data query table.
[0096] The data query device provided in the embodiment of the present invention can execute the data query method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0097] Embodiment 4
[0098] Figure 6A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment 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 processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0099] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0100] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0101] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a data query method.
[0102] In some embodiments, the data query method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data query method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data query method in any other appropriate manner (e.g., by means of firmware).
[0103] Various implementations 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 chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0104] Computer programs for implementing 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, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0105] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0106] To provide interaction with a user, the systems and techniques described herein may 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0107] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0108] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0109] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0110] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data query method, characterized in that: include: Get the entered data query statement; According to the data query statement, determine whether it is possible to query from a pre-built memory data query table, wherein the memory data query table is stored in the database memory and is built based on the database disk data; In the case where it is possible to query from the memory data query table, a data query result corresponding to the data query statement is determined according to the data query statement and the memory data query table.
2. The method according to claim 1, characterized in that The step of determining whether a query can be performed from a pre-built memory data query table according to the data query statement includes: Based on the data query statement, determining a query table mark state corresponding to the data query statement in the in-memory data query table; In the case where the query table mark state is an available state, it is determined that the query can be performed from the memory data query table; otherwise, it is determined that the query cannot be performed from the memory data query table.
3. The method according to claim 2, characterized in that The method comprises: When the memory data query table is in a construction state, marking the query table mark state as an unavailable state; When the memory data query table is in a modification state, marking the query table mark state as an unavailable state; When the memory data query table is in a loading state, the query table mark state is marked as an unavailable state.
4. The method according to claim 1, characterized in that: The method comprises: In the case where the query cannot be performed from the memory data query table, the data query result corresponding to the data query statement is determined according to the data query statement and the database disk data.
5. The method according to claim 1, characterized in that The step of determining the data query result corresponding to the data query statement according to the data query statement and the memory data query table includes: Parsing the data query statement to determine a data query type and a query statement instruction corresponding to the data query statement, wherein the data query type includes an equal value query and a range query; Based on the data query type, according to the query statement instruction and the memory data query table, a data query result corresponding to the data query statement is determined.
6. The method according to claim 5, characterized in that The memory data query table at least includes row data and an index value and row data address corresponding to the row data; The determining, based on the data query type, according to the query statement instruction and the memory data query table, a data query result corresponding to the data query statement includes: In the case where the data query type is an equal value query, the query statement instruction is compared with the index value in the memory data query table to determine the target index value, and the row data corresponding to the target index value is determined as the data query result; In the case where the data query type is a range query, the query statement instruction is matched with the row data address in the memory data query table to determine the row data address range, and the row data within the row data address range is determined as the data query result.
7. The method according to claim 1, characterized in that The process of constructing the memory data query table includes: Get storage index data from database disk; The storage index data is processed by granularity division to obtain memory table row data; Edit the index value of the memory table row data and perform row data address division processing to obtain memory table index data; The memory table index data is stored in a preset memory table model to obtain a memory data query table.
8. A data query device, characterized in that: include: A query statement acquisition module is used to acquire the input data query statement; A memory query table detection module, used to determine whether a query can be performed from a pre-built memory data query table according to the data query statement, wherein the memory data query table is stored in the database memory and is built based on the database disk data; A query result determination module is used to determine the data query result corresponding to the data query statement according to the data query statement and the memory data query table when it is possible to query from the memory data query table.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data query method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data query method according to any one of claims 1 to 7 when executed.