WO2020228184A1 - 数据库中表结构对比方法、装置、计算机设备和存储介质 - Google Patents

数据库中表结构对比方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2020228184A1
WO2020228184A1 PCT/CN2019/103452 CN2019103452W WO2020228184A1 WO 2020228184 A1 WO2020228184 A1 WO 2020228184A1 CN 2019103452 W CN2019103452 W CN 2019103452W WO 2020228184 A1 WO2020228184 A1 WO 2020228184A1
Authority
WO
WIPO (PCT)
Prior art keywords
upstream
downstream
information
field
length
Prior art date
Application number
PCT/CN2019/103452
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 WO2020228184A1 publication Critical patent/WO2020228184A1/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/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/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of data synchronization, in particular to a method, device, computer equipment and storage medium for comparing table structures in a database.
  • Testers In the process of data testing, there is often an operation to synchronize the data of the upstream table to the existing table.
  • Testers usually use the GoldenGate tool to synchronize the data of the upstream table to the downstream table.
  • GoldenGate tool In order to test the effect and stability, before the test, it is necessary to check whether the downstream table can insert the data of the upstream table.
  • the existing technology is manual detection by testers, which wastes time and manpower.
  • the main purpose of this application is to provide a method, device, computer equipment and storage medium for comparing table structures in a database, which aims to solve the problem of manual testing by testers in the prior art, which wastes time and manpower.
  • the database is a database based on the GoldenGate synchronization tool and includes:
  • the database is a database based on the GoldenGate synchronization tool, including:
  • the first acquiring unit is configured to acquire the name of the synchronization table in which the synchronization table is recorded and the list of the database connection string of each synchronization table name, wherein the synchronization table includes an upstream table and a downstream table in a one-to-one mapping relationship ;
  • the second acquiring unit is configured to acquire the first upstream table name of the first upstream table and the first downstream table name of the first downstream table that correspond to each other in the list, and the first upstream table name corresponding to the first upstream table name.
  • Upstream database connection string the first downstream database connection string corresponding to the first downstream table name;
  • connection unit is configured to connect to the first upstream database storing the first upstream table according to the first upstream database connection string, and to connect the first downstream database storing the first downstream table according to the first downstream database connection string;
  • a third acquiring unit configured to acquire the first upstream information of the first upstream table in the first upstream database, and acquire the first downstream information of the first downstream table in the first downstream database;
  • a judging unit configured to judge whether the first upstream information and the first downstream information meet preset requirements
  • a first determining unit configured to determine that the data in the first upstream table can be successfully synchronized to the first downstream table if the first upstream information and the first downstream information meet the preset requirements
  • the second determining unit is configured to generate reminder information if the first upstream information and the first downstream information do not meet the preset requirements.
  • the present application also provides a computer device including a memory and a processor, the memory stores computer readable instructions, and the processor implements the steps of any one of the above methods when the computer readable instructions are executed.
  • the present application also provides a computer non-volatile readable storage medium, on which computer readable instructions are stored, characterized in that, when the computer readable instructions are executed by a processor, the method of any one of the above step.
  • the table structure comparison method, device, computer equipment and storage medium in the database of the present application can automatically complete the judgment process of whether the upstream table and the downstream table match, without the need for manual detection by testers, save human resources, and improve detection efficiency.
  • This application completes the matching process of upstream and downstream tables before data synchronization, thereby reducing the occurrence of data failures in the subsequent data synchronization process.
  • FIG. 1 is a schematic flowchart of a method for comparing table structures in a database according to an embodiment of the application
  • FIG. 2 is a schematic block diagram of the structure of a table structure comparison device in a database according to an embodiment of the application;
  • FIG. 3 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
  • an embodiment of the present application provides a method for comparing table structures in a database.
  • the database is a database based on the GoldenGate synchronization tool and includes:
  • the above list may be a list prepared by the user in advance, such as a list manually configured by a tester, or a GoldenGate tool using the synchronization table information query link to automatically download the one-to-one correspondence between the upstream and downstream tables in the link
  • the name and table name correspond to the database connection string.
  • the above-mentioned database connection string is the information of the database, which is needed to access the database, such as the ip address, network port, database name, account number, and password stored in the database.
  • the above-mentioned upstream table and downstream table relationship is a one-to-one mapping relationship, that is, the data of a certain upstream table is only copied to its corresponding downstream table.
  • the above "first” is only a distinguishing mark, which is convenient for accurate reference and description.
  • the above-mentioned first upstream table name only represents an upstream table name, and it is in a one-to-one mapping relationship with the first downstream table name.
  • Others such as the "first" in the first upstream database connection string and the first downstream database connection string, are also only a distinguishing identifier.
  • the first upstream table name and the first downstream table name corresponding to each other in the list, and the database connection string corresponding to each first upstream table name and the first downstream table name are automatically obtained in order to facilitate subsequent connection pairs. Database, etc.
  • first upstream information and first downstream information may be acquired according to preset configuration requirements, for example, acquiring the field type of the first upstream table, the field type of the first downstream table, and so on.
  • the above preset requirement may be that the field type of the first upstream table is the same as the field type of the first downstream table, or it may be the field length of the first upstream table and the field length of the first downstream table. Same and so on.
  • step S6 if the first upstream information and the first downstream information meet the preset requirements, it means that the data in the first upstream table can be updated synchronously to the corresponding first downstream table.
  • the first upstream table corresponding to the first upstream table name and the first downstream table corresponding to the first downstream table name are correct matching relationships, and no adjustment is required.
  • step S7 if the first upstream information and the first downstream information do not meet the preset requirements, it means that the data in the first upstream table cannot be synchronized to the corresponding first downstream table.
  • the first upstream table corresponding to the first upstream table name in the list and the first downstream table corresponding to the first downstream table name are incorrect matching relationships and need to be adjusted.
  • a corresponding reminder message will be generated to Remind the tester to make changes.
  • the reminder message will show two reasons for the mismatch, for example, "The first upstream field type is numeric, and the first downstream field type is text, so the matching relationship needs to be modified."
  • the above-mentioned first upstream information is a first upstream field type
  • the first downstream information is a first downstream field type
  • the determining whether the first upstream information and the first downstream information conform to The preset required step S5 also includes:
  • S502 If the type of the first upstream field is the same as the type of the first downstream field, determine that the first upstream information and the first downstream information meet the preset requirement;
  • the above-mentioned field type includes data storage format, precision, etc., for example, if the field type is numeric, then only numeric values can be inserted into the corresponding column; if the field type is numeric and the length is X, then the corresponding column Only the value of X length, etc. can be inserted in. Therefore, if the type of the first upstream field is the same as the type of the first downstream field, it means that the data in the first upstream table can be synchronized to the corresponding first downstream table, and the first upstream table name in the above list corresponds to The first upstream table of and the first downstream table corresponding to the first downstream table name are correct matching relationships and no adjustment is required.
  • the required step S5 when the first upstream information is the length of the first upstream field, and when the first downstream information is the length of the first downstream field, it is determined whether the first upstream information and the first downstream information are in accordance with the preset
  • the required step S5 also includes:
  • S511 Determine whether the length of the first downstream field is greater than or equal to the length of the first upstream field.
  • the encoding format of the first upstream table and the first downstream table may be different.
  • the first upstream table is in the gbk encoding format
  • one Chinese occupies two bytes
  • the first downstream table is in the utf8 encoding format.
  • the field length of the downstream character type should be greater than or equal to the upstream field length.
  • the length of the first downstream field should be at least 1.5 times the length of the first upstream field. In this embodiment, as long as it is determined that the length of the first downstream field is greater than or equal to the length of the first upstream field, it is considered that the preset requirement is met.
  • the step S512 of determining that the first upstream information and the first downstream information meet the preset requirements includes :
  • S5122 Calculate the first proportional relationship of the field length between the coding format of the first upstream table and the coding format of the first downstream table;
  • S5123 Determine whether the second proportional relationship between the length of the first upstream field and the length of the first downstream field is less than or equal to the first proportional relationship
  • the minimum value of the first downstream field length is further determined. For example, if the first upstream table is in the gbk encoding format and the first downstream table is in the utf8 encoding format, then the length of the field between the two encoding formats is The first proportional relationship is 2/3, then the second proportional relationship between the length of the first upstream field and the length of the first downstream field is at least not greater than 2/3 to ensure that the data in the first upstream table can be inserted into the first downstream without error In the table, for example, the second proportional relationship is 2/5, 1/2, etc. It can also be understood that the length of the first downstream field is at least 1.5 times the length of the first upstream field.
  • the step S5 of whether the upstream information and the first downstream information meet the preset requirements further includes:
  • the type of the first upstream field is the same as the type of the first downstream field, and the length of the first downstream field is greater than or equal to the length of the first upstream field, it is determined that the preset requirement is met; otherwise, , It is determined that it does not meet the preset requirements.
  • the method includes:
  • the tester asks the computer equipment to be tested to be specified. Therefore, the tester may not be on site, so the modification operation cannot be performed in time, in order to prevent the tester from forgetting Modification operation, so send an email to remind.
  • the above-mentioned setting of the specified time length can prevent the situation where the tester has already performed the corresponding side modification operation on site and will receive a reminder email.
  • the method further includes:
  • S601 Generate a verification report after verifying the relationship between all the corresponding upstream tables and downstream tables in the list.
  • the verification result can be recorded in the verification report, for example, all upstream tables and downstream tables that do not meet the preset requirements are separately sorted into a report.
  • the method for comparing the table structure in the database based on the GoldenGate synchronization tool of this embodiment can automatically complete the judging process of whether the upstream table and the downstream table match, without manual detection by testers, saving human resources, and improving detection efficiency.
  • This application completes the matching process of upstream and downstream tables before data synchronization, thereby reducing the occurrence of data failures in the subsequent data synchronization process.
  • an embodiment of the present application also provides an apparatus for comparing table structure in a database.
  • the database is a database based on the GoldenGate synchronization tool and includes:
  • the first acquiring unit 10 is configured to acquire the name of the synchronization table in which the synchronization table is recorded and the list of database connection strings of each synchronization table name, wherein the synchronization table includes an upstream table and a downstream table in a one-to-one mapping relationship. table;
  • the second acquiring unit 20 is configured to acquire the first upstream table name of the first upstream table and the first downstream table name of the first downstream table that correspond to each other in the list, and the first upstream table name corresponding to the first upstream table name.
  • the connection unit 30 is configured to connect a first upstream database storing a first upstream table according to the first upstream database connection string, and connect a first downstream database storing a first downstream table according to the first downstream database connection string ;
  • the third acquiring unit 40 is configured to acquire the first upstream information of the first upstream table in the first upstream database, and acquire the first downstream information of the first downstream table in the first downstream database ;
  • the determining unit 50 is configured to determine whether the first upstream information and the first downstream information meet preset requirements
  • the first determining unit 60 is configured to determine that the data in the first upstream table can be successfully synchronized to the first downstream table if the first upstream information and the first downstream information meet the preset requirements;
  • the second determining unit 70 is configured to generate reminder information if the first upstream information and the first downstream information do not meet the preset requirements.
  • the first upstream information is a first upstream field type
  • the judgment unit 50 further includes:
  • the first judgment module is configured to judge whether the first upstream field type and the first downstream field type are the same;
  • a first determination module configured to determine that if the first upstream field type and the first downstream field type are the same, determine that the first upstream information and the first downstream information meet the preset requirements, otherwise determine The first upstream information and the first downstream information do not meet the preset requirements.
  • the judgment unit 50 when the first upstream information is the length of the first upstream field, and the first downstream information is the length of the first downstream field, the judgment unit 50 further includes:
  • the second judgment module is configured to judge whether the length of the first downstream field is greater than or equal to the length of the first upstream field
  • the second determining module is configured to determine that the first upstream information and the first downstream information meet the preset requirements if the length of the first downstream field is greater than or equal to the length of the first upstream field, otherwise It is determined that the first upstream information and the first downstream information do not meet the preset requirement.
  • the above-mentioned second determination module includes:
  • An obtaining submodule configured to obtain the coding format of the first upstream table and the coding format of the first downstream table if the length of the first downstream field is greater than or equal to the length of the first upstream field;
  • a judging submodule configured to judge whether the second proportional relationship between the length of the first upstream field and the length of the first downstream field is less than or equal to the first proportional relationship
  • a judging sub-module configured to judge the first upstream information and the first upstream information if the second proportional relationship between the first upstream field length and the first downstream field length is less than or equal to the first proportional relationship
  • the downstream information meets the preset requirements.
  • the judgment unit 50 when the first upstream information is the first upstream field type and the first upstream field length, and the first downstream information is the first downstream field type and the first downstream field length, the judgment unit 50 further include:
  • a third determining module configured to determine whether the first upstream field type and the first downstream field type are the same, and determine whether the first downstream field length is greater than or equal to the first upstream field length;
  • the third determination module is configured to determine whether the first upstream field type is the same as the first downstream field type, and the first downstream field length is greater than or equal to the first upstream field length. Otherwise, it is determined that it does not meet the preset requirements.
  • the device for comparing table structures in the database further includes:
  • the input judgment unit is used to judge whether the modification operation information input from the outside is accepted within a specified time length
  • the sending unit is configured to, if the modification operation information is not received, obtain the preset email address of the tester, and send the reminder information to the mailbox corresponding to the email address.
  • the device for comparing table structures in the database further includes:
  • the generating unit is configured to generate a verification report after the verification of the relationship between all the corresponding upstream tables and downstream tables in the list is completed.
  • the verification result can be recorded in the verification report, for example, all upstream tables and downstream tables that do not meet the preset requirements are separately sorted into a report.
  • the device for comparing the table structure in the database based on the GoldenGate synchronization tool of this embodiment is a device that executes the above method. It can automatically complete the judging process of whether the upstream table and the downstream table match, without the need for manual detection by testers, saving human resources, and improving detection s efficiency. This application completes the matching process of upstream and downstream tables before data synchronization, thereby reducing the occurrence of data failures in the subsequent data synchronization process.
  • an embodiment of the present invention also provides a computer device.
  • the computer device may be a server, and its internal structure may be as shown in FIG. 3.
  • the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the computer designed processor is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the memory provides an environment for the operation of the operating system and computer readable instructions in the non-volatile storage medium.
  • the computer equipment database is used for upstream tables, downstream tables and other data.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • An embodiment of the present invention also provides a computer non-volatile readable storage medium, on which computer readable instructions are stored, and when the computer readable instructions are executed by a processor, the method for comparing table structures in a database of any of the above embodiments is implemented
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

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

Abstract

一种数据库中表结构对比方法、装置、计算机设备和存储介质,该方法包括获取记录有同步表的同步表名、各所述同步表名的数据库连接串的列表,通过列表中的配置信息,以及预设的上游表信息和下游表信息匹配的要求,自动完成上游表和下游表是否匹配的判断过程,无需测试人员检测,节省人力资源,而且提高检测的效率。

Description

数据库中表结构对比方法、装置、计算机设备和存储介质
本申请要求于2019年5月13日提交中国专利局、申请号为2019103945477,申请名称为“数据库中表结构对比方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及到数据同步领域,特别是涉及到一种数据库中表结构对比方法、装置、计算机设备和存储介质。
背景技术
在数据测试过程中,往往存在将上游表的数据同步到现有表的操作,测试人员通常使用对GoldenGate工具将上游表的数据同步到下游表中。为了测试的效果和稳定性,在测试之前,需要查看下游表是否可以插入上游表的数据,现有技术是测试人员人工检测,浪费时间和人力。
技术问题
本申请的主要目的为提供一种数据库中表结构对比方法、装置、计算机设备和存储介质,旨在解决现有技术中测试人员人工检测,浪费时间和人力的问题。
技术解决方案
为了实现上述发明目的,本申请提出一种数据库中表结构对比方法,所述数据库是基于GoldenGate同步工具的数据库,包括:
获取记录有同步表的同步表名、以及各所述同步表名的数据库连接串的列表,其中,所述同步表包括呈一对一映射关系的上游表和下游表;
在所述列表中获取相互对应的第一上游表的第一上游表名和第一下游表的第一下游表名,以及与所述第一上游表名对应的第一上游数据库连接串,与所述第一下游表名对应的第一下游数据库连接串;
依据所述第一上游数据库连接串连接存储有第一上游表的第一上游数据库,以及依据所述第一下游数据库连接串连接存储有第一下游表的第一下游数据库;
在所述第一上游数据库中获取所述第一上游表的第一上游信息,以及在所述第一下游数据库中获取所述第一下游表的第一下游信息;
判断所述第一上游信息和所述第一下游信息是否符合预设的要求;
若所述第一上游信息和所述第一下游信息符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中;
若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息。
本申请还提供一种数据库中表结构对比装置,所述数据库是基于GoldenGate同步工具的数据库,包括:
第一获取单元,用于获取记录有同步表的同步表名、以及各所述同步表名的数据库连接串的列表,其中,所述同步表包括呈一对一映射关系的上游表和下游表;
第二获取单元,用于在所述列表中获取相互对应的第一上游表的第一上游表名和第一下游表的第一下游表名,以及与所述第一上游表名对应的第一上游数据库连接串,与所述第一下游表名对应的第一下游数据库连接串;
连接单元,用于依据所述第一上游数据库连接串连接存储有第一上游表的第一上游数据库,以及依据所述第一下游数据库连接串连接存储有第一下游表的第一下游数据库;
第三获取单元,用于在所述第一上游数据库中获取所述第一上游表的第一上游信息,以及在所述第一下游数据库中获取所述第一下游表的第一下游信息;
判断单元,用于判断所述第一上游信息和所述第一下游信息是否符合预设的要求;
第一判定单元,用于若所述第一上游信息和所述第一下游信息符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中;
第二判定单元,用于若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息。
本申请还提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,所述处理器执行所述计算机可读指令时实现上述任一项所述方法的步骤。
本申请还提供一种计算机非易失性可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现上述任一项所述的方法的步骤。
有益效果
本申请的数据库中表结构对比方法、装置、计算机设备和存储介质,可以自动完成上游表和下游表是否匹配的判断过程,无需测试人员人工检测,节省人力资源,而且提高检测的效率。本申请在数据同步之前完成上下游表的匹配过程,从而减少在后续的数据同步过程中,出现数据无法同步的情况发生。
附图说明
图1为本申请一实施例的数据库中表结构对比方法的流程示意图;
图2 为本申请一实施例的数据库中表结构对比装置的结构示意框图;
图3 为本申请一实施例的计算机设备的结构示意框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的最佳实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
参照图1,本申请实施例提供一种数据库中表结构对比方法,所述数据库是基于GoldenGate同步工具的数据库,包括:
S1、获取记录有同步表的同步表名、以及各所述同步表名的数据库连接串的列表,其中,所述同步表包括呈一对一映射关系的上游表和下游表;
S2、在所述列表中获取相互对应的第一上游表的第一上游表名和第一下游表的第一下游表名,以及与所述第一上游表名对应的第一上游数据库连接串,与所述第一下游表名对应的第一下游数据库连接串;
S3、依据所述第一上游数据库连接串连接存储有第一上游表的第一上游数据库,以及依据所述第一下游数据库连接串连接存储有第一下游表的第一下游数据库;
S4、在所述第一上游数据库中获取所述第一上游表的第一上游信息,以及在所述第一下游数据库中获取所述第一下游表的第一下游信息;
S5、判断所述第一上游信息和所述第一下游信息是否符合预设的要求;
S6、若所述第一上游信息和所述第一下游信息符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中;
S7、若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息。
如上述步骤S1所述,上述列表可以是用户预先准备的列表,如通过测试人员手动配置的列表,或者是通过GoldenGate工具利用同步表信息查询链接自动下载链路中上、下游一一对应的表名和表名对应数据库连接串。上述数据库连接串是数据库的信息,访问数据库需要用到,比如数据库存储的ip地址、网络端口、数据库名字、账号和密码等。上述上游表和下游表关系是一对一映射的关系,即某个上游表的数据只向其对应的下游表中复制。
如上述步骤S2所述,上述“第一”仅为区分标识,便于准确引用和描述。比如,上述的第一上游表名,仅表示一个上游表名,与其成一对一映射关系的为第一下游表名。其它如第一上游数据库连接串和第一下游数据库连接串中的“第一”也是仅为区分标识。在本实施例中,自动获取列表中各相互对应的第一上游表名和第一下游表名,以及各第一上游表名和第一下游表名对应的数据库连接串,以便于后续的连接对用的数据库等。
如上述步骤S3和S4所述,即为通过数据库连接串连接数据库的过程,以及到数据库获取同步表的相关信息,均为现有技术,在此不在赘述。上述第一上游信息和第一下游信息可以根据预设的配置要求进行获取,比如,获取第一上游表的字段类型、第一下游表的字段类型等等。
如上述步骤S5所述,上述预设的要求可以为第一上游表的字段类型与第一下游表表的字段类型相同,也可以是第一上游表的字段长度与第一下游表的字段长短相同等等。
如上述步骤S6所述,如果第一上游信息和所述第一下游信息符合预设的要求,说明第一上游表中的数据可以同步的更新到与其对应的第一下游表中,上述列表中的第一上游表名对应的第一上游表和第一下游表名对应的第一下游表,两者是正确的匹配关系,无需调整。
如上述步骤S7所述,如果第一上游信息和所述第一下游信息不符合预设的要求,说明第一上游表中的数据不可以同步的更新到与其对应的第一下游表中,上述列表中的第一上游表名对应的第一上游表和第一下游表名对应的第一下游表,两者是错误的匹配关系,需要调整,此时,会生成一个相应的提醒信息,以提醒测试人员进行修改。提醒信息会显示两则不匹配的原因,比如,“第一上游字段类型为数值,第一下游字段类型为文字,所以需要修改匹配关系”等。
在一个实施例中,上述第一上游信息为第一上游字段类型,所述第一下游信息为第一下游字段类型时,所述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤S5,还包括:
S501、判断所述第一上游字段类型和所述第一下游字段类型是否相同;
S502、若所述第一上游字段类型和所述第一下游字段类型相同,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求;
S503、若所述第一上游字段类型和所述第一下游字段类型不相同,则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
在本实施例中,上述字段类型包括数据存储格式、精度等,比如,字段类型为数值,那么其对应的列中只能插入数值;字段类型为数值、且长度为X,那么其对应的列中只能插入X长度的数值等。所以,如果第一上游字段类型与所述第一下游字段类型相同,说明第一上游表中的数据可以同步的更新到与其对应的第一下游表中,上述列表中的第一上游表名对应的第一上游表和第一下游表名对应的第一下游表,两者是正确的匹配关系,无需调整。
在另一个实施例中,上述第一上游信息为第一上游字段长度,上述第一下游信息为第一下游字段长度时,上述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤S5,还包括:
S511、判断所述第一下游字段长度是否大于或等于所述第一上游字段长度;
S512、若所述第一下游字段长度大于或等于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求;
S513、否所述第一下游字段长度小于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
在本实施例中,第一上游表和第一下游表的编码格式可能不同,比如在第一上游表为gbk编码格式,一个中文占用两个字节,第一下游表为utf8编码格式下,一个中文占用三个字节。如果第一上游表和第一下游表的编码格是一致的,那么下游字符类型的字段长度大于等于上游字段长度即可,具体地,如果第一上游表是gbk编码格式而第一下游表是utf8编码格式,那么第一下游字段长度至少应该为第一上游字段长度的1.5倍。在本实施例中,只要判定所述第一下游字段长度大于或等于所述第一上游字段长度,即会认为满足预设的要求。
进一步地,上述若所述第一下游字段长度大于或等于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求的步骤S512,包括:
S5121、若所述第一下游字段长度大于或等于所述第一上游字段长度,则获取第一上游表的编码格式,以及第一下游表的编码格式;
S5122、计算第一上游表的编码格式和第一下游表的编码格式之间的字段长度的第一比例关系;
S5123、判断所述第一上游字段长度与所述第一下游字段长度的第二比例关系是否小于等于所述第一比例关系;
S5124、若是,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求。
在本实施例中,是进一步地确定第一下游字段长度的最小值,比如,第一上游表是gbk编码格式而第一下游表是utf8编码格式,那么两个编码格式之间的字段长度的第一比例关系为2/3,那么第一上游字段长度与第一下游字段长度的第二比例关系至少不大于2/3,才能保证第一上游表中的数据可以无误的插入到第一下游表中,比如第二比例关系为2/5、1/2等。也可以理解为第一下游字段长度至少为第一上游字段长度的1.5倍。
在又一个实施例中,上述第一上游信息为第一上游字段类型和第一上游字段长度,上述第一下游信息为第一下游字段类型和第一下游字段长度时,上述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤S5,还包括:
S521、判断所述第一上游字段类型和所述第一下游字段类型是否相同,以及判断所述第一下游字段长度是否大于或等于所述第一上游字段长度;
S522、若所述第一上游字段类型和所述第一下游字段类型相同,以及所述第一下游字段长度大于或等于所述第一上游字段长度,则判定符合所述预设的要求;否则,判定不符合所述预设的要求。
在本实施例中,即为不需同时满足上述第一上游字段类型和所述第一下游字段类型相同的条件,以及所述第一下游字段长度大于或等于所述第一上游字段长度的条件,才会判定第一上游表和第一下游表之间是匹配的,否则会判定两者不匹配。因为,只要上述两个条件中的任意一个条件不达标,那么在将第一上游表中的数据插入到下游表中的时候,都会出现错误,比如,字段类型不同,出现无法插入的错误,下游字段长度小于上游字段长度,无法正常插入的错误等。
在一个实施例中,上述若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息的步骤S7之后,包括:
S701、判断在指定时间长度内是否接受到外部输入的修改操作信息;
S702、若未接收到所述修改操作信息,则获取预设的测试人员的邮箱地址,将所述提醒信息发送到所述邮箱地址对应的邮箱中。
在本实施例中,在做上游表和下游表匹配的过程中,测试人员是让测试的计算机设备指定进行的,所以测试人员可能不在现场,所以不能及时的进行修改操作,为了防止测试人员忘记进行修改操作,所以发送邮件进行提醒。本实施例中,上述指定时间长度的设置,可以防止测试人员现场已经进行了相应侧修改操作,还会接收到提醒邮件的情况发生。
在一个实施例中,上述若符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中的步骤S6之后,还包括:
S601、当对所述列表中的全部的相对应的上游表和下游表的关系验证结束后,生成验证报告。
在本实施例中,上述验证报告中可以记录验证的结果,比如,将全部的不符合预设要求的上游表和下游表单独整理到报告中等。
本实施例的基于GoldenGate同步工具的数据库中表结构对比方法,可以自动完成上游表和下游表是否匹配的判断过程,无需测试人员人工检测,节省人力资源,而且提高检测的效率。本申请在数据同步之前完成上下游表的匹配过程,从而减少在后续的数据同步过程中,出现数据无法同步的情况发生。
参照图2,本申请实施例还提供一种数据库中表结构对比装置,所述数据库是基于GoldenGate同步工具的数据库,包括:
第一获取单元10,用于获取记录有同步表的同步表名、以及各所述同步表名的数据库连接串的列表,其中,所述同步表包括呈一对一映射关系的上游表和下游表;
第二获取单元20,用于在所述列表中获取相互对应的第一上游表的第一上游表名和第一下游表的第一下游表名,以及与所述第一上游表名对应的第一上游数据库连接串,与所述第一下游表名对应的第一下游数据库连接串;
连接单元30,用于依据所述第一上游数据库连接串连接存储有第一上游表的第一上游数据库,以及依据所述第一下游数据库连接串连接存储有第一下游表的第一下游数据库;
第三获取单元40,用于在所述第一上游数据库中获取所述第一上游表的第一上游信息,以及在所述第一下游数据库中获取所述第一下游表的第一下游信息;
判断单元50,用于判断所述第一上游信息和所述第一下游信息是否符合预设的要求;
第一判定单元60,用于若所述第一上游信息和所述第一下游信息符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中;
第二判定单元70,用于若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息。
在一个实施例中,上述第一上游信息为第一上游字段类型,所述第一下游信息为第一下游字段类型时,上述判断单元50,还包括:
第一判断模块,用于判断所述第一上游字段类型和所述第一下游字段类型是否相同;
第一判定模块,用于若所述第一上游字段类型和所述第一下游字段类型相同,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求,否则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
在另一个实施例中,上述第一上游信息为第一上游字段长度,上述第一下游信息为第一下游字段长度时,上述判断单元50还包括:
第二判断模块,用于判断所述第一下游字段长度是否大于或等于所述第一上游字段长度;
第二判定模块,用于若所述第一下游字段长度大于或等于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求,否则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
进一步地,上述第二判定模块,包括:
获取子模块,用于若所述第一下游字段长度大于或等于所述第一上游字段长度,则获取第一上游表的编码格式,以及第一下游表的编码格式;
计算子模块,用于计算第一上游表的编码格式和第一下游表的编码格式之间的字段长度的第一比例关系;
判断子模块,用于判断所述第一上游字段长度与所述第一下游字段长度的第二比例关系是否小于等于所述第一比例关系;
判定子模块,用于若所述第一上游字段长度与所述第一下游字段长度的第二比例关系小于等于所述第一比例关系是,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求。
在又一个实施例中,上述第一上游信息为第一上游字段类型和第一上游字段长度,上述第一下游信息为第一下游字段类型和第一下游字段长度时,上述判断单元50,还包括:
第三判断模块,用于判断所述第一上游字段类型和所述第一下游字段类型是否相同,以及判断所述第一下游字段长度是否大于或等于所述第一上游字段长度;
第三判定模块,用于若所述第一上游字段类型和所述第一下游字段类型相同,以及所述第一下游字段长度大于或等于所述第一上游字段长度,则判定符合所述预设的要求;否则,判定不符合所述预设的要求。
在一个实施例中,上述数据库中表结构对比装置还包括:
输入判断单元,用于判断在指定时间长度内是否接受到外部输入的修改操作信息;
发送单元,用于若未接收到所述修改操作信息,则获取预设的测试人员的邮箱地址,将所述提醒信息发送到所述邮箱地址对应的邮箱中。
在一个实施例中,上述数据库中表结构对比装置还包括:
生成单元,用于当对所述列表中的全部的相对应的上游表和下游表的关系验证结束后,生成验证报告。
在本实施例中,上述验证报告中可以记录验证的结果,比如,将全部的不符合预设要求的上游表和下游表单独整理到报告中等。
本实施例的基于GoldenGate同步工具的数据库中表结构对比装置,是执行上述方法的装置,可以自动完成上游表和下游表是否匹配的判断过程,无需测试人员人工检测,节省人力资源,而且提高检测的效率。本申请在数据同步之前完成上下游表的匹配过程,从而减少在后续的数据同步过程中,出现数据无法同步的情况发生。
参照图3,本发明实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图3所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于上游表、下游表等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时可以实现上述任一实施例的数据库中表结构对比方法。
本发明一实施例还提供一种计算机非易失性可读存储介质,其上存储有计算机可读指令,计算机可读指令被处理器执行时实现上述任一实施例的数据库中表结构对比方法
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的和实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双速据率SDRAM(SSRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种数据库中表结构对比方法,所述数据库是基于GoldenGate同步工具的数据库,其特征在于,包括:
    获取记录有同步表的同步表名、以及各所述同步表名的数据库连接串的列表,其中,所述同步表包括呈一对一映射关系的上游表和下游表;
    在所述列表中获取相互对应的第一上游表的第一上游表名和第一下游表的第一下游表名,以及与所述第一上游表名对应的第一上游数据库连接串,与所述第一下游表名对应的第一下游数据库连接串;
    依据所述第一上游数据库连接串连接存储有第一上游表的第一上游数据库,以及依据所述第一下游数据库连接串连接存储有第一下游表的第一下游数据库;
    在所述第一上游数据库中获取所述第一上游表的第一上游信息,以及在所述第一下游数据库中获取所述第一下游表的第一下游信息;
    判断所述第一上游信息和所述第一下游信息是否符合预设的要求;
    若所述第一上游信息和所述第一下游信息符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中;
    若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息。
  2. 根据权利要求1所述的数据库中表结构对比方法,其特征在于,所述第一上游信息为第一上游字段类型,所述第一下游信息为第一下游字段类型时,所述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤,还包括:
    判断所述第一上游字段类型和所述第一下游字段类型是否相同;
    若所述第一上游字段类型和所述第一下游字段类型相同,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求;
    若所述第一上游字段类型和所述第一下游字段类型不相同,则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
  3. 根据权利要求1所述的数据库中表结构对比方法,其特征在于,所述第一上游信息为第一上游字段长度,所述第一下游信息为第一下游字段长度时,所述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤,还包括:
    判断所述第一下游字段长度是否大于或等于所述第一上游字段长度;
    若所述第一下游字段长度大于或等于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求;
    否所述第一下游字段长度小于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
  4. 根据权利要求3所述的数据库中表结构对比方法,其特征在于,所述若所述第一下游字段长度大于或等于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求的步骤,包括:
    若所述第一下游字段长度大于或等于所述第一上游字段长度,则获取第一上游表的编码格式,以及第一下游表的编码格式;
    计算第一上游表的编码格式和第一下游表的编码格式之间的字段长度的第一比例关系;
    判断所述第一上游字段长度与所述第一下游字段长度的第二比例关系是否小于等于所述第一比例关系;
    若是,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求。
  5. 根据权利要求1所述的数据库中表结构对比方法,其特征在于,所述第一上游信息为第一上游字段类型和第一上游字段长度,所述第一下游信息为第一下游字段类型和第一下游字段长度时,所述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤,还包括:
    判断所述第一上游字段类型和所述第一下游字段类型是否相同,以及判断所述第一下游字段长度是否大于或等于所述第一上游字段长度;
    若所述第一上游字段类型和所述第一下游字段类型相同,以及所述第一下游字段长度大于或等于所述第一上游字段长度,则判定符合所述预设的要求;否则,判定不符合所述预设的要求。
  6. 根据权利要求1所述的数据库中表结构对比方法,其特征在于,所述若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息的步骤之后,包括:
    判断在指定时间长度内是否接受到外部输入的修改操作信息;
    若未接收到所述修改操作信息,则获取预设的测试人员的邮箱地址,将所述提醒信息发送到所述邮箱地址对应的邮箱中。
  7. 根据权利要求1所述的数据库中表结构对比方法,其特征在于,所述若符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中的步骤之后,还包括:
    当对所述列表中的全部的相对应的上游表和下游表的关系验证结束后,生成验证报告。
  8. 一种数据库中表结构对比装置,所述数据库是基于GoldenGate同步工具的数据库,其特征在于,包括:
    第一获取单元,用于获取记录有同步表的同步表名、以及各所述同步表名的数据库连接串的列表,其中,所述同步表包括呈一对一映射关系的上游表和下游表;
    第二获取单元,用于在所述列表中获取相互对应的第一上游表的第一上游表名和第一下游表的第一下游表名,以及与所述第一上游表名对应的第一上游数据库连接串,与所述第一下游表名对应的第一下游数据库连接串;
    连接单元,用于依据所述第一上游数据库连接串连接存储有第一上游表的第一上游数据库,以及依据所述第一下游数据库连接串连接存储有第一下游表的第一下游数据库;
    第三获取单元,用于在所述第一上游数据库中获取所述第一上游表的第一上游信息,以及在所述第一下游数据库中获取所述第一下游表的第一下游信息;
    判断单元,用于判断所述第一上游信息和所述第一下游信息是否符合预设的要求;
    第一判定单元,用于若所述第一上游信息和所述第一下游信息符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中;
    第二判定单元,用于若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息。
  9. 根据权利要求8所述的数据库中表结构对比装置,其特征在于,所述第一上游信息为第一上游字段类型,所述第一下游信息为第一下游字段类型时,所述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤,还包括:
    第一判断模块,用于判断所述第一上游字段类型和所述第一下游字段类型是否相同;
    第一判定模块,用于若所述第一上游字段类型和所述第一下游字段类型相同,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求,否则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
  10. 根据权利要求8所述的数据库中表结构对比装置,其特征在于,所述第一上游信息为第一上游字段长度,所述第一下游信息为第一下游字段长度时,所述判断单元包括:
    第二判断模块,用于判断所述第一下游字段长度是否大于或等于所述第一上游字段长度;
    第二判定模块,用于若所述第一下游字段长度大于或等于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求,否则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
  11. 根据权利要求10所述的数据库中表结构对比装置,其特征在于,所述第二判断模块包括:
    获取子模块,用于若所述第一下游字段长度大于或等于所述第一上游字段长度,则获取第一上游表的编码格式,以及第一下游表的编码格式;
    计算子模块,用于计算第一上游表的编码格式和第一下游表的编码格式之间的字段长度的第一比例关系;
    判断子模块,用于判断所述第一上游字段长度与所述第一下游字段长度的第二比例关系是否小于等于所述第一比例关系;
    判定子模块,用于若所述第一上游字段长度与所述第一下游字段长度的第二比例关系小于等于所述第一比例关系是,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求。
  12. 根据权利要求8所述的数据库中表结构对比装置,其特征在于,所述第一上游信息为第一上游字段类型和第一上游字段长度,所述第一下游信息为第一下游字段类型和第一下游字段长度时,所述判断单元包括:
    第三判断模块,用于判断所述第一上游字段类型和所述第一下游字段类型是否相同,以及判断所述第一下游字段长度是否大于或等于所述第一上游字段长度;
    第三判定模块,用于若所述第一上游字段类型和所述第一下游字段类型相同,以及所述第一下游字段长度大于或等于所述第一上游字段长度,则判定符合所述预设的要求;否则,判定不符合所述预设的要求。
  13. 根据权利要求8所述的数据库中表结构对比装置,其特征在于,所述数据库中表结构对比装置还包括:
    输入判断单元,用于判断在指定时间长度内是否接受到外部输入的修改操作信息;
    发送单元,用于若未接收到所述修改操作信息,则获取预设的测试人员的邮箱地址,将所述提醒信息发送到所述邮箱地址对应的邮箱中。
  14. 根据权利要求8所述的数据库中表结构对比装置,其特征在于,所述数据库中表结构对比装置还包括:
    生成单元,用于当对所述列表中的全部的相对应的上游表和下游表的关系验证结束后,生成验证报告。
  15. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现一种数据库中表结构对比方法,所述数据库是基于GoldenGate同步工具的数据库,包括:
    获取记录有同步表的同步表名、以及各所述同步表名的数据库连接串的列表,其中,所述同步表包括呈一对一映射关系的上游表和下游表;
    在所述列表中获取相互对应的第一上游表的第一上游表名和第一下游表的第一下游表名,以及与所述第一上游表名对应的第一上游数据库连接串,与所述第一下游表名对应的第一下游数据库连接串;
    依据所述第一上游数据库连接串连接存储有第一上游表的第一上游数据库,以及依据所述第一下游数据库连接串连接存储有第一下游表的第一下游数据库;
    在所述第一上游数据库中获取所述第一上游表的第一上游信息,以及在所述第一下游数据库中获取所述第一下游表的第一下游信息;
    判断所述第一上游信息和所述第一下游信息是否符合预设的要求;
    若所述第一上游信息和所述第一下游信息符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中;
    若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息。
  16. 根据权利要求15所述的计算机设备,其特征在于,所述第一上游信息为第一上游字段类型,所述第一下游信息为第一下游字段类型时,所述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤,还包括:
    判断所述第一上游字段类型和所述第一下游字段类型是否相同;
    若所述第一上游字段类型和所述第一下游字段类型相同,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求;
    若所述第一上游字段类型和所述第一下游字段类型不相同,则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
  17. 根据权利要求15所述的计算机设备,其特征在于,所述第一上游信息为第一上游字段长度,所述第一下游信息为第一下游字段长度时,所述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤,还包括:
    判断所述第一下游字段长度是否大于或等于所述第一上游字段长度;
    若所述第一下游字段长度大于或等于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求;
    否所述第一下游字段长度小于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
  18. 根据权利要求17所述的计算机设备,其特征在于,所述若所述第一下游字段长度大于或等于所述第一上游字段长度,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求的步骤,包括:
    若所述第一下游字段长度大于或等于所述第一上游字段长度,则获取第一上游表的编码格式,以及第一下游表的编码格式;
    计算第一上游表的编码格式和第一下游表的编码格式之间的字段长度的第一比例关系;
    判断所述第一上游字段长度与所述第一下游字段长度的第二比例关系是否小于等于所述第一比例关系;
    若是,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求。
  19. 一种计算机非易失性可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现一种数据库中表结构对比方法,所述数据库是基于GoldenGate同步工具的数据库,包括:
    获取记录有同步表的同步表名、以及各所述同步表名的数据库连接串的列表,其中,所述同步表包括呈一对一映射关系的上游表和下游表;
    在所述列表中获取相互对应的第一上游表的第一上游表名和第一下游表的第一下游表名,以及与所述第一上游表名对应的第一上游数据库连接串,与所述第一下游表名对应的第一下游数据库连接串;
    依据所述第一上游数据库连接串连接存储有第一上游表的第一上游数据库,以及依据所述第一下游数据库连接串连接存储有第一下游表的第一下游数据库;
    在所述第一上游数据库中获取所述第一上游表的第一上游信息,以及在所述第一下游数据库中获取所述第一下游表的第一下游信息;
    判断所述第一上游信息和所述第一下游信息是否符合预设的要求;
    若所述第一上游信息和所述第一下游信息符合所述预设的要求,则判定第一上游表中的数据可以成功的同步到第一下游表中;
    若所述第一上游信息和所述第一下游信息不符合所述预设的要求,则生成提醒信息。
  20. 根据权利要求19所述的计算机非易失性可读存储介质,其特征在于,所述第一上游信息为第一上游字段类型,所述第一下游信息为第一下游字段类型时,所述判断所述第一上游信息和所述第一下游信息是否符合预设的要求的步骤,还包括:
    判断所述第一上游字段类型和所述第一下游字段类型是否相同;
    若所述第一上游字段类型和所述第一下游字段类型相同,则判定所述第一上游信息和所述第一下游信息符合所述预设的要求;
    若所述第一上游字段类型和所述第一下游字段类型不相同,则判定所述第一上游信息和所述第一下游信息不符合所述预设的要求。
PCT/CN2019/103452 2019-05-13 2019-08-29 数据库中表结构对比方法、装置、计算机设备和存储介质 WO2020228184A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910394547.7 2019-05-13
CN201910394547.7A CN110263032B (zh) 2019-05-13 2019-05-13 数据库中表结构对比方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2020228184A1 true WO2020228184A1 (zh) 2020-11-19

Family

ID=67914617

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103452 WO2020228184A1 (zh) 2019-05-13 2019-08-29 数据库中表结构对比方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN110263032B (zh)
WO (1) WO2020228184A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612773A (zh) * 2020-12-15 2021-04-06 平安消费金融有限公司 数据库同步测试方法、装置、计算机设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112307124A (zh) * 2020-11-03 2021-02-02 平安普惠企业管理有限公司 数据库同步验证方法、装置、设备及存储介质
CN112835984A (zh) * 2021-03-10 2021-05-25 北京车和家信息技术有限公司 告警处理方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455557A (zh) * 2013-08-08 2013-12-18 上海新炬网络技术有限公司 一种基于日志的结构化数据同步方法
CN106777272A (zh) * 2016-12-29 2017-05-31 成都康赛信息技术有限公司 一种数据比对及同步方法
CN107122355A (zh) * 2016-02-24 2017-09-01 阿里巴巴集团控股有限公司 数据迁移系统和方法
CN107346314A (zh) * 2016-05-06 2017-11-14 银联国际有限公司 一种数据库单向同步方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108471433B (zh) * 2018-01-25 2021-07-13 中国平安人寿保险股份有限公司 一种配置化的同步消息验证接收方法、系统及存储介质
CN108874644B (zh) * 2018-06-06 2021-12-24 平安科技(深圳)有限公司 数据监控方法、装置、计算机设备及存储介质
CN109388676B (zh) * 2018-08-21 2023-11-14 中国平安人寿保险股份有限公司 数据同步生成方法、装置、计算机设备以及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455557A (zh) * 2013-08-08 2013-12-18 上海新炬网络技术有限公司 一种基于日志的结构化数据同步方法
CN107122355A (zh) * 2016-02-24 2017-09-01 阿里巴巴集团控股有限公司 数据迁移系统和方法
CN107346314A (zh) * 2016-05-06 2017-11-14 银联国际有限公司 一种数据库单向同步方法
CN106777272A (zh) * 2016-12-29 2017-05-31 成都康赛信息技术有限公司 一种数据比对及同步方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112612773A (zh) * 2020-12-15 2021-04-06 平安消费金融有限公司 数据库同步测试方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN110263032A (zh) 2019-09-20
CN110263032B (zh) 2023-08-29

Similar Documents

Publication Publication Date Title
WO2020228184A1 (zh) 数据库中表结构对比方法、装置、计算机设备和存储介质
CN108874644B (zh) 数据监控方法、装置、计算机设备及存储介质
WO2017162029A1 (zh) 基于序列化格式的配置文件校验方法和装置
CN106502883B (zh) 自动化测试时客户端与服务端的数据库同步方法及系统
CN109344642A (zh) 接口规则校验方法、装置、计算机设备及存储介质
US20040039912A1 (en) Computer networked system and method of digital file management and authentication
CN110795450A (zh) Sql处理方法及装置
WO2020155483A1 (zh) Http请求报文头的适配方法、装置和计算机设备
US11842231B2 (en) Cloud-based API metadata management method and system for integrated API management
CN111045921A (zh) 自动化接口测试方法、装置、计算机设备及存储介质
CN109656931B (zh) 合同数据一致性的核实方法、装置、设备及存储介质
CN108572942A (zh) 一种创建超链接的方法和装置
CN110633198A (zh) 基于区块链的软件测试数据的存储方法及系统
JP4193196B1 (ja) Webサービス提供システム検査装置及びWebサービス提供システム検査プログラム
CN106850231A (zh) 一种保护接口安全的方法、服务端及系统、一种客户端
BR112016003486B1 (pt) Método, servidor e dispositivo de memória legível por computador para gerar automaticamente documentos de certificação
CN111290998A (zh) 迁移数据的校对方法、装置、设备及存储介质
CN110162461B (zh) 数据同步验证方法、装置和计算机设备
CN111797005A (zh) 网关接口解析方法、装置、计算机设备和存储介质
CN110602265A (zh) 一种适用于ied设备的61850模型短地址配置及资源映射方法
WO2020155784A1 (zh) 基于通用数据接口的报文保存方法、装置和计算机设备
CN110807037B (zh) 一种数据修改方法、装置、电子设备及存储介质
CN106933888A (zh) 数据库配置管理系统
CN112068982A (zh) 汽车设码方法、装置、计算机设备及存储介质
KR20150033027A (ko) 번역 관리 방법 및 시스템

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19928513

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19928513

Country of ref document: EP

Kind code of ref document: A1