A data reading method, device, equipment and medium

CN117421322BActive Publication Date: 2026-09-29SHANGHAI DAMENG DATABASE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311436811.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2026-09-29
Estimated Expiration
2043-10-31

AI Technical Summary

Technical Problem

特别是涉及数据定义语言修改表结构的情况下,各个节点上数据结构可能有所差别,如果要查询的表的字典对象结构与实际数据的结构不同,可能会出现不可预知的错误

Benefits of technology

[0038]根据本发明的另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使处理器执行时实现本发明任一实施例所述的数据读取方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117421322B_ABST
    Figure CN117421322B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data reading method, device, equipment and medium. The method comprises: receiving a data reading request of a client; wherein the data reading request comprises dictionary information of an index; determining a data page of data to be read according to the dictionary information; judging whether a data structure corresponding to the data page and a data structure corresponding to the dictionary information are the same; and if the data structure corresponding to the data page and the data structure corresponding to the dictionary information are the same, performing a data reading operation based on the data reading request. The technical solution can improve the accuracy of data reading by judging whether the data structures are the same before performing the reading operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed database technology, and in particular to a data reading method, apparatus, device, and medium. Background Technology

[0002] With the development of technology, distributed databases have become an important development direction in fields such as wireless communication and computer technology, and are playing an increasingly important role in the modern technology field.

[0003] Distributed databases often employ read-write separation. Each node in a distributed database can be configured as a master-slave cluster. Theoretically, read-write separation can be used, where transactions involving write operations are distributed to the master cluster of the data nodes for execution, while transactions involving only read operations are distributed to the slave cluster of the data nodes for execution. This utilizes the hardware resources of the slave database, reduces the concurrent access pressure on the master database, and thus improves the database throughput.

[0004] In a distributed database, an operation may involve multiple nodes, and the degree of data replay varies across different backup clusters. This is especially true when data definition languages ​​are used to modify table structures, as the data structures on different nodes may differ. If the dictionary object structure of the table being queried differs from the actual data structure, unpredictable errors may occur. Summary of the Invention

[0005] This invention provides a data reading method, apparatus, device, and medium that improves the accuracy of data reading by determining that the data structure is consistent before performing the reading operation.

[0006] According to one aspect of the present invention, a data reading method is provided, comprising:

[0007] Receive a data read request from a client; wherein the data read request includes dictionary information of the index;

[0008] The data page to be read is determined based on the dictionary information;

[0009] Determine whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information;

[0010] If the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information, then a data reading operation is performed based on the data reading request.

[0011] Optionally, the dictionary information includes first identification information;

[0012] Determining whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information includes:

[0013] Obtain the second identification information from the data page;

[0014] Determine whether the first identification information and the second identification information are the same;

[0015] If the first identification information and the second identification information are the same, then the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

[0016] Optionally, the first identification information includes a first index identifier and a first transaction identifier; the second identification information includes a second index identifier and a second transaction identifier.

[0017] Optionally, determining whether the first identification information and the second identification information are the same includes:

[0018] Determine whether the first index identifier and the second index identifier are the same, and determine whether the first transaction identifier and the second transaction identifier are the same;

[0019] If the first index identifier and the second index identifier are the same, and the first transaction identifier and the second transaction identifier are the same, then the first identifier information and the second identifier information are the same.

[0020] Optionally, the dictionary information includes address information;

[0021] The step of determining the data page to be read based on the dictionary information includes:

[0022] The address of the corresponding data page to be read is determined based on the address information.

[0023] Optionally, before receiving a data read request from the client, the following may also be included:

[0024] Add the index's identification information to the metadata system table; wherein, the identification information includes a transaction identifier;

[0025] When an index is created or modified, the identification information is stored in a data page, and the data page is recorded in a log.

[0026] Optionally, after determining the data page to be read based on the dictionary information, the method further includes:

[0027] Determine whether the data page meets the validity conditions;

[0028] If the data page meets the valid conditions, then it is determined whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

[0029] According to another aspect of the present invention, a data reading device is provided, comprising:

[0030] A request receiving module is used to receive data reading requests from clients; wherein, the data reading request includes dictionary information of the index;

[0031] The data page determination module is used to determine the data page of the data to be read based on the dictionary information.

[0032] The data structure judgment module is used to determine whether the data structure corresponding to the data page and the data structure corresponding to the dictionary information are the same;

[0033] The data reading module is used to perform a data reading operation based on the data reading request if the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

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

[0035] At least one processor; and

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

[0037] 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 data reading method according to any embodiment of the present invention.

[0038] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the data reading method described in any embodiment of the present invention.

[0039] The technical solution of this invention involves receiving a data read request from a client; wherein the data read request includes index dictionary information; determining the data page to be read based on the dictionary information; determining whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information; and if the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information, then performing a data read operation based on the data read request. This technical solution improves the accuracy of data reading by determining whether the data structures are consistent before performing the read operation.

[0040] 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

[0041] 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.

[0042] Figure 1 This is a flowchart of a data reading method provided according to Embodiment 1 of the present invention;

[0043] Figure 2 This is a flowchart of a data reading method provided according to Embodiment 2 of the present invention;

[0044] Figure 3 This is a schematic diagram of the structure of a data reading device according to Embodiment 3 of the present invention;

[0045] Figure 4 This is a schematic diagram of the structure of an electronic device provided according to Embodiment 4 of the present invention. Detailed Implementation

[0046] 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.

[0047] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0048] Example 1

[0049] Figure 1This is a flowchart of a data reading method according to Embodiment 1 of the present invention. This embodiment is applicable to data reading in a distributed environment. The method can be executed by a data reading device, which can be implemented in hardware and / or software, and can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes:

[0050] The technical solution of this embodiment can be applied to scenarios of distributed database read-write separation, where the standby database checks the structural consistency before performing the read operation. This embodiment's technical solution allows the standby database cluster to perform data read operations. The distributed database may include compute nodes (CNs) for receiving and processing various client requests, without storing any data themselves. Data nodes (DNs) provide data to compute nodes and handle data modification and access requests from compute nodes. Metadata nodes (MDs) provide metadata support for the entire distributed environment and also act as control nodes for distributed database transactions.

[0051] S110: Receive data read request from client.

[0052] The data read request includes dictionary information about the index. The client can be any device that a user can send requests to. A data read request can be understood as a request from the backup database cluster to read data. Specifically, a data read request can include which column of the data table to read and how many rows of data. An index can be understood as an index for each data table. A data table can be used to store data. In the database of this embodiment, a data table can have multiple indexes, including a clustered index storing all data and N secondary indexes for easy retrieval. N can be an integer greater than or equal to 0. Indexes are generally organized and stored using a B-tree. A B-tree is a self-balancing tree that maintains data order and is used for data storage.

[0053] Dictionary information can be understood as the basic structure and characteristic information of data tables in a database. For example, dictionary information may specifically include the definition type, length, precision, and special constraints of each column in the data table. In this embodiment, the indexed dictionary information can be stored in a metadata system table.

[0054] This embodiment can receive data read requests from clients, which may include dictionary information indexed in the metadata system table.

[0055] S120. Determine the data page to be read based on dictionary information.

[0056] In this embodiment, a data page can be understood as a series of data pages used to store data. In this embodiment, a data page can be a B-tree data page used to store data. The data to be read can be understood as the data to be read in the read request. In this embodiment, the data to be read can be stored in the data pages of the B-tree. The data page can include a custom-defined control page, which can record some identification information, such as index identification information. In this embodiment, the control page can also store some control data, which can be set according to actual needs. The dictionary information in this embodiment can include B-tree information. Based on the B-tree information, the corresponding B-tree for the data to be read is obtained, and the data pages of the B-tree are obtained. In this embodiment, the data page of the data to be read can be determined based on the B-tree information included in the dictionary information in the data read request.

[0057] S130. Determine whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

[0058] Here, the data structure can be understood as the structure of the data to be read. In this embodiment, the identification information can be used to determine whether the data structures are the same. In this embodiment, the dictionary information may include identification information. In this embodiment, the identification information carried in the dictionary and the identification information set in the B-tree control page can be used to determine whether they are consistent, and thus determine whether the data structure corresponding to the data page is consistent with the data structure corresponding to the dictionary information.

[0059] For example, the dictionary information T in the data read request may include three columns: c1, c2, and c3; however, the data page of the data table only contains data in two columns: c1 and c2. This indicates that the data structure corresponding to the data page is different from the data structure corresponding to the dictionary information.

[0060] In this embodiment, since the degree of data replay varies on each backup database cluster, the data structure on each node may differ when the data table structure is modified using the data definition language. Therefore, it is possible to determine whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information carried in the read request by judging whether the identification information in the read request is the same as the identification information in the data page.

[0061] In this embodiment, optionally, the dictionary information includes first identification information; determining whether the data structure corresponding to the data page and the data structure corresponding to the dictionary information are the same includes: obtaining second identification information in the data page; determining whether the first identification information and the second identification information are the same; if the first identification information and the second identification information are the same, then the data structure corresponding to the data page and the data structure corresponding to the dictionary information are the same.

[0062] In this embodiment, the first identification information can be understood as the identification information included in the dictionary information of the data read request. The data page can be understood as a custom control page in the B-tree, which can be used to store identification information or other control information. The second identification information can be understood as the identification information in the custom control page of the B-tree that stores the data. In this embodiment, the data structure corresponding to the data page and the data structure corresponding to the dictionary information can be determined by judging whether the first identification information in the dictionary information and the second identification information in the control page are the same; if the first identification information in the dictionary information and the second identification information in the control page are the same, then the data structure corresponding to the data page and the data structure corresponding to the dictionary information are the same. Through this setting, this embodiment can determine whether the data structures are the same by judging whether the identification information in the data read request and the identification information stored in the control page are the same, thereby improving the accuracy of data reading.

[0063] In this embodiment, optionally, the first identification information includes a first index identifier and a first transaction identifier; the second identification information includes a second index identifier and a second transaction identifier.

[0064] In this embodiment, the index identifier can be understood as the identification information corresponding to each index. The index identifier in this embodiment can be an index ID. The transaction identifier can be understood as the identification information of a running transaction. In this embodiment, the transaction identifier can be a transaction ID. A database transaction can represent a sequence of database operations that access and potentially manipulate various data items. A transaction can characterize the various operations performed on the data in the current database. The first identification information, including the first index identifier and the first transaction identifier, can be understood as being obtained from the data read request. The second identification information, including the second index identifier and the second transaction identifier, can be understood as being obtained from the control page of the B-tree storing the data. This embodiment, through this setting, allows for the acquisition and comparison of different identification information, facilitating data structure judgment and making the process more convenient and faster.

[0065] In this embodiment, optionally, determining whether the first identification information and the second identification information are the same includes: determining whether the first index identifier and the second index identifier are the same and determining whether the first transaction identifier and the second transaction identifier are the same; if the first index identifier and the second index identifier are the same, and the first transaction identifier and the second transaction identifier are the same, then the first identification information and the second identification information are the same.

[0066] In this embodiment, determining whether the first and second identifier information are the same can be done by judging whether the first and second index identifiers are the same, and whether the first and second transaction identifiers are the same. Specifically, it can be done by checking whether the obtained first and second index identifiers are the same. If the obtained first and second index identifiers are the same, then it is judged whether the first and second transaction identifiers are the same; if the obtained first and second index identifiers are different, an error is reported. If the obtained first and second index identifiers are the same, and the first and second transaction identifiers are also the same, it indicates that the first and second identifier information are the same, and the data structure to be read by the task data read request is the same as the data structure of the currently stored data, so subsequent data read operations can proceed. If the first and second transaction identifiers are different, an error is reported.

[0067] In this embodiment, by setting it up in this way, the index identifier and transaction identifier in the data request can be compared with the index identifier and transaction identifier in the B-tree control page of the stored data to determine whether the data structure is consistent. This improves the reliability of data reading and avoids data parsing failure or other unknown errors.

[0068] S140. If the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information, then a data reading operation is performed based on the data reading request.

[0069] In this embodiment, if the data structure in the data page is the same as the data structure in the dictionary information, a data reading operation can be performed based on the data reading request.

[0070] The technical solution of this invention involves receiving a data read request from a client; wherein the data read request includes index dictionary information; determining the data page to be read based on the dictionary information; determining whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information; and if the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information, then performing a data read operation based on the data read request. This technical solution improves the accuracy of data reading by determining whether the data structures are consistent before performing the read operation.

[0071] Example 2

[0072] Figure 2This is a flowchart of a data reading method according to Embodiment 2 of the present invention. This embodiment is an optimization based on the above embodiment. Specifically, the optimization includes: before receiving a data reading request from a client, adding index identification information to a metadata system table; wherein the identification information includes a transaction identifier; when an index is created or modified, the identification information is stored in a data page, and the data page is recorded in a log. Figure 2 As shown, the method includes:

[0073] S210. Add the index identification information to the metadata system table.

[0074] The identification information includes a transaction identifier; in this embodiment, the index identifier corresponding to the index is already reflected in the metadata system table. The metadata system table can be used to record dictionary information of the data table. The transaction identifier can be identification information for index creation or modification structure. In this embodiment, the transaction identifier can be a transaction ID. In this embodiment, a field can be added to the metadata system table that records the index to record the transaction ID for index creation or modification structure.

[0075] S220. When an index is created or modified, the identification information is stored in the data page, and the data page is recorded in the log.

[0076] In this embodiment, when creating or modifying index information, the corresponding transaction identifier can be stored in the control page of the B-tree, and the control page can be recorded in the corresponding log. The log can be a REDO log, also known as a redo log, used to provide rewrite operations and restore page operations modified by committed transactions, thus ensuring the durability of transactions.

[0077] Specifically, in this embodiment, when the data nodes of the master database cluster create an index B-tree based on the messages from the metadata nodes, they can obtain the transaction ID from the messages, set it in the control page of the B-tree, and record it in the redo log.

[0078] Furthermore, in this embodiment, the ID of the index to which the B-tree belongs and the ID of the transaction during the last structure adjustment can be recorded in the control page of the B-tree storing the table data. When the metadata node executes Data Definition Language (DDL) and sends a message to the data node to create the B-tree of the index, the transaction ID is attached to the message. In this embodiment, when a user sends a request to the compute node, the metadata node executes DDL to create or modify the index structure according to the request. When the metadata node executes DDL to create or modify the index structure, it records the ID of the current transaction in the metadata system table that records the index. Therefore, in this embodiment, when the compute node executes a data read request, it can obtain the dictionary information of the required index from the metadata node, including the transaction identifier of the index.

[0079] In addition, in this embodiment, the primary database cluster of data nodes sends REDO logs to the backup database cluster at a set period according to its own primary and backup cluster configuration, so that the backup database cluster can replay the events based on the REDO logs sent by the primary database cluster.

[0080] S230: Receive data read request from client.

[0081] The data read request includes dictionary information for the index.

[0082] S240. Determine the data page to be read based on the dictionary information.

[0083] In this embodiment, optionally, the dictionary information includes address information; determining the data page of the data to be read based on the dictionary information includes: determining the address of the corresponding data page of the data to be read based on the address information.

[0084] In this embodiment, the address information can be understood as the address of the B-tree storing the data. Based on the B-tree address information carried in the data read request, the address information of the corresponding B-tree control page storing the data to be read can be obtained, thereby determining the control page address of the data to be read. This configuration allows for the rapid determination of the control page address of the corresponding data to be read based on the data read request, facilitating data structure analysis.

[0085] In this embodiment, optionally, after determining the data page to be read based on the dictionary information, the method further includes: determining whether the data page meets the valid conditions; if the data page meets the valid conditions, determining whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

[0086] In this context, "valid conditions" can be understood as pre-defined conditions, which can be set according to actual needs in this embodiment. For example, a valid condition could be that the data page is not blank. Furthermore, this embodiment can also set some invalid conditions; if a data page meets the invalid conditions, it indicates that the data page is invalid.

[0087] In this embodiment, after determining the data page to be read based on the dictionary information, it can be judged whether the data page meets the preset valid conditions. If the data page meets the valid conditions, it can continue to judge whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

[0088] As can be understood, in this embodiment, the data pages in the data structure corresponding to the data page being judged and the data structure corresponding to the dictionary information are both valid data pages.

[0089] In this embodiment, by setting up such a system, the validity of the acquired data page can be determined before judging whether the data structure is the same, which further improves the accuracy of data reading and prevents invalid reading or reading errors.

[0090] S250. Determine whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

[0091] S260. If the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information, then a data reading operation is performed based on the data reading request.

[0092] The technical solution of this invention involves adding index identification information to the metadata system table; wherein the identification information includes a transaction identifier; when an index is created or modified, the identification information is stored in a data page, and the data page is recorded in a log; receiving a data read request from a client; wherein the data read request includes dictionary information of the index; determining the data page to be read based on the dictionary information; determining whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information; if the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information, then performing a data read operation based on the data read request. This technical solution improves the accuracy of data reading by determining whether the data structure is consistent before performing the read operation.

[0093] Example 3

[0094] Figure 3 This is a schematic diagram of a data reading device according to Embodiment 3 of the present invention.

[0095] like Figure 3 As shown, the device includes:

[0096] The request receiving module 310 is used to receive data reading requests from clients; wherein, the data reading request includes dictionary information of the index.

[0097] The data page determination module 320 is used to determine the data page of the data to be read based on dictionary information.

[0098] The data structure judgment module 330 is used to determine whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

[0099] The data reading module 340 is used to perform a data reading operation based on the data reading request if the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

[0100] Optionally, the dictionary information includes first identification information;

[0101] Data structure judgment module 330 includes:

[0102] The second identifier acquisition unit is used to acquire the second identifier information in the data page;

[0103] The identification information determination unit is used to determine whether the first identification information and the second identification information are the same;

[0104] The data structure same determination unit is used to determine that if the first identification information and the second identification information are the same, then the data structure corresponding to the data page and the data structure corresponding to the dictionary information are the same.

[0105] Optionally, the first identification information includes a first index identifier and a first transaction identifier; the second identification information includes a second index identifier and a second transaction identifier.

[0106] Optionally, the identification information determination unit is specifically used for:

[0107] Determine whether the first index identifier and the second index identifier are the same, and determine whether the first transaction identifier and the second transaction identifier are the same;

[0108] If the first index identifier and the second index identifier are the same, and the first transaction identifier and the second transaction identifier are the same, then the first identifier information and the second identifier information are the same.

[0109] Optionally, dictionary information includes address information;

[0110] The data page determination module 320 is specifically used to determine the address of the data page corresponding to the data to be read based on the address information.

[0111] Optionally, an identifier addition module is used to add index identifier information to the metadata system table before receiving a data read request from the client; wherein, the identifier information includes a transaction identifier; when an index is created or modified, the identifier information is stored in the data page and the data page is recorded in the log.

[0112] Optional, a data page validity determination module is used for...

[0113] After determining the data page to be read based on the dictionary information, it is determined whether the data page meets the valid conditions; if the data page meets the valid conditions, it is determined whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

[0114] The data reading device provided in this embodiment of the invention can execute a data reading method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution.

[0115] Example 4

[0116] Figure 4This is a schematic diagram of an electronic device according to Embodiment 4 of the present invention. The electronic device 10 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 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, 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 illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0117] like Figure 4 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.

[0118] 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.

[0119] 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 data reading methods.

[0120] In some embodiments, the data reading method may 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 may be loaded and / or mounted 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 data reading method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the data reading method by any other suitable means (e.g., by means of firmware).

[0121] 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.

[0122] 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.

[0123] 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.

[0124] 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).

[0125] 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.

[0126] 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.

[0127] 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.

[0128] 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 data reading method, characterized in that, include: Receive a data read request from a client; wherein the data read request includes dictionary information of the index; The data page to be read is determined based on the dictionary information; Determine whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information; If the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information, then a data reading operation is performed based on the data reading request; The dictionary information includes first identification information; Determining whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information includes: Obtain the second identification information from the data page; Determine whether the first identification information and the second identification information are the same; If the first identification information and the second identification information are the same, then the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information; The first identification information includes a first index identifier and a first transaction identifier; the second identification information includes a second index identifier and a second transaction identifier. Determining whether the first identification information and the second identification information are the same includes: Determine whether the first index identifier and the second index identifier are the same, and determine whether the first transaction identifier and the second transaction identifier are the same; If the first index identifier and the second index identifier are the same, and the first transaction identifier and the second transaction identifier are the same, then the first identifier information and the second identifier information are the same.

2. The method according to claim 1, characterized in that, The dictionary information includes address information; The step of determining the data page to be read based on the dictionary information includes: The address of the corresponding data page to be read is determined based on the address information.

3. The method according to claim 1, characterized in that, Before receiving data read requests from clients, it also includes: Add the index's identification information to the metadata system table; wherein, the identification information includes a transaction identifier; When an index is created or modified, the identification information is stored in a data page, and the data page is recorded in a log.

4. The method according to claim 1, characterized in that, After determining the data page to be read based on the dictionary information, the process also includes: Determine whether the data page meets the validity conditions; If the data page meets the valid conditions, then it is determined whether the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information.

5. A data reading device, characterized in that, include: A request receiving module is used to receive data reading requests from clients; wherein, the data reading request includes dictionary information of the index; The data page determination module is used to determine the data page of the data to be read based on the dictionary information. The data structure judgment module is used to determine whether the data structure corresponding to the data page and the data structure corresponding to the dictionary information are the same; The data reading module is used to perform a data reading operation based on the data reading request if the data structure corresponding to the data page is the same as the data structure corresponding to the dictionary information. The dictionary information includes first identification information; The data structure judgment module includes: The second identifier acquisition unit is used to acquire the second identifier information in the data page; An identification information determination unit is used to determine whether the first identification information and the second identification information are the same; The data structure same determination unit is used to determine that if the first identification information and the second identification information are the same, then the data structure corresponding to the data page and the data structure corresponding to the dictionary information are the same. The first identification information includes a first index identifier and a first transaction identifier; the second identification information includes a second index identifier and a second transaction identifier. The identification information determination unit is specifically used for: Determine whether the first index identifier and the second index identifier are the same, and determine whether the first transaction identifier and the second transaction identifier are the same; If the first index identifier and the second index identifier are the same, and the first transaction identifier and the second transaction identifier are the same, then the first identifier information and the second identifier information are the same.

6. 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 data reading method according to any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the data reading method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Data reading method and device, electronic equipment and storage medium

    CN109710388A

  • Data reading method, device and system and storage medium

    CN110196788A