WO2019041832A1 - 修改源数据库表结构的方法、服务器、系统及存储介质 - Google Patents

修改源数据库表结构的方法、服务器、系统及存储介质 Download PDF

Info

Publication number
WO2019041832A1
WO2019041832A1 PCT/CN2018/083879 CN2018083879W WO2019041832A1 WO 2019041832 A1 WO2019041832 A1 WO 2019041832A1 CN 2018083879 W CN2018083879 W CN 2018083879W WO 2019041832 A1 WO2019041832 A1 WO 2019041832A1
Authority
WO
WIPO (PCT)
Prior art keywords
table structure
database
metadata information
source database
source
Prior art date
Application number
PCT/CN2018/083879
Other languages
English (en)
French (fr)
Inventor
付军
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2019041832A1 publication Critical patent/WO2019041832A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/235Update request formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • the present application relates to the field of data synchronization technologies, and in particular, to a method, a server, a system, and a storage medium for automatically modifying a source database table structure.
  • the analyst generally needs to establish a development version according to the source database synchronization, modify the synchronization program in the same version time, including the construction of the script, synchronization script, etc., but at present, this operation process is complicated, the timing modification will consume more development manpower And easy to make mistakes.
  • the purpose of the present application is to provide a method, a server, a system and a storage medium for automatically modifying a source database table structure, so that the table structure of the target database can be automatically completed relative to the source database table structure.
  • the comparison and modification can reduce the labor cost and reduce the error rate in the data synchronization process.
  • a method for automatically modifying a source database table structure includes the following steps:
  • a script for modifying the table structure of the target database is generated according to the table structure change information, and the script of the table structure is sent to the target database for execution.
  • An application server that automatically modifies a source database table structure includes: a processor, a memory, a communication bus; and the memory stores a computer readable program executable by the processor;
  • the communication bus implements connection communication between the processor and the memory
  • the processor implements the steps in the method of automatically modifying the source database table structure as described above when the computer readable program is executed.
  • a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the automatic Steps in the method of modifying the source database table structure.
  • a system for automatically modifying a source database table structure comprising a plurality of source databases, a target database, and an application server for modifying a source database table structure as described above;
  • Each source database is used to synchronize metadata information to the target database on a daily basis
  • the application server is configured to receive metadata information that is pushed daily by each source database or target database, and save metadata information of at least two days; and compare the stored yen data information with yesterday metadata information, and determine a table structure. Whether there is a change; when the table structure changes, according to the table structure change information, a script for modifying the table structure of the target database is generated, and the script of the table structure is sent to the target database for execution.
  • the method for automatically modifying the source database table structure is pushed daily by receiving each source database or target database. Metadata information, and save at least the last two days of metadata information; after comparing the stored yen data information with yesterday's metadata information, determine whether the table structure changes; when the structure of the judgment table changes, according to the table structure change information, Generating a script that modifies the table structure of the target database, and sending the script of the table structure to the target database for execution, so that the table structure of the target database is automatically completed and compared with the table structure of the source database, so that the data is synchronized. In the process, both labor costs and error rates can be reduced.
  • FIG. 1 is a schematic diagram of an application environment of a method for automatically modifying a source database table structure provided by the present application.
  • FIG. 2 is a flow chart of a method for automatically modifying a source database table structure provided by the present application.
  • FIG. 3 is a flowchart of step S20 in the method for automatically modifying a source database table structure provided by the present application.
  • step S30 is a flowchart of step S30 in the method for automatically modifying a source database table structure provided by the present application.
  • FIG. 5 is a schematic diagram of an operating environment of a preferred embodiment of an application server for modifying a source database table structure provided by the present application.
  • FIG. 6 is a functional block diagram of a preferred embodiment of an application server for modifying a source database table structure according to the present application.
  • FIG. 7 is a structural block diagram of a system for modifying a source database table structure provided by the present application.
  • the purpose of the application is to provide a method, a server, a system and a storage medium for automatically modifying the structure of the source database table,
  • the table structure of the target database is automatically compared with the table structure of the source database, so that the labor cost can be reduced and the error rate can be reduced.
  • FIG. 1 is a schematic diagram of an application environment of a method for automatically modifying a source database table structure provided by the present application.
  • one or more applications can be installed in the application server to process related data.
  • the metadata information from the source database or the target database may be received by the application server, the metadata information is stored in the application server in the form of a list, and the current metadata information and the previously stored metadata are used by the application server.
  • Information comparison when the table structure changes, according to the table structure change information, generate a modification script to modify the target database to the target database, execute the modification script in the target database to modify the table structure, thereby realizing the automatic completion of the table structure of the target database Comparison and modification of the table structure relative to the source database.
  • the method for automatically modifying the source database table structure provided by the present application is described by using the method in the application server of FIG. 1 as an example, including the following steps:
  • the source database is an oracle database (the oracle database is also named Oracle) RDBMS, or Oracle for short, is a relational database management system from Oracle), MySQL (MySQL is an open source small relational database management system) database or PostgreSQL (PostgreSQL) Is a free object-relational database server database, the target database is hive (hive is a data warehouse tool based on Hadoop) database.
  • Oracle is also named Oracle
  • Oracle is also named Oracle
  • Oracle is a relational database management system from Oracle
  • MySQL MySQL is an open source small relational database management system
  • PostgreSQL PostgreSQL
  • hive is a data warehouse tool based on Hadoop
  • the application server is additionally configured to receive the metadata information pushed by each source database or the target database, and the subsequent processing of the metadata information is completed by the application server.
  • the metadata information is mainly various information of the front-end business system, such as various identity and deposit information of the customers of the banking system, and the metadata information is embodied by the table owner, table name, table comment, column name, column comment and Column order and other parts of the metadata information table.
  • step S10 the step of synchronizing the metadata information into the application server on a daily basis by each source database is also included.
  • each source database is connected to the application server, and Oozie is launched in the hive data warehouse for analysis (Oozie is a Java) Web application)
  • Timing synchronization task synchronizes the metadata information of multiple source databases of the front-end business system to the hive data warehouse and the application server every day at 2 am, when the application server directly receives the daily push elements from each source database. Data information and does not affect the daily data processing of the application server.
  • the metadata information may be synchronously synchronized to the target database by the respective source databases, and then the metadata information is pushed to the application server through the target database.
  • the metadata information of the multiple source databases of the front-end business system is synchronized to the hive data warehouse every day at 2 am, and then Pushed from the hive data warehouse to the application server.
  • the application server After the application server receives the metadata information of the current day, it will start the preset metadata comparison modification program, compare the metadata information of the day with the metadata information of the previous day, and obtain the new and modified table structure of each source database. And delete the information. Please refer to FIG. 2 , which is a flowchart of step S20 in the method for automatically modifying the source database table structure provided by the present application.
  • the step S20 includes:
  • the application server starts the metadata comparison modification program, and separates the yesterday metadata information and the current metadata information in the stored metadata information;
  • the table structure defines the fields, types, primary keys, foreign keys, and indexes of a table. These basic attributes form the table structure of the database.
  • the change of the table structure is mainly reflected in the change of the column name, such as adding or modifying the gender information column of the customer, the income status information column, etc., so in this embodiment, the table mainly focuses on the metadata information.
  • the owner's column names are compared.
  • FIG. 3 is a flowchart of step S30 in the method for automatically modifying the source database table structure provided by the present application.
  • the step S30 includes:
  • step S31 we can obtain that the column name of the source database table structure is deleted or modified at this time, so the comparison modification program will generate a table structure of the modified hive database and The script with the column name set to empty will be sent to the hive database for execution, and the corresponding column will be deleted on the target table of the hive database.
  • step S32 If the situation of step S32 occurs, we can get the case where the column name of the source database table structure is added or modified at this time, so the comparison modification program will extract this column, generate a table structure for modifying the hive database and add this in the corresponding position. The column script will then be sent to the hive database for execution, adding the corresponding column to the target table of the hive database.
  • the method further includes: ending the scheduled task of the current synchronization program, modifying the synchronization program to adapt to the table structure of the new source database; and initiating the scheduling task of the new synchronization program to the source database and/or the target database. step.
  • the original Oozie scheduling is killed (ie, ended), and the Oozie scheduled task is generated, and the Oozie API is called to be sent to the Oozie scheduling execution.
  • FIG. 5 is a schematic diagram of the internal structure of a computer device in an embodiment.
  • the computer device may be a terminal or a server, wherein the terminal may be a communication-enabled electronic device such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device.
  • the server can be a standalone server or a server cluster consisting of multiple servers.
  • the computer device includes a processor, a non-volatile storage medium, an internal memory, and a network interface connected by a system bus.
  • the non-volatile storage medium of the computer device can store an operating system and a computer readable program that, when executed, can cause the processor to perform a method of verifying the difficulty prediction.
  • the processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device.
  • the internal memory can store a computer readable program that, when executed by the processor, causes the processor to perform a method of verifying the difficulty prediction.
  • the network interface of the computer device is used for network communication, such as sending assigned tasks. It will be understood by those skilled in the art that the structure shown in FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied.
  • the specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • the application also provides an application server that automatically modifies the structure of the source database table, and includes a processor 10, a memory 20, and a display 30.
  • Figure 5 shows only some of the components of an application server that modify the source database table structure, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
  • the memory 20, in some embodiments, may be an internal storage unit of each component of the application server that modifies the source database table structure, such as a hard disk or memory of an application server.
  • the memory 20 may also be an external storage device of each component of the application server that modifies the source database table structure, such as a plug-in hard disk equipped on each component of the application server that modifies the source database table structure.
  • smart memory card Smart Media Card, SMC
  • flash card Flash
  • the memory 20 may also include an internal storage unit of the application server that modifies the source database table structure and an external storage device.
  • the memory 20 is configured to store application software and various types of data of an application server installed in the modified source database table structure, for example, the program code of the application server that installs the configuration of the modified source database table structure.
  • the memory 20 can also be used to temporarily store data that has been output or is about to be output.
  • the modified source database table structure program 40 is stored on the memory 20, and the modified source database table structure program 40 can be executed by the processor 10 to implement the modified source database table structure method of the embodiments of the present application.
  • the processor 10 may be a central processing unit (Central Processing Unit) in some embodiments.
  • the display 30 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic) in some embodiments. Light-Emitting Diode, organic light emitting diodes), etc.
  • the display 30 is for displaying information processed in the WeChat customer behavior feedback device and a user interface for displaying visualizations, such as an assignment information interface, an authentication report interface, and the like.
  • the components 10-30 of the WeChat customer behavior feedback device communicate with one another via a system bus.
  • a script for modifying the table structure of the target database is generated according to the table structure change information, and the script of the table structure is sent to the target database for execution.
  • the comparing stored Japanese yen data information and the yesterday metadata information, determining whether the table structure is changed includes:
  • the application server starts the metadata comparison modification program, and separates the yesterday metadata information and the current metadata information in the stored metadata information;
  • the column names of the respective table owners of the metadata information are compared one by one, and it is judged whether each column name exists in the yesterday metadata information and the today metadata information.
  • the step of comparing the column names of the respective table owners of the metadata information one by one, and determining whether each column name exists in the yesterday metadata information and the current metadata information includes:
  • Delete operation If a column name exists in the metadata information of yesterday and does not exist in today's metadata information, a script is generated to modify the table structure of the target database and set the column name to be empty at the corresponding location, and send it to the target database for execution. Delete operation
  • the method further includes:
  • Each source database periodically synchronizes metadata information to the application server.
  • the method further includes:
  • Each source database synchronizes the metadata information to the target database on a daily basis
  • the target database pushes metadata information to the application server.
  • the script for modifying the table structure of the target database is generated according to the table structure change information, and the script of the table structure is sent to the step executed in the target database, and further includes:
  • a scheduled scheduling task that initiates a new synchronization procedure to the source database and/or the target database.
  • FIG. 6 is a functional block diagram of a preferred embodiment of an application server for modifying a source database table structure program.
  • the installation modification source database table structure program may be divided into one or more modules, the one or more modules being stored in the memory and being processed by one or more processors (this embodiment) Executed for the processor) to complete the application.
  • an application server that installs a modified source database table structure program may be divided into a receiving module 31, a comparison analysis module 32, and a feedback modification module 33.
  • the module referred to in the present application refers to a series of computer program segments capable of performing a specific function, and is more suitable than the program to describe the execution process of the modified source database table structure program in the application server of the modified source database table structure.
  • the following description will specifically describe the functions of the modules 31-33.
  • the receiving module 31 is configured to receive metadata information that is pushed daily by each source database or the target database, and save metadata information of at least two days;
  • the comparison analysis module 32 is configured to compare the yen data information and the yesterday metadata information stored by the application server, and determine whether the table structure changes;
  • the feedback modification module 33 is configured to generate a script for modifying the table structure of the target database according to the table structure change information when the table structure is changed, and send the script of the table structure to the target database for execution.
  • the comparison analysis module 32 includes a separation unit and a comparison unit, wherein:
  • the separating unit is configured to separate the yesterday metadata information and the today metadata information in the metadata information stored by the application server.
  • the comparing unit is configured to compare the column names of the respective table owners of the metadata information one by one, and determine whether the column names exist in the yesterday metadata information and the today metadata information.
  • the feedback modification module 33 includes a deletion unit and an addition unit, wherein:
  • the deleting unit is configured to generate a table structure that modifies the target database and set the column name to be empty at a corresponding position when a column name exists in the metadata information of the yesterday and does not exist in the metadata information of the current day. , sent to the target database to perform the delete operation.
  • the adding unit is configured to: when a column name does not exist in the metadata information of the yesterday, and exists in the metadata information of the current day, extract the column name, generate a table structure of the modified target database, and add the column to the corresponding position
  • the name of the script is sent to the target database to perform the add operation.
  • the feedback modification module 33 further includes: a modification unit, configured to end a scheduled task of the current synchronization program, modify the synchronization program to adapt to the table structure of the new source database, and initiate a new to the source database and/or the target database.
  • a modification unit configured to end a scheduled task of the current synchronization program, modify the synchronization program to adapt to the table structure of the new source database, and initiate a new to the source database and/or the target database. The timing scheduling task of the synchronization program.
  • the present application further provides a system for modifying the structure of the source database table.
  • the method includes a plurality of source databases 110, a target database 120, and a modification.
  • the application server 130 of the source database table structure is not limited to the foregoing method and application server for automatically modifying the source database table structure.
  • the source database 110 is configured to synchronize metadata information into the target database on a daily basis.
  • the target database 120 is configured to push the metadata information into the application server.
  • the application server 130 is configured to receive metadata information that is pushed daily by each source database or target database, and save metadata information of at least two days; and compare the stored Japanese yen data information with yesterday metadata information, and determine a table. Whether the structure changes; when the table structure changes, according to the table structure change information, a script for modifying the table structure of the target database is generated, and the script of the table structure is sent to the target database for execution.
  • the target database 120 and the application server 130 directly interact with each other through the respective source databases.
  • the metadata information is synchronized to the target database through each source database, and then pushed to the application server by the target database.
  • the application server completes the analysis and processing of the metadata information, so that in the data synchronization process, the table structure of the target database is automatically completed and compared with the table structure of the source database by the application server.
  • the application server receives the metadata information pushed by each source database or the target database, and saves the metadata information of at least the last two days;
  • the application server compares the stored yen data information with the yesterday metadata information to determine whether the table structure has changed;
  • the application server When the table structure changes, the application server generates a script for modifying the table structure of the target database according to the table structure change information, and sends the script of the table structure to the target database for execution.
  • the application server compares the stored yen data information with the yesterday metadata information, and determines whether the table structure has a change process, including:
  • the application server starts the metadata comparison modification program, and separates the yesterday metadata information and the current metadata information in the stored metadata information;
  • the application server compares the column names of the respective table owners of the metadata information one by one, and determines whether the column names exist in the yesterday metadata information and the today metadata information.
  • the application server compares the column names of the respective table owners of the metadata information one by one, and determines whether each column name exists in the metadata information of the yesterday metadata information and the current metadata information, and includes:
  • the application server If a column name exists in the metadata information of yesterday and does not exist in today's metadata information, the application server generates a script that modifies the table structure of the target database and sets the column name to be empty at the corresponding location, and sends the script to the target database. Perform a delete operation;
  • the application server extracts the column name, generates a table structure that modifies the target database, and adds a script of the column name to the corresponding location, and sends Perform an add operation to the target database.
  • the workflow before the step of the application server receiving the metadata information that is pushed by the target database and storing the metadata information of the last two days, the workflow further includes:
  • Each source database periodically synchronizes metadata information to the application server.
  • the workflow before the step of the application server receiving the metadata information that the target database pushes daily and storing the metadata information of the last two days, the workflow further includes:
  • Each source database synchronizes the metadata information to the target database on a daily basis
  • the target database pushes metadata information to the application server.
  • the application server when there is a change in the table structure, the application server generates a script for modifying the table structure of the target database according to the table structure change information, and sends the script of the table structure to the execution step in the target database, and further includes:
  • the application server ends the scheduled scheduling task of the current synchronization program, and modifies the synchronization program to adapt to the table structure of the new source database;
  • the application server initiates a scheduled scheduling task of the new synchronization program to the source database and/or the target database.
  • the method for automatically modifying the source database table structure receives the metadata pushed daily by each source database or the target database. Information, and save at least the last two days of metadata information; then compare the stored yen data information with yesterday's metadata information to determine whether the table structure has changed; when the structure of the judgment table changes, generate changes according to the table structure change information A script of the table structure of the target database, and the script of the table structure is sent to the target database for execution. Thereby, the table structure of the target database is automatically completed and compared with the table structure of the source database, so that the labor cost can be reduced and the error rate can be reduced.
  • a computer program to instruct related hardware (such as a processor, a controller, etc.), and the program may be stored in a computer.
  • the program may include the flow of the method embodiments as described above when executed.
  • the storage medium described therein may be a memory, a magnetic disk, an optical disk, or the like.

Landscapes

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

Abstract

本申请公开了修改源数据库表结构的方法、服务器、系统及存储介质中,所述自动修改源数据库表结构的方法通过接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;之后对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;当判断表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。本申请在源数据库对目标数据库进行数据同步的过程中,使目标数据库的表结构自动完成相对于源数据库的表结构的对比及修改,从而既减少人力成本,又降低出错率。

Description

修改源数据库表结构的方法、服务器、系统及存储介质
本申请要求于2017年08月29日提交中国专利局、申请号为201710755733.X、发明名称为“修改源数据库表结构的方法、服务器、系统及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据同步技术领域,具体涉及自动修改源数据库表结构的方法、服务器、系统及存储介质。
背景技术
对业务系统进行数据分析前,首先需要获取业务系统的数据信息。为了不影响前端网络的性能,且前端网络的数据分散无法关联,影响分析,故需要将数据同步至数据仓库进行汇总,便于集中进行分析及处理。但是,业务系统的内容会由于业务需求的改变遭到更改,即对业务系统的数据进行同步的过程中会频繁遇到源数据库表结构修改的情况。
此时,一般需要分析人员根据源数据库同步建立开发版本,在同一版本时间修改同步程序,包括建表脚本,同步脚本等等,但目前,这个操作流程复杂,定时修改会耗费较多的开发人力,并且容易出错。
因此,现有技术还有待于改进和发展。
发明内容
鉴于上述现有技术的不足之处,本申请的目的在于提供一种自动修改源数据库表结构的方法、服务器、系统及存储介质,可使目标数据库的表结构自动完成相对于源数据库的表结构的对比及修改,从而在数据同步过程中,既可减少人力成本,又可降低出错率。
为了达到上述目的,本申请采取了以下技术方案:
一种自动修改源数据库表结构的方法,其包括如下步骤:
接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;
对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;
当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。
一种自动修改源数据库表结构的应用服务器,包括:处理器、存储器、通信总线;所述存储器上存储有可被所述处理器执行的计算机可读程序;
所述通信总线实现处理器和存储器之间的连接通信;
所述处理器执行所述计算机可读程序时实现如上述的自动修改源数据库表结构的方法中的步骤。
一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如上任意一项所述的自动修改源数据库表结构的方法中的步骤。
一种自动修改源数据库表结构的系统,包括若干个源数据库、目标数据库和如上所述的修改源数据库表结构的应用服务器;
各源数据库,用于每日定时将元数据信息同步至目标数据库中;
目标数据库,用于将元数据信息推送至应用服务器中;
所述应用服务器,用于接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;以及对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。
相较于现有技术,本申请提供的自动修改源数据库表结构的方法、服务器、系统及存储介质中,所述自动修改源数据库表结构的方法通过接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;之后对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;当判断表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行,从而使目标数据库的表结构自动完成相对于源数据库的表结构的对比及修改,使得在数据同步过程中,既可减少了人力成本,又可降低出错率。
附图说明
图1为本申请提供的自动修改源数据库表结构的方法的应用环境示意图。
图2为本申请提供的自动修改源数据库表结构的方法的流程图。
图3为本申请提供的自动修改源数据库表结构的方法中步骤S20的流程图。
图4为本申请提供的自动修改源数据库表结构的方法中步骤S30的流程图
图5为本申请提供的修改源数据库表结构的应用服务器的较佳实施例的运行环境示意图。
图6为本申请安装修改源数据库表结构的应用服务器的较佳实施例的功能模块图。
图7为本申请提供的修改源数据库表结构的系统的结构框图。
具体实施方式
鉴于现有技术中数据库的数据同步过程中操作流程复杂,耗费人力多且易出错的缺点,本申请的目的在于提供一种自动修改源数据库表结构的方法、服务器、系统及存储介质,通过使目标数据库的表结构自动完成相对于源数据库的表结构的对比及修改,使得在数据同步过程中,既可减少人力成本,又可降低出错率。
为使本申请的目的、技术方案及效果更加清楚、明确,以下参照附图并举实施例对本申请进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。
请参阅图1,其为本申请提供的自动修改源数据库表结构的方法的应用环境示意图。图1中,应用服务器中可安装一个或多个应用程序来处理相关数据。在本实施例中,可通过应用服务器接收来自源数据库或目标数据库的元数据信息,元数据信息以列表的形式存储在应用服务器中,并由应用服务器将当前元数据信息与之前存储的元数据信息对比,当表结构有变动时,根据表结构变动信息,生成修改目标数据库的修改脚本到目标数据库中,在目标数据库中执行修改脚本对表结构进行修改,从而实现目标数据库的表结构自动完成相对于源数据库的表结构的对比及修改。
请参阅图2,本申请提供的自动修改源数据库表结构的方法,以该方法应用于图1中的应用服务器为例进行说明,包括以下步骤:
S10、接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息。
优选的,所述源数据库为oracle数据库(oracle数据库又名Oracle RDBMS,或简称Oracle,是甲骨文公司的一款关系数据库管理系统),MySQL(MySQL是一个开放源码的小型关联式数据库管理系统)数据库或PostgreSQL(PostgreSQL 是一个自由的对象-关系数据库服务器)数据库,所述目标数据库为hive(hive是基于Hadoop的一个数据仓库工具)数据库。这些数据库均为常见且易于操作的数据库管理系统及工具,便于在本实施例中对数据进行分析及处理。
同时在本实施例中,通过额外设置应用服务器来接收各个源数据库或者目标数据库每日推送的元数据信息,并通过应用服务器完成对元数据信息的后续的处理。元数据信息主要为前端业务系统的各种信息,如银行业务系统的客户的各种身份及存款信息等,元数据信息体现在由表属主、表名称、表注释、列名称,列注释和列顺序等部分组成的元数据信息表中。
此外,在步骤S10之前,还包括各个源数据库每日定时将元数据信息同步至应用服务器中的步骤。此时,通过各个源数据库分别与应用服务器搭建联系,并在用于分析的hive数据仓库中启动Oozie(Oozie是一种Java Web应用程序)定时同步任务,每天凌晨2点将前端业务系统的多个源数据库的元数据信息同步至hive数据仓库和应用服务器中,这时应用服务器直接接收来自各个源数据库每日推送的元数据信息,并且不会影响应用服务器的日常数据处理。
或者,在步骤S10之前,还可先由各个源数据库每日定时将元数据信息同步至目标数据库中,再通过目标数据库将元数据信息推送至应用服务器中。此时,通过将用于分析的hive数据仓库与应用服务器搭建联系,并启动Oozie定时同步任务,每天凌晨2点将前端业务系统的多个源数据库的元数据信息同步至hive数据仓库后,再由hive数据仓库推送至应用服务器中。这时只用事先将应用服务器与单个hive数据仓库建立联系,而无需令各个源数据库分别与应用服务器搭建联系,也不需要在源数据库数量增加的情况下针对增加的源数据库再次搭建联系,大大节省了开发人员的时间与精力。
S20、对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动。
在应用服务器接收了当日的元数据信息后,其将启动预先设置好的元数据对比修改程序,将当天元数据信息与前一天元数据信息比较,获得各个源数据库的表结构的新增,修改和删除信息。请参阅图2,其为本申请提供的自动修改源数据库表结构的方法中步骤S20的流程图。
如图3所示,所述步骤S20包括:
S21、应用服务器启动元数据对比修改程序,分离存储的元数据信息中的昨日元数据信息和今日元数据信息;
S22、逐条对比元数据信息的各个表属主的列名称,判断各个列名称是否在昨日元数据信息和今日元数据信息中存在。
表结构定义一个表的字段、类型、主键、外键、索引,这些基本的属性组成了数据库的表结构。在业务系统中,其表结构改变主要体现在列名称的变化上,如增加或修改了如客户的性别信息栏、收入状况信息栏等等,故本实施例中主要针对元数据信息的各个表属主的列名称进行对比。
S30、当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。同时请参阅图3,其为本申请提供的自动修改源数据库表结构的方法中步骤S30的流程图。
如图4所示,所述步骤S30包括:
S31、若某一列名称在昨日元数据信息中存在、且在今日元数据信息中不存在,则生成修改目标数据库的表结构并在对应位置将此列名称置为空的脚本,发送至目标数据库中执行删除操作;
S32、若某一列名称在昨日元数据信息中不存在、且在今日元数据信息中存在,则抽取该列名称,生成修改目标数据库的表结构并在对应位置上增加该列名称的脚本,发送至目标数据库中执行增加操作。
具体来说,若出现步骤S31的情况,我们即可得出此时存在源数据库表结构的列名称删除或修改的情况,故对比修改程序将生成修改hive数据库的表结构并在对应位置将此列名称置为空的脚本,然后将发送至hive数据库中执行,在hive数据库的目标表上删除对应的列。
若出现步骤S32的情况,我们即可得出此时存在源数据库表结构的列名称增加或修改的情况,故对比修改程序将抽取此列,生成修改hive数据库的表结构并在对应位置增加此列的脚本,然后将发送至hive数据库中执行,在hive数据库的目标表上增加对应的列。
进一步的,在步骤S30之后,还包括结束当前同步程序的定时调度任务,修改同步程序以适应新的源数据库的表结构;向源数据库和/或者目标数据库发起新的同步程序的定时调度任务的步骤。在本实施例中具体为对hive数据库的修改完成后,kill掉(即结束)原来的Oozie调度,并生成Oozie定时任务,调用OozieAPI发送至Oozie调度执行。
请继续参阅图5,图5为一个实施例中计算机设备的内部结构示意图。该计算机设备可以是终端,也可以是服务器,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等具有通信功能的电子设备。服务器可以是独立的服务器,也可以是多个服务器组成的服务器集群。参照图5,该计算机设备包括通过系统总线连接的处理器、非易失性存储介质、内存储器和网络接口。其中,该计算机设备的非易失性存储介质可存储操作系统和计算机可读程序,该计算机可读程序被执行时,可使得处理器执行一种核保难度预测的方法。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该内存储器中可储存有计算机可读程序,该计算机可读程序被处理器执行时,可使得处理器执行一种核保难度预测的方法。计算机设备的网络接口用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
本申请还提供一种自动修改源数据库表结构的应用服务器,其包括处理器10、存储器20及显示器30。图5仅示出了修改源数据库表结构的应用服务器的部分组件,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
所述存储器20在一些实施例中可以是所述修改源数据库表结构的应用服务器的各组件的内部存储单元,例如应用服务器的硬盘或内存。所述存储器20在另一些实施例中也可以是所述修改源数据库表结构的应用服务器的各组件的外部存储设备,例如修改源数据库表结构的应用服务器的各组件上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器20还可以既包括所述修改源数据库表结构的应用服务器的内部存储单元也包括外部存储设备。所述存储器20用于存储安装于所述修改源数据库表结构的应用服务器的应用软件及各类数据,例如所述安装修改源数据库表结构的应用服务器的程序代码等。所述存储器20还可以用于暂时地存储已经输出或者将要输出的数据。在一实施例中,存储器20上存储有修改源数据库表结构程序40,该修改源数据库表结构程序40可被处理器10所执行,从而实现本申请各实施例的修改源数据库表结构方法。
所述处理器10在一些实施例中可以是一中央处理器(Central Processing Unit, CPU),微处理器或其他数据处理芯片,用于运行所述存储器20中存储的程序代码或处理数据,例如执行所述权限认证方法等。
所述显示器30在一些实施例中可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。所述显示器30用于显示在所述微信客户行为反馈设备中处理的信息以及用于显示可视化的用户界面,例如指派信息界面、认证报告界面等。所述微信客户行为反馈设备的部件10-30通过系统总线相互通信。
在一实施例中,当处理器10执行所述存储器20中修改源数据库表结构程序40时实现以下步骤:
接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;
对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;
当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。
进一步的,在所述的修改源数据库表结构的应用服务器中,所述对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动的步骤包括:
应用服务器启动元数据对比修改程序,分离存储的元数据信息中的昨日元数据信息和今日元数据信息;
逐条对比元数据信息的各个表属主的列名称,判断各个列名称是否在昨日元数据信息和今日元数据信息中存在。
所述逐条对比元数据信息的各个表属主的列名称,判断各个列名称是否在昨日元数据信息和今日元数据信息中存在的步骤后包括:
若某一列名称在昨日元数据信息中存在、且在今日元数据信息中不存在,则生成修改目标数据库的表结构并在对应位置将此列名称置为空的脚本,发送至目标数据库中执行删除操作;
若某一列名称在昨日元数据信息中不存在、且在今日元数据信息中存在,则抽取该列名称,生成修改目标数据库的表结构并在对应位置上增加该列名称的脚本,发送至目标数据库中执行增加操作。
在所述接收目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息的步骤之前,所述的方法还包括:
各个源数据库每日定时将元数据信息同步至应用服务器中。
或者,在所述接收目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息的步骤之前,所述的方法还包括:
各个源数据库每日定时将元数据信息同步至目标数据库中;
目标数据库将元数据信息推送至应用服务器中。
所述当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行的步骤之后,还包括:
结束当前同步程序的定时调度任务,修改同步程序以适应新的源数据库的表结构;
向源数据库和/或者目标数据库发起新的同步程序的定时调度任务。
请参阅图6,其为本申请安装修改源数据库表结构程序的应用服务器的较佳实施例的功能模块图。在本实施例中,安装修改源数据库表结构程序可以被分割成一个或多个模块,所述一个或者多个模块被存储于所述存储器中,并由一个或多个处理器(本实施例为所述处理器)所执行,以完成本申请。例如,在图6中,安装修改源数据库表结构程序的应用服务器可以被分割成接收模块31、对比分析模块32和反馈修改模块33。本申请所称的模块是指能够完成特定功能的一系列计算机程序段,比程序更适合于描述所述修改源数据库表结构程序在所述修改源数据库表结构的应用服务器中的执行过程。以下描述将具体介绍所述模块31-33的功能。
接收模块31,用于接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;
对比分析模块32,用于对比应用服务器存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;
反馈修改模块33,用于在表结构有变动的情况下,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。
所述对比分析模块32包括分离单元和对比单元,其中:
所述分离单元,用于分离应用服务器存储的元数据信息中的昨日元数据信息和今日元数据信息。
所述对比单元,用于逐条对比元数据信息的各个表属主的列名称,判断各个列名称是否在昨日元数据信息和今日元数据信息中存在。
所述反馈修改模块33包括删除单元和增加单元,其中:
所述删除单元,用于当某一列名称在昨日元数据信息中存在、且在今日元数据信息中不存在时,生成修改目标数据库的表结构并在对应位置将此列名称置为空的脚本,发送至目标数据库中执行删除操作。
所述增加单元,用于当某一列名称在昨日元数据信息中不存在、且在今日元数据信息中存在时,抽取该列名称,生成修改目标数据库的表结构并在对应位置上增加该列名称的脚本,发送至目标数据库中执行增加操作。
进一步地,所述反馈修改模块33还包括:修改单元,用于结束当前同步程序的定时调度任务,修改同步程序以适应新的源数据库的表结构;以及向源数据库和/或者目标数据库发起新的同步程序的定时调度任务。
基于上述自动修改源数据库表结构的方法和应用服务器,本申请还相应提供了一种修改源数据库表结构的系统,请参阅图7,其包括若干个源数据库110、一目标数据库120和一修改源数据库表结构的应用服务器130。
其中,所述各源数据库110,用于每日定时将元数据信息同步至目标数据库中。目标数据库120,用于将元数据信息推送至应用服务器中。所述应用服务器130,用于接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;以及对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。
在修改表结构时,具体需通过各个源数据库,目标数据库120和应用服务器130直接进行交互,例如通过各个源数据库将元数据信息同步到目标数据库中,再由目标数据库推送到应用服务器中,由应用服务器完成对元数据信息的分析和处理,从而在数据同步过程中,通过应用服务器使目标数据库的表结构自动完成相对于源数据库的表结构的对比及修改。
本实施例中修改源数据库表结构的系统的工作流程如下:
应用服务器接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;
应用服务器对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;
当表结构有变动时,应用服务器根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。
进一步的,在所述的修改源数据库表结构的系统中,所述应用服务器对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动的流程包括:
应用服务器启动元数据对比修改程序,分离存储的元数据信息中的昨日元数据信息和今日元数据信息;
应用服务器逐条对比元数据信息的各个表属主的列名称,判断各个列名称是否在昨日元数据信息和今日元数据信息中存在。
所述应用服务器逐条对比元数据信息的各个表属主的列名称,判断各个列名称是否在昨日元数据信息和今日元数据信息中存在的流程后包括:
若某一列名称在昨日元数据信息中存在、且在今日元数据信息中不存在,则应用服务器生成修改目标数据库的表结构并在对应位置将此列名称置为空的脚本,发送至目标数据库中执行删除操作;
若某一列名称在昨日元数据信息中不存在、且在今日元数据信息中存在,则应用服务器抽取该列名称,生成修改目标数据库的表结构并在对应位置上增加该列名称的脚本,发送至目标数据库中执行增加操作。
在一实施例中,在所述应用服务器接收目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息的步骤之前,所述的工作流程还包括:
各个源数据库每日定时将元数据信息同步至应用服务器中。
在另一实施例中,在所述应用服务器接收目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息的步骤之前,所述的工作流程还包括:
各个源数据库每日定时将元数据信息同步至目标数据库中;
目标数据库将元数据信息推送至应用服务器中。
进一步地,当表结构有变动时,应用服务器根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行的步骤之后,还包括:
应用服务器结束当前同步程序的定时调度任务,修改同步程序以适应新的源数据库的表结构;
应用服务器向源数据库和/或者目标数据库发起新的同步程序的定时调度任务。
综上所述,本申请提供的自动修改源数据库表结构的方法、服务器、系统及存储介质中,所述自动修改源数据库表结构的方法通过接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;之后对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;当判断表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。从而使目标数据库的表结构自动完成相对于源数据库的表结构的对比及修改,使得在数据同步过程中,既可减少人力成本,又可降低出错率。
当然,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关硬件(如处理器,控制器等)来完成,所述程序可存储于一计算机可读取的存储介质中,该程序在执行时可包括如上述各方法实施例的流程。其中所述的存储介质可为存储器、磁碟、光盘等。
应当理解的是,本申请的应用不限于上述的举例,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,所有这些改进和变换都应属于本申请所附权利要求的保护范围。

Claims (20)

  1. 一种自动修改源数据库表结构的方法,其特征在于,包括如下步骤:
    接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;
    对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;
    当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。
  2. 根据权利要求1所述的自动修改源数据库表结构的方法,其特征在于,所述对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动的步骤包括:
    应用服务器启动元数据对比修改程序,分离存储的元数据信息中的昨日元数据信息和今日元数据信息;
    逐条对比元数据信息的各个表属主的列名称,判断各个列名称是否在昨日元数据信息和今日元数据信息中存在。
  3. 根据权利要求2述的自动修改源数据库表结构的方法,其特征在于,所述当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行的步骤包括:
    若某一列名称在昨日元数据信息中存在、且在今日元数据信息中不存在,则生成修改目标数据库的表结构并在对应位置将此列名称置为空的脚本,发送至目标数据库中执行删除操作;
    若某一列名称在昨日元数据信息中不存在、且在今日元数据信息中存在,则抽取该列名称,生成修改目标数据库的表结构并在对应位置上增加该列名称的脚本,发送至目标数据库中执行增加操作。
  4. 根据权利要求1所述的自动修改源数据库表结构的方法,其特征在于,在所述接收目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息的步骤之前,所述的方法还包括:
    各个源数据库每日定时将元数据信息同步至应用服务器中。
  5. 根据权利要求1所述的自动修改源数据库表结构的方法,其特征在于,在所述接收目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息的步骤之前,所述的方法还包括:
    各个源数据库每日定时将元数据信息同步至目标数据库中;
    目标数据库将元数据信息推送至应用服务器中。
  6. 根据权利要求1所述的自动修改源数据库表结构的方法,其特征在于,所述当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行的步骤之后,还包括:
    结束当前同步程序的定时调度任务,修改同步程序以适应新的源数据库的表结构;
    向源数据库和/或者目标数据库发起新的同步程序的定时调度任务。
  7. 根据权利要求1所述的自动修改源数据库表结构的方法,其特征在于,所述源数据库为oracle数据库,MySQL数据库或PostgreSQL数据库。
  8. 根据权利要求2所述的自动修改源数据库表结构的方法,其特征在于,所述源数据库为oracle数据库,MySQL数据库或PostgreSQL数据库。
  9. 根据权利要求3所述的自动修改源数据库表结构的方法,其特征在于,所述源数据库为oracle数据库,MySQL数据库或PostgreSQL数据库。
  10. 根据权利要求4所述的自动修改源数据库表结构的方法,其特征在于,所述源数据库为oracle数据库,MySQL数据库或PostgreSQL数据库。
  11. 根据权利要求5所述的自动修改源数据库表结构的方法,其特征在于,所述源数据库为oracle数据库,MySQL数据库或PostgreSQL数据库。
  12. 根据权利要求6所述的自动修改源数据库表结构的方法,其特征在于,所述源数据库为oracle数据库,MySQL数据库或PostgreSQL数据库。
  13. 一种自动修改源数据库表结构的应用服务器,其特征在于,包括:处理器、存储器、通信总线;所述存储器上存储有可被所述处理器执行的计算机可读程序;
    所述通信总线实现处理器和存储器之间的连接通信;
    所述处理器执行所述计算机可读程序时实现如权利要求1所述的自动修改源数据库表结构的方法中的步骤。
  14. 一种自动修改源数据库表结构的应用服务器,其特征在于,包括:处理器、存储器、通信总线;所述存储器上存储有可被所述处理器执行的计算机可读程序;
    所述通信总线实现处理器和存储器之间的连接通信;
    所述处理器执行所述计算机可读程序时实现如权利要求2所述的自动修改源数据库表结构的方法中的步骤。
  15. 一种自动修改源数据库表结构的应用服务器,其特征在于,包括:处理器、存储器、通信总线;所述存储器上存储有可被所述处理器执行的计算机可读程序;
    所述通信总线实现处理器和存储器之间的连接通信;
    所述处理器执行所述计算机可读程序时实现如权利要求3所述的自动修改源数据库表结构的方法中的步骤。
  16. 一种自动修改源数据库表结构的应用服务器,其特征在于,包括:处理器、存储器、通信总线;所述存储器上存储有可被所述处理器执行的计算机可读程序;
    所述通信总线实现处理器和存储器之间的连接通信;
    所述处理器执行所述计算机可读程序时实现如权利要求4所述的自动修改源数据库表结构的方法中的步骤。
  17. 一种自动修改源数据库表结构的应用服务器,其特征在于,包括:处理器、存储器、通信总线;所述存储器上存储有可被所述处理器执行的计算机可读程序;
    所述通信总线实现处理器和存储器之间的连接通信;
    所述处理器执行所述计算机可读程序时实现如权利要求5所述的自动修改源数据库表结构的方法中的步骤。
  18. 一种自动修改源数据库表结构的应用服务器,其特征在于,包括:处理器、存储器、通信总线;所述存储器上存储有可被所述处理器执行的计算机可读程序;
    所述通信总线实现处理器和存储器之间的连接通信;
    所述处理器执行所述计算机可读程序时实现如权利要求6所述的自动修改源数据库表结构的方法中的步骤。
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如权利要求1所述的自动修改源数据库表结构的方法中的步骤。
  20. 一种自动修改源数据库表结构的系统,包括若干个源数据库,其特征在于,还包括目标数据库和如权利要求13所述的修改源数据库表结构的应用服务器;
    各源数据库,用于每日定时将元数据信息同步至目标数据库中;
    目标数据库,用于将元数据信息推送至应用服务器中;
    所述应用服务器,用于接收各个源数据库或者目标数据库每日推送的元数据信息,并保存至少最近两日的元数据信息;以及对比存储的当日元数据信息与昨日元数据信息,判断表结构是否有变动;当表结构有变动时,根据表结构变动信息,生成修改目标数据库的表结构的脚本,并将所述表结构的脚本发送至目标数据库中执行。
PCT/CN2018/083879 2017-08-29 2018-04-20 修改源数据库表结构的方法、服务器、系统及存储介质 WO2019041832A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710755733.XA CN107515933A (zh) 2017-08-29 2017-08-29 修改源数据库表结构的方法、服务器、系统及存储介质
CN201710755733.X 2017-08-29

Publications (1)

Publication Number Publication Date
WO2019041832A1 true WO2019041832A1 (zh) 2019-03-07

Family

ID=60724461

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/083879 WO2019041832A1 (zh) 2017-08-29 2018-04-20 修改源数据库表结构的方法、服务器、系统及存储介质

Country Status (2)

Country Link
CN (1) CN107515933A (zh)
WO (1) WO2019041832A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125101A (zh) * 2019-12-16 2020-05-08 杭州涂鸦信息技术有限公司 一种数据中心表结构一致性监控方法及系统

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107515933A (zh) * 2017-08-29 2017-12-26 平安科技(深圳)有限公司 修改源数据库表结构的方法、服务器、系统及存储介质
CN108170809B (zh) * 2017-12-28 2020-11-03 平安科技(深圳)有限公司 建表脚本生成方法、装置、设备及计算机可读存储介质
CN108509612A (zh) * 2018-03-30 2018-09-07 北京润科通用技术有限公司 一种数据处理方法及装置
CN109800234A (zh) * 2019-01-25 2019-05-24 苏州科达科技股份有限公司 业务平台数据库系统、升级方法、设备及存储介质
CN110059134A (zh) * 2019-03-18 2019-07-26 深圳市买买提信息科技有限公司 一种数据同步至云平台的方法、相关装置和设备
CN110209730A (zh) * 2019-04-25 2019-09-06 深圳壹账通智能科技有限公司 变更数据的同步方法、装置、计算机设备及计算机存储介质
CN110347693A (zh) * 2019-07-11 2019-10-18 招商局金融科技有限公司 数据同步方法、装置及存储介质
CN110866012A (zh) * 2019-11-11 2020-03-06 北京知道创宇信息技术股份有限公司 表结构管理方法、装置、服务器及可读存储介质
CN111367924B (zh) * 2020-02-26 2024-01-02 杭州数梦工场科技有限公司 数据同步方法、装置、电子设备、存储介质
CN112162992A (zh) * 2020-10-12 2021-01-01 浪潮软件集团有限公司 一种高效的数据库更新系统及方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100114853A1 (en) * 2008-11-06 2010-05-06 Deluxe Digital Studios, Inc. Methods, systems and apparatuses for use in updating a portable storage medium
CN104965735A (zh) * 2015-06-18 2015-10-07 北京京东尚科信息技术有限公司 用于生成升级sql脚本的装置
CN106326376A (zh) * 2016-08-15 2017-01-11 东软集团股份有限公司 用于表结构变更后的信息复制方法和装置
CN107515933A (zh) * 2017-08-29 2017-12-26 平安科技(深圳)有限公司 修改源数据库表结构的方法、服务器、系统及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102982126A (zh) * 2012-11-14 2013-03-20 浙江星汉信息技术有限公司 一种数据库表数据实时推送的方法及其系统
US9805070B2 (en) * 2013-07-09 2017-10-31 Oracle International Corporation Dynamic migration script management
CN104317843B (zh) * 2014-10-11 2017-08-25 上海瀚之友信息技术服务有限公司 一种数据同步etl系统
CN106649771B (zh) * 2016-12-27 2019-10-25 广州杰赛科技股份有限公司 数据库的数据模型更新方法和系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100114853A1 (en) * 2008-11-06 2010-05-06 Deluxe Digital Studios, Inc. Methods, systems and apparatuses for use in updating a portable storage medium
CN104965735A (zh) * 2015-06-18 2015-10-07 北京京东尚科信息技术有限公司 用于生成升级sql脚本的装置
CN106326376A (zh) * 2016-08-15 2017-01-11 东软集团股份有限公司 用于表结构变更后的信息复制方法和装置
CN107515933A (zh) * 2017-08-29 2017-12-26 平安科技(深圳)有限公司 修改源数据库表结构的方法、服务器、系统及存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111125101A (zh) * 2019-12-16 2020-05-08 杭州涂鸦信息技术有限公司 一种数据中心表结构一致性监控方法及系统
CN111125101B (zh) * 2019-12-16 2023-10-13 杭州涂鸦信息技术有限公司 一种数据中心表结构一致性监控方法及系统

Also Published As

Publication number Publication date
CN107515933A (zh) 2017-12-26

Similar Documents

Publication Publication Date Title
WO2019041832A1 (zh) 修改源数据库表结构的方法、服务器、系统及存储介质
WO2019100638A1 (zh) 数据同步方法、装置、设备及存储介质
WO2019165691A1 (zh) 自动生成测试案例的方法、装置、设备及可读存储介质
WO2019037396A1 (zh) 账户清结算方法、装置、设备及存储介质
WO2019100654A1 (zh) 多任务处理方法、装置、应用服务器及存储介质
WO2018107610A1 (zh) 业务数据处理方法、系统、设备及计算机可读存储介质
WO2019061613A1 (zh) 贷款资质筛选方法、装置及计算机可读存储介质
WO2020224247A1 (zh) 基于区块链的数据溯源方法、装置、设备及可读存储介质
WO2019192085A1 (zh) 银企直联通信方法、装置、设备及计算机可读存储介质
WO2019019714A1 (zh) 一种微信客户行为反馈方法、设备及存储介质
WO2015144089A1 (en) Application recommending method and apparatus
WO2019174375A1 (zh) 接口测试方法、装置、设备及计算机可读存储介质
WO2018227880A1 (zh) 数据比对方法、装置、设备及可读存储介质
WO2014056398A1 (zh) 数据处理方法、装置及存储介质
WO2015131803A1 (en) Application recommending method and system
WO2018205376A1 (zh) 一种关联信息查询方法、终端、服务器管理系统及计算机可读存储介质
WO2019056733A1 (zh) 并发量控制方法、应用服务器、系统及存储介质
WO2018233370A1 (zh) 镜像同步方法、系统、设备及计算机可读存储介质
WO2019119624A1 (zh) 基于Excel表的计算方法、装置、设备及存储介质
WO2018120430A1 (zh) 一种页面构建方法、终端、计算机可读存储介质及页面构建设备
WO2019169814A1 (zh) 自动生成中文注释的方法、装置、设备及存储介质
WO2018076812A1 (zh) 数据请求的响应方法、装置、存储介质、服务器及系统
WO2019161615A1 (zh) 账单录入方法、系统、光学字符识别服务器和存储介质
WO2014000635A1 (zh) 阅读器提供服务的方法、阅读器、终端及计算机存储介质
WO2018076864A1 (zh) 一种数据同步方法、装置、存储介质及电子设备

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25.09.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18851130

Country of ref document: EP

Kind code of ref document: A1