WO2021174763A1 - 基于查找表的数据库管理方法和装置 - Google Patents

基于查找表的数据库管理方法和装置 Download PDF

Info

Publication number
WO2021174763A1
WO2021174763A1 PCT/CN2020/107193 CN2020107193W WO2021174763A1 WO 2021174763 A1 WO2021174763 A1 WO 2021174763A1 CN 2020107193 W CN2020107193 W CN 2020107193W WO 2021174763 A1 WO2021174763 A1 WO 2021174763A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
column
address
request
page
Prior art date
Application number
PCT/CN2020/107193
Other languages
English (en)
French (fr)
Inventor
鄢贵海
卢文岩
王璐唐
Original Assignee
中科驭数(北京)科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中科驭数(北京)科技有限公司 filed Critical 中科驭数(北京)科技有限公司
Publication of WO2021174763A1 publication Critical patent/WO2021174763A1/zh
Priority to US17/901,443 priority Critical patent/US20220414155A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9017Indexing; Data structures therefor; Storage structures using directory or table look-up
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/221Column-oriented storage; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present invention relates to the field of computer technology, in particular to a database management method and device based on a lookup table.
  • the embodiment of the present invention provides a database management method and device based on a lookup table, so as to achieve the technical effect of simple and efficient realization of the lookup table function.
  • a database management method based on a lookup table including:
  • the three-level storage table is adjusted according to the operation requested by the data management operation request to obtain an adjusted three-level storage table; wherein, the three-level storage table includes: a page information table of data, which is used to pass a row The data records the information of a page of data, which is related to multiple columns in the data column information table; the data column information table is used to record the information of an array in the data table through a row of data, and is connected to multiple arrays in the data table; The data table is used to record the information of one data by one row of data.
  • the data management operation request includes at least one of the following: an insert operation request, an update operation request, a delete operation request, and a query operation request.
  • the insertion operation request includes at least one of the following: a new page insertion request, a column lengthening insertion request, and a new column insertion request.
  • adjusting the three-level storage table according to the data management operation request to obtain an adjusted three-level storage table includes:
  • Inserting a row of data in the page information table of the data is used to represent the page data information requested by the new page insertion request.
  • adjusting the three-level storage table according to the data management operation request to obtain an adjusted three-level storage table includes:
  • adjusting the three-level storage table according to the data management operation request to obtain an adjusted three-level storage table includes:
  • the page information table of the data and the column information table of the data are updated.
  • a database management device based on a lookup table including:
  • the retrieval module is used to retrieve the three-level storage table in response to the data management operation request
  • the adjustment module is configured to adjust the three-level storage table according to the operation requested by the data management operation request to obtain an adjusted three-level storage table; wherein, the three-level storage table includes: a data page information table , Is used to record the information of one page of data through a row of data, and is associated with multiple columns in the column information table of the data; the column information table of data is used to record the information of an array in the data table through a row of data, and associate it to the data table Multiple arrays; data table, used to record the information of one data through a row of data.
  • the three-level storage table includes: a data page information table , Is used to record the information of one page of data through a row of data, and is associated with multiple columns in the column information table of the data; the column information table of data is used to record the information of an array in the data table through a row of data, and associate it to the data table Multiple arrays; data table, used to record the information of one data through a row of data.
  • the data management operation request includes at least one of the following: an insert operation request, an update operation request, a delete operation request, and a query operation request.
  • the insertion operation request includes at least one of the following: a new page insertion request, a column lengthening insertion request, and a new column insertion request.
  • the adjustment module includes:
  • the query unit is configured to request the data table to insert the address and data when the status value of the row indicated by the input address is determined to be 0 when the data management operation request is a new page insertion request;
  • the first insertion unit is used to insert the data to be inserted into the insertion address obtained by the request;
  • the second inserting unit is used to request free addresses from the column information table of data and insert column information, wherein the storage address of the first data and the address of the last data storage in the column information are both set to the The insertion address requested in the data table;
  • the third inserting unit is used to insert a row of data into the page information table of the data, and is used to represent the page data information requested by the new page insertion request.
  • the device is implemented based on a field programmable gate array or an application specific integrated circuit.
  • a non-volatile computer-readable storage medium on which a computer program is stored, and the computer program generates the above-mentioned device when executed by a processor.
  • a database management method based on a lookup table is provided.
  • Three levels of storage tables are set to store separately: data page information, data column information and data, so as to solve the existing lookup table-based database management method.
  • the problem of low efficiency in the way of managing the database has achieved the purpose of simple and efficient lookup table operations.
  • Fig. 1 is a method flowchart of a database management method based on a lookup table according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of the master-slave relationship of a multi-level storage data table according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of the structure of a three-level storage data table according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of the T table after a new page is inserted according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of Table C after a new page is inserted according to an embodiment of the present invention.
  • Fig. 6 is a schematic diagram of the D table after a new page is inserted according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of the C table after column lengthening and insertion according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of the D table after column lengthening and insertion according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a T table after a new column is inserted according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of the C table after a new column is inserted according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of the D table after a new column is inserted according to an embodiment of the present invention.
  • Fig. 12 is a structural block diagram of a database management device based on a lookup table according to an embodiment of the present invention.
  • FIG. 1 is a method flowchart of an embodiment of a database management method based on a lookup table described in this application.
  • this application provides method operation steps or device structures as shown in the following embodiments or drawings, the method or device may include more or fewer operation steps or module units based on conventional or no creative labor. .
  • the execution order of these steps or the module structure of the device is not limited to the execution order or module structure shown in the description of the embodiments of this application and the drawings.
  • the described method or module structure is applied to an actual device or terminal product, it can be executed sequentially or in parallel according to the method or module structure connection shown in the embodiments or drawings (for example, parallel processors or multi-threaded processing Environment, even distributed processing environment).
  • the database management method based on a lookup table may include the following steps:
  • Step 101 Obtain a data management operation request
  • Step 102 Respond to the three-level storage table in response to the data management operation request;
  • Step 103 Adjust the three-level storage table according to the operation requested by the data management operation request to obtain an adjusted three-level storage table
  • the three-level storage table includes: a page information table of data, which is used to record the information of one page of data through a row of data, and is associated with multiple columns in the column information table of data; Data records the information of an array in the data table, which is associated with multiple arrays in the data table; the data table is used to record the information of one data through a row of data.
  • a database management method based on lookup tables is provided.
  • Three levels of storage tables are set to store separately: data page information, data column information and data, which can solve the existing lookup table-based approach
  • the problem of low efficiency in database management has achieved the purpose of simple and efficient lookup table operations.
  • the aforementioned data management operation request may include, but is not limited to, at least one of the following: an insert operation request, an update operation request, a delete operation request, and a query operation request. That is, these operations can be performed for the above-mentioned three-level storage table.
  • the foregoing insertion operation request may include but is not limited to at least one of the following: a new page insertion request, a column lengthening insertion request, and a new column insertion request.
  • the specific instructions are as follows:
  • the three-level storage table is adjusted according to the data management operation request to obtain the adjusted three-level storage table, which may include:
  • Inserting a row of data in the page information table of the data is used to represent the page data information requested by the new page insertion request.
  • the three-level storage table is adjusted according to the data management operation request to obtain the adjusted three-level storage table, which may include:
  • the three-level storage table is adjusted according to the data management operation request to obtain the adjusted three-level storage table, which may include:
  • the page information table of the data and the column information table of the data are updated.
  • a multi-level storage data table is provided, and the master-slave relationship can be as shown in Figure 2.
  • the first-level storage table TabLUT (referred to as T table) is the page information table of data
  • the second-level storage table ColLUT (referred to as C table) is the column information table of data
  • the third-level storage table DataLUT (referred to as D table), used to store data, is a data table.
  • T table A row of data records the related information of "a page of data". This page is a "column group" composed of multiple arrays arranged side by side, and each column is an array. Each row of information in the T table records the first address Coladds (bit width 16) stored in the first column of the next level C table storage related "column group", and the last address Coladde (bit width 16) stored in the last column of the array.
  • the number of columns in the "column group” Colnum (bit width is 8), and the status bit Status (bit width 1) used to indicate the validity/invalidity of the data in the row, where status is 1, indicating that the layer address is valid for storing data , When status is 0, it means that the data stored in this layer address is invalid or has been deleted.
  • Table C As a storage table for column information, one row of data records related information of "an array” stored in Table D, with a tentative depth of 1024 rows.
  • the stored data includes the number of data in "an array” BlockNum (bit width is 16), the storage address of the first data BlockStart (bit width is 16), the last data storage address BlockEnd (bit width is 16) and The flag bit Status (bit width 1) to determine whether the address of the array is valid.
  • it also stores the valid flag Conseq (bit width 1) for the downward connection of multiple rows of data and the downstream address Nxtaddr (bit width 16) of the column group.
  • Nxtaddr bit width 16
  • Table D The main body is a storage table with multiple rows of data, with 1024 rows tentatively scheduled. Each row of data records "a data" related information, and multiple rows of data are connected together to form “an array” by connecting up and down information.
  • the data itself is DataAdds (the bit width is 32), DataAdde (the bit width is 32), DataAddc (the bit width is 32), with the downward connection address DownBadd (the bit width is 16), and the downward connection mark Downseq (the bit width is 1 ), the upward connection address UpBAdd (the bit width is 16), the upward connection mark Upseq (the bit width is 1), and the valid flag signal Status (the bit width is 1).
  • One data may be composed of one row or multiple rows of DataAdds, DataAdde, DataAddc, and the storage location of multiple rows of data is also irregular, the address is not necessarily continuous, and multiple rows constitute each sub-data row of "one data” The relationship between multiple rows of data is recorded by the connection information and the connection flag.
  • the Downseq of a row of data is 1 to indicate that the next connection is valid, that is, there is data to be connected after the row of data
  • DownBadd represents the address of the data to be connected down
  • Downseq is 0 to indicate that there is no data down, that is, the row is "an array "The last line
  • DownBadd is the address of the line itself. The same is true for the upward connection signal Upseq and the upward connection data address UpBAdd.
  • a row of the T table represents a page, which is related to multiple columns in the C table, and a row of the C table is downwardly related to multiple arrays of the D table, forming a page of data as a whole.
  • any element (a1, a2, a3, b1, etc.) in the D table shown in FIG. 3 represents "a data" (DataAdds, DataAdde, DataAddc) and occupies a row of address space of D.
  • a data table look-up device which can support multiple data management operations at the same time.
  • the device implements the insertion, update, and deletion of the multi-level storage table through the upper-level command module And query operations.
  • the operations such as inserting, updating, deleting, and querying the multi-level storage table are described as follows:
  • Insertion which can be divided into three types of insertion:
  • inserting "the first data of a page" is equivalent to the "column header" of the first column, and it is also the first data in the "first array", for example: a1 in Figure 3.
  • the T table in the multi-level storage table is shown in Figure 4
  • the C table is shown in Figure 5
  • the D table is shown in Figure 6.
  • Add data after the existing sequence for example, add data a4 after the last data a3 in column A in Figure 3, and change its connection relationship to a1 ⁇ a2 ⁇ a3 ⁇ a4.
  • Query the T table according to the input table_id address to obtain Status, Colnum, ColAdds, Coladde; if the status value is 1, it means that the page already exists, and then enter the data ColID (ColID>0) in the T table
  • the value of Colnum is compared. If the input ColID is less than Colnum, it is the second type of insertion, that is, column lengthening insertion. If the input ColID is not less than Colnum, it is the third type of insertion, that is, the new column insertion.
  • the T table in the multi-level storage table is shown in Figure 9
  • the C table is shown in Figure 10
  • the D table is shown in Figure 11.
  • the input table_id all relevant data in the multi-level storage table is deleted, that is, all the status values of the C table become 0, all the data status values in the D table array become 0, and the page status position of the T table is 0.
  • the input table_id is equal to the insert address of page M
  • the data stored in the ABC address in the C table and the a1-a3, b1-b1-b5, and c1-c4 arrays in the D table will all be deleted.
  • the corresponding status flag signal is set to 0.
  • all the data of the input address in the address bit of the D table is output, that is, a set of DataAdds, DataAdde, DataAddc, DownBAdd, Downseq, UpBadd, Upseq data is output.
  • an embodiment of the present invention also provides a database management device based on a lookup table, as described in the following embodiments. Since the problem-solving principle of the database management device based on the look-up table is similar to that of the database management method based on the look-up table, the implementation of the database management device based on the look-up table can refer to the implementation of the database management method based on the look-up table, and the repetition will not be repeated here. .
  • the term "unit” or "module” can be a combination of software and/or hardware that implements a predetermined function.
  • FIG. 12 is a structural block diagram of a database management device based on a lookup table according to an embodiment of the present invention. As shown in FIG. 12, it may include: an acquisition module 1201, an invocation module 1202, and an adjustment module 1203. The structure will be described below. .
  • the obtaining module 1201 is used to obtain a data management operation request
  • the retrieval module 1202 is configured to retrieve a three-level storage table in response to the data management operation request;
  • the adjustment module 1203 is configured to adjust the three-level storage table according to the operation requested by the data management operation request to obtain an adjusted three-level storage table; wherein, the three-level storage table includes: data page information The table is used to record the information of a page of data through a row of data, and is associated with multiple columns in the column information table of the data; the column information table of data is used to record the information of an array in the data table through a row of data, and is associated to the data table Multiple arrays in; data table, used to record the information of one data through a row of data.
  • the aforementioned data management operation request may include, but is not limited to, at least one of the following: an insert operation request, an update operation request, a delete operation request, and a query operation request.
  • the above insertion operation request may include but is not limited to at least one of the following: a new page insertion request, a column lengthening insertion request, and a new column insertion request.
  • the adjustment module 1203 may include: a query unit, configured to determine that the status value of the row indicated by the input address is 0 when the data management operation request is a new page insertion request.
  • the data table is requested to insert the address and data;
  • the first insertion unit is used to insert the data to be inserted in the requested insertion address;
  • the second insertion unit is used to request the free address from the column information table of the data and insert it Column information, wherein the storage address of the first data and the address of the last data storage in the column information are both set to the insertion address obtained by requesting from the data table;
  • the third insertion unit is used for loading the data A row of data is inserted into the page information table of, which is used to characterize the page data information requested by the new page insertion request.
  • the device is based on a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC) implementation.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • An embodiment of the present invention also provides a non-volatile computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the device described in any of the foregoing embodiments is generated.
  • An embodiment of the present invention also provides an electronic device including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the steps of the above method when the computer program is executed.
  • the embodiment of the present application also provides a specific implementation manner of an electronic device that can implement all the steps in the database management method based on a lookup table in the foregoing embodiment.
  • the electronic device specifically includes the following content: a processor, a memory (memory), a communication interface (Communications Interface), and a bus; wherein the processor, memory, and communication interface communicate with each other through the bus; the processor is used to call the computer program in the memory, the When the processor executes the computer program, all the steps in the database management method based on the look-up table in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:
  • Step 1 Obtain a data management operation request
  • Step 2 Respond to the data management operation request to retrieve a three-level storage table
  • Step 3 Adjust the three-level storage table according to the operation requested by the data management operation request to obtain an adjusted three-level storage table
  • the three-level storage table includes: a page information table of data, which is used to record the information of one page of data through a row of data, and is associated with multiple columns in the column information table of data; Data records the information of an array in the data table, which is associated with multiple arrays in the data table; the data table is used to record the information of one data through a row of data.
  • the embodiment of the present application also provides a computer-readable storage medium capable of implementing all the steps in the look-up table-based database management method in the above-mentioned embodiment.
  • the computer-readable storage medium stores a computer program, and the computer program is
  • the processor implements all the steps of the database management method based on the lookup table in the foregoing embodiment when executing, for example, the processor implements the following steps when executing the computer program:
  • Step 1 Obtain a data management operation request
  • Step 2 Respond to the data management operation request to retrieve a three-level storage table
  • Step 3 Adjust the three-level storage table according to the operation requested by the data management operation request to obtain an adjusted three-level storage table
  • the three-level storage table includes: a page information table of data, which is used to record the information of one page of data through a row of data, and is associated with multiple columns in the column information table of data; Data records the information of an array in the data table, which is associated with multiple arrays in the data table; the data table is used to record the information of one data through a row of data.
  • a typical implementation device is a computer.
  • the computer may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, and a tablet.
  • Computers, wearable devices, or any combination of these devices may be specifically implemented by computer chips or entities, or implemented by products with certain functions.
  • the computer may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, and a tablet.
  • each module can be implemented in the same one or more software and/or hardware, or a module that implements the same function can be implemented by a combination of multiple sub-modules or sub-units.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • controllers in addition to implementing the controller in a purely computer-readable program code manner, it is entirely possible to program the method steps to make the controller use logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded logic.
  • the same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in the controller for realizing various functions can also be regarded as a structure within the hardware component. Or even, the device for realizing various functions can be regarded as both a software module for realizing the method and a structure within a hardware component.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • the embodiments of this specification can be provided as a method, a system or a computer program product. Therefore, the embodiments of this specification may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of this specification may adopt the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • the embodiments of this specification can also be practiced in distributed computing environments. In these distributed computing environments, tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

Landscapes

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

Abstract

一种基于查找表的数据库管理方法和装置,其中,该方法包括:获取数据管理操作请求(101);响应于所述数据管理操作请求调取三级存储表(102);根据所述数据管理操作请求所请求的操作对所述三级存储表进行调整,得到调整后的三级存储表(103);其中,所述三级存储表包括:数据的页信息表,用于通过一行数据记录一页数据的信息,关联到数据的列信息表中的多列;数据的列信息表,用于通过一行数据记录数据表中一个数组的信息,关联到数据表中的多个数组;数据表,用于通过一行数据记录一个数据的信息。通过上述方法解决了现有的基于查找表的方式对数据库进行管理所存在的效率低下的问题,达到了可以简单高效地进行查找表操作的目的。

Description

基于查找表的数据库管理方法和装置 技术领域
本发明涉及计算机技术领域,特别涉及一种基于查找表的数据库管理方法和装置。
背景技术
随着数据量的不断增加,数据库访问延时越来越大,许多在小数据上用传统方法很容易完成的任务,在大数据上就变得非常困难。目前,最快的SSD存储可以达到12GB/s的读取速度,但是按照这种读写速度,如果数据库有15TB大小,那么如果采用完整检索的方式完成一次查询依旧需要33小时。为了加快数据库查询速度,大都采用设计数据库专用处理器的方法来提高性能。
然而,对数据库的大部分操作都是对数据进行遍历,在进行数据处理时,需要管理大量的数据对象。目前,管理数据对象一般都是基于查找表的方式实现的,针对如何在硬件层次高效地实现复杂的查找表功能,目前尚未提出有效的解决方案。
发明内容
本发明实施例提供了一种基于查找表的数据库管理方法和装置,以达到简单高效实现查找表功能的技术效果。
一方面,提供了一种基于查找表的数据库管理方法,包括:
获取数据管理操作请求;
响应于所述数据管理操作请求调取三级存储表;
根据所述数据管理操作请求所请求的操作对所述三级存储表进行调整,得到调整后的三级存储表;其中,所述三级存储表包括:数据的页信息表,用于通过一行数据记录一页数据的信息,关联到数据的列信息表中的多列;数据的列信息表,用于通过一行数据记录数据表中一个数组的信息,关联到数据表中的多个数组;数据表,用于通过一行数据记录一个数据的信息。
在一个实施方式中,所述数据管理操作请求包括以下至少之一:插入操作请求、更新操作请求、删除操作请求、查询操作请求。
在一个实施方式中,所述插入操作请求包括以下至少之一:新页插入请求、列加长插入请求、新列插入请求。
在一个实施方式中,在所述数据管理操作请求为新页插入请求的情况下,根据所述数据管理操作请求对所述三级存储表进行调整,得到调整后的三级存储表,包括:
响应于所述新页插入请求,根据所述新页插入请求中的输入地址查询数据的页信息表;
在确定所述输入地址所指示的行的状态值为0的情况下,向数据表请求插入地址和数据;
在请求得到的插入地址中插入待插入的数据;
向数据的列信息表请求空闲地址并插入列信息,其中,所述列信息中的第一个数据的存储的地址和最后一个数据存储的地址都设置为向所述数据表中请求得到的插入地址;
在数据的页信息表中插入一行数据,用于表征所述新页插入请求所请求插入的页数据信息。
在一个实施方式中,在所述数据管理操作请求为列加长插入请求的情况下,根据所述数据管理操作请求对所述三级存储表进行调整,得到调整后的三级存储表,包括:
响应于所述列加长插入请求,根据所述列加长插入请求中的输入地址查询数据的页信息表,以得到对应的状态值、列组里列的个数、列组的第一列的地址、列组的最后一列的地址;
如果状态值为1,则确定该页存在;
将所述列加长插入请求中的输入数据与所述列组里列的个数的数值进行比较,如果所述输入数据小于所述列组里列的个数,则从列组的第一列的地址开始根据数据的列信息表的连接关系对数据的列信息表进行查询,并对查询次数计数;
当计数结果等于所述输入数据时停止查询,记录该行的数组的最后一个数据的地址;
在数据表中寻找新的空闲的地址,在记录的该行的数组的最后一个数据的地址之后插入一行数据,然后对该行的数据的最后一个数据的存储地址中的存储信息进行更 新;
对数据的列信息表进行更新。
在一个实施方式中,在所述数据管理操作请求为新列插入请求的情况下,根据所述数据管理操作请求对所述三级存储表进行调整,得到调整后的三级存储表,包括:
响应于所述新列插入请求,根据所述新列插入请求中的输入地址查询数据的页信息表,以得到对应的状态值、列组里列的个数、列组的第一列的地址、列组的最后一列的地址;
通过状态值确定该页是否存在;
如果该页存在,则将所述新列插入请求中的输入数据与所述列组里列的个数的数值进行比较,如果所述输入数据大于所述列组里列的个数,则在数据表请求空闲地址后进行插入操作;
在插入完成后,更新数据的页信息表和数据的列信息表。
另一方面,提供了一种基于查找表的数据库管理装置,包括:
获取模块,用于获取数据管理操作请求;
调取模块,用于响应于所述数据管理操作请求调取三级存储表;
调整模块,用于根据所述数据管理操作请求所请求的操作对所述三级存储表进行调整,得到调整后的三级存储表;其中,所述三级存储表包括:数据的页信息表,用于通过一行数据记录一页数据的信息,关联到数据的列信息表中的多列;数据的列信息表,用于通过一行数据记录数据表中一个数组的信息,关联到数据表中的多个数组;数据表,用于通过一行数据记录一个数据的信息。
在一个实施方式中,所述数据管理操作请求包括以下至少之一:插入操作请求、更新操作请求、删除操作请求、查询操作请求。
在一个实施方式中,所述插入操作请求包括以下至少之一:新页插入请求、列加长插入请求、新列插入请求。
在一个实施方式中,所述调整模块包括:
查询单元,用于在所述数据管理操作请求为新页插入请求的情况下,在确定所述输入地址所指示的行的状态值为0的情况下,向数据表请求插入地址和数据;
第一插入单元,用于在请求得到的插入地址中插入待插入的数据;
第二插入单元,用于向数据的列信息表请求空闲地址并插入列信息,其中,所述 列信息中的第一个数据的存储的地址和最后一个数据存储的地址都设置为向所述数据表中请求得到的插入地址;
第三插入单元,用于在数据的页信息表中插入一行数据,用于表征所述新页插入请求所请求插入的页数据信息。
在一个实施方式中,所述装置基于现场可编程门阵列或专用集成电路实现。
又一方面,提供了一种非易失性计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时生成上述装置。
在本发明实施例中,提供了一种基于查找表的数据库管理方法,通过设置三级存储表来分别存储:数据的页信息、数据的列信息和数据,从而可以解决现有的基于查找表的方式对数据库进行管理所存在的效率低下的问题,达到了可以简单高效地进行查找表操作的目的。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,并不构成对本发明的限定。在附图中:
图1是根据本发明实施例的基于查找表的数据库管理方法的方法流程图;
图2是根据本发明实施例的多级存储数据表的主从关系示意图;
图3是根据本发明实施例的三级存储数据表的结构示意图;
图4是根据本发明实施例的新页插入后的T表示意图;
图5是根据本发明实施例的新页插入后的C表示意图;
图6是根据本发明实施例的新页插入后的D表示意图;
图7是根据本发明实施例的列加长插入后的C表示意图;
图8是根据本发明实施例的列加长插入后的D表示意图;
图9是根据本发明实施例的新列插入后的T表示意图;
图10是根据本发明实施例的新列插入后的C表示意图;
图11是根据本发明实施例的新列插入后的D表示意图;
图12是根据本发明实施例的基于查找表的数据库管理装置的结构框图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚明白,下面结合实施方式和附图,对本发明做进一步详细说明。在此,本发明的示意性实施方式及其说明用于解释本发明,但并不作为对本发明的限定。
图1是本申请所述一种基于查找表的数据库管理方法一个实施例的方法流程图。虽然本申请提供了如下述实施例或附图所示的方法操作步骤或装置结构,但基于常规或者无需创造性的劳动在所述方法或装置中可以包括更多或者更少的操作步骤或模块单元。在逻辑性上不存在必要因果关系的步骤或结构中,这些步骤的执行顺序或装置的模块结构不限于本申请实施例描述及附图所示的执行顺序或模块结构。所述的方法或模块结构的在实际中的装置或终端产品应用时,可以按照实施例或者附图所示的方法或模块结构连接进行顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至分布式处理环境)。
如图1所示,该基于查找表的数据库管理方法可以包括如下步骤:
步骤101:获取数据管理操作请求;
步骤102:响应于所述数据管理操作请求调取三级存储表;
步骤103:根据所述数据管理操作请求所请求的操作对所述三级存储表进行调整,得到调整后的三级存储表;
其中,所述三级存储表包括:数据的页信息表,用于通过一行数据记录一页数据的信息,关联到数据的列信息表中的多列;数据的列信息表,用于通过一行数据记录数据表中一个数组的信息,关联到数据表中的多个数组;数据表,用于通过一行数据记录一个数据的信息。
在上例中,提供了一种基于查找表的数据库管理方法,通过设置三级存储表来分别存储:数据的页信息、数据的列信息和数据,从而可以解决现有的基于查找表的方式对数据库进行管理所存在的效率低下的问题,达到了可以简单高效地进行查找表操作的目的。
上述的数据管理操作请求可以包括但不限于以下至少之一:插入操作请求、更新操作请求、删除操作请求、查询操作请求。即,针对上述的三级存储表可以执行这些操作。
具体的,上述的插入操作请求可以包括但不限于以下至少之一:新页插入请求、列加长插入请求、新列插入请求。具体说明如下:
1)在所述数据管理操作请求为新页插入请求的情况下,根据所述数据管理操作请求对所述三级存储表进行调整,得到调整后的三级存储表,可以包括:
响应于所述新页插入请求,根据所述新页插入请求中的输入地址查询数据的页信息表;
在确定所述输入地址所指示的行的状态值为0的情况下,向数据表请求插入地址和数据;
在请求得到的插入地址中插入待插入的数据;
向数据的列信息表请求空闲地址并插入列信息,其中,所述列信息中的第一个数据的存储的地址和最后一个数据存储的地址都设置为向所述数据表中请求得到的插入地址;
在数据的页信息表中插入一行数据,用于表征所述新页插入请求所请求插入的页数据信息。
2)在所述数据管理操作请求为列加长插入请求的情况下,根据所述数据管理操作请求对所述三级存储表进行调整,得到调整后的三级存储表,可以包括:
响应于所述列加长插入请求,根据所述列加长插入请求中的输入地址查询数据的页信息表,以得到对应的状态值、列组里列的个数、列组的第一列的地址、列组的最后一列的地址;
通过状态值确定该页是否存在;
如果该页存在,则将所述列加长插入请求中的输入数据与所述列组里列的个数的数值进行比较,如果所述输入数据小于所述列组里列的个数,则从列组的第一列的地址开始根据数据的列信息表的连接关系对数据的列信息表进行查询,并对查询次数计数;
当计数结果等于所述输入数据时停止查询,记录该行的数组的最后一个数据的地址;
在数据表中寻找新的空闲的地址,在记录的该行的数组的最后一个数据的地址之后插入一行数据,然后对该行的数据的最后一个数据的存储地址中的存储信息进行更新;
对数据的列信息表进行更新。
3)在所述数据管理操作请求为新列插入请求的情况下,根据所述数据管理操作 请求对所述三级存储表进行调整,得到调整后的三级存储表,可以包括:
响应于所述列新列插入请求,根据所述新列插入请求中的输入地址查询数据的页信息表,以得到对应的状态值、列组里列的个数、列组的第一列的地址、列组的最后一列的地址;
通过状态值确定该页是否存在;
如果该页存在,则将所述新列插入请求中的输入数据与所述列组里列的个数的数值进行比较,如果所述输入数据大于所述列组里列的个数,则在数据表请求空闲地址和数据后进行插入操作;
在插入完成后,更新数据的页信息表和数据的列信息表。
下面结合一个具体实施例对上述方法进行说明,然而,值得注意的是,该具体实施例仅是为了更好地说明本申请,并不构成对本申请的不当限定。
在本例中,提供了一种多级存储数据的表格,主从关系可以如图2所示。其中,第一级存储表TabLUT(简称为T表),是数据的页信息表;第二级存储表ColLUT(简称为C表),是数据的列信息表;第三级存储表DataLUT(简称为D表),用于存放数据,是数据表。这三级存储表表示了多个存储数据之间的关系,同时每级表格均支持插入、更新、删除和查询操作。
下面对上述三级存储表的关系和每级表格的某行数据格式以及含义进行说明如下:
T表:一行数据记录了“一页数据”的相关信息,该页为多个数组并排排列构成的“列组”,每一列即为一个数组。T表的每一行信息记录了下一级C表存储相关“列组”的第一列存放的首地址Coladds(位宽为16),最后一列数组存放的末地址Coladde(位宽为16),“列组”列的个数Colnum(位宽为8),以及用来表示该行数据有效/无效的状态位Status(位宽1),,其中,status为1时表示该层地址存放数据有效,status为0时表示该层地址存放的数据无效或者已被删除。
C表:作为列信息的存储表,其一行数据记录了存放在D表中的“一个数组”的相关信息,暂定深度为1024行。存储数据包括“一个数组”里数据的个数BlockNum(位宽为16),第一个数据的存储的地址BlockStart(位宽为16),最后一个数据存储的地址BlockEnd(位宽为16)以及判断存储该数组的地址是否有效的标志位Status(位宽1)。此外,还存储了多行数据向下连接的有效标志Conseq(位宽1)以及列 组的下接地址Nxtaddr(位宽16),通过下接信息(Conseq,Nxtaddr)可以将C表的多行数据连接起来,表示成一个“列组”,即一页。
D表:主体为一个多行数据的存储表格,暂定1024行。每一行数据记录了“一个数据”的相关信息,多行数据通过上接下接信息连接在一起组成了“一个数组”。数据本身为DataAdds(位宽为32),DataAdde(位宽为32),DataAddc(位宽为32),附带向下连接地址DownBadd(位宽为16),向下连接标记Downseq(位宽为1),向上连接地址UpBAdd(位宽为16),向上连接标记Upseq(位宽为1),有效标志信号Status(位宽为1)。其中,Status为1时表示该行数据是有效的,为0时表示该行数据是无效的,无效的一行数据被认为已经删除。“一个数据”可能由一行,或者多行的DataAdds,DataAdde,DataAddc组成,且多行数据的存放的位置也是无规律的,地址不一定连续,多行构成的“一个数据”的各个子数据行则由连接信息和连接标志来记录多行数据之间的关系。
某行数据的Downseq为1表示下接有效,即该行数据后还有下接的数据,DownBadd表示向下连接数据的地址,Downseq为0则表示向下无数据,即该行是“一个数组”最后一行,同时DownBadd为该行本身的地址。向上连接信号Upseq及向上连接数据的地址UpBAdd同理。如果“一个数组”里只存储一行数据,则它的Downseq与Upseq均为0,向上,向下两个地址均为其本身地址;如果多行数据构成的“一个数组”的第一行,则第一行数据的向上连接标志Useq为0,向上地址UpBAdd为本身,向下连接标志Downseq为1,向下地址DownBadd为第二行的地址;最后一行的向下连接地址为其本身且标志位Downseq为0。
总体而言,如图3所示,T表的一行表示一页,关联到C表里的多列,C表的一行则向下关联到D表的多个数组,整体构成了一页数据。为了简化数据表的结构,图3所示D表中的任意一个元素(a1,a2,a3,b1等)代表“一个数据”(DataAdds,DataAdde,DataAddc),占用D的一行地址空间。
基于上述的三级存储表,提供了一种数据表查表装置,通过该装置可以同时支持多种数据的管理操作,该装置通过上层命令模块实现对该多级存储表的插入、更新、删除和查询等操作。具体的,对该多级存储表的插入、更新、删除和查询等操作说明如下:
1)插入,可以分为三种类型的插入:
第一类插入,新页插入:
即,插入“一页的第一个数据”,也相当于是第一列的“列头”,在“第一个数组”内也是第一个数据,例如:图3中的a1。根据输入地址(table_id)对T表进行查询,该行的状态值为0则向D表请求新的插入地址和数据,并在请求得到的新的地址内插入新的数据;然后,向C表请求新的空闲地址并插入新的数据,C表中的BlockStart和BlockEnd均为D表请求的空白地址,BlockNum=1;然后,向T表在输入的地址中插入一行新的数据,其中ColAdds与ColAdde均为上述C表请求的新的空闲地址,ColNum=1。
在操作完成后,多级存储表中T表如图4所示,C表如图5所示,D表如图6所示。
第二类插入,列加长插入:
在已经有的数列后面加数据,例如,在图3中的A列的最后一个数据a3后添加数据a4,将其连接关系变成a1→a2→a3→a4。根据输入的table_id地址对T表进行查询,以得到Status、Colnum、ColAdds、Coladde;如果状态值status=1,则表示该页已经存在,接下来将输入数据ColID(ColID>0)与T表中Colnum的数值进行比较。如果输入的ColID小于Colnum,则为第二类插入即列加长插入,如果输入的ColID不小于Colnum,则为第三类插入即新列插入。
对于第二类插入,假设ColID=1,则从ColAdds开始根据C表的连接关系(Nxtaddr,Conseq)对C表进行查询,并对查询次数计数,当计数结果等于ColID=1时停止查询,记录该行的BlockEnd地址即数据a3的插入地址,在这里记作addr_3;D表找到新的空闲ID后,在addr_3后插入一行新的数据,然后将D表中a3的存储地址中的存储信息进行更新;随后更新C表中第一列数组A的BlockEnd的数值为a4的插入地址即上述过程中D表查询到的新的空闲地址,BlockStart保持不变,BlockNum加1。
在操作完成后,多级存储表中C表如图7所示,D表如图8所示,T表无变化。
第三类插入,新列插入:
在一个已经有数据(有列)的“页”里面加入新的一列,如图3中M页已经有3列数据,加入新的一列H,C表对应M地址的列的下接关系则变为D→E→F→G→H,同时D表里面还会在新的地址里写入“一个数据”h1。前几步与第二类插入一致, 均为查询T表信息,比较输入数据ColID(ColID>0)与T表中Colnum的大小关系,假如此时输入的ColID=4>Colnum=3,则确定为第三类插入;D表请求空闲地址和数据后进行插入操作,在此记录新一行数据的插入地址为addr_h1;接着C表进行空闲地址(H)的查询后插入一行新的数据,其中BlockStart和BlockEnd为addr_h1,BlockNum=1;然后向T表中输入地址tablut_id的一行数据进行更新操作,ColAdds保持不变仍为A的地址,Coladde则由原本的C的地址变为C表查询的空闲地址H,Colnum加1。
在操作完成后,多级存储表中T表如图9所示,C表如图10所示,D表如图11所示。
2)更新:
根据输入和内部存储表的数据关系找到需要更新的地址位置,在D表内更新一个新的DataAddc。
3)删除:
根据输入table_id将多级存储表内相关数据全部删除,即所有C表状态值变0,D表数组内的所有数据状态值变0,T表的页状态位置0。如图3所示的表,当输入table_id等于M页的插入地址时,会将C表中ABC地址存储的数据以及D表中a1-a3、b1-b1-b5、c1-c4数组全部删除,所对应的status状态标志信号置0。
4)查询:
根据输入地址将D表中地址位该输入地址的数据全部输出,即输出一组DataAdds、DataAdde、DataAddc、DownBAdd、Downseq、UpBadd、Upseq数据。
基于同一发明构思,本发明实施例中还提供了一种基于查找表的数据库管理装置,如下面的实施例所述。由于基于查找表的数据库管理装置解决问题的原理与基于查找表的数据库管理方法相似,因此基于查找表的数据库管理装置的实施可以参见基于查找表的数据库管理方法的实施,重复之处不再赘述。以下所使用的,术语“单元”或者“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。图12是本发明实施例的基于查找表的数据库管理装置的一种结构框图,如图12所示,可以包括:获取模块1201、调取模块1202和调整模块1203,下面对该结构进行说明。
获取模块1201,用于获取数据管理操作请求;
调取模块1202,用于响应于所述数据管理操作请求调取三级存储表;
调整模块1203,用于根据所述数据管理操作请求所请求的操作对所述三级存储表进行调整,得到调整后的三级存储表;其中,所述三级存储表包括:数据的页信息表,用于通过一行数据记录一页数据的信息,关联到数据的列信息表中的多列;数据的列信息表,用于通过一行数据记录数据表中一个数组的信息,关联到数据表中的多个数组;数据表,用于通过一行数据记录一个数据的信息。
在一个实施方式中,上述数据管理操作请求可以包括但不限于以下至少之一:插入操作请求、更新操作请求、删除操作请求、查询操作请求。
在一个实施方式中,上述插入操作请求可以包括但不限于以下至少之一:新页插入请求、列加长插入请求、新列插入请求。
在一个实施方式中,上述调整模块1203可以包括:查询单元,用于在所述数据管理操作请求为新页插入请求的情况下,在确定所述输入地址所指示的行的状态值为0的情况下,向数据表请求插入地址和数据;第一插入单元,用于在请求得到的插入地址中插入待插入的数据;第二插入单元,用于向数据的列信息表请求空闲地址并插入列信息,其中,所述列信息中的第一个数据的存储的地址和最后一个数据存储的地址都设置为向所述数据表中请求得到的插入地址;第三插入单元,用于在数据的页信息表中插入一行数据,用于表征所述新页插入请求所请求插入的页数据信息。
在一个实施方式中,所述装置基于现场可编程门阵列(FPGA)或专用集成电路实现(ASIC)。
本发明实施例还提供了一种非易失性计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时生成上述任一实施例所述的装置。
本发明实施例还提供了一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述方法的步骤。
本申请的实施例还提供能够实现上述实施例中的基于查找表的数据库管理方法中全部步骤的一种电子设备的具体实施方式,所述电子设备具体包括如下内容:处理器(processor)、存储器(memory)、通信接口(Communications Interface)和总线;其中,所述处理器、存储器、通信接口通过所述总线完成相互间的通信;所述处理器用于调 用所述存储器中的计算机程序,所述处理器执行所述计算机程序时实现上述实施例中的基于查找表的数据库管理方法中的全部步骤,例如,所述处理器执行所述计算机程序时实现下述步骤:
步骤1:获取数据管理操作请求;
步骤2:响应于所述数据管理操作请求调取三级存储表;
步骤3:根据所述数据管理操作请求所请求的操作对所述三级存储表进行调整,得到调整后的三级存储表;
其中,所述三级存储表包括:数据的页信息表,用于通过一行数据记录一页数据的信息,关联到数据的列信息表中的多列;数据的列信息表,用于通过一行数据记录数据表中一个数组的信息,关联到数据表中的多个数组;数据表,用于通过一行数据记录一个数据的信息。
从上述描述可知,提供了一种基于查找表的数据库管理方法,通过设置三级存储表来分别存储:数据的页信息、数据的列信息和数据,从而可以解决现有的基于查找表的方式对数据库进行管理所存在的效率低下的问题,达到了可以简单高效地进行查找表操作的目的。
本申请的实施例还提供能够实现上述实施例中的基于查找表的数据库管理方法中全部步骤的一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例中的基于查找表的数据库管理方法的全部步骤,例如,所述处理器执行所述计算机程序时实现下述步骤:
步骤1:获取数据管理操作请求;
步骤2:响应于所述数据管理操作请求调取三级存储表;
步骤3:根据所述数据管理操作请求所请求的操作对所述三级存储表进行调整,得到调整后的三级存储表;
其中,所述三级存储表包括:数据的页信息表,用于通过一行数据记录一页数据的信息,关联到数据的列信息表中的多列;数据的列信息表,用于通过一行数据记录数据表中一个数组的信息,关联到数据表中的多个数组;数据表,用于通过一行数据记录一个数据的信息。
从上述描述可知,提供了一种基于查找表的数据库管理方法,通过设置三级存储表来分别存储:数据的页信息、数据的列信息和数据,从而可以解决现有的基于查找 表的方式对数据库进行管理所存在的效率低下的问题,达到了可以简单高效地进行查找表操作的目的。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于硬件+程序类实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
虽然本申请提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的劳动可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或客户端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境)。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
虽然本说明书实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下, 并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书实施例时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内部包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算 机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
本领域技术人员应明白,本说明书的实施例可提供为方法、系统或计算机程序产品。因此,本说明书实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于 系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书实施例的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
以上所述仅为本说明书实施例的实施例而已,并不用于限制本说明书实施例。对于本领域技术人员来说,本说明书实施例可以有各种更改和变化。凡在本说明书实施例的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本说明书实施例的权利要求范围之内。

Claims (12)

  1. 一种基于查找表的数据库管理方法,其特征在于,包括:
    获取数据管理操作请求;
    响应于所述数据管理操作请求调取三级存储表;
    根据所述数据管理操作请求所请求的操作对所述三级存储表进行调整,得到调整后的三级存储表;
    其中,所述三级存储表包括:数据的页信息表,用于通过一行数据记录一页数据的信息,关联到数据的列信息表中的多列;数据的列信息表,用于通过一行数据记录数据表中一个数组的信息,关联到数据表中的多个数组;数据表,用于通过一行数据记录一个数据的信息。
  2. 根据权利要求1所述的方法,其特征在于,所述数据管理操作请求包括以下至少之一:插入操作请求、更新操作请求、删除操作请求、查询操作请求。
  3. 根据权利要求2所述的方法,其特征在于,所述插入操作请求包括以下至少之一:新页插入请求、列加长插入请求、新列插入请求。
  4. 根据权利要求3所述的方法,其特征在于,在所述数据管理操作请求为新页插入请求的情况下,根据所述数据管理操作请求对所述三级存储表进行调整,得到调整后的三级存储表,包括:
    响应于所述新页插入请求,根据所述新页插入请求中的输入地址查询数据的页信息表;
    在确定所述输入地址所指示的行的状态值为0的情况下,向数据表请求插入地址和数据;
    在请求得到的插入地址中插入待插入的数据;
    向数据的列信息表请求空闲地址并插入列信息,其中,所述列信息中的第一个数据的存储的地址和最后一个数据存储的地址都设置为向所述数据表中请求得到的插入地址;
    在数据的页信息表中插入一行数据,用于表征所述新页插入请求所请求插入的页数据信息。
  5. 根据权利要求3所述的方法,其特征在于,在所述数据管理操作请求为列加 长插入请求的情况下,根据所述数据管理操作请求对所述三级存储表进行调整,得到调整后的三级存储表,包括:
    响应于所述列加长插入请求,根据所述列加长插入请求中的输入地址查询数据的页信息表,以得到对应的状态值、列组里列的个数、列组的第一列的地址、列组的最后一列的地址;
    通过状态值确定该页是否存在;
    如果该页存在,则将所述列加长插入请求中的输入数据与所述列组里列的个数的数值进行比较,如果所述输入数据小于所述列组里列的个数,则从列组的第一列的地址开始根据数据的列信息表的连接关系对数据的列信息表进行查询,并对查询次数计数;
    当计数结果等于所述输入数据时停止查询,记录该行的数组的最后一个数据的地址;
    在数据表中寻找新的空闲的地址,在记录的该行的数组的最后一个数据的地址之后插入一行数据,然后对该行的数据的最后一个数据的存储地址中的存储信息进行更新;
    对数据的列信息表进行更新。
  6. 根据权利要求3所述的方法,其特征在于,在所述数据管理操作请求为新列插入请求的情况下,根据所述数据管理操作请求对所述三级存储表进行调整,得到调整后的三级存储表,包括:
    响应于所述新列插入请求,根据所述新列插入请求中的输入地址查询数据的页信息表,以得到对应的状态值、列组里列的个数、列组的第一列的地址、列组的最后一列的地址;
    通过状态值确定该页是否存在;
    如果该页存在,则将所述新列插入请求中的输入数据与所述列组里列的个数的数值进行比较,如果所述输入数据大于所述列组里列的个数,则在数据表请求空闲地址后进行插入操作;
    在插入完成后,更新数据的页信息表和数据的列信息表。
  7. 一种基于查找表的数据库管理装置,其特征在于,包括:
    获取模块,用于获取数据管理操作请求;
    调取模块,用于响应于所述数据管理操作请求调取三级存储表;
    调整模块,用于根据所述数据管理操作请求所请求的操作对所述三级存储表进行调整,得到调整后的三级存储表;其中,所述三级存储表包括:数据的页信息表,用于通过一行数据记录一页数据的信息,关联到数据的列信息表中的多列;数据的列信息表,用于通过一行数据记录数据表中一个数组的信息,关联到数据表中的多个数组;数据表,用于通过一行数据记录一个数据的信息。
  8. 根据权利要求7所述的装置,其特征在于,所述数据管理操作请求包括以下至少之一:插入操作请求、更新操作请求、删除操作请求、查询操作请求。
  9. 根据权利要求8所述的装置,其特征在于,所述插入操作请求包括以下至少之一:新页插入请求、列加长插入请求、新列插入请求。
  10. 根据权利要求9所述的装置,其特征在于,所述调整模块包括:
    查询单元,用于在所述数据管理操作请求为新页插入请求的情况下,在确定所述输入地址所指示的行的状态值为0的情况下,向数据表请求插入地址和数据;
    第一插入单元,用于在请求得到的插入地址中插入待插入的数据;
    第二插入单元,用于向数据的列信息表请求空闲地址并插入列信息,其中,所述列信息中的第一个数据的存储的地址和最后一个数据存储的地址都设置为向所述数据表中请求得到的插入地址;
    第三插入单元,用于在数据的页信息表中插入一行数据,用于表征所述新页插入请求所请求插入的页数据信息。
  11. 根据权利要求7所述的装置,其特征在于,所述装置基于现场可编程门阵列或专用集成电路实现。
  12. 一种非易失性计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时生成权利要求7至10中任一项所述装置。
PCT/CN2020/107193 2020-03-03 2020-08-05 基于查找表的数据库管理方法和装置 WO2021174763A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/901,443 US20220414155A1 (en) 2020-03-03 2022-09-01 Database management method and apparatus based on lookup table

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010139975.8 2020-03-03
CN202010139975.8A CN111427885B (zh) 2020-03-03 2020-03-03 基于查找表的数据库管理方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/901,443 Continuation US20220414155A1 (en) 2020-03-03 2022-09-01 Database management method and apparatus based on lookup table

Publications (1)

Publication Number Publication Date
WO2021174763A1 true WO2021174763A1 (zh) 2021-09-10

Family

ID=71547572

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/107193 WO2021174763A1 (zh) 2020-03-03 2020-08-05 基于查找表的数据库管理方法和装置

Country Status (3)

Country Link
US (1) US20220414155A1 (zh)
CN (1) CN111427885B (zh)
WO (1) WO2021174763A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427885B (zh) * 2020-03-03 2023-06-09 中科驭数(北京)科技有限公司 基于查找表的数据库管理方法和装置
CN112818007B (zh) * 2021-02-03 2021-10-19 中科驭数(北京)科技有限公司 数据处理方法、装置及可读存储介质
CN113448962B (zh) * 2021-06-02 2022-10-28 中科驭数(北京)科技有限公司 数据库数据管理方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8150850B2 (en) * 2008-01-07 2012-04-03 Akiban Technologies, Inc. Multiple dimensioned database architecture
CN102804168A (zh) * 2009-06-19 2012-11-28 赛贝斯股份有限公司 在数据库系统中减少存储需求的数据压缩
CN103377289A (zh) * 2012-04-30 2013-10-30 Sap股份公司 统一表查询处理
CN111427885A (zh) * 2020-03-03 2020-07-17 中科驭数(北京)科技有限公司 基于查找表的数据库管理方法和装置

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090141716A1 (en) * 2007-11-30 2009-06-04 Hangzhou H3C Technologies Co., Ltd. Method and apparatus for packet rule matching
CN101727465B (zh) * 2008-11-03 2011-12-21 中国移动通信集团公司 分布式列存储数据库索引建立、查询方法及装置与系统
US10671585B2 (en) * 2012-01-31 2020-06-02 Pure Storage, Inc. Storing indexed data to a dispersed storage network
US8972337B1 (en) * 2013-02-21 2015-03-03 Amazon Technologies, Inc. Efficient query processing in columnar databases using bloom filters
US10394848B2 (en) * 2013-07-29 2019-08-27 Amazon Technologies, Inc. Generating a multi-column index for relational databases by interleaving data bits for selectivity
US9928259B2 (en) * 2015-04-21 2018-03-27 International Business Machines Corporation Deleted database record reuse
CN106326309B (zh) * 2015-07-03 2020-02-21 阿里巴巴集团控股有限公司 一种数据查询方法和装置
GB201615748D0 (en) * 2016-09-15 2016-11-02 Gb Gas Holdings Ltd System for importing data into a data repository
US10853364B2 (en) * 2016-09-28 2020-12-01 Microsoft Technology Licensing, Llc Direct table association in in-memory databases
CN107256233B (zh) * 2017-05-16 2021-01-12 北京奇虎科技有限公司 一种数据存储方法和装置
CN108932313B (zh) * 2018-06-20 2021-06-04 斑马网络技术有限公司 数据处理方法、装置、电子设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8150850B2 (en) * 2008-01-07 2012-04-03 Akiban Technologies, Inc. Multiple dimensioned database architecture
CN102804168A (zh) * 2009-06-19 2012-11-28 赛贝斯股份有限公司 在数据库系统中减少存储需求的数据压缩
CN103377289A (zh) * 2012-04-30 2013-10-30 Sap股份公司 统一表查询处理
CN111427885A (zh) * 2020-03-03 2020-07-17 中科驭数(北京)科技有限公司 基于查找表的数据库管理方法和装置

Also Published As

Publication number Publication date
US20220414155A1 (en) 2022-12-29
CN111427885A (zh) 2020-07-17
CN111427885B (zh) 2023-06-09

Similar Documents

Publication Publication Date Title
WO2021174763A1 (zh) 基于查找表的数据库管理方法和装置
CN107273042B (zh) 重复删除dram系统算法架构的存储器模块及方法
US11586629B2 (en) Method and device of storing data object
CN108052541B (zh) 基于多级页表目录结构的文件系统的实现、访问方法、终端
CN106649401A (zh) 分布式文件系统中的数据写入方法和装置
US20150113230A1 (en) Directory storage method and query method, and node controller
CN107391544B (zh) 列式存储数据的处理方法、装置、设备及计算机储存介质
CN110109873B (zh) 一种用于消息队列的文件管理方法
US11288287B2 (en) Methods and apparatus to partition a database
CN111061758B (zh) 数据存储方法、装置及存储介质
CN110134335B (zh) 一种基于键值对的rdf数据管理方法、装置及存储介质
CN103914483A (zh) 文件存储方法、装置及文件读取方法、装置
WO2013166125A1 (en) Systems and methods of accessing distributed data
WO2024041376A1 (zh) 分布式图数据处理系统、方法、装置、设备及存储介质
CN112632068A (zh) 一种快速提供海量数据查询服务的解决方法
US20240220334A1 (en) Data processing method in distributed system, and related system
US20150052327A1 (en) Dynamic memory relocation
US11429311B1 (en) Method and system for managing requests in a distributed system
CN107273443B (zh) 一种基于大数据模型元数据的混合索引方法
CN107102898B (zh) 一种基于numa架构的内存管理、构建数据结构的方法及装置
CN108804571B (zh) 一种数据存储方法、装置以及设备
CN112069088B (zh) 一种地址映射管理方法及相关装置、设备
CN104508647B (zh) 用于扩大超大规模计算系统的存储器容量的方法和系统
CN112307272B (zh) 确定对象之间关系信息的方法、装置、计算设备及存储介质
CN113849482A (zh) 一种数据迁移方法、装置及电子设备

Legal Events

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

Ref document number: 20923438

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20923438

Country of ref document: EP

Kind code of ref document: A1