Method, device, electronic equipment and storage medium for data processing

By creating and executing the table modification operation in a temporary database, the problem of automating database table structure change checks in existing technologies is solved, improving efficiency, reducing labor costs, and ensuring the accuracy and reliability of database changes.

CN117331928BActive Publication Date: 2026-05-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-06-24
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, the inspection of database table structure changes relies on the developers' understanding of the database table structure, which cannot automatically adapt to different change scenarios, resulting in low inspection efficiency and high labor costs. In particular, it is difficult to achieve effective automated inspection in large-scale database environments.

Method used

By obtaining the table structure string from the database, creating the corresponding data table in a temporary database, performing the table modification operation on that data table, and obtaining the execution result to determine whether the original database table structure change was successful, a general and automated checking solution is provided.

Benefits of technology

It enables automated checking of the success or failure of database table structure changes in different database scenarios, improving checking efficiency, reducing labor costs, and ensuring the accuracy and reliability of database changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117331928B_ABST
    Figure CN117331928B_ABST
Patent Text Reader

Abstract

The application provides a data processing method, device and equipment and a storage medium, and relates to the technical field of databases. In the data processing method, a first table structure string of a first data table of a first database is acquired, and a second data table is created in a second database according to the first table structure string, wherein the first data table has been subjected to a table modification operation. Then, the table modification operation is performed on the second data table, and an execution result of performing the table modification operation on the second database is acquired, wherein the execution result is used to indicate that the table modification operation is successful or to indicate that a database management system has an error. Finally, whether the table modification operation on the first data table is successful or not is determined according to the execution result. The embodiment of the application can provide a general and automatic table structure change checking scheme, improve the checking efficiency of database table structure change, and reduce the labor cost.
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 more specifically, to a data processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] A database is a computer software system that organizes, stores, and manages data according to a data structure. In database operations and maintenance, it's generally necessary to verify the results of data synchronization or to check the results of database operations. For example, in the application scenario of a financial-grade database for a third-party payment platform, accurate changes to the database table structure are crucial to the business; any changes to the database table structure that do not meet expectations may lead to online service failures for the third-party payment platform.

[0003] Currently, changes to database table structures can be manually confirmed by the database administrator (DBA) or developers, or the results can be checked using table structure string analysis. However, table structure string analysis relies on developers' understanding of the database table structure for targeted programming and cannot automatically adapt to different database table structure change scenarios.

[0004] Therefore, there is an urgent need for a universal and automated solution for checking database table structure changes. Summary of the Invention

[0005] This application provides a data processing method, apparatus, device, and storage medium, which can provide a general and automated method for checking changes in database table structure, improving the efficiency of checking database table structure changes and reducing labor costs.

[0006] In a first aspect, embodiments of this application provide a data processing method, including:

[0007] Obtain the first table structure string of the first data table in the first database, wherein the first data table has been modified by the table operation;

[0008] Based on the structure string of the first table, create a second data table in the second database;

[0009] Perform the table modification operation on the second data table and obtain the execution result of the table modification operation on the second data table, wherein the execution result is used to indicate that the table modification operation was successful, or to indicate that the database management system reported an error;

[0010] Based on the execution result, determine whether the table modification operation on the first data table was successful.

[0011] Secondly, embodiments of this application provide a data processing apparatus, comprising:

[0012] The acquisition unit is used to acquire the first table structure string of the first data table of the first database, wherein the first data table has been subjected to the table operation;

[0013] A creation unit is used to create a second data table in the second database based on the structure string of the first table.

[0014] The table modification unit is used to perform the table modification operation on the second data table and obtain the execution result of the table modification operation on the second data table, wherein the execution result is used to indicate that the table modification operation was successful or to indicate that the database management system reported an error.

[0015] The determining unit is used to determine, based on the execution result, whether the table modification operation on the first data table was successful.

[0016] Thirdly, embodiments of this application provide an electronic device, including:

[0017] Processor, adapted to implement computer instructions; and,

[0018] A memory that stores computer instructions adapted for loading by a processor and executing the method described in the first aspect above.

[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer instructions that, when read and executed by a processor of a computer device, cause the computer device to perform the method described in the first aspect.

[0020] Fifthly, embodiments of this application provide a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in the first aspect.

[0021] Through the above technical solution, the embodiments of this application can continue to perform the table modification operation already performed on the first data table by creating a second data table based on the first table structure string of the first data table, and determine whether the table modification operation on the first data table was successful based on the execution result of the table modification operation on the second data table. In this way, a single program script can be used to check the table structure change results in different scenarios. Therefore, developers do not need to write a check program script specifically for the characteristics of the table structure string. Thus, the embodiments of this application can provide a general and automated table structure change check solution, improve the efficiency of database table structure change check, and reduce labor costs. Attached Figure Description

[0022] Figure 1 This is an optional schematic diagram of the system architecture involved in an embodiment of this application;

[0023] Figure 2 A schematic flowchart illustrating a data processing method provided in an embodiment of this application;

[0024] Figure 3 A schematic flowchart illustrating another data processing method provided in an embodiment of this application;

[0025] Figure 4 This is a schematic block diagram of a data processing apparatus according to an embodiment of this application;

[0026] Figure 5 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0027] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0028] The solution provided in this application may involve cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize the computing, storage, processing, and sharing of data.

[0029] Cloud technology is a collective term for network technology, information technology, integration technology, management platform technology, and application technology applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can be achieved through cloud computing.

[0030] The solution provided in this application can also incorporate database technology. A database, simply put, can be viewed as an electronic filing cabinet, a place to store electronic files. Users can perform operations such as adding, querying, updating, and deleting data in the files. A "database" is a collection of data stored together in a certain way, capable of being shared by multiple users, with minimal redundancy, and independent of application programs.

[0031] A database consists of one or a group of tables. That is, the data in a database is organized in units of tables, and each table contains related data arranged in rows.

[0032] A Database Management System (DBMS) is a computer software system designed to manage databases, generally possessing basic functions such as storage, retrieval, security, and backup. DBMSs can be classified according to the database model they support, such as relational or Extensible Markup Language (XML); or according to the type of computer they support, such as server clusters or mobile devices; or according to the query language used, such as Structured Query Language (SQL) or XQuery; or according to performance priorities, such as maximum scale or maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, simultaneously supporting multiple query languages.

[0033] For example, relational databases can include MySQL, Oracle, SQLite, etc., without limitation.

[0034] The following is a brief introduction to the relevant terms used in this application.

[0035] 1) Database sharding and table partitioning: This is a database partitioning technique. Database sharding is the process of splitting a single database into multiple databases, distributing data across multiple databases; table partitioning is the process of splitting a single table into multiple tables, distributing data across multiple tables. Database sharding and table partitioning alleviate the performance bottlenecks and pressure on a single database or table by distributing data across more databases or tables.

[0036] Specifically, as the amount of data in a single database increases, the database's queries per second (QPS) also increases. Correspondingly, the time required for reading and writing to the database also increases. At this point, database read / write performance may become a bottleneck for business development, necessitating database performance optimization. One approach is to distribute the connection load across a single database through database sharding. For example, if the QPS is 3500, and assuming a single database can support 1000 connections, it could be split into four databases to distribute the query connection load.

[0037] If a single table contains a large amount of data, exceeding a certain threshold, bottlenecks may still exist for both data queries and updates, even after traditional database-level optimization methods such as index optimization. In this case, the data can be split into multiple tables according to certain rules to solve the access performance issues that cannot be resolved in a single-table environment.

[0038] 2) Table Structure: Also known as a table structure string, it is a descriptive string for a data table in a database. The table structure defines the basic attributes of a table, such as its fields, types, primary keys, and indexes. In this embodiment, a MySQL table structure is used as an example for illustration.

[0039] The following is a specific example of the table structure for the data table test_tabel_01:

[0040] CREATETABLE `test_tabel_01`(

[0041] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0042] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0043] `c_test`varchar(32)DEFAULT NULL COMMENT'Test field c',

[0044] PRIMARY KEY(`a_test`)

[0045] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0046] Here, `a_test`, `b_test`, and `c_test` are the fields of the table test_table_01, with int and varchar being the data types, and PRIMARY KEY being the primary key.

[0047] 3) Table modification operations: These refer to operations that modify the table structure of a database. Modifications to the table structure can include operations such as adding, modifying, and deleting data. Specifically, this can refer to operations such as adding, modifying, and deleting basic attributes such as fields, types, primary keys, and indexes within the table structure; this application does not limit this specific operation.

[0048] For example, table modification operations may include adding a type, adding an index, modifying a field, modifying a field type, modifying an index, modifying the storage engine, modifying the primary key, deleting a field, deleting an index, and deleting the primary key.

[0049] In this embodiment, the modification of a MySQL table structure is used as an example. For instance, the ALTER statement can be used to modify the table.

[0050] As a concrete example, a field `d_test` can be added to the data table t_test_db_{x}.t_test_table_{y} using the following ALTER statement:

[0051] ALTER TABLE t_test_db_{x}.t_test_table_{y}ADD COLUMN`d_test`int(11)DEFAULT NULL COMMENT'Test field d';

[0052] Where x corresponds to the range of the database and y corresponds to the range of the data table.

[0053] Continuing with the example above, after adding the field `d_test` to the data table `test_tabel_01` through the table modification operations described above, the table structure of `test_tabel_01` can be updated as follows:

[0054] CREATETABLE `test_tabel_01`(

[0055] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0056] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0057] `c_test`varchar(32)DEFAULT NULL COMMENT'Test field c',

[0058] `d_test`int(11)DEFAULT NULL COMMENT'Test field d',

[0059] PRIMARY KEY(`a_test`)

[0060] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0061] The above table modification operation of adding a field enables the addition of a new field to the database table structure. Generally, adding a field can also be referred to as adding a column, and this application does not limit this terminology.

[0062] It should be understood that this application uses a MySQL table structure as an example for illustration, but this application is not limited to this. For example, the table structure can also be that of other types of databases, such as Oracle databases, SQLite databases, etc. Accordingly, the specific table modification operations can be adapted to the corresponding database type.

[0063] In database operations and maintenance, when a database is changed, such as during data synchronization or database operations, it is necessary to check the results of the changes to avoid online service failures caused by unexpected changes.

[0064] Database changes can include creating a new database (i.e., database creation), creating new tables, and changing table structures. Table structure changes can be achieved through table modification operations. Checking the results of database and table creation changes is relatively simple; it can be done by checking if the database or table exists in the changed database. However, checking changes to table structures is more difficult.

[0065] For situations with small amounts of business data, table structure changes can be manually verified by DBAs or developers to ensure the changes meet expectations. However, for situations with large amounts of business data, such as table structure changes in financial-grade databases for third-party payment platforms, which require millions of table structure changes across thousands of database instances annually, manual verification for each change is clearly impractical.

[0066] In existing technologies, table structure changes can be checked through table structure string analysis. In this method, DBAs typically need to write targeted scripts based on their understanding of the database table structure to check batches of table structure changes.

[0067] To effectively illustrate the technical solution for string analysis of table structures, a specific example is provided.

[0068] Suppose that the business logic creates a batch of 1000 databases and 10 tables (i.e., tables with identical structures) using database sharding and table partitioning. The sharding rule is t_test_db_{x}.t_test_table_{y}, where x corresponds to 00-99, y corresponds to 0-9, and the table range is:

[0069] t_test_db_00.t_test_table_0

[0070] t_test_db_00.t_test_table_1 ......

[0072] t_test_db_99.t_test_table_9

[0073] If the table structure of these 1000 tables is changed and the changes are manually confirmed one by one, the efficiency will be very low and oversights are likely to occur.

[0074] In real-world business scenarios, it is often necessary to change the structure of tens of thousands of tables. Therefore, writing programs to check the results of table structure changes becomes indispensable.

[0075] One approach is to retrieve the table structure (i.e., the table structure string) to be validated from the online database for analysis. For example, the table structure string for a specified database table can be retrieved using the SQL statement: `show create table {database name}.{table name}`. Specifically, the table structure can be obtained using the SQL statement: `show create table t_test_db_00.t_test_table_0\G`.

[0076] CREATE TABLE `test_table_01`(

[0077] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0078] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0079] `c_test`varchar(32)DEFAULT NULL COMMENT'Test field c',

[0080] PRIMARY KEY(`a_test`)

[0081] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0082] Suppose the business logic involves adding a field to any of the 1000 tables mentioned above:

[0083] ALTER TABLE t_test_db_{x}.t_test_table_{y}ADD COLUMN`d_test`int(11)DEFAULT NULL COMMENT'Test field d';

[0084] Accordingly, the table structure above is changed as follows:

[0085] CREATE TABLE `test_table_01`(

[0086] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0087] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0088] `c_test`varchar(32)DEFAULT NULL COMMENT'Test field c',

[0089] `d_test`int(11)DEFAULT NULL COMMENT'Test field d',

[0090] PRIMARY KEY(`a_test`)

[0091] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0092] When using table structure string analysis to check the results of changes to the table structure of the above 1000 tables, the modified table structure strings of the 1000 tables can be obtained by connecting to the online database. The success of the table modification operation by analyzing whether the table structure string contains "d_test" can be determined.

[0093] As can be seen, the table structure string analysis method relies on the developer's understanding of the database table structure to perform targeted programming. For example, when the newly added field name is "e_test" in the above example, the developer needs to modify the program script to determine whether the table structure string contains "e_test" in order to determine whether the table modification operation of adding the field was successful.

[0094] Therefore, when checking for table structure changes by analyzing the table structure string, it is necessary to manually understand the definition of the table structure and write a check program script based on the characteristics of the table structure string. This has the problems of high customization and difficulty in automation, and it is impossible to make a single script adaptable to different table modification scenarios.

[0095] Additionally, when performing table structure string matching, errors can easily occur if other field names or comments also contain the strings that need to be matched.

[0096] In view of this, the embodiments of this application provide a data processing solution that can provide a general and automated method to check changes in database table structure, improve the efficiency of checking database table structure changes, and reduce labor costs.

[0097] Specifically, the system can obtain the first table structure string of the first table in the first database, and create a second table in the second database based on this first table structure string, where the first table has already undergone a table modification operation. Then, the system can perform the table modification operation on the second table and obtain the execution result. This execution result indicates either success or an error in the database management system. Finally, based on the execution result, the system can determine whether the table modification operation on the first table was successful.

[0098] The first database can be a database corresponding to an online service, or it can serve an application for a specific organization. It can also be called a real database, an online database, etc. The second database includes a second data table created based on the structure string of the first table of the first data table. It is not a database corresponding to an online service, and it does not need to serve an application for a specific organization. It can also be called a temporary database.

[0099] The second data table is created based on the first table structure string of the first data table. Therefore, the basic attributes of the second data table are the same as those of the first data table. Based on this, the changes to the table structure in the first database can be checked using the second data table.

[0100] In this embodiment, performing the table modification operation on the second data table is equivalent to continuing the table modification operation on the first data table, which has already undergone the same operation, without affecting the online business corresponding to the first data table. In this case, if the table modification operation is not repeatable and the operation on the first data table is successful, the database management system will report an error when performing the same table modification operation on the second data table due to repeated execution of the same operation. If the table modification operation is repeatable and the operation on the first data table is successful, although the operation on the second data table will be successful, the table structure of the second data table will not change when the same operation is repeatedly performed on it. Based on this, the success of the table modification operation on the first data table can be determined by the execution result of the table modification operation on the second data table.

[0101] Therefore, this application embodiment continues to perform the table modification operation already performed on the first data table on the second data table created based on the first table structure string of the first data table, and determines whether the table modification operation on the first data table was successful based on the execution result of the table modification operation on the second data table. This enables a single program script to adapt to the table structure change result check in different scenarios. Therefore, developers do not need to write a check program script specifically for the characteristics of the table structure string. Thus, this application embodiment can provide a general and automated table structure change check scheme, improve the efficiency of database table structure change check, and reduce labor costs.

[0102] As an example, this application embodiment can be applied to scenarios involving large volumes of business data, such as table structure changes in financial-grade databases of third-party payment platforms. In such scenarios, when facing millions of table structure changes across thousands of database instances, the general and automated table structure change checking scheme provided in this application embodiment can be adopted. For example, for a data table in an online business database that has already undergone a table modification operation, the table structure string of the data table can be obtained, and a temporary data table can be created in a temporary database based on the table structure string. This temporary data table can be used to check the change results of the aforementioned data table that has already undergone the table modification operation. Specifically, for this temporary data table, the table modification operation can be performed on it, and based on the execution result of the table modification operation, it can be determined whether the table modification operation on the aforementioned data table was successful, thereby realizing the checking of the change results of the table modification operation on the aforementioned data table. For example, if the database management system reports an error when the table modification operation is performed on the temporary data table, it indicates that the same table modification operation was repeatedly performed on the temporary data table, and in this case, the table modification operation on the aforementioned data table can be considered successful. For example, if the modification operation on the temporary data table is successful and the table structure of the temporary data table remains unchanged after the modification operation is performed, it means that the same modification operation has been performed on the temporary data table again. In this case, the modification operation on the aforementioned data table can be considered successful.

[0103] Therefore, the table structure change inspection scheme provided in this application embodiment can make the table structure change and inspection mechanism of the entire financial-grade database more complete, reduce or avoid the occurrence of anomalies during the table structure change process, improve the security and reliability of the database, and reduce the manpower cost required for database table structure changes. For example, it can truly realize the requirement of "every operation must be checked" for financial-grade database table structure change work orders.

[0104] Figure 1 This is an optional schematic diagram of the system architecture 10 involved in an embodiment of this application.

[0105] System architecture 10 could be, for example, a database management system. Figure 1 As shown, the system architecture 10 includes a database 11 and a computing module 12.

[0106] Database 11 can be used to store electronic documents. Database 11 can serve the applications of a specific organization, such as storing data for that organization's applications. Users can perform operations such as adding, querying, updating, and deleting data in the files of Database 11. In response to user operations such as adding, updating, and deleting data in the files of Database 11, the table structure of the data tables in Database 11 changes.

[0107] The calculation module 12 can be used to check the changes to the table structure of the data tables in the database 11 to ensure the accuracy of the changes to the database table structure and to minimize the possibility of online service failures caused by unexpected changes to the database 11.

[0108] In one embodiment of this application, the calculation module 12 can obtain the first table structure string of the first data table in the first database (an example of the database in database 11) that has already undergone a table modification operation, and create a second data table in the second database (another example of the database in database 11) based on the first table structure string, and determine whether the table modification operation on the first data table was successful based on the execution result of the table modification operation on the second data table, thereby realizing the checking of the change result of the table modification operation on the first data table.

[0109] Figure 1 The system architecture 10 can be set up on a server. The application corresponding to the database 11 for a specific organization can be set up on a terminal; this application does not impose any restrictions on this.

[0110] There may be one or more servers. When there are multiple servers, at least two servers are used to provide different services, and / or at least two servers are used to provide the same service, such as providing the same service in a load-balanced manner. This application does not limit this.

[0111] The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The server can also be a node in the blockchain. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, in-vehicle terminal, smart TV, etc., but is not limited to these. The terminal and server can be connected directly or indirectly through wired or wireless communication, which is not restricted in this application.

[0112] The solutions provided in the embodiments of this application are described below with reference to the accompanying drawings.

[0113] Figure 2 This is a schematic flowchart illustrating a data processing method 200 provided in an embodiment of this application. Method 200 can be executed by any electronic device with data processing capabilities. For example, the electronic device can be implemented as a server or terminal device; or, for example, the electronic device can be implemented as... Figure 1The calculation module 12 in the application is not limited in this respect. Figure 2 As shown, method 200 may include steps 210 to 240.

[0114] 210. Obtain the first table structure string of the first data table in the first database, where the first data table has already undergone the table operation.

[0115] The first database can be a database corresponding to online business operations, a service for an application of a specific organization, or simply a physical database or online database; there are no limitations on its usage. For example, the online business could include the business of a third-party payment platform, meaning the first database could be a financial-grade database of that platform. Users can perform operations such as adding, querying, updating, and deleting electronic files (e.g., data tables) stored in the first database.

[0116] For example, the first database can be a MySQL database, an Oracle database, a SQLite database, etc., without limitation.

[0117] In this embodiment of the application, the first data table in the first database is a data table that has already undergone a table modification operation, meaning that the table modification operation has been performed on the first data table before step 210. Here, the first data table can also be referred to as the modified data table. After the table modification operation is performed on the first data table, this embodiment of the application needs to check (or verify) the table structure change result of the first data table. At this time, the first data table is the data table to be checked (or verified).

[0118] For details on modifying the table, please refer to the relevant description above, which will not be repeated here.

[0119] The first table structure string (i.e., table structure) of the first data table defines the basic attributes of the first data table, such as fields, types, primary keys, and indexes. For example, when the first database is MySQL, the first table structure string of the first data table can be obtained by using SHOWCREATTABLE `database_name`.`table_name`.

[0120] As a concrete example, for the first data table #1, such as the data table test_tabel_01, you can obtain the following first table structure string #1 by using SHOWCREATETABLE`test_tabel_01`:

[0121] SHOWCREATETABLE`test_tabel_01`(

[0122] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0123] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0124] `c_test`varchar(32)DEFAULT NULL COMMENT'Test field c',

[0125] `d_test`int(11)DEFAULT NULL COMMENT'Test field d',

[0126] PRIMARY KEY(`a_test`)

[0127] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0128] Before obtaining the first table structure string #1, the table modification operation of adding the field "d_test" had already been performed on the data table test_tabel_01.

[0129] As another concrete example, for the first data table #2, such as the data table test_tabel_02, the following first table structure string #2 can be obtained by SHOWCREATETABLE `test_tabel_02`:

[0130] SHOWCREATETABLE`test_tabel_02`(

[0131] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0132] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0133] `e_test`varchar(32)DEFAULT NULL COMMENT'Test field e',

[0134] PRIMARY KEY(`a_test`)

[0135] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0136] Before obtaining the first table structure string #2, a table modification operation was performed on the field of the fourth row of the data table test_tabel_02, changing the field to "e_test".

[0137] 220. Based on the structure string of the first table, create a second data table in the second database.

[0138] The second database includes a second data table created based on the first table structure string of the first data table in the first database. This second database is not the database corresponding to the online service and does not need to serve any specific organization's application; it can also be called a temporary database. Accordingly, users cannot perform operations such as adding, querying, updating, or deleting electronic files (such as data tables) stored in this second database. This second data table in the second database can also be called a temporary data table.

[0139] It should be noted that the second database and the first database may exist in the same database or in different databases, and this application does not limit this; the versions of the second database and the first database may be the same or different, and this application does not limit this.

[0140] In this embodiment, the second data table is created based on the first table structure string of the first data table; therefore, the basic attributes of the second data table are the same as those of the first data table. For example, when the version of the second database is the same as the version of the first database, the table structure string of the second data table is the same as that of the first data table. As another example, when the version of the second database is different from that of the first database, although the table structure string of the second data table may differ from that of the first data table, the basic attributes of the second data table are the same as those of the first data table. Based on this, this embodiment can utilize the second data table to check the changes to the table structure in the first database.

[0141] For example, when the second database is MySQL, a second data table can be created using CREATTABLE `database_name`.`table_name`, where the second table structure string of the second data table is the same as the first table structure string of the first data table.

[0142] Continuing with the example above, based on the first table structure string #1, we can create a second table #1 in the second database with the following table structure string using CREATETABLE `test_table_01`:

[0143] CREATETABLE `test_tabel_01`(

[0144] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0145] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0146] `c_test`varchar(32)DEFAULT NULL COMMENT'Test field c',

[0147] PRIMARY KEY(`a_test`)

[0148] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0149] For example, based on the structure string #2 of the first table, a second data table #2 with the following table structure string can be created in the second database using CREATETABLE `test_table_02`:

[0150] CREATETABLE `test_tabel_02`(

[0151] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0152] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0153] `e_test`varchar(32)DEFAULT NULL COMMENT'Test field e',

[0154] PRIMARY KEY(`a_test`)

[0155] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0156] 230. Perform the table modification operation on the second data table and obtain the execution result of the table modification operation on the second data table. The execution result is used to indicate that the table modification operation was successful or to indicate that the database management system reported an error.

[0157] Since the basic attributes of the second data table are the same as those of the first data table, this embodiment of the application performs a table modification operation on the second data table, which is equivalent to continuing to perform the same table modification operation on the first data table that has already been modified, and will not affect the online business corresponding to the first data table.

[0158] In some embodiments, if the table modification operation is a non-repeatable operation, and the table modification operation on the first data table is successful, the database management system will report an error when performing the table modification operation on the second data table because the same table modification operation is being executed repeatedly. That is, the result of performing the table modification operation on the second data table in this case is an error reported by the database management system.

[0159] For example, if the operation to add a field "d_test" to the second data table #1 is executed again, the database management system will report an error. As an example, the system might display the message: "Error adding a field with the same name 'd_test' to the second data table #1 again!!!"

[0160] For example, operations that cannot be repeated may include at least one of adding a field, adding an index, deleting a field, and deleting an index.

[0161] In other embodiments, if the table modification operation is a repeatable operation, and the table modification operation is successful when performed on the first data table, then performing the table modification operation on the second data table will also be successful. It is understood that although the table modification operation is successful on the second data table at this time, the table structure of the second data table will not change when the same table modification operation is repeatedly performed on the second data table.

[0162] For example, regarding the second data table #2 mentioned above, if we continue to perform the table modification operation of changing the field in the fourth row of the data table to the field "e_test", the table modification operation can still be successfully performed on the second data table #2, that is, continuing to modify the field in the fourth row of the second data table #2 to "e_test". In this case, the table structure of the second data table #2 will not change.

[0163] For example, operations that can be performed repeatedly may include at least one of modifying a field, modifying a field type, modifying an index, modifying a storage engine, and modifying a primary key.

[0164] 240. Based on the execution result, determine whether the table modification operation on the first data table was successful.

[0165] Therefore, this application embodiment continues to perform the table modification operation already performed on the first data table on the second data table created based on the first table structure string of the first data table, and determines whether the table modification operation on the first data table was successful based on the execution result of the table modification operation on the second data table. This enables a single program script to adapt to the table structure change result check in different scenarios. Therefore, developers do not need to write a check program script specifically for the characteristics of the table structure string. Thus, this application embodiment can provide a general and automated table structure change check scheme, improve the efficiency of database table structure change check, and reduce labor costs.

[0166] In some embodiments, if the result of performing the table modification operation on the second data table is an error reported by the database management system, it indicates that the table modification operation on the first data table was successful.

[0167] Accordingly, this table modification operation is a non-repeatable operation, which may include at least one of the following: adding a field, adding an index, deleting a field, and deleting an index.

[0168] Continuing with the example above, for the second table structure #1, when the operation to add the field "d_test" is executed and the database management system reports an error, it can be determined that the operation to add the field "d_test" to the first data table was successful.

[0169] It should be understood that the above example illustrates the non-repeatable table modification operation of adding a field, but the embodiments of this application are not limited to this. This non-repeatable table modification operation can also be at least one of adding an index, deleting a field, or deleting an index.

[0170] In other embodiments, if the table modification operation on the second data table is successful, it is necessary to further determine whether the table structure of the second data table has changed after the table modification operation was performed. Furthermore, the success of the table modification operation on the first data table can be determined based on whether the table structure of the second data table has changed.

[0171] Correspondingly, this table modification operation is one that can be performed repeatedly, and may include at least one of the following: modifying a field, modifying a field type, modifying an index, modifying a storage engine, or modifying a primary key.

[0172] As an example, if the table modification operation on the second data table is successful, then the second table structure string of the third data table is obtained, where the third data table is the data table after the table modification operation was successfully performed on the second data table. Then, based on the second table structure string, it can be determined whether the table modification operation on the first data table was successful.

[0173] Continuing with the example above, for the second table structure #2, by modifying the field in the fourth row of the data table to "e_test", we can obtain the third data table #1. For the third table #1, we can obtain the following second table structure string #1 using SHOWCREATETABLE `test_table_02`:

[0174] SHOWCREATETABLE`test_tabel_02`(

[0175] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0176] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0177] `e_test`varchar(32)DEFAULT NULL COMMENT'Test field e',

[0178] PRIMARY KEY(`a_test`)

[0179] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0180] As one possible implementation, the structure string of the third table of the second data table can also be obtained. If the structure string of the third table is the same as the structure string of the second table, then the table modification operation on the first data table is considered successful; if the structure string of the third table is different from the structure string of the second table, then the table modification operation on the first data table is considered to have failed.

[0181] For example, after creating a second data table in a second database, and before performing the table modification operation on that second data table, the third table structure string of the second data table can be obtained.

[0182] For example, in step 220 above, for the second data table #2, the following third table structure string #1 can be obtained by SHOWCREATETABLE`test_table_02`:

[0183] CREATETABLE `test_tabel_02`(

[0184] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0185] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0186] `e_test`varchar(32)DEFAULT NULL COMMENT'Test field e',

[0187] PRIMARY KEY(`a_test`)

[0188] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0189] Then, the structure string #1 of the second table and the structure string #1 of the third table can be compared. In this example, the structure string #1 of the second table and the structure string #1 of the third table are the same, thus confirming that the field in the fourth row of the data table test_table_02 in the first database has been successfully modified to the field "e_test".

[0190] As another concrete example, when the obtained third table structure string #2 is as follows:

[0191] CREATETABLE `test_tabel_02`(

[0192] `a_test`int(11)unsigned NOT NULL AUTO_INCREMENT COMMENT'Test field a',

[0193] `b_test`varchar(32)DEFAULT NULL COMMENT'Test field b',

[0194] `c_test`varchar(32)DEFAULT NULL COMMENT'Test field c',

[0195] PRIMARY KEY(`a_test`)

[0196] )ENGINE=InnoDB DEFAULT CHARSET=utf8;

[0197] At this point, the structure string #2 of the third table is different from the structure string #1 of the second table mentioned above. It can be assumed that the modification of the field "e_test" in the fourth row of the data table test_table_02 in the first database was unsuccessful.

[0198] It should be understood that the above example illustrates a table modification operation that can be repeatedly performed on a data table, specifically modifying a field. However, the embodiments of this application are not limited to this. The repeatedly performed table modification operation can also be at least one of modifying a field type, modifying an index, modifying a storage engine, or modifying a primary key.

[0199] It should be noted that, in this embodiment, the success of the table modification operation on the first data table is determined by comparing whether the third table structure string of the second data table in the second database is consistent with the second table structure string, rather than by comparing whether the first table structure string of the first data table in the first database is consistent with the second table structure string. This effectively shields the interference of character set and database version on database table structure change checks, thereby improving the accuracy of database table structure change checks.

[0200] Specifically, in scenarios where table structure strings contain Chinese characters, setting different character sets may result in different strings for the table structure. For example, some character sets may display Chinese characters correctly, while others may display garbled characters. However, when the third table structure string of the second data table is obtained from the same environment (i.e., the second database) as the second table structure string of the third data table, setting the same character set can yield the same table structure string, effectively shielding the character set from interfering with database table structure change checks.

[0201] Furthermore, when the version of the second database (i.e., the temporary database) used for verification is inconsistent with the version of the first database (i.e., the online database), it may lead to inconsistencies in the final table structure representation. For example, an `int(11)` created in MySQL 5.7 can only be an `int` in MySQL 5.7. However, when the third table structure string of the second data table is obtained from the same environment (i.e., the second database) as the second data table's second table structure string, both corresponding to the MySQL version of the second database and using the same representation of the table structure string, the interference of the database version on the database table structure change check can be effectively shielded.

[0202] In other embodiments, such as when the first and second databases are the same version, or when the table structure string does not contain Chinese characters, the success of the table modification operation on the first data table can be determined by comparing the first table structure string with the second table structure string. For example, if the first table structure string and the second table structure string are the same, the table modification operation on the first data table is determined to have been successfully performed; if the first table structure string and the second table structure string are different, the table modification operation on the first data table is determined to have failed.

[0203] Figure 3 This is a schematic flowchart of another data processing method 300 provided in this application embodiment. Method 300 can be executed by any electronic device with data processing capabilities. For example, the electronic device can be implemented as a server or terminal device; or, for example, the electronic device can be implemented as... Figure 1 The calculation module 12 in this application is not limited in this respect.

[0204] It should be understood that Figure 3 The steps or operations of a data processing method are illustrated, but these steps or operations are merely examples, and other operations may be performed in the embodiments of this application. Figure 3 Variations of various operations within it. Furthermore... Figure 3 The various steps in can be followed according to... Figure 3 The different orders in which they are presented may be executed, and it is possible that they are not intended to be executed. Figure 3 All operations within.

[0205] like Figure 3 As shown, method 300 may include steps 301 to 308.

[0206] 301, retrieve the table structure of the change table to be verified from the online database.

[0207] For example, the online database is an example of the first database in method 200, and the modified table is an example of the first data table in method 200. Here, the modified table has already undergone a table modification operation before its table structure is obtained.

[0208] As an example, you can retrieve the table structure of the modified table using `SHOWCREATTABLE `database_name`.`table_name`. Here, `database_name` can be the name of the online database, and `table_name` is the name of the modified table.

[0209] 302. Create a temporary data table in the temporary database.

[0210] For example, the temporary database is an example of the second database in method 200, and the temporary data table is an example of the second data table in method 200. Here, the temporary data table can be created in the temporary database according to the table structure in step 301.

[0211] As an example, this temporary data table can be created using `CREATETABLE `database_name`.`table_name`, where the table structure string of this temporary data table is the same as the table structure string of the changed table obtained in step 301. Here, `database_name` can be the name of the temporary database, and `table_name` is the name of the temporary data table, which can be the same as the name of the changed table in step 301.

[0212] 303, retrieve the table structure V1 of the temporary data table.

[0213] As an example, the table structure V1 of the temporary data table can be obtained using SHOWCREATTABLE `database_name`.`table_name`. Here, `database_name` can be the name of the temporary database, and `table_name` can be the name of the temporary data table mentioned above.

[0214] 304 indicates that a table modification operation was performed on the temporary data table.

[0215] Here, the table modification operation is the same as the table modification operation performed on the table before obtaining the table structure of the modified table in step 301.

[0216] 305, check if there is an error.

[0217] When an error occurs when performing a table modification operation on a temporary data table, the check result is: the table modification was successful, meaning that the table modification operation performed on the modified table before step 301 was successful.

[0218] Specifically, if the table modification operation performed on the modified table before step 301 is an operation that cannot be repeated, and the table modification operation on the temporary data table fails, it means that the same table modification operation was repeatedly performed on the temporary data table, thus indicating that the table modification operation performed on the modified table before step 301 was successful.

[0219] If no errors occur when performing the table modification operation on the temporary data table, you can continue to step 306.

[0220] 306, Get the table structure V2 of the temporary data table.

[0221] For example, the temporary data table at this time, that is, the temporary data table that has performed the same table modification operation as the modified table, is an example of the third data table in method 200.

[0222] As an example, the table structure V2 of the temporary data table can be obtained using SHOWCREATTABLE `database_name`.`table_name`. Here, `database_name` can be the name of the temporary database, and `table_name` can be the name of the temporary data table mentioned above.

[0223] 307, Compare table structure V1 and table structure V2.

[0224] As an example, the string corresponding to table structure V1 can be compared with the string corresponding to table structure V2.

[0225] 308, check if they match.

[0226] When the strings of table structure V1 and table structure V2 are consistent, the check result is: the table modification was successful, that is, the table modification operation performed on the modified table before step 301 was successful.

[0227] Specifically, when the table modification operation performed on the change table before step 301 is a repeatable operation, the table structure V2 of the temporary data table after the table modification operation is performed is the same as the table structure V1 of the temporary data table when no table modification operation is performed. That is, when the same table modification operation is repeatedly performed on the temporary data table, the table structure of the temporary data table does not change. Therefore, it can be determined that the table modification operation performed on the change table before step 301 is successful.

[0228] When the strings of table structure V1 and table structure V2 are inconsistent, the check result is: the table modification operation failed, that is, the table modification operation performed on the modified table before step 301 failed.

[0229] Specifically, if the table modification operation performed on the changed table before step 301 is a repeatable operation, the table structure V2 of the temporary data table after the table modification operation is performed is different from the table structure V1 of the temporary data table when no table modification operation is performed. That is, the table structure of the temporary data table has changed. This indicates that the table modification operation performed on the temporary data table in step 304 is different from the table modification operation performed on the changed table before step 301. Therefore, it can be determined that the table modification operation performed on the changed table before step 301 failed.

[0230] Therefore, this application embodiment continues to perform the table modification operation already performed on the first data table on the second data table created based on the first table structure string of the first data table, and determines whether the table modification operation on the first data table was successful based on the execution result of the table modification operation on the second data table. This enables a single program script to adapt to the table structure change result check in different scenarios. Therefore, developers do not need to write a check program script specifically for the characteristics of the table structure string. Thus, this application embodiment can provide a general and automated table structure change check scheme, improve the efficiency of database table structure change check, and reduce labor costs.

[0231] The specific embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solutions of this application, and these simple modifications all fall within the protection scope of this application. For example, the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this application will not describe the various possible combinations separately. Furthermore, various different embodiments of this application can also be arbitrarily combined, as long as they do not violate the spirit of this application, they should also be considered as the content disclosed in this application.

[0232] It should also be understood that, in the various method embodiments of this application, the sequence numbers of the above processes do not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. It should be understood that these sequence numbers can be interchanged where appropriate so that the embodiments of this application described can be implemented in a sequence other than those illustrated or described.

[0233] The above text combined Figures 1 to 3 The method embodiments of this application are described in detail below, in conjunction with... Figures 4 to 5 The following describes in detail the device embodiments of this application.

[0234] Figure 4 This is a schematic block diagram of a data processing apparatus 400 according to an embodiment of this application. Figure 4 As shown, the device 400 may include an acquisition unit 410, a creation unit 420, a table modification unit 430, and a determination unit 440.

[0235] The acquisition unit 410 is used to acquire the first table structure string of the first data table of the first database, wherein the first data table has been subjected to the table modification operation;

[0236] Creation unit 420 is used to create a second data table in the second database based on the first table structure string;

[0237] The table modification unit 430 is used to perform the table modification operation on the second data table and obtain the execution result of the table modification operation on the second data table, wherein the execution result is used to indicate that the table modification operation was successful or to indicate that the database management system reported an error.

[0238] The determining unit 440 is used to determine whether the table modification operation on the first data table was successful based on the execution result.

[0239] In some embodiments, the determining unit 440 is specifically used for:

[0240] If the execution result is used to indicate an error to the database management system, then the table modification operation on the first data table is determined to have been successfully performed.

[0241] In some embodiments, the table modification operation includes at least one of adding a field, adding an index, deleting a field, and deleting an index.

[0242] In some embodiments, the determining unit 440 is specifically used for:

[0243] If the execution result is used to indicate that the table modification operation was successful, then the second table structure string of the third data table is obtained, wherein the third data table is the data table after the table modification operation was successfully executed on the second data table;

[0244] Based on the second table structure string, determine whether the table modification operation on the first data table was successful.

[0245] In some embodiments, the determining unit 440 is specifically used for:

[0246] Obtain the structure string of the third table from the second data table;

[0247] If the structure string of the third table is the same as the structure string of the second table, then the table modification operation on the first data table is successfully performed.

[0248] If the structure string of the third table is inconsistent with the structure string of the second table, then the operation of modifying the table on the first data table is determined to have failed.

[0249] In some embodiments, the table modification operation includes at least one of modifying a field, modifying a field type, modifying an index, modifying a storage engine, and modifying a primary key.

[0250] In some embodiments, the first database includes a database corresponding to online services, and the second database is a database different from the first database.

[0251] In some embodiments, the online business includes the business of a third-party payment platform.

[0252] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details are omitted here. Specifically, when the data processing device 400 in this embodiment can correspond to the execution body that performs the method 200 of the embodiments of this application, the aforementioned and other operations and / or functions of each module in the device 400 are respectively for implementing Figure 2 The corresponding processes of each method in the document will not be elaborated here for the sake of brevity.

[0253] The apparatus and system of this application embodiments have been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that these functional modules can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the methods disclosed in this application embodiments can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.

[0254] like Figure 5 This is a schematic block diagram of the electronic device 500 provided in the embodiments of this application.

[0255] like Figure 5 As shown, the electronic device 500 may include:

[0256] The system includes a memory 510 and a processor 520. The memory 510 stores computer programs and transfers the program code to the processor 520. In other words, the processor 520 can retrieve and run the computer program from the memory 510 to implement the methods described in the embodiments of this application.

[0257] For example, the processor 520 can be used to execute the steps of each execution entity in the method 200 described above according to the instructions in the computer program.

[0258] In some embodiments of this application, the processor 520 may include, but is not limited to:

[0259] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0260] In some embodiments of this application, the memory 510 includes, but is not limited to:

[0261] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0262] In some embodiments of this application, the computer program may be divided into one or more modules, which are stored in the memory 510 and executed by the processor 520 to perform the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the electronic device 500.

[0263] Optionally, the electronic device 500 may also include:

[0264] Communication interface 530, which can be connected to processor 520 or memory 510.

[0265] The processor 520 can control the communication interface 530 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. For example, the communication interface 530 may include a transmitter and a receiver. The communication interface 530 may further include antennas, and the number of antennas may be one or more.

[0266] It should be understood that the various components in the electronic device 500 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.

[0267] According to one aspect of this application, a communication device is provided, including a processor and a memory for storing a computer program, the processor for calling and running the computer program stored in the memory, causing the encoder to perform the method of the above-described method embodiment.

[0268] According to one aspect of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.

[0269] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in the above-described method embodiments.

[0270] In other words, when implemented using software, it can be implemented wholly or partially in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0271] It should be understood that in the embodiments of this application, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information.

[0272] In the description of this application, unless otherwise stated, "at least one" means one or more, and "multiple" means two or more. Additionally, "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0273] It should also be understood that the descriptions of "first", "second", etc. appearing in the embodiments of this application are only for illustration and to distinguish the objects being described, and there is no order to them. They do not indicate any special limitation on the number of devices in the embodiments of this application, and cannot constitute any limitation on the embodiments of this application.

[0274] It should also be understood that specific features, structures, or characteristics relating to embodiments in the specification are included in at least one embodiment of this application. Furthermore, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0275] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products, or devices.

[0276] It is understood that specific embodiments of this application may involve user information and other related data. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0277] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0278] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or modules may be electrical, mechanical, or other forms.

[0279] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0280] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data processing method, characterized in that, include: Obtain the first table structure string of the first data table in the first database, wherein the first data table has been modified by the table operation; Based on the structure string of the first table, create a second data table in the second database; Perform the table modification operation on the second data table and obtain the execution result of the table modification operation on the second data table, wherein the execution result is used to indicate that the table modification operation was successful, or to indicate that the database management system reported an error; Based on the execution result, determine whether the table modification operation on the first data table was successful.

2. The method according to claim 1, characterized in that, The step of determining whether the table modification operation on the first data table was successful based on the execution result includes: If the execution result is used to indicate an error to the database management system, then the table modification operation on the first data table is determined to have been successfully performed.

3. The method according to claim 2, characterized in that, The table modification operation includes at least one of adding a field, adding an index, deleting a field, and deleting an index.

4. The method according to claim 1, characterized in that, The step of determining whether the table modification operation on the first data table was successful based on the execution result includes: If the execution result is used to indicate that the table modification operation was successful, then the second table structure string of the third data table is obtained, wherein the third data table is the data table after the table modification operation was successfully executed on the second data table; Based on the second table structure string, determine whether the table modification operation on the first data table was successful.

5. The method according to claim 4, characterized in that, The step of determining whether the table modification operation on the first data table was successful based on the second table structure string includes: After creating the second data table in the second database, and before performing the table modification operation on the second data table, obtain the third table structure string of the second data table; If the structure string of the third table is the same as the structure string of the second table, then the table modification operation on the first data table is successfully performed. If the structure string of the third table is inconsistent with the structure string of the second table, then the operation of modifying the table on the first data table is determined to have failed.

6. The method according to claim 4 or 5, characterized in that, The table modification operation includes at least one of the following: modifying a field, modifying a field type, modifying an index, modifying a storage engine, and modifying a primary key.

7. The method according to claim 1, characterized in that, The first database includes the database corresponding to online business, and the second database is a different database from the first database.

8. The method according to claim 7, characterized in that, The online business includes the business of third-party payment platforms.

9. A data processing apparatus, characterized in that, include: The acquisition unit is used to acquire the first table structure string of the first data table of the first database, wherein the first data table has been subjected to the table operation; A creation unit is used to create a second data table in the second database based on the structure string of the first table. The table modification unit is used to perform the table modification operation on the second data table and obtain the execution result of the table modification operation on the second data table, wherein the execution result is used to indicate that the table modification operation was successful or to indicate that the database management system reported an error. The determining unit is used to determine, based on the execution result, whether the table modification operation on the first data table was successful.

10. An electronic device, characterized in that, The method includes a processor and a memory, wherein the memory stores instructions, and when the processor executes the instructions, it causes the processor to perform the method according to any one of claims 1-8.

11. A computer storage medium, characterized in that, Includes instructions that, when run on a computer, cause the computer to perform the method of any one of claims 1-8.

12. A computer program product, characterized in that, It includes computer program code that, when executed by an electronic device, causes the electronic device to perform the method of any one of claims 1-8.