CN115687292B - Verifiable database upgrading method irrelevant to database technology - Google Patents

Verifiable database upgrading method irrelevant to database technology Download PDF

Info

Publication number
CN115687292B
CN115687292B CN202211121679.0A CN202211121679A CN115687292B CN 115687292 B CN115687292 B CN 115687292B CN 202211121679 A CN202211121679 A CN 202211121679A CN 115687292 B CN115687292 B CN 115687292B
Authority
CN
China
Prior art keywords
statement
upgrade
verification
sentences
standard
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.)
Active
Application number
CN202211121679.0A
Other languages
Chinese (zh)
Other versions
CN115687292A (en
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.)
Hangzhou New China And Big Polytron Technologies Inc
Original Assignee
Hangzhou New China And Big Polytron Technologies Inc
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 Hangzhou New China And Big Polytron Technologies Inc filed Critical Hangzhou New China And Big Polytron Technologies Inc
Publication of CN115687292A publication Critical patent/CN115687292A/en
Application granted granted Critical
Publication of CN115687292B publication Critical patent/CN115687292B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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

Abstract

The invention relates to the technical field of computers, in particular to a verifiable database upgrading method irrelevant to database technology, which comprises the following steps: generating a standard upgrade sentence, and generating a standard verification sentence corresponding to the standard upgrade sentence; packaging the standard upgrade statement and the standard verification statement to be used as an upgrade package, and sending the upgrade package to the target equipment; unpacking the upgrade package by the target equipment, analyzing the standard upgrade statement into an upgrade statement conforming to the type of the local database, and analyzing the standard verification statement into a verification statement conforming to the type of the local database; the target device executes the upgrade statement; and the target equipment executes the verification statement, if the verification is passed, the feedback upgrade is successful, otherwise, the feedback upgrade fails and rolls back to the stage before the upgrade statement is executed. The beneficial technical effects of the invention are as follows: the technical staff does not need to consider specific database types when the codes are manufactured, so that the efficiency of the technical staff is improved, and the safety of database upgrading is improved.

Description

Verifiable database upgrading method irrelevant to database technology
Technical Field
The invention relates to the technical field of computers, in particular to a verifiable database upgrading method irrelevant to database technology.
Background
The need to upgrade a database in a project is a frequently encountered situation in software projects. Upgrading deployed databases is a cumbersome and very careful task. Changes to database table attributes, field attribute variations, and changes to field values all fall into the category of database upgrades. For a distributed system, databases are deployed on a plurality of terminal devices or cloud devices, and the types of the databases locally arranged on the devices are different, so that the workload and difficulty of upgrading the databases are further increased. The work efficiency of project developers and the project progress are seriously affected. For this reason, it is necessary to study database upgrade methods that can deviate from database-type database independence.
As chinese patent CN105468717a, publication date 2016, month 4 and 6, a database operating method and apparatus are disclosed, the method comprising: receiving a database operation request for a target database, the database operation request comprising: the method comprises the steps of identifying the type of a target database and carrying out operation identification of preset database operations on the target database, wherein each operation identification is preset to correspond to a plurality of database operations respectively executed by different types of databases; determining database operations corresponding to the operation identifiers, which are performed by the database of the type indicated by the type identifier; and executing the determined database operation on the target database. The technical scheme realizes the unification of operation logic, operation interfaces and operation methods of databases of different types, but the technical scheme can not solve the upgrading of irrelevant types of databases.
Disclosure of Invention
The invention aims to solve the technical problems that: the technical problem of being able to implement a database-independent database upgrade scheme is lacking at present. The database upgrading method which can be verified and is irrelevant to the database technology can effectively improve the database upgrading efficiency of the distributed project.
The technical problems are solved, and the invention adopts the following technical scheme: a verifiable database upgrade method independent of database technology, comprising: generating a standard upgrade sentence, and generating a standard verification sentence corresponding to the standard upgrade sentence;
packaging the standard upgrade statement and the standard verification statement to be used as an upgrade package, and sending the upgrade package to the target equipment;
unpacking the upgrade package by the target equipment, analyzing the standard upgrade statement into an upgrade statement conforming to the type of the local database, and analyzing the standard verification statement into a verification statement conforming to the type of the local database;
the target device executes the upgrade statement;
and the target equipment executes the verification statement, if the verification is passed, the feedback upgrade is successful, otherwise, the feedback upgrade fails and rolls back to the stage before the upgrade statement is executed.
Preferably, the method for generating the standard upgrade sentence comprises the following steps:
the upgrade sentences of various databases are listed, and the upgrade sentences with the same functions are grouped;
associating a semantic replacement statement for each set of upgrade statements, the semantic replacement statement comprising a function identifier for representing a database operation and a number of parameter placeholders for recording statement parameters;
associating a mapper for indicating the mapping relation between the parameter placeholders and the content of the upgrade sentences for each upgrade sentence of each group to form an upgrade sentence comparison table;
writing upgrade sentences of any database according to upgrade contents and then converting the upgrade sentences into corresponding semantic alternative sentences, or directly writing the semantic alternative sentences, wherein the semantic alternative sentences are standard upgrade sentences.
Preferably, the method for generating the standard verification statement comprises the following steps:
associating verification execution sentences and verification condition sentences for each upgrading sentence, wherein the verification execution sentences are database operation sentences, and the verification condition sentences judge upgrading results according to the output of a database;
dividing verification execution sentences associated with the upgrading sentences into a group, and associating standard verification execution sentences for each group of verification execution sentences, wherein the standard verification execution sentences comprise function identifiers for representing database operations and a plurality of parameter placeholders for recording sentence parameters;
associating a mapping symbol indicating parameter placeholders with mapping relations of verification execution sentences for each standard verification execution sentence to form a verification sentence comparison table;
dividing verification condition sentences associated with the upgrading sentences into a group, and generating standard condition sentences for each group of verification condition sentences, wherein the standard condition sentences comprise attribute extraction words, attribute condition words and condition parameter placeholders;
recording a mapping symbol of a condition parameter placeholder and a mapping relation of the verification condition statement for each standard verification execution statement association to form a condition statement comparison table;
and obtaining standard verification executing sentences and standard conditional sentences corresponding to the upgrade sentences according to the verification sentence comparison table and the conditional sentence comparison table, wherein the standard verification executing sentences and the standard conditional sentences form standard verification sentences.
Preferably, the method further comprises: uploading the upgrade statement comparison table, the verification statement comparison table and the conditional statement comparison table to the network storage device;
the method for the target device to analyze the standard upgrade statement into the upgrade statement conforming to the local database type comprises the following steps:
inquiring an upgrade statement comparison table to obtain upgrade statements which accord with the type of the database of the target equipment in the group where the standard upgrade statement is located;
mapping parameters in the standard upgrade statement into the upgrade statement according to the mapping symbol to complete analysis;
the method for analyzing the standard verification statement into the verification statement conforming to the local database type comprises the following steps:
inquiring a verification statement comparison table to obtain verification execution statements and verification condition statements which accord with the target number merging database types in a group where standard verification execution statements are located;
and mapping parameters in the standard verification execution statement into the verification execution statement according to the mapper, and mapping parameters in the standard conditional statement into the verification conditional statement according to the mapper to complete analysis.
Preferably, the method for the target device to execute the upgrade sentence includes:
judging an execution object of the upgrade sentence, and if the execution object is a database, directly executing the upgrade sentence;
if the execution object is a table of the database, establishing a copy of the table, wherein the copy of the table maintains the structure of the table and copies data of a plurality of tables;
replacing an execution object of the execution statement with a copy of the table, and executing the execution object on the copy of the table;
verifying the upgrading result of the copy of the table by using the verification statement, if the upgrading is successful, executing the next step, and if the upgrading is failed, deleting the copy of the table and ending the database upgrading;
deleting the copy of the table, restoring the execution object of the execution statement and executing the execution object;
and verifying the upgrading result by using a verification statement.
Preferably, the method for associating and verifying the execution statement for each upgrade statement comprises the following steps:
manually creating a verification execution statement set of each database type;
creating a database instance of each database type to be recorded as an auxiliary instance, and generating a plurality of instance tables on the auxiliary instance;
sequentially reading upgrade sentences in the upgrade sentence comparison table, and manually filling parameters in the semantic replacement sentences to lead the parameters to point to auxiliary examples and/or example tables;
mapping parameters in the semantic replacement statement into an upgrade statement to form an executable upgrade statement, and executing the executable upgrade statement on an auxiliary instance;
attempting to fill parameters in the semantic replacement sentences into verification execution sentences in the verification execution sentence set, and executing the verification execution sentences on the auxiliary instance in sequence;
screening out verification execution sentences of execution errors, and taking the verification execution sentences successfully executed on the auxiliary instance as suggested associated verification execution sentences for manual selection.
Preferably, the method further comprises: for verification execution sentences which can be successfully executed, obtaining output contents of the verification execution sentences;
sequentially changing parameters in the executable upgrade statement, and executing the executable upgrade statement again;
after any parameter is changed, obtaining verification execution sentences with different output contents, and using the verification execution sentences as suggestion association verification execution sentences for manual selection.
The beneficial technical effects of the invention are as follows: the standard sentences of the database upgrading sentences and the verification sentences are manufactured, so that a technician does not need to consider specific database types when manufacturing codes, the efficiency of the technician is improved, and the project development progress is accelerated; the verification statement can timely judge whether the database is successfully upgraded, so that faults can be checked early, and the security of the database upgrading is improved.
Other features and advantages of the present invention will be disclosed in the following detailed description of the invention and the accompanying drawings.
Drawings
The invention is further described with reference to the accompanying drawings:
FIG. 1 is a flowchart of a method for upgrading a verifiable database according to an embodiment of the present invention.
Fig. 2 is a flowchart of a method for generating a standard upgrade sentence according to an embodiment of the present invention.
FIG. 3 is a flowchart illustrating a method for generating a standard verification statement according to an embodiment of the present invention.
Fig. 4 is a flowchart of a target device parsing method according to an embodiment of the invention.
FIG. 5 is a flowchart of a method for associating verification execution statements with upgrade statements according to a second embodiment of the present invention.
Detailed Description
The technical solutions of the embodiments of the present invention will be explained and illustrated below with reference to the drawings of the embodiments of the present invention, but the following embodiments are only preferred embodiments of the present invention, and not all embodiments. Based on the examples in the implementation manner, other examples obtained by a person skilled in the art without making creative efforts fall within the protection scope of the present invention.
In the following description, directional or positional relationships such as the terms "inner", "outer", "upper", "lower", "left", "right", etc., are presented for convenience in describing the embodiments and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore should not be construed as limiting the invention.
Embodiment one:
a method for verifiable database upgrades independent of database technology, see fig. 1, comprising:
step A01) generating a standard upgrade sentence, and generating a standard verification sentence corresponding to the standard upgrade sentence;
step A02), packaging the standard upgrade statement and the standard verification statement as an upgrade package, and sending the upgrade package to the target equipment;
step A03), unpacking the upgrade package by the target equipment, analyzing the standard upgrade statement into an upgrade statement conforming to the type of the local database, and analyzing the standard verification statement into a verification statement conforming to the type of the local database;
step A04), the target device executes the upgrade statement;
step A05), the target device executes the verification statement, if the verification is passed, the feedback upgrade is successful, otherwise, the feedback upgrade fails and rolls back to the stage before the upgrade statement is executed.
For a distributed system, there are multiple server devices and terminal devices in the system, both of which are networked, but the database types on the devices are not the same. For project management systems, the same system has multiple enterprise users, and the same system will be deployed on the devices of the multiple enterprise users, supporting the respective business of each enterprise user. The types of databases supported by devices of different enterprise users are not identical. However, when the system is upgraded, the database may need to be adjusted. The same upgrade content is referred to at this time, and needs to be executed on a plurality of databases of different types. If upgrade content is developed, technicians need to consider upgrade sentences and verification sentences of each database, which results in a code of project development being bloated, seriously affecting development efficiency, and simultaneously affecting stability and reliability of the databases.
As shown in table 1, a part of the standard upgrade sentence supported by the present embodiment is enumerated, and the standard upgrade sentence is an expression expressed in a high-level language. Each standard upgrade statement is associated with a standard verification statement. The standard upgrade statements shown in table 1 are the addition of fields in the table, the setting or changing of the attributes of the fields, and the deletion of the fields, respectively. The corresponding standard verification statement is whether a corresponding field exists in the check table and whether the attribute of the field is a specified attribute. If the attribute exists and accords with the attribute, the output of the standard verification statement is true, otherwise, the output is false. For the added field and the set field attribute, when the output of the standard verification statement is true, the database upgrade is indicated to be successful. For the deleted field, when the output of the standard verification statement is false, the database upgrade is indicated to be successful. When a technician develops a project, only standard upgrade sentences and standard verification sentences need to be written. There is no need to consider different database types.
Table 1 standard upgrade statements and standard verification statements created in this embodiment
Figure BDA0003846775280000051
Referring to fig. 2, the method for generating the standard upgrade sentence includes:
step B01) listing upgrade sentences of various databases, and grouping the upgrade sentences with the same function;
step B02) associating a semantic replacement sentence for each group of upgrade sentences, wherein the semantic replacement sentence comprises a function identifier for representing database operation and a plurality of parameter placeholders for recording sentence parameters;
step B03), associating a mapper for indicating the mapping relation between the parameter placeholders and the content of the upgrade sentences for each upgrade sentence of each group to form an upgrade sentence comparison table;
step B04) writing upgrade sentences of any database according to the upgrade content and then converting the upgrade sentences into corresponding semantic alternative sentences, or directly writing the semantic alternative sentences, wherein the semantic alternative sentences are standard upgrade sentences.
Table 2 partial upgrade statement comparison table established in this embodiment
Figure BDA0003846775280000061
As shown in table 2, an upgrade statement lookup table of standard upgrade statement upgrade () established for the present embodiment. Corresponding execution statements of different database types are recorded in the table. Wherein, table names, C1, T1, L1, B1, C2, T2, L2 and B2 are parameter placeholders. Meanwhile, the name of the parameter placeholder also indicates the mapping relation between the parameter placeholder and the content of the upgrade sentence, namely the parameter placeholder is used as a mapper at the same time. If Upgradedd (op, A, x1, int), the corresponding upgrade statement is ALTERTABLEAADDCOLUMNx1int, and if SQLServer database is AltertableAaddx1int. The upgrade statement comparison table records corresponding execution statements of all supported standard upgrade statements under various database types, and can convert the standard upgrade statements into the execution statements of the corresponding database types so as to finish database upgrade as long as the database types are recorded by the upgrade statement comparison table. To improve the stability of the database upgrade, it is proposed to operate only one field or one table at a time.
Referring to fig. 3, the method for generating the standard verification statement includes:
step C01), associating verification execution sentences and verification condition sentences for each upgrading sentence, wherein the verification execution sentences are database operation sentences, and the verification condition sentences judge upgrading results according to the output of the database;
step C02) dividing verification execution sentences associated with the upgrading sentences into a group, associating standard verification execution sentences for each group of verification execution sentences, wherein the standard verification execution sentences comprise function identifiers for representing database operations and a plurality of parameter placeholders for recording sentence parameters;
step C03), associating a mapping symbol indicating the mapping relation between the parameter placeholder and the standard verification execution statement for each verification execution statement to form a verification statement comparison table, as shown in a table 4;
step C04) dividing verification condition sentences associated with the upgrading sentences into a group, and generating standard condition sentences for each group of verification condition sentences, wherein the standard condition sentences comprise attribute extraction words, attribute condition words and condition parameter placeholders;
step C05), associating record condition parameter placeholders for each standard verification execution statement with the mapping symbols of the verification condition statement mapping relation to form a condition statement comparison table, as shown in table 5;
step C06) obtaining standard verification executing sentences and standard conditional sentences corresponding to the upgrade sentences according to the verification sentence comparison table and the conditional sentence comparison table, wherein the standard verification executing sentences and the standard conditional sentences form standard verification sentences.
Table 3 this embodiment creates an upgrade statement, a validation execution statement, and a validation conditional statement association table
Figure BDA0003846775280000071
As shown in table 3, the verification execution statement and the conditional statement of the same group of upgrade statements with fields added in the table are recorded. The verification execution statement and the conditional statement recorded in table 3 are the verification execution statement and the conditional statement of the same group, respectively. And associating standard verification execution statements and standard conditional statements for the verification execution statements and the conditional statements of the same group. Table 3 shows that the standard validation execution statement is formally identical to the validation execution statement of the exemplary database type, since exactly the same statement is employed for the various database types.
Wherein OUT represents the output of the execution of the standard verification execution statement, and the standard conditional statement out=RThe attribute extraction word in the rule is OUT, namely all the outputs of the standard verification execution statement are extracted, the attribute condition word is=, namely the condition is equal to the condition, and the condition parameter placeholder isR. Standard conditional statement OUT-! =RThe attribute condition word is-! =, remaining and standard conditional statement OUT =RThe same applies. When writing standard conditional statement of standard upgrade statement Upgraded (), standard conditional statement of standard upgrade statement Upgraded () should be written at the same timeRThe value is true.
Table 4 partial verification statement comparison table built in this embodiment
Figure BDA0003846775280000081
TABLE 5 partial Condition statement comparison Table built in this example
Figure BDA0003846775280000082
Figure BDA0003846775280000091
Uploading the upgrade statement comparison table, the verification statement comparison table and the conditional statement comparison table to the network storage device. Referring to fig. 4, the method for the target device to parse the standard upgrade sentence into the upgrade sentence conforming to the local database type includes:
step D01), inquiring an upgrade statement comparison table to obtain upgrade statements which accord with the type of the database of the target equipment in the group where the standard upgrade statement is located;
step D02) mapping parameters in the standard upgrading statement into the upgrading statement according to the mapping symbol to complete analysis;
the method for analyzing the standard verification statement into the verification statement conforming to the local database type comprises the following steps:
step D03), inquiring a verification statement comparison table to obtain verification execution statements and verification condition statements which accord with the target number and merge database types in the group where the standard verification execution statements are located;
step D04) mapping parameters in the standard verification execution statement into the verification execution statement according to the mapper, and mapping parameters in the standard conditional statement into the verification conditional statement according to the mapper, so as to complete analysis. And issuing the upgrade statement comparison table and the verification statement comparison table to each terminal, or uploading the upgrade statement comparison table and the verification statement comparison table to the network storage equipment, and reading the upgrade statement comparison table and the verification statement comparison table through access links. The cloud device or the terminal device queries the upgrade statement comparison table and the verification statement comparison table to obtain upgrade statements, verification execution statements and verification condition statements corresponding to the local database types.
The method for the target device to execute the upgrade statement comprises the following steps:
judging an execution object of the upgrade sentence, and if the execution object is a database, directly executing the upgrade sentence;
if the execution object is a table of the database, establishing a copy of the table, wherein the copy of the table maintains the structure of the table and copies data of a plurality of tables;
replacing an execution object of the execution statement with a copy of the table, and executing the execution object on the copy of the table;
verifying the upgrading result of the copy of the table by using the verification statement, if the upgrading is successful, executing the next step, and if the upgrading is failed, deleting the copy of the table and ending the database upgrading;
deleting the copy of the table, restoring the execution object of the execution statement and executing the execution object;
and verifying the upgrading result by using a verification statement.
If the execution object is a table of the database, a copy of the table is made, the copy has the same table structure, and a plurality of lines of data are copied to the copy. And firstly, upgrading is executed on the copy, and if the upgrading is successful, the upgrading is executed on the original table. If the execution is unsuccessful, the database upgrade operation is terminated.
The beneficial technical effects of this embodiment are: the standard sentences of the database upgrading sentences and the verification sentences are manufactured, so that a technician does not need to consider specific database types when manufacturing codes, the efficiency of the technician is improved, and the project development progress is accelerated; the verification statement can timely judge whether the database is successfully upgraded, so that faults can be checked early, and the security of the database upgrading is improved.
Embodiment two:
the embodiment provides a technical scheme for accelerating the efficiency of associated verification executing sentences on the basis of the first embodiment. Referring to fig. 5, the method for associating verification execution statements for each upgrade statement includes:
step E01), manually manufacturing a verification execution statement set of each database type;
step E02) creating database examples of each database type to be recorded as auxiliary examples, and generating a plurality of example tables on the auxiliary examples;
step E03) sequentially reading the upgrade sentences in the upgrade sentence comparison table, and manually filling in parameters in the semantic replacement sentences to lead the parameters to point to auxiliary examples and/or example tables;
step E04) mapping parameters in the semantic replacement statement into the upgrade statement to form an executable upgrade statement, and executing the executable upgrade statement on the auxiliary instance;
step E05), attempting to fill parameters in the semantic replacement sentences into verification execution sentences in the verification execution sentence set, and sequentially executing the verification execution sentences on the auxiliary instance;
step E06) screening out the verification execution statement of the execution error, and taking the verification execution statement successfully executed on the auxiliary instance as a suggestion association verification execution statement for manual selection.
More advantageously, for verification execution statements that can be successfully executed, obtaining output content of the verification execution statements; sequentially changing parameters in the executable upgrade statement, and executing the executable upgrade statement again; after any parameter is changed, obtaining verification execution sentences with different output contents, and using the verification execution sentences as suggestion association verification execution sentences for manual selection.
Compared with the first embodiment, the method and the device can provide recommended sentences related to verification execution sentences and verification condition sentences for workers, so that the manual related verification execution sentences are more convenient and quick, the efficiency of the manual related verification execution sentences is improved, and the project research and development efficiency is further improved.
While the invention has been described in terms of embodiments, it will be appreciated by those skilled in the art that the invention is not limited thereto but rather includes the drawings and the description of the embodiments above. Any modifications which do not depart from the functional and structural principles of the present invention are intended to be included within the scope of the appended claims.

Claims (4)

1. A verifiable database upgrading method irrelevant to database technology is characterized in that,
comprising the following steps:
generating a standard upgrade sentence, and generating a standard verification sentence corresponding to the standard upgrade sentence;
packaging the standard upgrade statement and the standard verification statement to be used as an upgrade package, and sending the upgrade package to the target equipment;
unpacking the upgrade package by the target equipment, analyzing the standard upgrade statement into an upgrade statement conforming to the type of the local database, and analyzing the standard verification statement into a verification statement conforming to the type of the local database;
the target device executes the upgrade statement;
the target device executes the verification statement, if the verification is passed, the feedback upgrade is successful, otherwise, the feedback upgrade fails and rolls back to the execution of the upgrade statement;
the method for generating the standard upgrade statement comprises the following steps:
the upgrade sentences of various databases are listed, and the upgrade sentences with the same functions are grouped;
associating a semantic replacement statement for each set of upgrade statements, the semantic replacement statement comprising a function identifier for representing a database operation and a number of parameter placeholders for recording statement parameters;
associating a mapper for indicating the mapping relation between the parameter placeholders and the content of the upgrade sentences for each upgrade sentence of each group to form an upgrade sentence comparison table;
writing upgrade sentences of any database according to upgrade contents and then converting the upgrade sentences into corresponding semantic alternative sentences, or directly writing the semantic alternative sentences, wherein the semantic alternative sentences are standard upgrade sentences;
the method for generating the standard verification statement comprises the following steps:
associating verification execution sentences and verification condition sentences for each upgrading sentence, wherein the verification execution sentences are database operation sentences, and the verification condition sentences judge upgrading results according to the output of a database;
dividing verification execution sentences associated with the upgrading sentences into a group, and associating standard verification execution sentences for each group of verification execution sentences, wherein the standard verification execution sentences comprise function identifiers for representing database operations and a plurality of parameter placeholders for recording sentence parameters;
associating a mapper indicating the mapping relation between the parameter placeholder and the standard verification execution statement for each verification execution statement to form a verification statement comparison table;
dividing verification condition sentences associated with the upgrading sentences into a group, and generating standard condition sentences for each group of verification condition sentences, wherein the standard condition sentences comprise attribute extraction words, attribute condition words and condition parameter placeholders;
recording a mapping symbol of a condition parameter placeholder and a mapping relation of the verification condition statement for each standard verification execution statement association to form a condition statement comparison table;
obtaining standard verification executing sentences and standard conditional sentences corresponding to the upgrade sentences according to the verification sentence comparison table and the conditional sentence comparison table, wherein the standard verification executing sentences and the standard conditional sentences form standard verification sentences;
the method further comprises the steps of:
uploading the upgrade statement comparison table, the verification statement comparison table and the conditional statement comparison table to the network storage device;
the method for the target device to analyze the standard upgrade statement into the upgrade statement conforming to the local database type comprises the following steps:
inquiring an upgrade statement comparison table to obtain upgrade statements which accord with the type of the database of the target equipment in the group where the standard upgrade statement is located;
mapping parameters in the standard upgrade statement into the upgrade statement according to the mapping symbol to complete analysis;
the method for analyzing the standard verification statement into the verification statement conforming to the local database type comprises the following steps:
inquiring a verification statement comparison table to obtain verification execution statements and verification condition statements which accord with the target number merging database types in a group where standard verification execution statements are located;
and mapping parameters in the standard verification execution statement into the verification execution statement according to the mapper, and mapping parameters in the standard conditional statement into the verification conditional statement according to the mapper to complete analysis.
2. A method of verifiable database technology independent database upgrades as in claim 1,
the method for the target device to execute the upgrade statement comprises the following steps:
judging an execution object of the upgrade sentence, and if the execution object is a database, directly executing the upgrade sentence;
if the execution object is a table of the database, establishing a copy of the table, wherein the copy of the table maintains the structure of the table and copies data of a plurality of tables;
replacing an execution object of the execution statement with a copy of the table, and executing the execution object on the copy of the table;
verifying the upgrading result of the copy of the table by using the verification statement, if the upgrading is successful, executing the next step, and if the upgrading is failed, deleting the copy of the table and ending the database upgrading;
deleting the copy of the table, restoring the execution object of the execution statement and executing the execution object;
and verifying the upgrading result by using a verification statement.
3. A method of verifiable database technology independent database upgrades as in claim 1,
the method for associating and verifying the execution statement for each upgrade statement comprises the following steps:
manually creating a verification execution statement set of each database type;
creating a database instance of each database type to be recorded as an auxiliary instance, and generating a plurality of instance tables on the auxiliary instance;
sequentially reading upgrade sentences in the upgrade sentence comparison table, and manually filling parameters in the semantic replacement sentences to lead the parameters to point to auxiliary examples and/or example tables;
mapping parameters in the semantic replacement statement into an upgrade statement to form an executable upgrade statement, and executing the executable upgrade statement on an auxiliary instance;
attempting to fill parameters in the semantic replacement sentences into verification execution sentences in the verification execution sentence set, and executing the verification execution sentences on the auxiliary instance in sequence;
screening out verification execution sentences of execution errors, and taking the verification execution sentences successfully executed on the auxiliary instance as suggested associated verification execution sentences for manual selection.
4. A method of verifiable database technology independent database upgrades according to claim 3, wherein the method further comprises:
for verification execution sentences which can be successfully executed, obtaining output contents of the verification execution sentences;
sequentially changing parameters in the executable upgrade statement, and executing the executable upgrade statement again;
after any parameter is changed, outputting verification execution sentences with different contents as suggestion association verification execution sentences for manual selection.
CN202211121679.0A 2022-08-03 2022-09-15 Verifiable database upgrading method irrelevant to database technology Active CN115687292B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210928206 2022-08-03
CN2022109282065 2022-08-03

Publications (2)

Publication Number Publication Date
CN115687292A CN115687292A (en) 2023-02-03
CN115687292B true CN115687292B (en) 2023-06-23

Family

ID=85062579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211121679.0A Active CN115687292B (en) 2022-08-03 2022-09-15 Verifiable database upgrading method irrelevant to database technology

Country Status (1)

Country Link
CN (1) CN115687292B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103186468A (en) * 2013-04-10 2013-07-03 华为技术有限公司 Method and device for testing and verifying software upgrading accuracy
CN104065528A (en) * 2013-03-15 2014-09-24 美国网件公司 Method And Apparatus For Analyzing And Verifying Functionality Of Multiple Network Devices
US9092741B1 (en) * 2014-04-21 2015-07-28 Amber Flux Private Limited Cognitive platform and method for energy management for enterprises
CN106445618A (en) * 2016-10-17 2017-02-22 成都知道创宇信息技术有限公司 Automatic database updating method
CN107657038A (en) * 2017-09-29 2018-02-02 北京酷我科技有限公司 A kind of database method for quickly reading
CN110333894A (en) * 2019-07-10 2019-10-15 中国民航信息网络股份有限公司 Method for upgrading system and device
CN110825413A (en) * 2019-11-04 2020-02-21 江苏金智教育信息股份有限公司 Database upgrading method and device and application deployment upgrading method and device
CN111309581A (en) * 2020-02-28 2020-06-19 中国工商银行股份有限公司 Application performance detection method and device in database upgrading scene
CN112231395A (en) * 2020-09-14 2021-01-15 苏宁金融科技(南京)有限公司 Transaction data synchronization method and server
CN112615865A (en) * 2020-12-21 2021-04-06 曹佳乐 Data anti-intrusion method based on big data and artificial intelligence and big data server
CN113268470A (en) * 2021-06-17 2021-08-17 重庆富民银行股份有限公司 Efficient database rollback scheme verification method
CN113721948A (en) * 2021-07-21 2021-11-30 北京中科江南信息技术股份有限公司 Database upgrading method, system and storage medium
CN114756569A (en) * 2022-03-25 2022-07-15 北京友友天宇系统技术有限公司 Multi-layer parsing method of structured query statement, computer device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107295811B (en) * 2016-07-05 2020-09-08 深圳市大疆创新科技有限公司 Networking verification method and device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104065528A (en) * 2013-03-15 2014-09-24 美国网件公司 Method And Apparatus For Analyzing And Verifying Functionality Of Multiple Network Devices
CN103186468A (en) * 2013-04-10 2013-07-03 华为技术有限公司 Method and device for testing and verifying software upgrading accuracy
US9092741B1 (en) * 2014-04-21 2015-07-28 Amber Flux Private Limited Cognitive platform and method for energy management for enterprises
CN106445618A (en) * 2016-10-17 2017-02-22 成都知道创宇信息技术有限公司 Automatic database updating method
CN107657038A (en) * 2017-09-29 2018-02-02 北京酷我科技有限公司 A kind of database method for quickly reading
CN110333894A (en) * 2019-07-10 2019-10-15 中国民航信息网络股份有限公司 Method for upgrading system and device
CN110825413A (en) * 2019-11-04 2020-02-21 江苏金智教育信息股份有限公司 Database upgrading method and device and application deployment upgrading method and device
CN111309581A (en) * 2020-02-28 2020-06-19 中国工商银行股份有限公司 Application performance detection method and device in database upgrading scene
CN112231395A (en) * 2020-09-14 2021-01-15 苏宁金融科技(南京)有限公司 Transaction data synchronization method and server
CN112615865A (en) * 2020-12-21 2021-04-06 曹佳乐 Data anti-intrusion method based on big data and artificial intelligence and big data server
CN113268470A (en) * 2021-06-17 2021-08-17 重庆富民银行股份有限公司 Efficient database rollback scheme verification method
CN113721948A (en) * 2021-07-21 2021-11-30 北京中科江南信息技术股份有限公司 Database upgrading method, system and storage medium
CN114756569A (en) * 2022-03-25 2022-07-15 北京友友天宇系统技术有限公司 Multi-layer parsing method of structured query statement, computer device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于形式化描述和模板对数据帧解析技术的研究;宋遇刚等;产业与科技论坛;52-54 *

Also Published As

Publication number Publication date
CN115687292A (en) 2023-02-03

Similar Documents

Publication Publication Date Title
US9589014B2 (en) Creating data in a data store using a dynamic ontology
CN105786998B (en) Database middleware system and the method for handling data using it
US10621212B2 (en) Language tag management on international data storage
US20080195377A1 (en) Method, device, and program product for verifying translation in resource file
US20070150500A1 (en) Device for reporting software problem information
US20230046582A1 (en) Cloud-based api metadata management method and system for integrated api management
CN104461531A (en) Implementing method for self-defined functions of reporting system
CN112579461A (en) Assertion processing method, system and storage medium
CN106708897B (en) Data warehouse quality guarantee method, device and system
CN108459846B (en) Software cloud customization method and platform
CN112930534A (en) Management system, acquisition device, and management method
US20050138146A1 (en) On-demand creation of POSIX locale source
JPH09212353A (en) Method and device for supporting reused design
CN113591422A (en) System for generating test case flow information in chip verification and application
CN115687292B (en) Verifiable database upgrading method irrelevant to database technology
CN112783916A (en) SQL statement auditing method and device, storage medium and electronic equipment
KR100762712B1 (en) Method for transforming of electronic document based on mapping rule and system thereof
WO2023151397A1 (en) Application program deployment method and apparatus, device, and medium
CN111258562A (en) Java code quality inspection method, device, equipment and storage medium
CN112416367B (en) Application resource change influence analysis system based on software reverse disassembly and analysis
Le Zou et al. On synchronizing with web service evolution
US20050137846A1 (en) On-demand creation of Java locale source
US6675373B1 (en) Automatic generation of balancing logic for data conversion
US20040046793A1 (en) Program generation method
US20090222447A1 (en) Data processing apparatus and data processing method

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
GR01 Patent grant
GR01 Patent grant