Compatibility processing method and device of distributed database, electronic equipment and storage medium

CN116186031BActive Publication Date: 2026-08-07JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINZHUAN INFORMATION TECHNOLOGY CO LTD
Filing Date
2022-12-21
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0003]但是,在每张表增加一列隐藏列不仅需要占用过多的存储空间,还使得在每次表插入数据时都需要额外地插入一列隐藏列数据,影响插入性能等问题

Benefits of technology

[0041]本申请实施例通过依据分布式数据库的操作指令确定目标表信息,基于目标表信息的主键参数进行编码,生成伪列编码信息,依据伪列编码信息执行操作指令,得到操作指令对应的操作结果;以此实现对操作指令响应的过程中,无需获取隐藏列的数据,而是基于目标表信息的主键参数进行编码实时生成伪列编码信息,进行响应操作指令;解决了现有方案中需要为每张表增加一列隐藏列所存在的存储空间占用过多以及影响插入性能的问题,本实施例无需设置隐藏列实现了无需占用过多的存储空间以及提高了插入性能的效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116186031B_ABST
    Figure CN116186031B_ABST
Patent Text Reader

Abstract

The application relates to a compatible processing method and device of a distributed database, electronic equipment and a storage medium. The compatible processing method of the distributed database comprises the following steps: determining target table information according to an operation instruction of the distributed database, encoding based on a primary key parameter of the target table information, generating pseudo column encoding information, executing the operation instruction according to the pseudo column encoding information, and obtaining an operation result corresponding to the operation instruction. In this way, in the process of responding to the operation instruction, data of a hidden column does not need to be obtained, but the pseudo column encoding information is generated in real time based on the primary key parameter of the target table information, and the operation instruction is responded to. The problem that too much storage space is occupied and the insertion performance is affected because a hidden column needs to be added for each table in the prior art is solved. In the embodiment, the hidden column does not need to be set, too much storage space is not occupied, and the insertion performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of databases, and more particularly to a compatible processing method, apparatus, electronic device, and storage medium for distributed databases. Background Technology

[0002] ROWID is an important and unique feature of Oracle, while other commonly used databases do not have ROWID. Therefore, after Oracle data is migrated to the target database, in order to maintain the compatibility of the original ROWID-based applications or operation commands, a hidden column is usually added to each table. A specific function is used to generate a globally unique value for the target database and store it in the hidden column, thereby achieving the effect of supporting various use cases of ROWID.

[0003] However, adding a hidden column to each table not only requires excessive storage space, but also requires an extra hidden column to be inserted every time data is inserted into the table, affecting insertion performance and other issues. Summary of the Invention

[0004] To solve the above-mentioned technical problems, or at least partially solve them, this application provides a compatible processing method, apparatus, electronic device, and storage medium for distributed databases.

[0005] Firstly, this application provides a compatible processing method for distributed databases, including:

[0006] Obtain operation commands from the distributed database;

[0007] The target table information is determined based on the operation instructions;

[0008] Based on the primary key parameters of the target table information, pseudo-column encoding information is generated.

[0009] The operation instruction is executed based on the pseudo-column encoding information to obtain the operation result corresponding to the operation instruction.

[0010] Optionally, determining the target table information based on the operation instruction includes:

[0011] Determine the instruction information for the operation command;

[0012] If the instruction information contains a ROWID instruction, determine the table information corresponding to the ROWID instruction;

[0013] The table information corresponding to the ROWID instruction is used as the target table information.

[0014] Optionally, the step of encoding the primary key parameters based on the target table information to generate pseudo-column encoding information includes:

[0015] Obtain the primary key parameters and shard location information of the target table;

[0016] The sharding location information and the primary key parameters are encoded to generate the pseudo-column code.

[0017] Optionally, the step of executing the operation instruction based on the pseudo-column encoding information to obtain the operation result corresponding to the operation instruction includes:

[0018] Determine at least one execution instruction corresponding to the operation instruction, wherein the execution instruction includes preset variables;

[0019] The pseudo-column encoding information is assigned to a preset variable in the execution instruction;

[0020] Execute the execution instruction to obtain the operation result corresponding to the operation instruction.

[0021] Optionally, executing the execution instruction to obtain the operation result corresponding to the operation instruction includes:

[0022] The execution instruction determines the pseudo-column encoding information based on the preset variables;

[0023] The pseudo-column encoding information is decoded to obtain the primary key parameters corresponding to the pseudo-column encoding information;

[0024] The execution instruction is processed based on the primary key parameter to obtain the operation result corresponding to the operation instruction.

[0025] Optionally, the execution instruction performs processing based on the primary key parameter to obtain the operation result corresponding to the operation instruction, including:

[0026] The primary key is used to perform a primary key index to determine the target data information;

[0027] The execution instruction is processed based on the target data information to obtain the operation result corresponding to the operation instruction.

[0028] Optionally, the step of encoding pseudo-column encoding information based on the primary key parameters of the target table information includes:

[0029] Get the preset encoding method;

[0030] Based on the primary key parameters of the target table information, pseudo-column encoding information is generated using the preset encoding method.

[0031] Secondly, this application provides an apparatus for compatible processing of distributed databases, comprising:

[0032] The acquisition module is used to obtain operation instructions from the distributed database.

[0033] The determination module is used to determine the target table information based on the operation instructions;

[0034] The generation module is used to encode pseudo-column encoding information based on the primary key parameters of the target table information;

[0035] The execution module is used to execute the operation instruction based on the pseudo-column encoding information and obtain the operation result corresponding to the operation instruction.

[0036] Thirdly, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0037] Memory, used to store computer programs;

[0038] When a processor executes a program stored in memory, it implements the steps of the distributed database compatibility processing method described in any embodiment of the first aspect.

[0039] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the distributed database compatibility processing method as described in any embodiment of the first aspect.

[0040] The technical solutions provided in this application have the following advantages compared with the prior art:

[0041] This embodiment determines the target table information based on the operation instructions of the distributed database, encodes the primary key parameters of the target table information to generate pseudo-column encoding information, and executes the operation instructions based on the pseudo-column encoding information to obtain the operation result corresponding to the operation instructions. In this way, in the process of responding to operation instructions, there is no need to obtain the data of the hidden column. Instead, pseudo-column encoding information is generated in real time based on the primary key parameters of the target table information to respond to the operation instructions. This solves the problem of excessive storage space occupation and impact on insertion performance caused by adding a hidden column to each table in the existing solution. This embodiment achieves the effect of not occupying too much storage space and improving insertion performance by eliminating the need to set a hidden column. Attached Figure Description

[0042] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 A flowchart illustrating a compatibility processing method for a distributed database provided in an embodiment of this application;

[0045] Figure 2 A schematic diagram of the structure of a compatible processing device for a distributed database provided in an embodiment of this application;

[0046] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0048] Oracle is a widely used database with numerous applications based on it. As the database field evolves, more and more other databases are being adopted, leading to frequent migrations of Oracle data to other commonly used databases. Oracle possesses a crucial unique feature: ROWID. Each row in an Oracle table has a unique identifier, or ROWID, which is typically used internally by Oracle to access data. Therefore, when migrating Oracle data to other commonly used databases, to ensure compatibility with the original Oracle applications' ROWID-based business requirements, especially in distributed databases, a common approach is to add a hidden column to each table and create a virtual column and a unique index on that hidden column. A globally unique value is then generated using a specific function and stored in this hidden column. This ensures the distributed database is compatible with various ROWID-supported use cases.

[0049] While adding a hidden column to each table to store ROWID can quickly and easily solve ROWID compatibility issues, this method also has the following problems: 1. The newly added hidden column is a real column, meaning each table needs to occupy several bytes of storage space. For a large number of tables, this can lead to significant space consumption by the hidden column data. 2. Since it's a hidden column, every time new data is inserted into the table, an additional hidden column needs to be inserted, which reduces insertion performance. 3. Because the ROWID stored in the hidden column is related to the data in the table, a unique index on the hidden column must be maintained every time a Data Manipulation Language (DML) operation is performed, which reduces database performance. 4. Because the hidden column contains ROWID, data retrieval requires two indexing operations: first, the unique ROWID index, and then the primary key index. This requires two index I / O operations, resulting in low retrieval efficiency.

[0050] Figure 1 This is a flowchart illustrating a distributed database compatibility processing method provided in an embodiment of this application.

[0051] like Figure 1 As shown in the illustration, this application discloses an embodiment of a method for compatible processing of distributed databases, including:

[0052] S110: Obtain operation instructions for the distributed database;

[0053] S120: Determine the target table information based on the operation instructions;

[0054] S130: Generate pseudo-column encoding information based on the primary key parameters of the target table information;

[0055] S140: Execute the operation instruction based on the pseudo-column encoding information to obtain the operation result corresponding to the operation instruction.

[0056] This embodiment uses a distributed database as an example, but it can be adapted to other databases as well. The operation instructions for the distributed database are obtained. These instructions are used to indicate commands input to the distributed database, and can be user-side application operations or code commands. The target table information is determined based on the operation instructions. For distributed databases, operation instructions can include CRUD operations, etc. Therefore, the target table information represents the table information in the distributed database targeted by the operation instructions. After determining the target table information corresponding to the operation instructions, corresponding operations need to be performed on the target table information. In existing technical solutions, the ROEID information of the target table information is determined through a hidden column, and then the target table information is determined by performing two indexes based on the ROEID information and the primary key index. The target data in the table information is not hidden in this embodiment. Instead, it is encoded based on the primary key parameters of the target table information to generate pseudo-column encoding information. That is, after determining the target table information, pseudo-column encoding information is generated based on the primary key parameters of the target table information. The pseudo-column encoding information is the ROEID information corresponding to the table information. Since the pseudo-column encoding information is not added to the hidden column during the table creation process, but is generated in real time based on the operation command, it is the ROEID information in the pseudo-hidden column that plays a role. Finally, the operation command is executed according to the pseudo-column encoding information to obtain the operation result corresponding to the operation command. In this way, without setting a hidden column to store the ROEID information, the pseudo-column encoding information corresponding to the target table information is generated in real time to complete the response to the operation command. Compared with existing hidden column solutions, it is not necessary to set a hidden column, which achieves the effects of not occupying too much storage space and improving insertion performance.

[0057] In one embodiment, step S120, which determines the target table information based on the operation instruction, may include:

[0058] S121: Instruction information for determining operation instructions;

[0059] S122: If the ROWID instruction exists in the instruction information, determine the table information corresponding to the ROWID instruction;

[0060] S123: Use the table information corresponding to the ROWID instruction as the target table information.

[0061] As mentioned above, ROWID is a feature unique to Oracle databases. Therefore, real-time encoding of pseudo-column encoding information is only required when the content of Oracle's ROWID needs to be utilized. Thus, after obtaining the operation instruction, at least one instruction information of the operation instruction is first determined, and it is determined whether there is a ROWID instruction in the instruction information. If there is a ROWID instruction in the instruction information, it means that the response of the operation instruction needs to utilize ROWID information. Therefore, the table information corresponding to the ROWID instruction is determined, and the table information corresponding to the ROWID instruction is used as the target table information. Based on the primary key parameters of the target table information, pseudo-column encoding information is generated, thereby achieving the effect of distributed database compatibility with execution information containing ROWID instructions.

[0062] In one embodiment, S130 encodes pseudo-column encoding information based on the primary key parameters of the target table information, which may include:

[0063] S131: Obtain the primary key parameters and sharding location information of the target table;

[0064] S132: Encode the sharding location information and primary key parameters to generate pseudo-column codes.

[0065] This embodiment uses a distributed database as an example to obtain the primary key parameters and shard location information of the target table. The primary key parameters represent the primary key field of the target table. Since table information in a distributed database can be stored on different data nodes, after obtaining the primary key parameters, it is also necessary to obtain the shard location information. The shard location information represents the specific data node location where the target table information is stored. The shard location information and primary key parameters are encoded to generate a pseudo-column code. The pseudo-column code contains the primary key parameters and shard location information of the target table. Since the primary key field of the table information is unique, and with the addition of the shard location information, the pseudo-column code acts as a unique index. This ensures that when querying the distributed database through the pseudo-column code, the target data can be determined with only one index, without needing to go through two indexes. This achieves the effect of efficient data retrieval of ROWID in the distributed database.

[0066] It should be noted that for non-distributed databases, information from the same table is stored on the same data node. Therefore, there is no need to determine the sharding location of the target table information. Thus, for non-distributed databases, it is sufficient to obtain the primary key parameters of the target table information.

[0067] Since an operation instruction can include multiple execution contents, and each execution content is determined by specific instruction information, such as the operation instruction to modify the name can include instruction information such as query instruction, delete instruction, and add instruction. Different execution instructions under the same operation instruction may need to execute the same ROWID instruction. Therefore, if each execution instruction is encoded separately to generate corresponding pseudo-column codes, it will cause resource waste and reduce the response efficiency of operation instructions.

[0068] In one embodiment, S140 executes an operation instruction based on the pseudo-column encoding information to obtain the operation result corresponding to the operation instruction, including:

[0069] S141: Determine at least one execution instruction corresponding to the operation instruction, the execution instruction including preset variables;

[0070] S142: Assign the pseudo-column encoding information to the preset variable in the execution instruction;

[0071] S143: Execute the execution instruction to obtain the operation result corresponding to the operation instruction.

[0072] In this embodiment, at least one execution instruction corresponding to the operation instruction is determined. The execution instruction includes a preset variable, which is used to represent the traversal of storing pseudo-column encoding information. Therefore, after encoding based on the primary key parameters of the target table information to generate pseudo-column encoding information, the pseudo-column encoding information is assigned to the preset variable in the execution instruction. When subsequent execution instructions corresponding to the same operation instruction need to call ROWID information, they can be quickly retrieved by calling the preset variable. This achieves the effect of only needing to encode based on the primary key parameters of the target table information and generate pseudo-column encoding information once during the response to the same operation instruction, thereby improving the effect of quickly obtaining the response to execution instructions containing ROWID instructions in the distributed database.

[0073] In step S130, the primary key parameters of the target table information are encoded to generate pseudo-column encoding information. The generation process of the pseudo-column encoding information is determined so that it can include the primary key parameters of the target table information. This allows the primary key parameters of the target table information to be used for indexing during the execution of the operation instruction. Since the pseudo-column encoding information also undergoes a decoding process, step S143 executes the execution instruction to obtain the operation result corresponding to the operation instruction, which may include:

[0074] S1431: The execution instruction determines the pseudo-column encoding information based on preset variables;

[0075] S1432: Decode the pseudo-column encoding information to obtain the primary key parameters corresponding to the pseudo-column encoding information;

[0076] S1433: The execution instruction is processed based on the primary key parameter to obtain the operation result corresponding to the operation instruction.

[0077] In this embodiment, the execution of operation instructions involves executing each execution instruction within the operation instructions. Therefore, when the execution instruction references pseudo-column encoding information, the execution instruction first determines the pseudo-column encoding information based on preset variables. Next, the pseudo-column encoding information needs to be decoded to obtain the primary key parameter corresponding to the pseudo-column encoding information. At this point, the corresponding execution instruction is executed based on the primary key parameter index. The decoding process corresponds to the aforementioned encoding method of generating pseudo-column encoding information based on the primary key parameter of the target table information. It only requires determining that the encoded pseudo-column encoding information is ROWID information and the decoded primary key parameter of the target table information. Therefore, S130 encodes pseudo-column encoding information based on the primary key parameter of the target table information, including:

[0078] S1434: Obtain the preset encoding method;

[0079] S1435: Generate pseudo-column encoding information based on the primary key parameters of the target table information using a preset encoding method.

[0080] In this embodiment, the preset encoding method can be base64 encoding, and the decoding method is the base64 corresponding decoding method, so as to achieve the effect that the encoding and decoding process of pseudo-column encoded information is completely symmetrical and reversible.

[0081] In one embodiment, S1433: The execution instruction is processed based on the primary key parameter to obtain the operation result corresponding to the operation instruction, which may include:

[0082] S14331: Perform primary key indexing based on primary key parameters to determine target data information;

[0083] S14332: The execution instruction performs processing based on the target data information to obtain the operation result corresponding to the operation instruction.

[0084] In this embodiment, during the execution of instructions based on primary key parameters, the primary key index is first used to determine the target data information. For example, the key index determines which row of the target data information is the target data information. The target data information is then obtained. After the execution instructions are processed based on the target data information, the operation result corresponding to the operation instructions is obtained. It should be noted that when the operation instructions include several execution instructions, each execution instruction is executed sequentially. This embodiment eliminates the need to set hidden columns, thus avoiding excessive storage space usage and improving insertion performance.

[0085] In a specific example,

[0086] Table Tb01: The ID field is the primary key parameter in a multi-sharded distributed database.

[0087]

[0088]

[0089] This determines that the target data required for the execution of the current operation instruction is the first row of data in the target table information in the g1 shard. In this way, during the response to the operation instruction, there is no need to obtain the data of the hidden column. Instead, pseudo-column encoding information is generated in real time based on the primary key parameters of the target table information to respond to the operation instruction. This eliminates the need to set hidden columns, thereby reducing the storage space required and improving insertion performance.

[0090] Figure 2 This is a schematic diagram of the structure of a compatible processing device for a distributed database provided in an embodiment of this application.

[0091] like Figure 2 As shown, this application also discloses an embodiment providing a compatible processing apparatus for distributed databases, including:

[0092] Module 210 is used to obtain operation instructions from the distributed database;

[0093] Module 220 is used to determine the target table information based on the operation instructions;

[0094] The generation module 230 is used to encode pseudo-column encoding information based on the primary key parameters of the target table information.

[0095] The execution module 240 is used to execute operation instructions based on pseudo-column encoding information and obtain the operation results corresponding to the operation instructions.

[0096] In one embodiment, the determining module 220 may include:

[0097] The first determining unit is used to determine the instruction information of the operation instruction;

[0098] The second determining unit is used to determine the table information corresponding to the ROWID instruction when the instruction information contains the ROWID instruction.

[0099] The target table unit is used to take the table information corresponding to the ROWID instruction as the target table information.

[0100] In one embodiment, the generation module 230 may include:

[0101] The first acquisition unit is used to acquire the primary key parameters and sharding location information of the target table.

[0102] The first generation unit is used to encode the sharding location information and primary key parameters to generate pseudo-column codes.

[0103] In one embodiment, the execution module 240 may include:

[0104] The third determining unit is used to determine at least one execution instruction corresponding to the operation instruction, and the execution instruction includes preset variables;

[0105] The assignment unit is used to assign pseudo-column encoding information to preset variables in the execution instruction;

[0106] The execution unit is used to execute the instructions and obtain the operation results corresponding to the instructions.

[0107] In one embodiment, the execution unit may include:

[0108] The first determining subunit is used to execute instructions to determine pseudo-column encoding information based on preset variables;

[0109] The decoding subunit is used to decode the pseudo-column encoding information to obtain the primary key parameters corresponding to the pseudo-column encoding information;

[0110] The execution subunit is used to execute instructions based on the primary key parameters to obtain the operation results corresponding to the operation instructions.

[0111] In one embodiment, the execution subunit may include:

[0112] The second determining subunit is used to perform primary key indexing based on the primary key parameters to determine the target data information;

[0113] The operation result subunit is used to execute instructions based on target data information to obtain the operation result corresponding to the operation instructions.

[0114] In one embodiment, the generation module 230 may include:

[0115] The second acquisition unit is used to acquire a preset encoding method;

[0116] The second generation unit is used to generate pseudo-column encoding information based on the primary key parameters of the target table information using a preset encoding method.

[0117] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0118] like Figure 3As shown in the figure, this application embodiment provides an electronic device, including a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340.

[0119] Memory 330 is used to store computer programs;

[0120] In one embodiment of this application, when the processor 310 executes the program stored in the memory 330, it implements the distributed database compatible processing method provided in any of the foregoing method embodiments.

[0121] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the distributed database compatible processing method provided in any of the foregoing method embodiments.

[0122] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0123] The foregoing has described specific embodiments of the embodiments described in this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0124] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for handling compatibility issues in a distributed database, characterized in that, include: Obtain operation commands from the distributed database; The target table information is determined according to the operation instruction, wherein the target table information is used to represent the table information in the distributed database to which the operation instruction is applied; Based on the primary key parameters of the target table information, pseudo-column encoding information is generated, including: obtaining the primary key parameters and sharding position information of the target table information; encoding the sharding position information and the primary key parameters to generate the pseudo-column encoding; The operation instruction is executed based on the pseudo-column encoding information to obtain the operation result corresponding to the operation instruction.

2. The method according to claim 1, characterized in that, The step of determining the target table information based on the operation instructions includes: Determine the instruction information for the operation command; If the instruction information contains a ROWID instruction, determine the table information corresponding to the ROWID instruction; The table information corresponding to the ROWID instruction is used as the target table information.

3. The method according to claim 1, characterized in that, The step of executing the operation instruction based on the pseudo-column encoding information to obtain the operation result corresponding to the operation instruction includes: Determine at least one execution instruction corresponding to the operation instruction, wherein the execution instruction includes preset variables; The pseudo-column encoding information is assigned to a preset variable in the execution instruction; Execute the execution instruction to obtain the operation result corresponding to the operation instruction.

4. The method according to claim 3, characterized in that, The execution of the execution instruction to obtain the operation result corresponding to the operation instruction includes: The execution instruction determines the pseudo-column encoding information based on the preset variables; The pseudo-column encoding information is decoded to obtain the primary key parameters corresponding to the pseudo-column encoding information; The execution instruction is processed based on the primary key parameter to obtain the operation result corresponding to the operation instruction.

5. The method according to claim 4, characterized in that, The execution instruction is processed based on the primary key parameter to obtain the operation result corresponding to the operation instruction, including: The primary key is used to perform a primary key index to determine the target data information; The execution instruction is processed based on the target data information to obtain the operation result corresponding to the operation instruction.

6. The method according to claim 1, characterized in that, The process of generating pseudo-column encoding information based on the primary key parameters of the target table information includes: Get the preset encoding method; Based on the primary key parameters of the target table information, pseudo-column encoding information is generated using the preset encoding method.

7. An apparatus for compatible processing of distributed databases, characterized in that, include: The acquisition module is used to obtain operation instructions from the distributed database. The determining module is used to determine the target table information based on the operation instruction, wherein the target table information is used to represent the table information in the distributed database to which the operation instruction is applied; The generation module is used to encode pseudo-column encoding information based on the primary key parameters of the target table information. Specifically, it is used to: obtain the primary key parameters and sharding position information of the target table information; and encode the sharding position information and the primary key parameters to generate the pseudo-column encoding. The execution module is used to execute the operation instruction based on the pseudo-column encoding information and obtain the operation result corresponding to the operation instruction.

8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method for compatible processing of a distributed database as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for compatible processing of a distributed database as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Spatial-temporal data management method and system, host and computer readable storage medium

    CN113032405A

  • Pseudo column implementation method and device, electronic equipment and storage medium

    CN115292313A