Method, device and equipment for checking data table consistency and storage medium
By automatically comparing the business primary key information and field attributes of data tables, a consistency verification report is generated, which solves the problem of low efficiency of manual comparison in existing technologies and realizes efficient data table structure consistency detection and system change consistency assurance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2023-03-01
- Publication Date
- 2026-07-03
Smart Images

Figure CN116361285B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of big data technology, and in particular relates to a method, apparatus, device and storage medium for verifying the consistency of data tables. Background Technology
[0002] During the design phase of an enterprise data management system, a physical model is typically designed, generating design-state metadata. When the system is deployed to the production environment, production-state metadata is retrieved from that environment. Because data management systems undergo frequent changes as business operations evolve, it's crucial to pre-test the consistency between the physical model and database tables to ensure the system can be better applied to other business scenarios. This allows data governance personnel to adjust any structural inconsistencies in the physical model and database tables based on the test results, thereby guaranteeing consistency between the system's design and production states. Current technology typically uses manual comparison to determine the structural consistency between the physical model tables and the database tables, but this method is inefficient and prone to errors. Summary of the Invention
[0003] This application provides a method, apparatus, device, and storage medium for verifying the consistency of data tables, which can automatically verify whether the structures of physical model tables and database tables are consistent.
[0004] In a first aspect, embodiments of this application provide a method for verifying the consistency of data tables. The method includes: acquiring first business primary key information and a first identifier corresponding to multiple first data tables in multiple design states, and second business primary key information and a second identifier corresponding to multiple second data tables in multiple production states; the first identifier and the second identifier are determined according to the language of a first target type; comparing whether the first business primary key information and the second business primary key information are consistent to obtain a first primary key information comparison result; for the first data tables and the second data tables with consistent business primary key information in the first primary key information comparison result, comparing whether the first identifier and the second identifier are consistent to obtain an identifier comparison result; for the first data tables and the second data tables with consistent identifiers in the identifier comparison result, comparing whether the fields of the first data tables and the fields of the second data tables are consistent to obtain a field comparison result; and determining the verification result of data table consistency based on the first primary key information comparison result, the identifier comparison result, and the field comparison result.
[0005] According to the implementation of the first aspect of this application, for a first data table and a second data table with identical identifiers in the identifier comparison results, a field comparison result is obtained by comparing whether the fields of the first data table and the fields of the second data table are consistent. Specifically, this includes: for a first data table and a second data table with identical identifiers in the identifier comparison results, comparing whether the first field business primary key information corresponding to the fields of the first data table and the second field business primary key information corresponding to the fields of the second data table are consistent, to obtain a second primary key information comparison result; for a first data table and a second data table with consistent field business primary key information in the second primary key information comparison results, comparing whether the field attributes corresponding to the fields of the first data table and the fields of the second data table are consistent, to obtain a field attribute comparison result; the field attributes include at least one of: field identifier, field type, and field length; the field identifier is determined according to the language of the first target type; and the field comparison result is obtained based on the second primary key information comparison result and the field attribute comparison result.
[0006] According to any of the foregoing embodiments of the first aspect of this application, the first business primary key information is determined based on the subsystem and mode to which the first data table belongs and the third identifier corresponding to the first data table; the second business primary key information is determined based on the subsystem and mode to which the second data table belongs and the fourth identifier corresponding to the second data table; the third identifier and the fourth identifier are determined based on the language of the second target type.
[0007] According to any of the foregoing embodiments of the first aspect of this application, the first field business primary key information is determined based on the fifth identifier corresponding to the field of the first data table; the second field business primary key information is determined based on the sixth identifier corresponding to the field of the second data table; the fifth identifier and the sixth identifier are determined based on the language of the second target type.
[0008] According to any of the foregoing embodiments of the first aspect of this application, after determining the verification result of the data table consistency based on the comparison result of the first primary key information, the comparison result of the identifier, and the comparison result of the field, the verification method further includes: generating a data table consistency verification report based on the verification result of the data table consistency; the verification report includes: the comparison result of the first primary key information, the comparison result of the identifier, the comparison result of the second primary key information, and the comparison result of the field attribute.
[0009] According to any of the foregoing embodiments of the first aspect of this application, after generating a data table consistency inspection report based on the data table consistency inspection results, the inspection method further includes: displaying the data table consistency inspection report.
[0010] According to any of the foregoing embodiments of the first aspect of this application, the data table consistency inspection report is displayed, specifically including: displaying the first primary key information comparison result, the identifier comparison result, the second primary key information comparison result, and the field attribute comparison result using different display styles; the display style includes at least one of the displayed font, font size, and color.
[0011] Secondly, embodiments of this application provide a data table consistency verification device, comprising: an acquisition module, configured to acquire first business primary key information and a first identifier corresponding to multiple first data tables in design states, and second business primary key information and a second identifier corresponding to multiple second data tables in production states; the first identifier and the second identifier are determined according to the language of a first target type; a first comparison module, configured to compare whether the first business primary key information and the second business primary key information are consistent, and obtain a first primary key information comparison result; a second comparison module, configured to compare whether the first identifier and the second identifier are consistent for the first data tables and the second data tables with consistent business primary key information in the first primary key information comparison result, and obtain an identifier comparison result; a third comparison module, configured to compare whether the fields of the first data tables and the second data tables with consistent identifiers in the identifier comparison result are consistent, and obtain a field comparison result; and a determination module, configured to determine the data table consistency verification result based on the first primary key information comparison result, the identifier comparison result, and the field comparison result.
[0012] Thirdly, embodiments of this application provide an electronic device, which includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the steps of the data table consistency verification method provided in the first aspect.
[0013] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the data table consistency verification method provided in the first aspect.
[0014] The data table consistency verification method, apparatus, device, and storage medium of this application embodiment acquire first business primary key information and first identifier corresponding to multiple first data tables in the design state, and second business primary key information and second identifier corresponding to multiple second data tables in the production state. The first identifier and second identifier are determined according to the language of a first target type. The first business primary key information and the second business primary key information are compared to obtain a first primary key information comparison result. For the first data tables and second data tables with consistent business primary key information in the first primary key information comparison result, the first identifier and the second identifier are compared to obtain an identifier comparison result. For the first data tables and second data tables with consistent identifiers in the identifier comparison result, the fields of the first data tables and the fields of the second data tables are compared to obtain a field comparison result. Based on the first primary key information comparison result, the identifier comparison result, and the field comparison result, the data table consistency verification result is determined. Based on the verification method provided by this application embodiment, it is possible to automatically verify whether the structures of the first data tables in the design state and the second data tables in the production state in a data management system are consistent, and obtain a relatively accurate verification result. In this way, data governance personnel can make corresponding adjustments to the first and second data tables with inconsistent structures based on the inspection results, thereby ensuring the consistency of system design and production state changes. Compared with manual comparison methods, the inspection method provided in this application embodiment greatly improves the efficiency of data governance personnel in managing the data management system. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating a data table consistency verification method provided in an embodiment of this application;
[0017] Figure 2 This is a flowchart illustrating another data table consistency verification method provided in an embodiment of this application;
[0018] Figure 3 This is a schematic diagram of the structure of a data table consistency verification device provided in an embodiment of this application;
[0019] Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0021] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0022] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0023] Various modifications and variations can be made to this application without departing from its spirit or scope, which will be apparent to those skilled in the art. Therefore, this application is intended to cover modifications and variations falling within the scope of the corresponding claims (the claimed technical solutions) and their equivalents. It should be noted that the embodiments provided in this application can be combined with each other without contradiction.
[0024] It should be noted that the acquisition, storage, use, and processing of data in this application embodiment all comply with the relevant provisions of national laws and regulations.
[0025] Before describing the technical solutions provided in the embodiments of this application, in order to facilitate understanding of the embodiments of this application, this application first specifically explains the problems existing in the prior art:
[0026] As mentioned above, the inventors of this application have discovered that in the prior art, the management of physical models and database tables has been incorporated into enterprise metadata management or data asset management systems to achieve complete automatic collection of physical model tables and database tables, as well as accurate maintenance of business metadata, thereby effectively supporting business metadata benchmarking and technical metadata alignment. Although the management of physical model tables and database tables as data assets has become increasingly mature in the prior art, currently, manual comparison is often the only way to determine whether the structures of physical model tables and database tables are consistent, in order to achieve consistency analysis between design-state data assets and production-state data assets. However, manual comparison is inefficient and prone to errors, and cannot quickly provide data governance personnel with accurate and reliable analysis results.
[0027] In view of the inventors’ above-mentioned research findings, the embodiments of this application provide a method, apparatus, device and storage medium for verifying the consistency of data tables, which can solve the technical problem that the existing method of manually comparing the structure of physical model tables and database tables is inefficient and prone to errors.
[0028] The following section first introduces the data table consistency verification method provided in the embodiments of this application.
[0029] Figure 1 This is a flowchart illustrating a data table consistency verification method provided in an embodiment of this application. Figure 1 As shown, the method may include the following steps S101 to S105:
[0030] S101. Obtain the first business primary key information and first identifier corresponding to the first data tables of multiple design states, and the second business primary key information and second identifier corresponding to the second data tables of multiple production states.
[0031] The process involves obtaining the first data table (physical model table) for multiple design states requiring consistency analysis, and the second data table (database table) for multiple production states. This allows for the determination of the first business primary key information and first identifier for each physical model table to be compared, and the second business primary key information and second identifier for each database table. The first business primary key information uniquely identifies the physical model table, and the second business primary key information uniquely identifies the database table. The first and second identifiers are determined based on the same language type, i.e., the language of the first target type. The language of the first target type can include, but is not limited to, Chinese. Taking Chinese as an example, the first and second identifiers are the Chinese names of the physical model table and the database table, respectively.
[0032] S102. Compare whether the first business primary key information and the second business primary key information are consistent to obtain the comparison result of the first primary key information.
[0033] Compare the first business primary key information of multiple first data tables with the second business primary key information of multiple second data tables to see if they are consistent, and obtain the comparison result of the first primary key information with consistent business primary key information, or the comparison result of the first primary key information with inconsistent business primary key information.
[0034] S103. For the first data table and the second data table whose business primary key information is consistent in the first primary key information comparison result, compare whether the first identifier and the second identifier are consistent to obtain the identifier comparison result.
[0035] For the first and second data tables with identical business primary key information in the first primary key information comparison results, the first identifier of the first data table and the second identifier of the second data table are compared separately to obtain an identifier comparison result with identical identifiers or an identifier comparison result with inconsistent identifiers. The first and second data tables are only matched if both the business primary key information and the identifiers are identical; otherwise, they are not matched. In this case, a comparison result of a matched table is formed for the matched first and second data tables. For the mismatched first and second data tables, it is identified whether the table is unique to the physical model or unique to the database, resulting in a comparison result of a non-matching database table and / or a non-matching physical model table.
[0036] S104. For the first and second data tables with consistent identifiers in the identifier comparison results, compare whether the fields of the first data table and the fields of the second data table are consistent to obtain the field comparison results.
[0037] For the first and second data tables that match in the identifier comparison results (i.e., the matching tables), the fields of the first and second data tables are then compared to determine whether they are identical. This yields either a field comparison result with completely identical fields or a field comparison result with slightly different fields. Only when the fields are completely identical can the first and second data tables be considered a complete match, thus confirming their consistency. Otherwise, the first and second data tables are not consistent.
[0038] S105. Based on the comparison results of the first primary key information, the identification comparison results, and the field comparison results, determine the verification results of the data table consistency.
[0039] Based on the comparison results of the first primary key information, the identification comparison results, and the field comparison results, the consistency test results of the first data table and the second data table are obtained, including the first data table being a matching table, the first data table being a non-matching database table, the second data table being a non-matching physical model table, and the first data table and the second data table being a complete match.
[0040] The data table consistency verification method of this application can automatically verify whether the structures of a first data table in the design state and a second data table in the production state are consistent in a data management system, and obtain relatively accurate verification results. Thus, data governance personnel can make corresponding adjustments to the structurally inconsistent first and second data tables based on the verification results, thereby ensuring the consistency of changes between the system's design and production states. Compared with manual comparison methods, the verification method provided by this application significantly improves the efficiency of data governance personnel in managing the data management system.
[0041] Figure 2 This is a flowchart illustrating another data table consistency verification method provided in an embodiment of this application. For example... Figure 2 As shown, according to some embodiments of this application, optionally, S104 compares whether the fields of the first data table and the second data table, which have the same identifier in the identifier comparison result, are consistent, to obtain the field comparison result. Specifically, it may also include the following steps S201 to S203:
[0042] S201. For the first data table and the second data table with the same identifier in the identifier comparison result, compare whether the first field business primary key information corresponding to the field of the first data table is consistent with the second field business primary key information corresponding to the field of the second data table, and obtain the second primary key information comparison result.
[0043] For the first and second data tables with identical identifiers in the identifier comparison results, first compare whether the first field business primary key information corresponding to the field in the first data table is consistent with the second field business primary key information corresponding to the field in the second data table, to obtain the second primary key information comparison result if the field business primary key information is consistent, or the second primary key information comparison result if the field business primary key information is inconsistent.
[0044] S202. For the first and second data tables whose field business primary key information is consistent in the second primary key information comparison results, compare whether the field attributes corresponding to the fields in the first data table and the field attributes corresponding to the fields in the second data table are consistent, and obtain the field attribute comparison results.
[0045] For the first and second data tables whose business primary key information is consistent in the second primary key information comparison results, the field attributes corresponding to the fields in the first data table and the field attributes corresponding to the fields in the second data table are compared to see if they are consistent, so as to obtain the field attribute comparison results with consistent field attributes or the field attribute comparison results with inconsistent field attributes.
[0046] The field attributes in this embodiment include at least one of field identifier, field type, and field length. The field identifier is determined based on the language of the first target type. Taking Chinese as an example, the field identifiers are the Chinese names of the fields in the physical model table and the database table. Then, the Chinese names, types, and lengths of the fields in the first and second data tables are compared to see if they are consistent. For the first and second data tables with completely consistent field names, types, and lengths, a field attribute comparison result indicating consistent field attributes is obtained. For the first and second data tables with inconsistent field names, types, and lengths, a field attribute comparison result indicating inconsistent field attributes is obtained.
[0047] If the Chinese names of the fields are inconsistent, it can be identified whether the field is unique to the physical model table or the database table, resulting in a comparison of the additional physical model table fields and / or additional database table fields. If the field types are inconsistent, a comparison result of field type mismatch can be obtained. If the field lengths are inconsistent, a comparison result of field length mismatch can be obtained. Only when the business primary key information and field attributes of the fields are consistent can a field comparison result of completely consistent fields be obtained; otherwise, a field comparison result of incompletely consistent fields will be obtained.
[0048] S203. Based on the comparison results of the second primary key information and the field attribute comparison results, obtain the field comparison results.
[0049] Based on the comparison results of the second primary key information and the field attribute comparison results, the following field comparison results were obtained: fields are completely consistent; the field in the first data table is an extra physical model table field; the field in the second data table is an extra database table field; field types do not match; field lengths do not match.
[0050] In some embodiments, the first business primary key information is determined based on the subsystem and mode to which the first data table belongs and the third identifier corresponding to the first data table; the second business primary key information is determined based on the subsystem and mode to which the second data table belongs and the fourth identifier corresponding to the second data table; the third identifier and the fourth identifier are determined based on the language of the second target type.
[0051] For example, the language of the second target type is different from that of the first target type. Taking English as an example, the third identifier and the fourth identifier are the English names of the physical model table and the database table, respectively. In this case, the first business primary key information of the first data table can be determined as the name of the subsystem to which the physical model table belongs, the name of the SCHEMA or database to which it belongs, and the English name of the physical model table; the second business primary key information of the second data table can be determined as the name of the subsystem to which the database table belongs, the name of the SCHEMA or database to which it belongs, and the English name of the database table.
[0052] In some embodiments, the first field business primary key information is determined based on the fifth identifier corresponding to the field of the first data table; the second field business primary key information is determined based on the sixth identifier corresponding to the field of the second data table; the fifth identifier and the sixth identifier are determined based on the language of the second target type.
[0053] For example, taking English as the language of the second target type, the fifth identifier and the sixth identifier are the English names of the physical model table field and the database table field, respectively. In this case, the first field of the first data table, the business primary key information, can be determined as the first business primary key information and the English name of the physical model table field, and the second field of the second data table, the business primary key information, can be determined as the second business primary key information and the English name of the database table field.
[0054] In some embodiments, after determining the data table consistency verification result based on the first primary key information comparison result, the identifier comparison result, and the field comparison result, the verification method further includes: generating a data table consistency verification report based on the data table consistency verification result; the verification report includes: the first primary key information comparison result, the identifier comparison result, the second primary key information comparison result, and the field attribute comparison result.
[0055] For example, after determining the data table consistency verification result based on the comparison results of the first primary key information, the identification comparison result, and the field comparison result, it is also necessary to generate a data table consistency verification report based on the data table consistency verification result. The verification report may include, but is not limited to, the comparison results of the first primary key information and the identification comparison result, such as: the first data table and the second data table are a matching table, the first data table is a database table without a match, and the second data table is a physical model table without a match; the comparison results of the second primary key information and the field attribute comparison result, such as: the first data table and the second data table are a complete match, the field in the first data table is an extra physical model table field, the field in the second data table is an extra database table field, the field type does not match, and the field length does not match.
[0056] In some embodiments, after generating a data table consistency test report based on the data table consistency test results, the test method further includes: displaying the data table consistency test report.
[0057] For example, after generating a data table consistency verification report based on the data table consistency verification results, it is also necessary to display the verification report to the data governance personnel so that they can adjust the structure of the inconsistent physical model table and database table according to the verification report to achieve consistency between the physical model table and the database table, thereby ensuring the consistency of changes in the design state and production state of the data management system.
[0058] In some embodiments, displaying a data table consistency verification report specifically includes: displaying the comparison results of the first primary key information, the identification comparison results, the comparison results of the second primary key information, and the comparison results of field attributes using different display styles; the display style includes at least one of the displayed font, font size, and color.
[0059] For example, different fonts, font sizes, and colors can be used to display the comparison results of the first primary key information, the identification comparison results, the second primary key information, and the field attribute comparison results. This allows data governance personnel to quickly locate the inconsistencies between the physical model table and the database table, thereby improving their efficiency in managing the data management system. This application does not specifically limit the display style of the inspection report.
[0060] Based on the data table consistency verification method provided in the above embodiments, this application also provides specific implementation methods of the data table consistency verification device. Please refer to the following embodiments.
[0061] like Figure 3 As shown, the data table consistency verification device 30 provided in this application embodiment includes the following modules:
[0062] The acquisition module 301 is used to acquire the first business primary key information and the first identifier corresponding to the first data tables of multiple design states, and the second business primary key information and the second identifier corresponding to the second data tables of multiple production states; the first identifier and the second identifier are determined according to the language of the first target type;
[0063] The first comparison module 302 is used to compare whether the first business primary key information and the second business primary key information are consistent, and to obtain the comparison result of the first primary key information.
[0064] The second comparison module 303 is used to compare the first identifier and the second identifier for the first data table and the second data table whose business primary key information is consistent in the first primary key information comparison result, and obtain the identifier comparison result.
[0065] The third comparison module 304 is used to compare the fields of the first data table and the second data table that have the same identifier in the identifier comparison result to obtain the field comparison result.
[0066] The determination module 305 is used to determine the verification result of the data table consistency based on the comparison results of the first primary key information, the identification comparison results, and the field comparison results.
[0067] The data table consistency verification device of this application embodiment can automatically verify whether the structures of a first data table in the design state and a second data table in the production state are consistent in a data management system, and obtain relatively accurate verification results. Thus, data governance personnel can make corresponding adjustments to the structurally inconsistent first and second data tables based on the verification results, thereby ensuring the consistency of changes between the system's design and production states. Compared with manual comparison methods, the verification device provided in this application embodiment greatly improves the efficiency of data governance personnel in managing the data management system.
[0068] In some embodiments, the third comparison module 304 is specifically used for: comparing whether the first field business primary key information corresponding to the fields of the first data table and the second field business primary key information corresponding to the fields of the second data table are consistent in the identification comparison results, to obtain a second primary key information comparison result; comparing whether the field attributes corresponding to the fields of the first data table and the second data table are consistent in the second primary key information comparison results, to obtain a field attribute comparison result; the field attributes include at least one of: field identifier, field type, and field length; the field identifier is determined according to the language of the first target type; and obtaining a field comparison result based on the second primary key information comparison result and the field attribute comparison result.
[0069] In some embodiments, the first business primary key information is determined based on the subsystem and mode to which the first data table belongs and the third identifier corresponding to the first data table; the second business primary key information is determined based on the subsystem and mode to which the second data table belongs and the fourth identifier corresponding to the second data table; the third identifier and the fourth identifier are determined based on the language of the second target type.
[0070] In some embodiments, the first field business primary key information is determined based on the fifth identifier corresponding to the field of the first data table; the second field business primary key information is determined based on the sixth identifier corresponding to the field of the second data table; the fifth identifier and the sixth identifier are determined based on the language of the second target type.
[0071] In some embodiments, the data table consistency verification device 30 may further include: a generation module, used to generate a data table consistency verification report based on the data table consistency verification results; the verification report includes: a first primary key information comparison result, an identifier comparison result, a second primary key information comparison result, and a field attribute comparison result.
[0072] In some embodiments, the data table consistency verification device 30 may further include a display module for displaying a data table consistency verification report.
[0073] In some embodiments, the above-mentioned display module is specifically used to: display the comparison results of the first primary key information, the identification comparison results, the comparison results of the second primary key information, and the comparison results of the field attributes using different display styles; the display style includes at least one of the displayed font, font size, and color.
[0074] Figure 3 Each module in the illustrated device has the ability to implement Figure 1 The functions of each step in the process and their corresponding technical effects are described in detail here for the sake of brevity.
[0075] Based on the data table consistency verification method provided in the above embodiments, this application also provides specific implementation methods for electronic devices. Please refer to the following embodiments.
[0076] Figure 4 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.
[0077] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.
[0078] Specifically, the processor 401 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0079] Memory 402 may include mass storage for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. In one example, memory 402 may include removable or non-removable (or fixed) media, or memory 402 may be non-volatile solid-state memory. Memory 402 may be internal or external to the integrated gateway disaster recovery device.
[0080] In one example, memory 402 may be read-only memory (ROM). In one example, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
[0081] Memory 402 may include read-only memory (ROM), random access memory (RAM), disk storage media device, optical storage media device, flash memory device, electrical, optical, or other physical / tangible memory storage device. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this application.
[0082] The processor 401 reads and executes computer program instructions stored in the memory 402 to achieve... Figure 1 The method / steps S101 to S105 in the illustrated embodiment achieve the following: Figure 1 The technical effects achieved by executing the methods / steps shown in the examples are not elaborated here for the sake of brevity.
[0083] In one example, the electronic device may also include a communication interface 403 and a bus 410. For example, Figure 4 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 410 and complete communication with each other.
[0084] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0085] Bus 410 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 410 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.
[0086] Furthermore, in conjunction with the data table consistency verification methods in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the data table consistency verification methods in the above embodiments. Examples of computer-readable storage media include non-transitory computer-readable storage media, such as electronic circuits, semiconductor memory devices, ROM, random access memory, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, and hard disks.
[0087] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0088] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0089] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0090] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0091] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for verifying the consistency of a data table, characterized in that, The method includes: Obtain the first business primary key information and first identifier corresponding to the first data tables in multiple design states, and the second business primary key information and second identifier corresponding to the second data tables in multiple production states; the first identifier and the second identifier are determined according to the language of the first target type; the first identifier and the second identifier are the table business names determined based on the first target language; Compare whether the first business primary key information and the second business primary key information are consistent to obtain the first primary key information comparison result; For the first data table and the second data table whose business primary key information is consistent in the first primary key information comparison result, the first identifier and the second identifier are compared to see if they are consistent, and the identifier comparison result is obtained. For the first data table and the second data table with the same identifier in the identifier comparison result, compare whether the fields of the first data table and the fields of the second data table are consistent to obtain the field comparison result; Based on the comparison results of the first primary key information, the comparison results of the identifier, and the comparison results of the fields, the verification result of the data table consistency is determined; Specifically, the step of comparing the fields of the first data table and the second data table, which have the same identifier in the identifier comparison result, to obtain the field comparison result includes: For the first data table and the second data table with the same identifier in the identifier comparison result, compare whether the first field business primary key information corresponding to the field of the first data table and the second field business primary key information corresponding to the field of the second data table are consistent, and obtain the second primary key information comparison result; For the first data table and the second data table whose field business primary key information is consistent in the second primary key information comparison result, the field attributes corresponding to the fields in the first data table and the field attributes corresponding to the fields in the second data table are compared to see if they are consistent, and a field attribute comparison result is obtained; the field attributes include at least one of: field identifier, field type, and field length; the field identifier is determined according to the language of the first target type; The field comparison result is obtained based on the comparison result of the second primary key information and the comparison result of the field attributes.
2. The method according to claim 1, characterized in that, The first business primary key information is determined based on the subsystem, mode, and third identifier corresponding to the first data table; The second business primary key information is determined based on the subsystem, mode, and fourth identifier corresponding to the second data table; The third and fourth identifiers are determined based on the language of the second target type.
3. The method according to claim 1, characterized in that, The first field's business primary key information is determined based on the fifth identifier corresponding to the field in the first data table; The second field, the business primary key information, is determined based on the sixth identifier corresponding to the field in the second data table; The fifth and sixth identifiers are determined according to the language of the second target type.
4. The method according to claim 1, characterized in that, After determining the data table consistency verification result based on the comparison result of the first primary key information, the comparison result of the identifier, and the comparison result of the fields, the method further includes: Based on the data table consistency verification results, a data table consistency verification report is generated; the verification report includes: the first primary key information comparison result, the identifier comparison result, the second primary key information comparison result, and the field attribute comparison result.
5. The method according to claim 4, characterized in that, After generating a data table consistency test report based on the data table consistency test results, the method further includes: Displays a report verifying the consistency of the data table.
6. The method according to claim 5, characterized in that, The verification report displaying the consistency of the data table specifically includes: The comparison results of the first primary key information, the comparison results of the identifier, the comparison results of the second primary key information, and the comparison results of the field attributes are displayed using different display styles; The display style includes at least one of the following: font, font size, and color.
7. A data table consistency verification device, characterized in that, The device includes: The acquisition module is used to acquire the first business primary key information and the first identifier corresponding to the first data tables in multiple design states, and the second business primary key information and the second identifier corresponding to the second data tables in multiple production states; the first identifier and the second identifier are determined according to the language of the first target type; the first identifier and the second identifier are the table business names determined based on the first target language; The first comparison module is used to compare whether the first business primary key information and the second business primary key information are consistent, and to obtain the first primary key information comparison result. The second comparison module is used to compare the first identifier and the second identifier for the first data table and the second data table whose business primary key information is consistent in the first primary key information comparison result, respectively, to obtain the identifier comparison result. The third comparison module is used to compare the fields of the first data table and the second data table that have the same identifier in the identification comparison result to see if they are consistent, and to obtain the field comparison result. The determination module is used to determine the data table consistency verification result based on the comparison result of the first primary key information, the comparison result of the identifier, and the comparison result of the field. The third comparison module is specifically used to compare the first field business primary key information corresponding to the field of the first data table and the second data table corresponding to the field of the second data table for the first data table and the second data table with the same identifier in the identification comparison result, and to obtain the second primary key information comparison result. For the first data table and the second data table whose field business primary key information is consistent in the second primary key information comparison result, the field attributes corresponding to the fields in the first data table and the field attributes corresponding to the fields in the second data table are compared to see if they are consistent, and a field attribute comparison result is obtained; the field attributes include at least one of: field identifier, field type, and field length; the field identifier is determined according to the language of the first target type; The field comparison result is obtained based on the comparison result of the second primary key information and the comparison result of the field attributes.
8. An electronic device, characterized in that, The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the data table consistency verification method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the data table consistency verification method as described in any one of claims 1 to 6.