A data access method, device, apparatus, and storage medium
By accessing associated and non-associated columns within the engine of a multi-model database, the performance issues caused by the case-insensitive semantics of multi-model databases are resolved, achieving efficient data access.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TRANSWARP TECHNOLOGY (SHANGHAI) CO LTD
- Filing Date
- 2023-08-25
- Publication Date
- 2026-06-02
AI Technical Summary
Multi-model databases handle case-insensitive semantics of data at the engine layer using a case conversion function, which causes filtering conditions to fail to execute effectively and impacts performance.
In the engine of a multi-model database, by obtaining case-sensitive attribute information from data access requests, and in the case-insensitive case, the accompanying columns and non-accompanying columns in the data table are accessed. The accompanying columns are used to store case-consistent data of the target data column, and the non-accompanying columns are used to store the original data, thus realizing the parsing and processing of case-insensitive semantics.
It implements case-insensitive semantics for multi-model databases, improves data access performance, shields storage heterogeneity, and ensures effective data access.
Smart Images

Figure CN117033402B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of database technology, and in particular to a data access method, apparatus, device, and storage medium. Background Technology
[0002] A multi-model database is a database capable of handling a mixture of data schemas, such as relational, key-value, document-based, graph-based, and time-series data, providing a good solution for heterogeneous data. When accessing most character-type data in the database, you can choose to use either case-sensitive or case-insensitive methods.
[0003] Relational databases typically implement case-insensitive parsing of data values at the storage level or by using functions to convert column values to lowercase. However, in our multi-model database architecture, we need to interface with the storage and databases of other systems, making it impossible to implement case-insensitive parsing and calculation at the storage level. Handling case-insensitive semantics at the engine level would prevent filtering conditions from being effectively executed, resulting in poor performance for the multi-model database. Summary of the Invention
[0004] This invention provides a data access method, apparatus, device, and storage medium to solve the problem that multi-modal databases with heterogeneous storage cannot effectively implement case-insensitive semantics for data.
[0005] According to one aspect of the present invention, a data access method is provided for an engine of a multi-model database, the method comprising:
[0006] Obtain a data access request; the data access request includes case-sensitive attribute information;
[0007] When the case-sensitive attribute information is case-insensitive, the associated column and non-associated column in the data table are accessed according to the data access request; the associated column is used to store case-insensitive data corresponding to the target data column; the non-associated column is used to store the original data.
[0008] According to another aspect of the present invention, a data access apparatus is provided for an engine applied to a multi-model database, the apparatus comprising:
[0009] The request acquisition module is used to acquire data access requests; the data access requests include case-sensitive attribute information.
[0010] The data access module is used to access the associated columns and non-associated columns in the data table according to the data access request when the case-sensitive attribute information is case-insensitive; the associated columns are used to store case-consistent data corresponding to the target data column; the non-associated columns are used to store the original data.
[0011] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0012] At least one processor; and
[0013] A memory communicatively connected to the at least one processor; wherein,
[0014] 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 access method according to any embodiment of the present invention.
[0015] 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 access method described in any embodiment of the present invention.
[0016] The technical solution of this invention obtains a data access request, which includes case-sensitive attribute information. If the case-sensitive attribute information is case-insensitive, the accompanying column and non-accompanying column in the data table are accessed according to the data access request. The accompanying column stores case-insensitive data corresponding to the target data column; the non-accompanying column stores the original data. By parsing and processing case-insensitive semantics in the engine, the problem that processing case-insensitive semantics of data through a case conversion function at the engine layer would lead to ineffective execution of filtering conditions is solved, thus realizing the function of case-insensitive semantics in multi-model databases.
[0017] 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
[0018] 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.
[0019] Figure 1This is a flowchart of a data access method provided in Embodiment 1 of the present invention;
[0020] Figure 2 This is a flowchart of a data access method provided in Embodiment 2 of the present invention;
[0021] Figure 3 This is a schematic diagram of the structure of a data access device provided in Embodiment 3 of the present invention;
[0022] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the data access method of the present invention. Detailed Implementation
[0023] 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.
[0024] It should be noted that the terms "first," "second," "original," and "target," 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 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.
[0025] Example 1
[0026] Figure 1 This is a flowchart of a data access method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where case-insensitive functionality is implemented on a multi-modal database. The method can be executed by a data access device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0027] S110. Obtain the data access request; the data access request includes case-sensitive attribute information.
[0028] A data access request refers to a request to access data stored in the storage layer of a multi-model database. The data access request includes case-sensitive attribute information. This information indicates whether the accessed data is case-sensitive; it can be either case-sensitive or case-insensitive. Optionally, the data access request may include data insertion requests, data query requests, data update requests, data grouping requests, data association requests, and data sorting requests.
[0029] In this embodiment, the multi-model database engine obtains data access requests, parses them, and obtains case-sensitive attribute information and data access instructions. The case-sensitive attribute information can be configured to control whether the data access instructions are case-sensitive. The configuration method for the case-sensitive attribute information can be set according to user needs; for example, it can be set to case-sensitive by default, or it can be set to case-insensitive based on parameter configuration.
[0030] For example, the initial data access statement can be an initial data access statement, and the case sensitivity attribute information can be the access parameters in the initial data access statement; or the initial data access statement and the case sensitivity attribute information can be obtained, and a data access request in data packet format can be generated based on the initial data access statement and the case sensitivity attribute information.
[0031] S120. When the case-sensitive attribute information is case-insensitive, access the associated column and non-associated column in the data table according to the data access request; the associated column is used to store case-insensitive data of the target data column; the non-associated column is used to store the original data.
[0032] The data storage layer of the multi-model database stores data tables, which include non-companion columns and companion columns. Non-companion columns store the original data and contain target data columns. These target data columns store the accessed data, such as the primary key; the accessed target data can contain either uppercase or lowercase data. Companion columns store case-insensitive data from the target data columns; this case-insensitive data can be uniformly uppercase or uniformly lowercase.
[0033] In this embodiment, when the multi-model database engine determines that the case-sensitive attribute information of the data access request is case-insensitive, it pushes the data access request down to the data storage layer of the multi-model database, accesses the data in the companion column corresponding to the target data column in the data table, realizes data filtering, and further accesses the data stored in the non-companion column according to the filtering results.
[0034] Thus, through the engine of the multi-model database, the data is filtered by accessing the case-insensitive data in the companion column of the data storage layer according to the obtained data access request, and the original data of the filtered data is stored in the non-companion column, so that the data access of the multi-model database is case-insensitive.
[0035] It's important to note that when querying and displaying data, information from companion columns will not be shown to users; only information from non-companion columns will be displayed. Furthermore, the introduction of companion columns has no direct impact on transaction processing. Companion columns merely provide an auxiliary column to achieve case-insensitive semantics. Transaction isolation levels, locking mechanisms, and concurrency control still apply to both non-companion columns and companion columns.
[0036] In an optional embodiment of the present invention, before obtaining the data access request, the method further includes: obtaining a data creation request; creating a data table containing a target data column in the storage layer of the multi-model database according to the data creation request; and adding a companion column corresponding to the target data column to the data table.
[0037] Among them, a data creation request refers to a request used to create data in the storage layer of a multi-model database.
[0038] In this embodiment, before accessing the data stored in the storage layer of the multi-model database, it is necessary to create a data table in the database that stores the target data column, and create a companion column in the data table to store the case-consistent data corresponding to the target data column.
[0039] For example, the data creation request obtained can be: create table student(id int, namevarchar(10)); the database engine creates a data table student(id int, name varchar(10), name__ci varchar(10)) in the storage layer, that is, adds a companion column name__civarchar(10) to the last column of the data table to store the lowercase data corresponding to the target data column name varchar(10).
[0040] Optionally, after adding the companion column corresponding to the target data column to the data table, the method further includes: creating an index on the companion column that is the same as the target data column.
[0041] In this embodiment, when an index is created on a data table, if an index is created on the target data column of the data table, the same index will also be created synchronously on the companion column. By creating an index on the companion column, the performance of queries performing case-insensitive comparisons based on the target data column can be improved. Furthermore, by using composite indexes, the companion column can be combined with other columns to support more complex query requirements.
[0042] In this embodiment of the invention, by creating a companion column corresponding to the target data column in the data layer of the multi-model database to store case-insensitive data of the target data column, the engine of the multi-model database can filter data based on the companion column corresponding to the target data column when it receives a data access request to access the target data column, and access the original data of the filtered data stored in the non-companion column, thereby realizing case-insensitive data access in the multi-model database.
[0043] The technical solution of this invention obtains a data access request, which includes case-sensitive attribute information. When the case-sensitive attribute information is case-insensitive, the accompanying column and non-accompanying column in the data table are accessed according to the data access request. The accompanying column is used to store case-insensitive data corresponding to the target data column; the non-accompanying column is used to store the original data. By parsing and processing case-insensitive semantics in the engine, the heterogeneity of storage is masked, and the function of case-insensitive semantics in multi-model databases is realized.
[0044] Example 2
[0045] Figure 2 This is a flowchart of a data access method provided in Embodiment 2 of the present invention. This embodiment further defines the data access request process in the above embodiments. In this embodiment, the data access request includes: data insertion request, data query request, data update request, data grouping request, data association request, and data sorting request.
[0046] like Figure 2 As shown, the method includes:
[0047] S210. Obtain the data access request; the data access request includes case-sensitive attribute information.
[0048] S220. When the case-sensitive attribute information is case-insensitive, generate the target data access statement based on the initial data access statement contained in the data access request.
[0049] The initial data access statement is a statement instruction that requests access to data in the data storage layer without considering case sensitivity information.
[0050] S230. Obtain the target data by accessing the associated column corresponding to the target data column in the data table according to the target data access statement, and access the original data in the non-associated column corresponding to the target data.
[0051] In this embodiment, since it is necessary to access the companion column to achieve case-insensitive semantics for the data, the initial data access statement needs to be transformed into a target data access statement. Based on the target data access statement, the companion column corresponding to the target data column in the data table is accessed to obtain the target data. Data filtering is then performed based on the case-insensitive data in the companion column. Finally, the original data in the non-companion column corresponding to the target data is accessed, thus achieving case-insensitive access to the data table.
[0052] In a first optional embodiment of the present invention, accessing the companion column corresponding to the target data column in the data table according to the target data access statement to obtain the target data, and accessing the original data in the non-companion column corresponding to the target data, may include: when the data access request is a data insertion request, inserting the case-inclusive data corresponding to the target insertion data into the companion column corresponding to the target data column according to the target data insertion statement, and inserting the target insertion data into the target data column in the data table.
[0053] The target data insertion statement is derived from the engine of the multi-model database by optimizing the initial data insertion statement in the data access request. It is used to implement data insertion statements with case-insensitive semantics.
[0054] In this embodiment, when inserting data based on case insensitivity, in addition to inserting case-insensitive data corresponding to the target data into the companion column corresponding to the target data column according to the target data insertion statement, it is also necessary to insert the target data into the target data column of the data table.
[0055] The method of inserting case-insensitive data corresponding to the target data into the companion column of the target data column based on the target data insert statement can be as follows: For example, the initial data insert statement can be: "insert into student select '1', 'TDH' from dual". The multi-model database engine can add a lower(name) expression to the companion column name__ci to optimize the initial data insert statement into the target data insert statement, such as: "insert into student select '1', 'TDH', 'tdh' from dual;". This inserts the target data into the target data column in the data storage layer, and also inserts the lowercase data corresponding to the target data into the companion column in the data storage layer.
[0056] In a second optional embodiment of the present invention, accessing the associated column corresponding to the target data column in the data table according to the target data access statement to obtain the target data, and accessing the original data in the non-associated column corresponding to the target data, may include: when the data access request is a data query request, filtering the case-consistent data stored in the associated column according to the target data query statement to obtain the target query data, and returning the original data in the non-associated column corresponding to the target query data.
[0057] The target data query statement is obtained by optimizing the initial data query statement in the data access request from the engine of the multi-model database. It is used to implement a data query statement with case-insensitive semantics.
[0058] In this embodiment, when querying data in a case-insensitive manner, the initial data query statement can be: "select * from student_grade where name = 'Tdh'". The multi-model database engine can optimize the initial data query statement into a target data query statement, such as "select * from student_grade where name__ci = 'tdh'". In this way, the multi-model database engine can push the filter condition "name__ci = 'tdh'" on the companion column down to the data storage layer, performing case-insensitive filtering at the data storage level, ultimately obtaining the case-insensitive target query data; and returning the original data in the non-companion column corresponding to the target query data. The case-insensitive data stored in the companion column is not displayed to the user; instead, the original data of the target query data in the non-companion column is shown.
[0059] In a third optional embodiment of the present invention, accessing the associated column corresponding to the target data column in the data table according to the target data access statement to obtain the target data, and accessing the original data in the non-associated column corresponding to the target data, may include: when the data access request is a data update request, updating the associated column according to the case-consistent data of the target update data in the target data update statement, and updating the target data column in the non-associated column according to the target update data.
[0060] The target data update statement is obtained by the multi-model database engine from the initial data update statement in the data access request, and is used to implement the data update statement under case-insensitive semantics.
[0061] In this embodiment, when updating data based on case insensitivity, it is assumed that there is another data table: "create table newStudent(id int,name varchar(10)casespecific)", and then the initial data update statement based on id can be: "update student a set name=(select name fromnewStudent b where a.id=b.id);"; The engine of the multi-model database can optimize the initial data update statement into a target data update statement, such as update student a set(name,name__ci)=(select name,lower(name)from newStudent b where a.id=b.id)", which uses the target update data to update the target data column in the companion column, and uses the lowercase data of the target update data to update the companion column.
[0062] In a fourth optional embodiment of the present invention, accessing the associated column corresponding to the target data column in the data table according to the target data access statement to obtain the target data, and accessing the original data in the non-associated column corresponding to the target data, may include: when the data access request is a data grouping request, grouping the data in the associated column according to the target data grouping statement to obtain target grouped data, and returning the original data in the non-associated column corresponding to the target grouped data.
[0063] The target data grouping statement is derived from the initial data grouping statement in the data access request by the engine of the multi-model database. It is used to implement data grouping statements with case-insensitive semantics.
[0064] In this embodiment, when grouping data based on case insensitivity, the initial data grouping statement can be: "select name from student group by name". The multi-model database engine can optimize the initial data grouping statement into a target data grouping statement, such as "select name__ci from student group by name__ci". This achieves grouping of data in the companion column according to the target data grouping statement to obtain the target grouped data, and returns the original data in the non-companion column corresponding to the target grouped data. The case-insensitive data stored in the companion column is not displayed to the user; instead, the original data of the target grouped data in the non-companion column is shown.
[0065] In a fifth optional embodiment of the present invention, accessing the associated column corresponding to the target data column in the data table according to the target data access statement to obtain the target data, and accessing the original data in the non-associated column corresponding to the target data, may include: when the data access request is a data association request, determining whether the case sensitivity attribute information of the two associated target data columns is both case insensitive according to the target data association statement; if so, associating the data in the associated columns corresponding to the two target data columns to obtain the target association result, and returning the original data in the non-associated column corresponding to the target association result.
[0066] Among them, the target data association statement is obtained by the engine of the multi-model database from the initial data association statement in the data access request, and is used to implement the data association statement under case-insensitive semantics.
[0067] In this embodiment, when grouping data based on case insensitivity, the initial data join statement can be: "select count(*) from student a join student b on a.name=b.name;". First, it is necessary to determine whether the case-sensitive attribute information of the two joined data columns is case-insensitive. If so, the multi-model database engine can optimize the initial data join statement into the target data join statement, such as "select count(*) from student a join student b on a.name__ci=b.name__ci;". This is equivalent to the data storage layer using the companion column instead of the target data column to perform data join and obtain the target join result, but the original data in the non-companion column corresponding to the returned target join result is returned.
[0068] In a sixth optional embodiment of the present invention, accessing the associated column corresponding to the target data column in the data table according to the target data access statement to obtain the target data, and accessing the original data in the non-associated column corresponding to the target data, may include: when the data access request is a data sorting request, sorting the data filtered in the associated column according to the target data sorting statement to obtain a first target sorting result, and returning the original data in the non-associated column corresponding to the first target sorting result.
[0069] The target data sorting statement is obtained by the multi-model database engine from the initial data sorting statement in the data access request, and is used to implement the data sorting statement under case-insensitive semantics.
[0070] In this embodiment, data sorting can include database-level, table-level, and query-level sorting. In a multi-model database, different levels of collation functions actually include case-insensitive attribute information (case-specific). If the case-sensitive attribute information is determined to be case-insensitive based on the user-set collation level, such as "select * from student order by name COLLATE binary;", meaning the collation is set to be case-insensitive at the table level, the multi-model database engine can sort and compare based on the accompanying column `name__ci` to obtain a first target sorting result that conforms to the case-insensitive nature of the current collation, and return the original data in the non-accompanying column corresponding to the first target sorting result.
[0071] The technical solution of this invention involves obtaining a data access request, which includes case-sensitive attribute information. If the case-sensitive attribute information is case-insensitive, a target data access statement is generated based on the initial data access statement contained in the data access request. For data insertion requests, data query requests, data update requests, data grouping requests, data association requests, and data sorting requests, the target data is obtained by accessing the accompanying columns corresponding to the target data column in the data table according to the target data access statement, and the original data in the non-accompanying columns corresponding to the target data is also accessed. By parsing and processing case-insensitive semantics in the engine, the heterogeneity of storage is masked, realizing the function of case-insensitive semantics in multi-model databases and ensuring the data access performance of multi-model databases.
[0072] In an optional embodiment of the present invention, the method further includes: when the case-sensitive attribute information is case-sensitive and the data access request is a data sorting request, sorting the target data column according to the data access request to obtain a second sorting result, and returning the original data in the non-co-occurring column corresponding to the second sorting result.
[0073] In this implementation, if the case sensitivity attribute is determined to be case-insensitive based on the level of the sorting function set by the user, such as "select * from student order by name COLLATE binary_ci;", which means that the collation is set to be case-sensitive at the column level of the query, the multi-model database engine can sort and compare based on the non-companion column name, thereby obtaining a second target sorting result that conforms to the case sensitivity of the current collation, and returning the second target sorting result.
[0074] In an optional embodiment of the present invention, the method further includes: when the case-sensitive attribute information is case-sensitive and the data access request is a data query request, a data update request, a data grouping request, or a data association request, filtering the data table according to the logical operator contained in the data access statement to obtain the filtering result; deleting the companion columns contained in the filtering result through a column trimming optimizer; and accessing the original data in the non-companion columns according to the logical operator.
[0075] When the compiler internally adds companion columns, to ensure semantic and performance consistency in the database, the "select *" statement will select all columns. Without additional processing, the compiler will also select companion columns, which does not conform to the expected data access behavior. For example, in the "select * from student where name = 'a'" statement, during execution, three logical operators will be generated sequentially: TableScan(table student), Filter(where name = 'a' (case-specific)), and Select(select *). First, the compiler generates the column information to be output for each operator from bottom to top: TableScan (representing all columns, including companion columns), Filter (representing all columns, including companion columns), and Select (representing all non-companion columns). In this embodiment, the compiler uses a column pruning optimizer to prune unnecessary columns from top to bottom. Because the filtering function is semantically sensitive and does not require companion columns, the column pruning optimizer can remove the companion columns of the Filter operator, and subsequently, also remove the companion columns of the TableScan operator. This ensures that the filtering results do not include unnecessary companion columns; at the same time, other operators also trim unnecessary companion columns as much as possible, thereby ensuring the best performance of database execution.
[0076] Example 3
[0077] Figure 3 This is a schematic diagram of the structure of a data access device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a request acquisition module 310 and a data access module 320; wherein,
[0078] The request acquisition module 310 is used to acquire data access requests; the data access requests include case-sensitive attribute information.
[0079] The data access module 320 is used to access the associated column and non-associated column in the data table according to the data access request when the case-sensitive attribute information is case-insensitive; the associated column is used to store case-consistent data corresponding to the target data column; the non-associated column is used to store the original data.
[0080] The technical solution of this invention involves obtaining a data access request, which includes case-sensitive attribute information. If the case-sensitive attribute information is case-insensitive, the accompanying column and non-accompanying column in the data table are accessed according to the data access request. The accompanying column is used to store case-insensitive data corresponding to the target data column, and the non-accompanying column is used to store the original data. By implementing the parsing and processing of case-insensitive semantics in the engine, the function of case-insensitive semantics in a multi-model database is realized.
[0081] Optional, also includes:
[0082] Create a request retrieval module to retrieve the data creation request before retrieving the data access request;
[0083] The data table creation module is used to create a data table containing target data columns in the storage layer of the multi-model database according to the data creation request.
[0084] The companion column creation module is used to create a companion column corresponding to the target data column in the data table.
[0085] Optional, also includes:
[0086] The index creation module is used to create an index on the same as the target data column after adding a companion column corresponding to the target data column to the data table.
[0087] Optionally, the data access module 320 includes:
[0088] An access statement generation unit is used to generate a target data access statement based on the initial data access statement contained in the data access request.
[0089] The data access unit is used to access the associated column corresponding to the target data column in the data table according to the target data access statement to obtain the target data, and to access the original data in the non-associated column corresponding to the target data.
[0090] Optionally, the data access requests include: data insertion requests, data query requests, data update requests, data grouping requests, data association requests, and data sorting requests; the data access unit is specifically used for:
[0091] When the data access request is a data insertion request, insert the case-neutral data corresponding to the target data into the companion column corresponding to the target data column according to the target data insertion statement, and insert the target data into the target data column of the data table.
[0092] When the data access request is a data query request, the case-insensitive data stored in the companion column is filtered according to the target data query statement to obtain the target query data, and the original data in the non-companion column corresponding to the target query data is returned.
[0093] When the data access request is a data update request, the accompanying column is updated according to the case-consistent data of the target update data in the target data update statement, and the target data column in the non-accompanying column is updated according to the target update data.
[0094] When the data access request is a data grouping request, the data in the companion column is grouped according to the target data grouping statement to obtain the target grouped data, and the original data in the non-companion column corresponding to the target grouped data is returned;
[0095] When the data access request is a data association request, it is determined whether the case-sensitive attribute information of the two target data columns to be associated is case-insensitive according to the target data association statement; if so, the data in the companion columns corresponding to the two target data columns are associated to obtain the target association result, and the original data in the non-companion columns corresponding to the target association result is returned.
[0096] When the data access request is a data sorting request, the data filtered in the companion column is sorted according to the target data sorting statement to obtain a first target sorting result, and the original data in the non-companion column corresponding to the first target sorting result is returned.
[0097] Optional, also includes:
[0098] The data sorting module is used to sort the target data column according to the data access request to obtain a second sorting result when the case-sensitive attribute information is case-sensitive and the data access request is a data sorting request, and to return the original data in the non-co-occurring column corresponding to the second sorting result.
[0099] Optional, also includes:
[0100] The filtering module is used to filter the data table to obtain filtering results based on the logical operators contained in the data access statement when the case-sensitive attribute information is case-sensitive and the data access request is a data query request, data update request, data grouping request, or data association request.
[0101] The deletion module is used to delete the accompanying columns contained in the filtering results through the column trimming optimizer;
[0102] The access module accesses the original data in the non-co-occurring column according to the logical operator.
[0103] The data access device provided in the embodiments of the present invention can execute the data access method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0104] Example 4
[0105] Figure 4 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0106] 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.
[0107] 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.
[0108] 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 access methods.
[0109] In some embodiments, the data access 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 access method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the data access method by any other suitable means (e.g., by means of firmware).
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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).
[0114] 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.
[0115] 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.
[0116] 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.
[0117] 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 access method, characterized in that, An engine applied to a multi-model database, the method comprising: Obtain a data access request; the data access request includes case-sensitive attribute information; When the case-sensitive attribute information is case-insensitive, the associated column and non-associated column in the data table are accessed according to the data access request; the associated column is used to store case-insensitive data corresponding to the target data column; the non-associated column is used to store the original data; The step of accessing the associated and non-associated columns in the data table according to the data access request includes: Generate a target data access statement based on the initial data access statement contained in the data access request; The target data is obtained by accessing the associated column corresponding to the target data column in the data table according to the target data access statement, and the original data in the non-associated column corresponding to the target data is also accessed.
2. The method according to claim 1, characterized in that, Before obtaining the data access request, it also includes: Get data to create a request; Based on the data creation request, a data table containing the target data columns is created in the storage layer of the multi-model database; Create a companion column corresponding to the target data column in the data table.
3. The method according to claim 2, characterized in that, After adding the accompanying column corresponding to the target data column to the data table, the method further includes: Create an index on the companion column that is identical to the target data column.
4. The method according to claim 1, characterized in that, The data access requests include: data insertion requests, data query requests, data update requests, data grouping requests, data association requests, and data sorting requests; accessing the associated columns corresponding to the target data column in the data table according to the target data access statement to obtain the target data, and accessing the original data in the non-associated columns corresponding to the target data, including: When the data access request is a data insertion request, insert the case-neutral data corresponding to the target data into the companion column corresponding to the target data column according to the target data insertion statement, and insert the target data into the target data column of the data table. When the data access request is a data query request, the case-insensitive data stored in the companion column is filtered according to the target data query statement to obtain the target query data, and the original data in the non-companion column corresponding to the target query data is returned. When the data access request is a data update request, the accompanying column is updated according to the case-consistent data of the target update data in the target data update statement, and the target data column in the non-accompanying column is updated according to the target update data. When the data access request is a data grouping request, the data in the companion column is grouped according to the target data grouping statement to obtain the target grouped data, and the original data in the non-companion column corresponding to the target grouped data is returned; When the data access request is a data association request, it is determined whether the case-sensitive attribute information of the two target data columns to be associated is case-insensitive according to the target data association statement; if so, the data in the companion columns corresponding to the two target data columns are associated to obtain the target association result, and the original data in the non-companion columns corresponding to the target association result is returned. When the data access request is a data sorting request, the data filtered in the companion column is sorted according to the target data sorting statement to obtain a first target sorting result, and the original data in the non-companion column corresponding to the first target sorting result is returned.
5. The method according to claim 4, characterized in that, Also includes: If the case-sensitive attribute information is case-sensitive and the data access request is a data sorting request, the target data column is sorted according to the data access request to obtain a second sorting result, and the original data in the non-co-occurring column corresponding to the second sorting result is returned.
6. The method according to claim 4, characterized in that, Also includes: When the case-sensitive attribute information is case-sensitive, and the data access request is a data query request, data update request, data grouping request, or data association request, the data table is filtered according to the logical operators contained in the data access statement to obtain the filtering results; The column trimmer optimizer removes the accompanying columns from the filtered results. Access the original data in the non-co-occurring column according to the logical operator.
7. A data access device, characterized in that, An engine for use in multi-model databases, the device comprising: The request acquisition module is used to acquire data access requests; the data access requests include case-sensitive attribute information. The data access module is used to access the associated columns and non-associated columns in the data table according to the data access request when the case-sensitive attribute information is case-insensitive; the associated columns are used to store case-consistent data corresponding to the target data column; the non-associated columns are used to store the original data; The data access module includes: An access statement generation unit is used to generate a target data access statement based on the initial data access statement contained in the data access request. The data access unit is used to access the associated column corresponding to the target data column in the data table according to the target data access statement to obtain the target data, and to access the original data in the non-associated column corresponding to the target data.
8. 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 access method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the data access method according to any one of claims 1-6.