Data table changing method and device and electronic equipment

By executing the data table change method on the database management platform, obtaining the change plan and sharding templates, and batch processing according to the strategy, the problems of inefficiency and omission of traditional methods are solved, and efficient and accurate data table changes are achieved.

CN120216512APending Publication Date: 2025-06-27NETSUNION CLEARING CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311808848.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

Traditional data table change methods are inefficient and are prone to missed data tables in scenarios where the number of database shards is large.

Method used

Through the data table change method executed by the database management platform, the data table change plan and pre-configured shard template are obtained, and the metadata tables treated with the changed are batch processed according to the change strategy.

Benefits of technology

Improve the efficiency of data table changes, avoid omissions, ensure the accuracy and reliability of data table changes, and reduce operation and maintenance management costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216512A_ABST
    Figure CN120216512A_ABST
Patent Text Reader

Abstract

The invention discloses a data table changing method and device and electronic equipment. The method is executed by a database management platform and comprises the steps that a data table change plan is obtained, the data table change plan comprises change object information and a change strategy, and the change object information comprises database fragment information to be changed; obtaining a target fragmentation template corresponding to the database fragmentation information from a pre-configured fragmentation template, wherein each fragmentation template comprises table description information of a metadata table deployed in a database fragmentation; obtaining a metadata table to be changed from a database system according to table description information in the target fragment template; and performing table change processing on the metadata table to be changed according to the change strategy. According to the technical scheme, the data table change efficiency is improved, and the accuracy and reliability of data table change are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database technology, and in particular, to a method, apparatus, and electronic device for changing data tables. Background Art

[0002] In the current technical context, database sharding and table partitioning is a relatively common solution for coping with the challenges of large-scale data storage and query; however, this solution also has some pain points and disadvantages, such as high maintenance costs.

[0003] When there are requirements for table changes such as creating tables and modifying tables in a database system, the traditional method is to sequentially select each database that needs to have its data table changed and design the corresponding SQL (Structured Query Language) statements, and implement the data table change by driving each database to execute the corresponding SQL statements.

[0004] It can be seen that the traditional data table change efficiency is relatively low, and in scenarios where the number of database shards is large, it is easy to miss data tables. Summary of the Invention

[0005] The purpose of the embodiments of this application is to at least solve one of the above technical defects, and specifically provide a method, apparatus, and electronic device for changing data tables to improve the efficiency of data table change and ensure the accuracy and reliability of data table change.

[0006] The embodiments of this application adopt the following technical solutions:

[0007] In a first aspect, the embodiments of this application provide a method for changing a data table, which is executed by a database management platform. The method for changing a data table includes:

[0008] Obtain a data table change plan, where the data table change plan includes change object information and a change strategy, and the change object information includes database shard information to be changed;

[0009] Obtain a target shard template corresponding to the database shard information from a pre-configured shard template, and each shard template includes table description information of a meta data table deployed in the database shard;

[0010] Obtain the meta data table to be changed from the database system according to the table description information in the target shard template;

[0011] Perform table change processing on the meta data table to be changed according to the change strategy.

[0012] In a second aspect, the embodiments of this application also provide a data table change apparatus, which is applied to a database management platform. The data table change apparatus includes:

[0013] A first acquisition unit, configured to acquire a data table change plan, where the data table change plan includes change object information and a change strategy, and the change object information includes database shard information to be changed;

[0014] A second acquisition unit, configured to acquire a target shard template corresponding to the database shard information from a pre-configured shard template, and each shard template includes table description information of a metadata table deployed in the database shard;

[0015] A third acquisition unit, configured to acquire the metadata table to be changed from the database system according to the table description information in the target shard template;

[0016] A change execution unit, configured to perform table change processing on the metadata table to be changed according to the change strategy.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes:

[0018] A memory, storing computer-executable instructions;

[0019] A processor, when the computer-executable instructions are executed, causing the processor to execute the data table change method.

[0020] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores one or more programs, and when the one or more programs are executed by an electronic device including a plurality of application programs, the electronic device is caused to execute the data table change method.

[0021] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0022] The database management platform in the embodiment of the present application pre-configures a data table change plan and a shard template. The data table change plan includes change object information and a change strategy, and each shard template includes table description information of a metadata table in the corresponding database shard. The database management platform obtains a target shard template from the shard template through the database shard information in the change object information, so as to obtain the metadata table to be changed through the target shard template. In this way, table change processing can be performed on the metadata table to be changed in batches according to the change strategy.

[0023] In the embodiment of the present application, by pre-configuring a shard template for each database shard, when it is necessary to change the data table in the database system, directly select the corresponding shard template to perform batch change processing on all metadata tables to be changed, which can improve the change efficiency, avoid omissions, and ensure the accuracy and reliability of the data table change.

[0024] In addition, the database management platform of the embodiments of the present application can flexibly, configurable, and efficiently implement the automatic change of data tables by pre-configuring sharding templates and data table change plans, which is convenient for database administrators to overall manage the database system and reduce the operation and maintenance management costs. Description of the Drawings

[0025] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0026] Figure 1 is a schematic flowchart of a data table change method shown in an embodiment of the present application;

[0027] Figure 2 is a complete flowchart of a data table change shown in an embodiment of the present application;

[0028] Figure 3 is a schematic structural diagram of a data table change device shown in an embodiment of the present application;

[0029] Figure 4 is a schematic structural diagram of an electronic device shown in an embodiment of the present application. Detailed Embodiments

[0030] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0031] The following will describe in detail the technical solutions provided by each embodiment of the present application with reference to the drawings.

[0032] The embodiments of the present application provide a data table change method, which is executed by a database management platform. The database management platform is used to manage a database system. The database system includes multiple database shards, and each database shard includes multiple database nodes. The data table structures of the multiple database nodes are the same.

[0033] As Figure 1 shown, a flowchart of a data table change method in an embodiment of the present application is provided. The method at least includes the following steps S110 to step S140:

[0034] Step S110: Obtain a data table change plan, where the data table change plan includes change object information and a change strategy, and the change object information includes database shard information to be changed.

[0035] In the embodiment of the present application, the data table change plan can be pre-configured by a database administrator. The data table change plan includes change object information and a change strategy. The change object information includes the database object to which the change is directed and guidance information for querying the database object. Since each database node in each database shard has the same table structure, the database shard information is used as the guidance information in the embodiment of the present application. In this way, not only can the specific data table be quickly queried, but also it is convenient to formulate a change strategy. The database shard information includes relevant information for describing the database shard, such as shard identification, shard name, shard creation time, shard change time, etc.

[0036] The change strategy includes information such as change content and change execution conditions. The change content is used to describe the specific content of the current data table change. For example, it includes table change content and / or in-table element change content. The table change content, for example, includes modifying, deleting, adding a data table and the description information of the data table. The in-table element change content, for example, includes modifying, deleting, adding data records in the data table.

[0037] The change execution condition is used to describe the trigger condition for change execution, such as trigger based on time, trigger based on a command, or trigger based on a work order system, etc.

[0038] Step S120: Obtain a target shard template corresponding to the database shard information from a pre-configured shard template. Each shard template includes table description information of a meta-data table deployed in the database shard.

[0039] In the embodiment of the present application, the shard template can be pre-configured by a database administrator. For example, a corresponding shard template is configured for each database shard. Each shard template includes table description information of a meta-data table. The meta-data table refers to one or more data tables included in each database node deployed in each database shard. The table description information includes relevant information for describing and identifying each meta-data table, such as network connection information, node identification information, table address information, etc., of the database node where the meta-data table is located.

[0040] For example, if the database system includes N database shards, then when configuring the shard template, corresponding shard templates are configured for each database shard respectively, with a total of N shard templates configured. Obtain the table description information of the metadata table according to the database schema information in each database shard. Generally, the table description information of multiple metadata tables can be obtained. Assuming that one metadata table is deployed in each database node, the table description information of N metadata tables is obtained. The database schema information here includes, for example, the number of database nodes in the database shard, the network connection information of the database nodes, the node identification information of the database nodes, and the data table information in each database node (such as including the data table name, data table type, data table address, etc.).

[0041] In this way, the target shard template can be determined according to the database shard information to be changed, and then the metadata table to be changed can be obtained according to the target shard template.

[0042] Step S130, obtain the metadata table to be changed from the database system according to the table description information in the target shard template.

[0043] Step S140, perform table change processing on the metadata table to be changed according to the change strategy.

[0044] As Figure 1 It can be seen from the data table change method shown that in the embodiments of the present application, by pre-configuring shard templates for each database shard, when it is necessary to change the data tables of the database system, the corresponding shard templates can be directly selected to perform batch change processing on all the metadata tables to be changed, which can improve the change efficiency, avoid omissions, and ensure the accuracy and reliability of the data table change.

[0045] In addition, the database management platform of the embodiments of the present application can flexibly, configurable, and efficiently implement the automatic change of the data tables by pre-configuring shard templates and data table change plans, which is convenient for database administrators to overall manage the database system and reduce the operation and maintenance management costs.

[0046] As described above, the change strategy of the embodiments of the present application includes the change content. In some embodiments of the present application, Figure 1 the method shown also includes:[[]]

[0047] Obtain the SQL change statement according to the change content.

[0048] In some scenarios, in this embodiment, the database management platform can automatically construct the SQL change statement based on the change content. For example, the change content includes the difference information between the data tables before and after the change, and the SQL change statement is constructed based on the difference information.

[0049] In other scenarios, the SQL change statement can be obtained through the front-end configuration page of the database management platform, and the SQL change statement can be constructed by the database administrator according to the statement generation guidelines provided by the front-end configuration page.

[0050] Correspondingly, in some embodiments of the present application, in the above step S130, performing table change processing on the meta-data table to be changed according to the change policy specifically includes:

[0051] Performing table change processing on the meta-data table to be changed according to the SQL change statement.

[0052] It should be noted that in the exemplary embodiment of the present application, when the database in the database system is an SQL database, the SQL change statement can be used to perform data table change operations. For other types of databases, corresponding change statements can also be designed to perform data table change operations, and the embodiments of the present application do not make specific restrictions on this.

[0053] In some embodiments of the present application, in step S140, performing table change processing on the meta-data table to be changed according to the SQL change statement specifically includes:

[0054] Determine whether the SQL change statement is incorrect;

[0055] If the SQL change statement is correct, perform table change processing on the meta-data table to be changed according to the SQL change statement;

[0056] If the SQL change statement is incorrect, generate an alarm message.

[0057] In this embodiment, before executing the SQL statement, it is checked whether the SQL change statement is incorrect, and the SQL change statement is only executed when it is correct to avoid incorrect changes to the meta-data table and affecting business continuity.

[0058] In some possible implementation solutions of this embodiment, the following steps can be used to determine whether the SQL change statement is incorrect:

[0059] Obtain the conflict detection result between the SQL change statement and the target database shard regarding the operation object;

[0060] Determine whether the SQL change statement is incorrect according to the conflict detection result.

[0061] Of course, in some other possible implementation solutions of this embodiment, it is also possible to detect whether the SQL change statement is incorrect according to the detection rules pre-configured in the database management platform, for example, detecting whether there are syntax errors in the SQL change statement based on syntax rules.

[0062] In some application scenarios, obtaining the conflict detection result between the SQL change statement and the target database shard regarding the operation object specifically includes:

[0063] Obtaining the current metadata table information of each database node within the target database shard, as well as the operation object information of the SQL change statement;

[0064] Performing conflict detection by respectively comparing the operation object information of the SQL change statement with the current metadata table information of each database node to obtain the conflict detection results corresponding to each database node.

[0065] The current metadata table information of each database node can accurately represent the current status information of all metadata tables deployed on each database node, while the operation object information of the SQL change statement can represent the specific data table targeted by the SQL change statement. If database node A currently deploys a first data table and a second data table, and the operation object information of the SQL change statement indicates a change to a third data table, obviously there is a conflict at this time.

[0066] In this way, it can be determined whether the SQL change statement is incorrect based on the conflict detection results corresponding to each database node. Specifically:

[0067] At this time, if the conflict detection results corresponding to each database node are all conflict-free, it is determined that the SQL change statement is correct, and table change processing is performed on the metadata table to be changed according to the SQL change statement;

[0068] If the conflict detection results corresponding to each database node are all in conflict, it is determined that the SQL change statement is incorrect, and an alarm message is generated;

[0069] If some of the conflict detection results corresponding to each database node are conflict-free and some are in conflict, it is determined that the SQL change statement is correct, but there is a fault in the target database shard. At this time, in the embodiments of the present application, table change processing can be performed on the metadata table to be changed according to the SQL change statement, or an alarm can be issued. Those skilled in the art can flexibly select the implementation scheme based on business requirements.

[0070] It should be noted that the embodiments of the present application show a real-time solution for obtaining the conflict detection result between the SQL change statement and the target database shard regarding the operation object. In other embodiments of the present application, a conflict check request can also be generated according to the operation object information of the SQL change statement, and the conflict check request is sent to each database node of the target database shard, so that each database node performs conflict detection according to the conflict check request, and each database node sends the obtained conflict detection results to the database management platform.

[0071] In addition, in other embodiments of the present application, Figure 1 Before the method shown performs table change processing on the metadata table to be changed according to the SQL change statement, compliance checks can also be performed. For example, check whether the change content in the SQL change statement is compliant, and check the online status of each database node in the target database shard to avoid the situation where a certain database node fails to go online and thus fails to perform data table change, etc.

[0072] As described above, the change strategy also includes change execution conditions. In some embodiments of the present application, when performing table change processing on the metadata table to be changed according to the SQL change statement in step S140 above, it specifically includes:

[0073] Send the SQL change statement, the metadata table to be changed, and the change execution conditions to the target database shard, so that each database node in the target database shard performs batch change processing on the metadata table according to the change execution conditions and the SQL change statement.

[0074] In some application scenarios of this embodiment, the SQL change statement, the metadata table to be changed, and the change execution conditions can be directly sent to the target database shard, and each database node of the target database shard determines when to execute the SQL change statement according to the change execution conditions.

[0075] In some other application scenarios of this embodiment, a data table change work order can also be generated according to the SQL change statement, the metadata table to be changed, and the change execution conditions, and the data table change work order is submitted to the work order system, and the work order system performs change processing on the metadata table based on the data table change work order.

[0076] In addition, the table structures in each database shard described above in the embodiments of the present application are the same, which can be specifically understood as the table structures of the same business are the same. In actual application scenarios, there are various types of data tables deployed on the database nodes in the database system. Therefore, when obtaining the metadata table to be changed with the database shard as the guiding object, the data table type should also be specified through the change object information.

[0077] Specifically, in some embodiments of the present application, the change object information further includes the data table type to be changed. When obtaining the metadata table to be changed from the database system according to the table description information in the target shard template in step S130 above, it specifically includes:

[0078] Obtain the metadata table to be changed from the database system according to the data table type to be changed and the table description information in the target shard template.

[0079] For example, if the data table type to be changed specified in the data table change plan is a payment type data table, and the table description information in the target sharding template includes the table description information of the payment type data table and the table description information of the clearing type data table, then the meta data table corresponding to the table description information of the payment type data table should be used as the meta data table to be changed.

[0080] The following Figure 2 details the data table change method according to the embodiments of the present application.

[0081] As Figure 2 shown, the database administrator pre-configures a sharding template for each database shard in the database system. The sharding template includes multiple pieces of data, and each piece of data corresponds to the table description information of all meta data tables within a database node. Assume that database shard A includes three database nodes, which are respectively identified by the IP addresses of the nodes as IP1_Port1, IP2_Port2, and IP3_Port3. If each database node includes a meta data table, then the sharding template A corresponding to database shard A includes three pieces of data. The first piece of data is IP1_Port1: database name 1, the second piece of data is IP2_Port2: database name, and the third piece of data is IP3_Port3: database name 3.

[0082] The database administrator also pre-formulates a data table change plan according to business requirements. Taking one of the data table change plans as an example, if sharding template A is determined as the target sharding template according to the database shard information to be changed in the first data table change plan, then the meta data tables under the above three database names can be determined as the data tables to be changed.

[0083] In addition, the database administrator can also construct an SQL change statement according to the change strategy in the first data table change plan, and then check whether the SQL change statement is incorrect. If it is correct, a data table change work order is generated according to the data table to be changed, the SQL change statement, and the change execution condition in the change strategy, and the data table change work order is submitted to the work order system, and the work order system performs change processing on the meta data table based on the data table change work order.

[0084] The embodiments of the present application also provide a data table change device, which is applied to a database management platform. As Figure 3 shown, a structural schematic diagram of a data table change device in the embodiments of the present application is provided. The device 300 includes a first acquisition unit 310, a second acquisition unit 320, a third acquisition unit 330, and a change execution unit 340;

[0085] The first acquisition unit 310 is used to acquire a data table change plan, where the data table change plan includes change object information and a change strategy, and the change object information includes database shard information to be changed;

[0086] A second acquisition unit 320, configured to acquire a target shard template corresponding to the database shard information from a pre-configured shard template, where each shard template includes table description information of a metadata table deployed in a database shard;

[0087] A third acquisition unit 330, configured to acquire a metadata table to be changed from a database system according to the table description information in the target shard template;

[0088] A change execution unit 340, configured to perform table change processing on the metadata table to be changed according to the change policy.

[0089] In some embodiments of the present application, the change policy includes change content, and the apparatus 300 further includes a fourth acquisition unit;

[0090] The fourth acquisition unit is configured to acquire an SQL change statement according to the change content.

[0091] In some embodiments of the present application, the change execution unit 340 is specifically configured to perform table change processing on the metadata table to be changed according to the SQL change statement.

[0092] In some embodiments of the present application, the change execution unit 340 is specifically configured to determine whether the SQL change statement is incorrect; if the SQL change statement is correct, perform table change processing on the metadata table to be changed according to the SQL change statement; if the SQL change statement is incorrect, generate an alarm message.

[0093] In some embodiments of the present application, the change execution unit 340 is specifically configured to obtain a conflict detection result between the SQL change statement and a target database shard regarding an operation object; determine whether the SQL change statement is incorrect according to the conflict detection result.

[0094] In some embodiments of the present application, the change execution unit 340 is specifically configured to obtain current metadata table information of each database node in a target database shard, and operation object information of the SQL change statement; perform conflict detection on the operation object information of the SQL change statement and the current metadata table information of each database node respectively, and obtain a conflict detection result corresponding to each database node.

[0095] In some embodiments of the present application, the change execution unit 340 is specifically configured to determine that the SQL change statement is correct if the conflict detection results corresponding to each database node are all conflict-free; determine that the SQL change statement is incorrect if the conflict detection results corresponding to each database node are all in conflict; and determine that the SQL change statement is correct, but the target database shard has a fault if some of the conflict detection results corresponding to each database node are conflict-free and some are in conflict.

[0096] In some embodiments of the present application, the change strategy further includes a change execution condition. The change execution unit 340 is specifically configured to send the SQL change statement, the metadata table to be changed, and the change execution condition to the target database shard, so that each database node in the target database shard performs change processing on the metadata table according to the change execution condition and the SQL change statement.

[0097] It can be understood that the above data table change device can implement each step of the data table change method provided in the foregoing embodiments. The relevant explanations of the data table change method are applicable to the data table change device and will not be elaborated here.

[0098] Figure 4 The structural schematic diagram of an electronic device shown in the embodiments of the present application is provided. Please refer to Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory, such as at least one disk memory, etc. Of course, the electronic device may also include other hardware required for other services.

[0099] The processor, network interface, and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, Figure 4 only a bidirectional arrow is used in

[0100] A memory for storing programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory may include a memory and a non-volatile memory, and provide instructions and data to the processor.

[0101] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a data table change device at the logical level. The processor executes the program stored in the memory, and executes the data table change method, and specifically executes the following steps:

[0102] Obtain a data table change plan, where the data table change plan includes change object information and a change strategy, and the change object information includes database shard information to be changed;

[0103] Obtain a target shard template corresponding to the database shard information from the pre-configured shard templates, and each shard template includes table description information of the meta data tables deployed in the database shard;

[0104] Obtain the meta data table to be changed from the database system according to the table description information in the target shard template;

[0105] Perform table change processing on the meta data table to be changed according to the change strategy.

[0106] The above as in this application Figure 1The method executed by the data table change device disclosed in the embodiments shown can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor or instructions in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above data table change method.

[0107] The electronic device can also execute Figure 1 the method executed by the data table change device in Figure 1 the embodiments shown and implement the functions of the data table change device in

[0108] Embodiments of the present application also propose a computer-readable storage medium. The computer-readable storage medium stores one or more programs. The one or more programs include instructions that, when executed by an electronic device including a plurality of application programs, can enable the electronic device to execute Figure 1 the method executed by the data table change device in the embodiments shown and specifically execute the following steps:

[0109] Obtain a data table change plan, where the data table change plan includes change object information and a change strategy, and the change object information includes database shard information to be changed;

[0110] Obtain a target sharding template corresponding to the database sharding information from a pre-configured sharding template, where each sharding template includes table description information of a metadata table deployed within a database shard;

[0111] Obtain the metadata table to be changed from the database system according to the table description information in the target sharding template;

[0112] Perform table change processing on the metadata table to be changed according to the change strategy.

[0113] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0114] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0115] These computer program instructions can also be stored in a computer-readable memory capable of guiding a computer or other programmable data processing devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implement the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing devices, such that a series of operation steps are executed on the computer or other programmable devices to generate computer-implemented processing, so that the instructions executed on the computer or other programmable devices provide steps for implementing the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0117] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0118] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0119] Computer-readable media includes both permanent and non-permanent, removable and non-removable media implemented by any method or technology for information storage. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transitory media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0120] It should also be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, commodity or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, commodity or device comprising the element.

[0121] Those skilled in the art will appreciate that the embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0122] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. A method for changing a data table, which is executed by a database management platform, wherein, The data table change method includes: Obtain a data table change plan, where the data table change plan includes change object information and a change strategy, and the change object information includes database shard information to be changed; Obtain a target shard template corresponding to the database shard information from a pre-configured shard template, and each shard template includes table description information of a metadata table deployed within a database shard; Obtain the metadata table to be changed from the database system according to the table description information in the target shard template; Perform table change processing on the metadata table to be changed according to the change strategy.

2. The data table change method according to claim 1, wherein, The change strategy includes change content, and the method further includes: Obtain an SQL change statement according to the change content.

3. The data table change method according to claim 2, wherein, The performing table change processing on the metadata table to be changed according to the change strategy includes: Perform table change processing on the metadata table to be changed according to the SQL change statement.

4. The data table change method according to claim 3, wherein The performing table change processing on the metadata table to be changed according to the SQL change statement includes: Determine whether the SQL change statement is incorrect; If the SQL change statement is correct, perform table change processing on the metadata table to be changed according to the SQL change statement; If the SQL change statement is incorrect, generate an alarm message.

5. The data table change method according to claim 4, wherein, The determining whether the SQL change statement is incorrect includes: Obtain a conflict detection result regarding the operation object between the SQL change statement and the target database shard; Determine whether the SQL change statement is incorrect according to the conflict detection result.

6. The data table change method according to claim 5, wherein, The obtaining a conflict detection result regarding the operation object between the SQL change statement and the target database shard includes: Obtain the current metadata table information of each database node within the target database shard and the operation object information of the SQL change statement; Perform conflict detection on the operation object information of the SQL change statement respectively with the current metadata table information of each database node to obtain conflict detection results corresponding to each database node.

7. The data table change method according to claim 6, wherein, The determining whether the SQL change statement is incorrect according to the conflict detection result includes: If the conflict detection results corresponding to each database node are all conflict-free, determine that the SQL change statement is correct; If the conflict detection results corresponding to each database node are all in conflict, determine that the SQL change statement is incorrect; If some of the conflict detection results corresponding to each database node are conflict-free and some are in conflict, determine that the SQL change statement is correct, but there is a fault in the target database shard.

8. The data table change method according to claim 3, wherein The change strategy further includes a change execution condition, and the performing table change processing on the metadata table to be changed according to the SQL change statement further includes: Send the SQL change statement, the metadata table to be changed, and the change execution condition to the target database shard, so that each database node within the target database shard performs change processing on the metadata table according to the change execution condition and the SQL change statement.

9. A data table change device, applied to a database management platform, wherein, The data table change device includes: A first acquisition unit, configured to acquire a data table change plan, where the data table change plan includes change object information and a change strategy, and the change object information includes database shard information to be changed; A second acquisition unit, configured to acquire a target shard template corresponding to the database shard information from a pre-configured shard template, and each shard template includes table description information of a metadata table deployed in the database shard; A third acquisition unit, configured to acquire the metadata table to be changed from the database system according to the table description information in the target shard template; A change execution unit, configured to perform a table change process on the metadata table to be changed according to the change strategy.

10. An electronic device, wherein, The electronic device includes: A memory, storing computer-executable instructions; A processor, when the computer-executable instructions are executed, causing the processor to execute the data table change method according to any one of claims 1 to 8.