CN116225936A - Version error data control method and device - Google Patents

Version error data control method and device Download PDF

Info

Publication number
CN116225936A
CN116225936A CN202310187498.6A CN202310187498A CN116225936A CN 116225936 A CN116225936 A CN 116225936A CN 202310187498 A CN202310187498 A CN 202310187498A CN 116225936 A CN116225936 A CN 116225936A
Authority
CN
China
Prior art keywords
data
data table
version
sql script
current
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202310187498.6A
Other languages
Chinese (zh)
Inventor
邹宁
李钇廷
李英灯
刘文峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310187498.6A priority Critical patent/CN116225936A/en
Publication of CN116225936A publication Critical patent/CN116225936A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • 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/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a version error data control method and device, relates to the technical field of version management, and can be used in the financial field or other technical fields. The method comprises the following steps: acquiring an SQL script list in a current version library according to the submitted current SQL script, and acquiring a history submission record of the current version library script; creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record; and carrying out data comparison on the first data table and the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from carrying out version production. The apparatus performs the above method. The version error data control method and device provided by the embodiment of the invention can effectively control the version error data production, thereby reducing the version production risk.

Description

Version error data control method and device
Technical Field
The invention relates to the technical field of version management, in particular to a version error data control method and device.
Background
In the version production of the system, besides the content of the application program version, the production content of the initial data is also provided. The data production content is mainly SQL sentences submitted in the version, such as inserting data into a certain data table. After the system version is released to the verification environment and problems are found later, the system version needs to release test patches for correction, and when the final version is put into production, all the test patches need to be installed one by one in production according to the release time sequence. When a developer sends out a data script test patch, only correct data content is sent out, and the data content with the previous version error is not deleted, so that the incorrect data is finally put into production.
As shown in fig. 1, in the version development stage, the SQL script file a is submitted, and the content is to delete record 1 first and then add record 1 again. The version is released to the verification environment for installation, at which time record 1 is newly added to the database system. In the verification stage, if it is found that the record 1 should not be newly added, but the record 2 should be newly added, at the moment, the developer modifies the SQL script file, deletes the record 2 instead, and then adds the record 2 again, and then the patch is delivered, and after the patch is installed in the verification environment, the record 2 is newly added in the database system. And finally, when the production is put into operation, the release version and the subsequent patch version are installed one by one in the production environment according to the delivery time sequence.
According to the procedure described above, the production environment creates a situation that is inconsistent with the developer's expectations, who expects that the last database record has only record n, but actually creates data for records 1 through n.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a version error data control method and device, which can at least partially solve the problems in the prior art.
In one aspect, the present invention provides a version error data control method, including:
acquiring an SQL script list in a current version library according to the submitted current SQL script, and acquiring a history submission record of the current version library script;
creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record;
and carrying out data comparison on the first data table and the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from carrying out version production.
Wherein creating a first data table corresponding to the SQL script list according to the current SQL script comprises:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values;
creating a first table-building statement according to the table name, the field name and the field type;
and running the first list establishing sentence in a database, and establishing and obtaining a first data list corresponding to the SQL script list.
Wherein creating a second data table corresponding to the history commit record according to the current SQL script comprises:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values;
creating a second table-building statement according to the table name, the field name and the field type;
and running the second list establishing sentence in a database, and establishing and obtaining a second data list corresponding to the history submission record.
The data comparison of the first data table and the second data table comprises:
and comparing the data record numbers in the first data table and the second data table, and if the data record number comparison result is inconsistent, directly determining that the data comparison result is inconsistent.
The data comparison of the first data table and the second data table comprises:
if the comparison result of the data records is consistent, inquiring the data in the first data table in the second data table;
if at least one item of data in the first data table cannot be found in the second data table, directly determining that the data comparison result is inconsistent.
The data comparison of the first data table and the second data table comprises:
deleting the data in the first data table which is searched in the second data table;
and if the number of the remaining data records in the second data table is determined to be not zero, determining that the data comparison result is inconsistent.
The version error data control method further comprises the following steps:
and if the data comparison result is the data consistency, allowing the SQL script in the current version library to carry out version production.
In one aspect, the present invention provides a version error data control device for a client, including:
the acquisition unit is used for acquiring an SQL script list in the current version library according to the submitted current SQL script and acquiring a history submission record of the current version library script;
the creating unit is used for creating a first data table corresponding to the SQL script list according to the current SQL script and creating a second data table corresponding to the history submission record;
and the control unit is used for comparing the data of the first data table with the data of the second data table, and preventing the SQL script in the current version library from version production if the data comparison result is inconsistent.
In still another aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein,
the processor and the memory complete communication with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions capable of performing the method of:
acquiring an SQL script list in a current version library according to the submitted current SQL script, and acquiring a history submission record of the current version library script;
creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record;
and carrying out data comparison on the first data table and the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from carrying out version production.
Embodiments of the present invention provide a non-transitory computer readable storage medium comprising:
the non-transitory computer readable storage medium stores computer instructions that cause the computer to perform the method of:
acquiring an SQL script list in a current version library according to the submitted current SQL script, and acquiring a history submission record of the current version library script;
creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record;
and carrying out data comparison on the first data table and the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from carrying out version production.
According to the version error data control method and device provided by the embodiment of the invention, an SQL script list in a current version library is obtained according to the submitted current SQL script, and a historical submission record of the current version library script is obtained; creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record; and comparing the data of the first data table with the data of the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from version production, and effectively controlling version error data production, thereby reducing the version production risk.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. In the drawings:
FIG. 1 is an illustrative schematic diagram of prior art version development, release and commissioning sequences.
Fig. 2 is a flowchart illustrating a method for controlling version error data according to an embodiment of the present invention.
Fig. 3 is a flowchart illustrating a method for controlling version error data according to another embodiment of the present invention.
Fig. 4 is a flowchart illustrating a method for controlling version error data according to another embodiment of the present invention.
Fig. 5 is a flowchart of a version error data control method according to another embodiment of the present invention.
Fig. 6 is a schematic structural diagram of a device for controlling version error data of a client according to an embodiment of the present invention.
Fig. 7 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in further detail with reference to the accompanying drawings. The exemplary embodiments of the present invention and their descriptions herein are for the purpose of explaining the present invention, but are not to be construed as limiting the invention. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be arbitrarily combined with each other.
Description of related terms:
SQL language: the structured query language is a database query and programming language used for accessing data and querying, updating and managing a relational database system.
H2 database: a lightweight relational database that is open source can be configured to run as an in-memory database, meaning that data is not persisted on disk.
Fig. 2 is a flow chart of a method for controlling version error data according to an embodiment of the present invention, as shown in fig. 2, where the method for controlling version error data according to the embodiment of the present invention includes:
step S1: and acquiring an SQL script list in the current version library according to the submitted current SQL script, and acquiring a historical submission record of the current version library script.
Step S2: creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record.
Step S3: and carrying out data comparison on the first data table and the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from carrying out version production.
In the step S1, the device obtains the SQL script list in the current version library according to the submitted current SQL script, and obtains the history submitted record of the current version library script. The apparatus may be a computer device performing the method and may comprise, for example, a server. It should be noted that the data acquisition and analysis according to the embodiments of the present invention are authorized by the client.
SQL scripts are SQL statements containing one to many SQL commands, which can be placed in a text file, called an "SQL script file", which is then executed by the relevant command.
As shown in fig. 3, the list of SQL scripts in the current version library may be the current up-to-date list of SQL scripts in fig. 3.
In the step S2, the device creates a first data table corresponding to the SQL script list according to the current SQL script, and creates a second data table corresponding to the history commit record. Creating a first data table corresponding to the SQL script list according to the current SQL script, wherein the first data table comprises:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values;
creating a first table-building statement according to the table name, the field name and the field type;
and running the first list establishing sentence in a database, and establishing and obtaining a first data list corresponding to the SQL script list.
Creating a second data table corresponding to the historical commit record according to the current SQL script, including:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values;
creating a second table-building statement according to the table name, the field name and the field type;
and running the second list establishing sentence in a database, and establishing and obtaining a second data list corresponding to the history submission record.
As shown in fig. 4, the table structure generating device is described as follows:
and simulating and generating a table structure according to the submitted SQL data script.
1. According to the SQL script, analyzing the SQL sentence of the newly added data, obtaining the table name, the field name and the field value thereof, and matching the corresponding field type according to the field value, wherein for numbers, the matched field type is a digital type (number), and for other, the matched field type is a character type (varchar) with indefinite length.
The SQL script statement is as follows:
insert into table1(column1,column2,column3)value(1,’A’,’B’);
wherein, table name is table1, field names are column1, column2 and column3, and field types corresponding to 1, A and B are number, varchar and varchar respectively.
2. And creating a table construction sentence according to the table name, the field name and the field type, wherein each table generates a table construction sentence, the table names are respectively added with suffixes of A and B, and then the operation data of the SQL script of the current version library and the history submission record of the SQL script of the current version library are respectively stored. As an example, the tables created are table1_A and table1_B:
CREATE TABLE table1_A(number,varchar,varchar);
CREATE TABLE table1_B(number,varchar,varchar);
3. a table-building statement may be run in the H2 database to create a corresponding table. The H2 database is used for data storage, and the purpose is to make the scheme lighter and more universal through the memory database, and the corresponding database environment is not required to be established according to the production database actually used by the system. In the scheme, the H2 database can also be replaced by a database system such as a mysql database.
In the step S3, the device performs data comparison on the first data table and the second data table, and if it is determined that the data comparison result is inconsistent, the device prevents the SQL script in the current version library from performing version production, and corresponds to the "return current submission script" in fig. 3. The version error data control method further comprises the following steps:
and if the data comparison result is the data consistency, allowing the SQL script in the current version library to carry out version production, and corresponding to 'pass through' in the figure 3.
The data comparison of the first data table and the second data table comprises:
and comparing the data record numbers in the first data table and the second data table, and if the data record number comparison result is inconsistent, directly determining that the data comparison result is inconsistent. The data record numbers are compared first, and if the data record number C1 in the first data table is not equal to the data record number C2 in the second data table, the data comparison result can be directly determined as inconsistent data.
If the number of data records C1 in the first data table is equal to the number of data records C2 in the second data table, the subsequent steps are continued.
The data comparison of the first data table and the second data table comprises:
if the comparison result of the data records is consistent, inquiring the data in the first data table in the second data table; each item of data in the first data table may be traversed one by one to determine whether it can be queried in the second data table.
If at least one item of data in the first data table cannot be found in the second data table, directly determining that the data comparison result is inconsistent. If the data in the first data table cannot be found in the second data table, and the direct data comparison result can be that the data is inconsistent.
If all the data in the first data table can be found in the second data table, the following steps are continued to be executed.
The data comparison of the first data table and the second data table comprises:
deleting the data in the first data table which is searched in the second data table;
and if the number of the remaining data records in the second data table is determined to be not zero, determining that the data comparison result is inconsistent. If the number of the remaining data records is not zero, the fact that the remaining data exists in the second data table, namely the data does not exist in the first data table, can be determined that the data comparison result is inconsistent.
If the number of the remaining data records is zero, the data comparison result can be determined to be consistent.
As shown in fig. 5, the data alignment apparatus is described as follows:
after the SQL script of the current version library is operated, the historical submitting record of the SQL script of the current version library and the SQL script in the current version library are compared, whether the data of the table1_A and the data of the table1_B are consistent or not are judged, if yes, the version submitting is free of problems, otherwise, the version submitting is free of problems.
Principle of:
table a: the SQL script of the current version library runs data;
table B: historical submission records of scripts of the current version library and SQL script operation data in the current version library.
1. Checking whether the record number of the A table is consistent with the record number of the B table, if so, continuing checking, otherwise, returning to check that the record number of the A table is inconsistent.
2. And querying each data record of the A table, correspondingly querying the data of the B table, and deleting the corresponding record of the B table if the data is queried. If the data is not queried, a check is returned to be inconsistent.
3. Checking the number of the data records of the B table, returning to check inconsistency if the number of the records is not equal to 0, and returning to check consistency if the number of the records is not equal to 0.
It should be noted that, the comparison of the data record numbers is simplest and fast, the data processing amount of the data in the first data table is slightly larger by the second data table, and the determination of whether the remaining data record numbers are zero can be realized only after the data in the first data table is queried based on the second data table.
The steps are executed based on the sequence of whether the number of the data records is zero or not, so that the data processing efficiency can be further optimized, and whether the data of the data comparison result is consistent or not can be rapidly judged.
According to the version error data control method provided by the embodiment of the invention, when the SQL script is submitted, the SQL script list in the current version library and the historical submission record of the current version library script are respectively obtained. And generating a table structure device through the SQL script according to the SQL script in the current version library and the historically submitted script, and generating the table structure. And respectively running the SQL script in the current version library, and the historical submission record of the current version library script and the SQL script in the current version library. And comparing the SQL script running result in the current version library with the SQL script running result in the current version library by the data comparison device, and returning the comparison result by the data comparison device. If the data is consistent, the version check is successful, the version check can be put into the version library, otherwise, the submission is returned, and the version check is refused to be put into the version library.
The version error data control method provided by the embodiment of the invention has the following beneficial effects:
the method can effectively solve the problem that when a developer develops the SQL data script, the final version generates undeveloped expected data record errors due to the fact that the SQL data script is modified by errors, and reduces the version production risk.
According to the version error data control method provided by the embodiment of the invention, an SQL script list in a current version library is obtained according to the submitted current SQL script, and a history submission record of the current version library script is obtained; creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record; and comparing the data of the first data table with the data of the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from version production, and effectively controlling version error data production, thereby reducing the version production risk.
Further, creating a first data table corresponding to the SQL script list according to the current SQL script comprises:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values; the description of the embodiments may be referred to above, and will not be repeated.
Creating a first table-building statement according to the table name, the field name and the field type; the description of the embodiments may be referred to above, and will not be repeated.
And running the first list establishing sentence in a database, and establishing and obtaining a first data list corresponding to the SQL script list. The description of the embodiments may be referred to above, and will not be repeated.
The version error data control method provided by the embodiment of the invention can be used for efficiently creating the first data table for data comparison.
Further, creating a second data table corresponding to the historical commit record according to the current SQL script, including:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values; the description of the embodiments may be referred to above, and will not be repeated.
Creating a second table-building statement according to the table name, the field name and the field type; the description of the embodiments may be referred to above, and will not be repeated.
And running the second list establishing sentence in a database, and establishing and obtaining a second data list corresponding to the history submission record. The description of the embodiments may be referred to above, and will not be repeated.
The version error data control method provided by the embodiment of the invention can be used for efficiently creating the second data table for data comparison.
Further, the data comparison of the first data table and the second data table includes:
and comparing the data record numbers in the first data table and the second data table, and if the data record number comparison result is inconsistent, directly determining that the data comparison result is inconsistent. The description of the embodiments may be referred to above, and will not be repeated.
The version error data control method provided by the embodiment of the invention can further rapidly and accurately determine the data comparison result.
Further, the data comparison of the first data table and the second data table includes:
if the comparison result of the data records is consistent, inquiring the data in the first data table in the second data table; the description of the embodiments may be referred to above, and will not be repeated.
If at least one item of data in the first data table cannot be found in the second data table, directly determining that the data comparison result is inconsistent. The description of the embodiments may be referred to above, and will not be repeated.
The version error data control method provided by the embodiment of the invention can further rapidly and accurately determine the data comparison result.
Further, the data comparison of the first data table and the second data table includes:
deleting the data in the first data table which is searched in the second data table; the description of the embodiments may be referred to above, and will not be repeated.
And if the number of the remaining data records in the second data table is determined to be not zero, determining that the data comparison result is inconsistent. The description of the embodiments may be referred to above, and will not be repeated.
The version error data control method provided by the embodiment of the invention can further rapidly and accurately determine the data comparison result.
Further, the version error data control method further comprises the following steps:
and if the data comparison result is the data consistency, allowing the SQL script in the current version library to carry out version production. The description of the embodiments may be referred to above, and will not be repeated.
The version error data control method provided by the embodiment of the invention can further effectively control the version error data production, thereby reducing the version production risk.
It should be noted that, the version error data control method provided by the embodiment of the invention can be used in the financial field and also can be used in any technical field except the financial field, and the application field of the version error data control method is not limited by the embodiment of the invention.
Fig. 6 is a schematic structural diagram of a device for controlling version error data of a client according to an embodiment of the present invention, as shown in fig. 6, where the device for controlling version error data of a client according to an embodiment of the present invention includes an obtaining unit 601, a creating unit 602, and a control unit 603, where:
the acquiring unit 601 is configured to acquire an SQL script list in a current version library according to a submitted current SQL script, and acquire a history submission record of the current version library script; the creating unit 602 is configured to create a first data table corresponding to the SQL script list according to the current SQL script, and create a second data table corresponding to the history submission record; the control unit 603 is configured to perform data comparison on the first data table and the second data table, and if it is determined that the data comparison result is inconsistent, prevent the SQL script in the current version library from performing version production.
Specifically, the acquiring unit 601 in the device is configured to acquire an SQL script list in a current version library according to a submitted current SQL script, and acquire a history submitted record of the current version library script; the creating unit 602 is configured to create a first data table corresponding to the SQL script list according to the current SQL script, and create a second data table corresponding to the history submission record; the control unit 603 is configured to perform data comparison on the first data table and the second data table, and if it is determined that the data comparison result is inconsistent, prevent the SQL script in the current version library from performing version production.
The version error data control device provided by the embodiment of the invention acquires an SQL script list in a current version library according to the submitted current SQL script, and acquires a history submitted record of the current version library script; creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record; and comparing the data of the first data table with the data of the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from version production, and effectively controlling version error data production, thereby reducing the version production risk.
Further, the acquiring unit 601 is specifically configured to:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values;
creating a first table-building statement according to the table name, the field name and the field type;
and running the first list establishing sentence in a database, and establishing and obtaining a first data list corresponding to the SQL script list.
The version error data control device provided by the embodiment of the invention can be used for efficiently creating the first data table for data comparison.
Further, the acquiring unit 601 is specifically configured to:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values;
creating a second table-building statement according to the table name, the field name and the field type;
and running the second list establishing sentence in a database, and establishing and obtaining a second data list corresponding to the history submission record.
The version error data control device provided by the embodiment of the invention can be used for efficiently creating the second data table for data comparison.
Further, the control unit 603 is specifically configured to:
and comparing the data record numbers in the first data table and the second data table, and if the data record number comparison result is inconsistent, directly determining that the data comparison result is inconsistent.
The version error data control device provided by the embodiment of the invention can further rapidly and accurately determine the data comparison result.
Further, the control unit 603 is specifically configured to:
if the comparison result of the data records is consistent, inquiring the data in the first data table in the second data table;
if at least one item of data in the first data table cannot be found in the second data table, directly determining that the data comparison result is inconsistent.
The version error data control device provided by the embodiment of the invention can further rapidly and accurately determine the data comparison result.
Further, the control unit 603 is specifically configured to:
deleting the data in the first data table which is searched in the second data table;
and if the number of the remaining data records in the second data table is determined to be not zero, determining that the data comparison result is inconsistent.
The version error data control device provided by the embodiment of the invention can further rapidly and accurately determine the data comparison result.
Further, the version error data control device is further configured to:
and if the data comparison result is the data consistency, allowing the SQL script in the current version library to carry out version production.
The version error data control device provided by the embodiment of the invention can further effectively control the version error data production, thereby reducing the version production risk.
The embodiment of the present invention provides an embodiment of a version error data control device for a client, which may be specifically used to execute the processing flow of each method embodiment, and the functions thereof are not described herein in detail, and may refer to the detailed description of the method embodiments.
Fig. 7 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention, as shown in fig. 7, where the electronic device includes: a processor (processor) 701, a memory (memory) 702, and a bus 703;
wherein, the processor 701 and the memory 702 complete communication with each other through the bus 703;
the processor 701 is configured to invoke the program instructions in the memory 702 to perform the methods provided in the above method embodiments, for example, including:
acquiring an SQL script list in a current version library according to the submitted current SQL script, and acquiring a history submission record of the current version library script;
creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record;
and carrying out data comparison on the first data table and the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from carrying out version production.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are capable of performing the methods provided by the above-described method embodiments, for example comprising:
acquiring an SQL script list in a current version library according to the submitted current SQL script, and acquiring a history submission record of the current version library script;
creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record;
and carrying out data comparison on the first data table and the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from carrying out version production.
The present embodiment provides a computer-readable storage medium storing a computer program that causes the computer to execute the methods provided by the above-described method embodiments, for example, including:
acquiring an SQL script list in a current version library according to the submitted current SQL script, and acquiring a history submission record of the current version library script;
creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record;
and carrying out data comparison on the first data table and the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from carrying out version production.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description of the present specification, reference to the terms "one embodiment," "one particular embodiment," "some embodiments," "for example," "an example," "a particular example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (10)

1. A version error data control method, comprising:
acquiring an SQL script list in a current version library according to the submitted current SQL script, and acquiring a history submission record of the current version library script;
creating a first data table corresponding to the SQL script list according to the current SQL script, and creating a second data table corresponding to the history submission record;
and carrying out data comparison on the first data table and the second data table, and if the data comparison result is inconsistent, preventing the SQL script in the current version library from carrying out version production.
2. The version error data control method according to claim 1, wherein creating a first data table corresponding to the SQL script manifest from the current SQL script comprises:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values;
creating a first table-building statement according to the table name, the field name and the field type;
and running the first list establishing sentence in a database, and establishing and obtaining a first data list corresponding to the SQL script list.
3. The version error data control method according to claim 2, wherein creating a second data table corresponding to the history commit record from the current SQL script comprises:
analyzing SQL sentences in the current SQL script to obtain table names, field names and field values thereof, and determining corresponding field types according to the field values;
creating a second table-building statement according to the table name, the field name and the field type;
and running the second list establishing sentence in a database, and establishing and obtaining a second data list corresponding to the history submission record.
4. The version error data control method according to claim 1, wherein said data comparison of said first data table and said second data table comprises:
and comparing the data record numbers in the first data table and the second data table, and if the data record number comparison result is inconsistent, directly determining that the data comparison result is inconsistent.
5. The version error data control method according to claim 4, wherein said comparing the data of the first data table and the second data table comprises:
if the comparison result of the data records is consistent, inquiring the data in the first data table in the second data table;
if at least one item of data in the first data table cannot be found in the second data table, directly determining that the data comparison result is inconsistent.
6. The version error data control method according to claim 5, wherein said comparing the data of the first data table and the second data table comprises:
deleting the data in the first data table which is searched in the second data table;
and if the number of the remaining data records in the second data table is determined to be not zero, determining that the data comparison result is inconsistent.
7. The version error data control method according to any one of claims 1 to 6, characterized in that the version error data control method further comprises:
and if the data comparison result is the data consistency, allowing the SQL script in the current version library to carry out version production.
8. A version error data control apparatus, comprising:
the acquisition unit is used for acquiring an SQL script list in the current version library according to the submitted current SQL script and acquiring a history submission record of the current version library script;
the creating unit is used for creating a first data table corresponding to the SQL script list according to the current SQL script and creating a second data table corresponding to the history submission record;
and the control unit is used for comparing the data of the first data table with the data of the second data table, and preventing the SQL script in the current version library from version production if the data comparison result is inconsistent.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any one of claims 1 to 7 when the computer program is executed by the processor.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
CN202310187498.6A 2023-02-22 2023-02-22 Version error data control method and device Pending CN116225936A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310187498.6A CN116225936A (en) 2023-02-22 2023-02-22 Version error data control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310187498.6A CN116225936A (en) 2023-02-22 2023-02-22 Version error data control method and device

Publications (1)

Publication Number Publication Date
CN116225936A true CN116225936A (en) 2023-06-06

Family

ID=86587020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310187498.6A Pending CN116225936A (en) 2023-02-22 2023-02-22 Version error data control method and device

Country Status (1)

Country Link
CN (1) CN116225936A (en)

Similar Documents

Publication Publication Date Title
US7953744B2 (en) Database change verifier
US7401085B2 (en) System and method for controlling the release of updates to a database configuration
US8065323B2 (en) Offline validation of data in a database system for foreign key constraints
US7933869B2 (en) Method and system for cloning a tenant database in a multi-tenant system
US7610317B2 (en) Synchronization with derived metadata
US7689593B2 (en) Systems and methods for accessing a shared space in a provider-tenant environment
Rauber et al. Identification of reproducible subsets for data citation, sharing and re-use
US8078579B2 (en) Data source currency tracking and currency based execution
US20080140696A1 (en) System and method for analyzing data sources to generate metadata
US20070162969A1 (en) Provider-tenant systems, and methods for using the same
US20070156902A1 (en) Systems and methods for implementing a tenant space in a provider-tenant environment
US20070162451A1 (en) Systems and methods for linking a tenant to a provider
US8527460B2 (en) Method for carrying out database version control
US20090228527A1 (en) System and method for providing data migration services
US8990440B2 (en) Reusing system configuration information and metadata for related operations
CN111767266A (en) Entity contact model design method and device, computer equipment and storage medium
US20080172659A1 (en) Harmonizing a test file and test configuration in a revision control system
US20230289331A1 (en) Model generation service for data retrieval
CN116225936A (en) Version error data control method and device
CN112817931B (en) Incremental version file generation method and device
CN114138815A (en) Multi-database compatibility implementation method, device and medium for application program
US9916154B2 (en) File-based transport of table content
CN117573199B (en) Model difference comparison analysis method, device, equipment and medium
CN117435635A (en) Database version query method and device
CN117215956A (en) Method, device, equipment and storage medium for database synchronous test

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination