Database version package detection method and device

Through automated programs to identify and correct SQL statements in the database version package, the problem of low manual inspection efficiency when it is quickly carried out in the financial industry project iteration is solved, efficient version inspection and risk warning are realized, and the version error rate is reduced and the version error rate is improved. Work efficiency.

CN113448855BActive Publication Date: 2024-11-29INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110767952.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-07
Publication Date
2024-11-29
Estimated Expiration
2041-07-07

AI Technical Summary

Technical Problem

When the project iteration in the financial industry is progressing rapidly, the time cost of manually checking database version packages is high and not efficient enough. Relying on manual experience, it is difficult to quickly retrieve the release history, resulting in high error rate for installing the version and difficult to identify the risk of production.

Method used

Through automated programs, SQL execution statements in the database version package are identified, error correction checksum risk identification is performed, early warning information is generated, and the distribution history is archived into the library, which is convenient for subsequent review and problem tracking.

Benefits of technology

It reduces the error rate of installation, improves the work efficiency of the test environment, gets rid of the dependence on manual experience, and realizes automated static inspection and early warning of database statements, which facilitates problem analysis and tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113448855B_ABST
    Figure CN113448855B_ABST
Patent Text Reader

Abstract

The present invention provides a database version package detection method and device, which relates to the field of database maintenance and can be applied to the financial field and other fields. The method comprises: obtaining all downloaded file data in the download directory of a database target application, identifying the downloaded file data according to preset rules to obtain a version package file; analyzing the version package file through a preset database statement recognition template to obtain a database release statement; performing error correction verification on the database release statement according to preset statement rules to obtain a verification result; performing risk identification on the database release statement according to the verification result through a preset risk statement identifier, and obtaining an early warning strategy according to the comparison of the identification result with a preset corresponding table; generating early warning information after associating the early warning strategy with the database release statement corresponding to the identification result, and providing the early warning information to a predetermined location.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of database maintenance, and can be applied to the financial field and other fields, and in particular to a database version package detection method and device. Background Art

[0002] In order to adapt to the rapid changes in the market, continuously provide customers with more convenient and high-quality services, and seize the first market share, the current R&D project iterations in the financial industry, agile product development, and heavy project testing have greatly increased the operation and maintenance requirements of the test center, so it is no longer possible to manually review the version content as before. After the test center receives a large number of version packages every day, only the programs in the version package in the database are fully visible, and the installation error rate is high. In order to reduce the error rate of installation and identify the risk of production early, it is necessary to statically check the version package entity.

[0003] The original manual method of checking version entities has the following difficulties:

[0004] 1. With the rapid iteration of the project, the number of versions has increased significantly, and the workload has doubled. Without increasing manpower, manual version checking takes too long;

[0005] 2. The accuracy of manual version checking depends on the work experience of the checker;

[0006] 3. The number of versions is large, and the human brain cannot remember the release history. It is impossible to quickly retrieve the release version number when developing programs, analyzing problems, and tracking problems. Summary of the invention

[0007] The purpose of the present invention is to provide a database version package detection method and device, based on the SQL execution statement in the version package as the basis of the rule, through the automation program idea instead of manual to achieve version error correction, key statement identification, risk warning functions, at the same time, the database version history can also be archived into the warehouse, the identified erroneous statements, high-risk statements into the warehouse for marking, convenient for subsequent version development process reference and problem tracking reference.

[0008] To achieve the above-mentioned purpose, the present invention provides a database version package detection method, which comprises: obtaining all downloaded file data in the download directory of the database target application, identifying the downloaded file data according to preset rules to obtain a version package file; analyzing the version package file through a preset database statement recognition template to obtain a database release statement; performing error correction verification on the database release statement according to preset statement rules to obtain a verification result; performing risk identification on the database release statement according to the verification result through a preset risk statement identifier, and obtaining an early warning strategy by comparing the identification result with a preset corresponding table; generating early warning information after associating the early warning strategy with the database release statement corresponding to the identification result, and providing the early warning information to a predetermined location.

[0009] In the above-mentioned database version package detection method, preferably, analyzing the version package file through a preset database statement recognition template to identify and obtain a database release statement also includes: parsing the version package file to obtain a database version file of a target application, and recording the path of the version package file where the database version file is located into a database path table.

[0010] In the above-mentioned database version package detection method, preferably, performing error correction verification on the database release statement according to preset statement rules to obtain a verification result includes: analyzing the consistency between the actual execution status and the predetermined execution status of the database release statement according to the preset statement rules; when the actual execution status is inconsistent with the predetermined execution status, generating a prompt message and outputting it to a predetermined location.

[0011] In the above-mentioned database version package detection method, preferably, performing error correction verification on the database release statement according to preset statement rules to obtain a verification result also includes: obtaining all statement information and application name information in the database release statement, and analyzing the database type and format information of the statement information; when the database type and the format information conform to a preset format, detecting a predetermined identifier in the statement information to obtain a detection result; and dividing the statement information with a semicolon as a separator according to the detection result to obtain an actual execution statement.

[0012] In the above-mentioned database version package detection method, preferably, performing error correction verification on the database release statement according to preset statement rules to obtain a verification result also includes: when the database type and the format information do not conform to the preset format, or the statement information does not contain a predetermined identifier, generating a prompt message and outputting it to a predetermined location.

[0013] In the above-mentioned database version package detection method, preferably, analyzing the consistency between the actual execution status of the database release statement and the predetermined execution status according to the preset statement rules includes: the types of inconsistency between the actual execution status and the predetermined execution status include: the create table already exists in the database, the field added by the alter table already exists in the database, the field deleted by the alter table does not exist in the database, the field where the index added by the alter table is located does not exist in the database, the index added by the alter table already exists in the database, the index deleted by the alter table does not exist in the database, and the delete table does not exist in the database.

[0014] In the above-mentioned database version package detection method, preferably, obtaining an early warning strategy based on the comparison of the identification result with the preset corresponding table includes: for statements that only have create statements but no create indexes, generating prompt information according to a preset period and outputting it to a predetermined location; for alter modification statements, when a table adds a field and assigns a default default value to the added field and there is no not null setting, querying the table level of the modified table in the production database; when the table level exceeds a predetermined threshold, prompting that the statement execution takes a long time, generating a modified version entity, and splitting the statement execution strategy; for alter statements that delete table fields and delete table statements, and there is no backup statement, prompting confirmation whether a backup strategy is required in advance before execution.

[0015] The present invention also provides a database version package detection device, which includes a database statement recognition module, a database statement error correction module, a high-risk statement recognition and warning module and a database statement release history archiving module; the database statement recognition module is used to obtain all downloaded file data in the download directory of the database target application, and identify the downloaded file data according to preset rules to obtain a version package file; and, analyze the version package file through a preset database statement recognition template to obtain a database release statement; the database statement error correction module is used to perform error correction verification on the database release statement according to preset statement rules to obtain a verification result; and, based on the verification result, perform risk identification on the database release statement through a preset risk statement identifier, and obtain a warning strategy based on the comparison of the identification result with a preset corresponding table; the high-risk statement recognition and warning module is used to generate warning information after associating the warning strategy with the database release statement corresponding to the identification result, and provide the warning information to the database statement release history archiving module.

[0016] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.

[0017] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above method.

[0018] The beneficial technical effects of the present invention are: before installing the version package, an automated static check is performed on the database versioning statements, reducing versioning errors and the problem of excessively long versioning time in the production environment, and improving the work efficiency of the test environment; database statements are automatically identified, and the goals of error correction and early warning are achieved, getting rid of the problem of relying on manual experience; the database statement versioning history is archived and stored in the database, making it easy to view historical change information and help analyze problems; identified erroneous statements and high-risk statements are archived and stored in the database, which can be used as experience accumulation and to facilitate problem tracking. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:

[0020] Figure 1 A schematic diagram of a flow chart of a database version package detection method provided by an embodiment of the present invention;

[0021] Figure 2 A schematic diagram of the application process of the database version package detection method provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of a flow chart of an error correction process provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of a preprocessing flow of an error correction check provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of an application flow of database statement error correction provided by an embodiment of the present invention;

[0025] Figure 6 A schematic diagram of a database publishing statement recognition process provided by an embodiment of the present invention;

[0026] Figure 7 A schematic diagram of a risk statement identification process provided by an embodiment of the present invention;

[0027] Figure 8 A schematic diagram of the structure of a database version package detection device provided by an embodiment of the present invention;

[0028] Fig. 9 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The following will describe the implementation methods of the present invention in detail with reference to the accompanying drawings and embodiments, so that the implementation process of how the present invention applies technical means to solve technical problems and achieve technical effects can be fully understood and implemented accordingly. It should be noted that as long as there is no conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other, and the technical solutions formed are all within the protection scope of the present invention.

[0030] In addition, the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be performed in an order different from that shown here.

[0031] Please refer to Figure 1 As shown, the database version package detection method provided by the present invention comprises:

[0032] S101 obtains all downloaded file data in the download directory of the target application in the database, and identifies the downloaded file data according to a preset rule to obtain a version package file;

[0033] S102 analyzes the version package file through a preset database statement identification template to identify and obtain a database release statement;

[0034] S103 performs error correction verification on the database release statement according to preset statement rules to obtain a verification result;

[0035] S104 performs risk identification on the database release statement according to the verification result by using a preset risk statement identifier, and obtains an early warning strategy by comparing the identification result with a preset corresponding table;

[0036] S105: Associating the warning strategy with the database release statement corresponding to the recognition result to generate warning information, and providing the warning information to a predetermined location.

[0037] Among them, in the above embodiment, analyzing the version package file through the preset database statement identification template to obtain the database release statement also includes: parsing the version package file to obtain the database version file of the target application, and recording the path of the version package file where the database version file is located in the database path table. For details, please refer to the subsequent Figure 6 As shown, no further details are given here. In actual work, the database version package detection method provided by the present invention mainly has the following two usage scenarios: 1. Before the version package is installed, a pre-installation static check is performed on it, including database error statements and statements with high execution risks. 2. Archive the release history, including the database release statements in the identified version package, as well as the error statements and high-risk statements determined by the device of the present invention; the application process can be referred to Figure 2 As shown, the details are as follows:

[0038] Step 1: In the current download directory, traverse each file, identify the version package file, and go to the next step;

[0039] Step 2: Traverse each version package, call the database statement recognition template, identify the database release statement, record it in the database, and go to the next step;

[0040] Step 3: For each statement, call the database statement error correction module to determine whether there is an error in the statement. If there is an error, send an early warning email to remind the application technology person in charge and record it in the database and add a label. If there is no error, go to the next step;

[0041] Step 4: For each statement, call the high-risk statement identification and warning module to determine whether there is a risk in the statement execution. If so, send a warning email to remind the application manager and record it in the database and add a label. If not, go to the first step to continue analyzing other version packages.

[0042] Among them, database registration means recording database statements into the database table, that is, the identification and processing log table distinguishlog(id, appname, editionname, insertdate, sql, result, table), and the table fields are id serial number, application abbreviation, version package name, insertion time, identification statement, identification result, and table name. Adding labels to the database means marking the identified erroneous statements and high-risk statements in the result field for easy distinction. The identified alter and other database model definition statements can also be marked in the result field to facilitate testers to understand and quickly query. The method to determine whether it is a version package is non-folder, and the file name ends with .zip, and the file name contains ".", and the file name contains "F-".

[0043] Please refer to Figure 3 As shown, in one embodiment of the present invention, performing error correction verification on the database release statement according to the preset statement rule to obtain the verification result includes:

[0044] S301 analyzes the consistency between the actual execution status of the database release statement and the predetermined execution status according to the preset statement rules;

[0045] S302: When the actual execution status is inconsistent with the predetermined execution status, a prompt message is generated and output to a predetermined location.

[0046] Among them, the consistency between the actual execution of the database release statement and the scheduled execution according to the preset statement rules includes: the types of inconsistency between the actual execution and the scheduled execution include: the create table already exists in the database, the fields added by the alter table already exist in the database, the fields deleted by the alter table do not exist in the database, the fields where the indexes added by the alter table are located do not exist in the database, the indexes added by the alter table already exist in the database, the indexes deleted by the alter table do not exist in the database, and the delete table does not exist in the database. For details, please refer to Figure 4 As shown, performing error correction verification on the database release statement according to the preset statement rule to obtain the verification result also includes:

[0047] S401 obtains all statement information and application name information in the database release statement, and analyzes the database type and format information of the statement information;

[0048] S402: when the database type and the format information conform to a preset format, detecting a predetermined identifier in the statement information to obtain a detection result;

[0049] S403 divides the statement information using semicolons as separators according to the detection result to obtain actual execution statements.

[0050] S404 obtains the actual execution statement and checks whether the statement execution premise is consistent with the current database reality.

[0051] In one embodiment of the present invention, the database release statement is corrected and verified according to the preset statement rules to obtain the verification result, which further includes: when the database type and the format information conform to the preset format, and the statement information does not contain a predetermined identifier, a prompt message is generated and output to a predetermined location. After the database statement is identified, it is verified to determine whether there is an execution error or the statement cannot take effect. For a detailed process, please refer to Figure 5 As shown, it specifically includes: obtaining the statement variable and the application name appname variable whose values ​​are all statements in the current database file, querying the dbType (appname.type) table to determine whether the application database type is oracle, and for oracle type statements, and the database itself has not been modified to be set to automatically commit, mainly determine whether there is a problem that the statement update is not effective. The judgment basis is that the database statement does not belong to the procedure or package creation statement, but contains update, insert, and delete DML statements, then determine whether it contains a "commit;" statement and there are no other DML statements after the last "commit;" statement. If it is satisfied, it means There is no problem with the statement. If it is not satisfied, it means that the statement has an update that has not taken effect. The error correction statement needs to be labeled in the result field of the distinguishlog table, and an email is sent to remind the person in charge of the application that the statement has this error. For non-Oracle statements, the main judgment is whether the execution premise of the pre-executed database statement is consistent with the current database. If it is not consistent, after the statement is executed, errors such as field non-existence and table existing will be reported. The judgment is based on comparing the pre-executed database statement with the current database table structure. If it is satisfied, it means that there is no problem with the statement. If it is not satisfied, it means that the statement has an execution error. The error correction statement needs to be labeled in the result field of the distinguishlog table, and an email is sent to remind the person in charge of the application that the statement has this error. After all statements are parsed and judged, the database high-risk statement identification and warning module is called, and the parameters statement and appname variables are passed.

[0052] In the above embodiment, the version package file is parsed to obtain the database version file of the target application, and the path of the version package file where the database version file is located is recorded in the database path table. Specifically, it includes the following: In actual work, when identifying a database release statement, if it is the first time to parse and identify the version package of an application, after the database version file is identified, the path of the version package where the file is located is recorded in the dbpath table; if it is not the first time to parse and identify the version package of an application, the database release file is directly located according to the experience recorded in the dbpath, and then the database statement is split and recorded into the database for subsequent error correction. The specific process can be referred to Figure 6 As shown, it includes: obtaining a version package with a zip suffix, extracting the application name F-*** from the version package file name and assigning it to the appname variable, querying the dbpath (appname, path) table to see if there is a record of the version package path where the database version of this application is located, if there is a path record, directly entering the path where the database file is located according to the record, traversing each database file, assigning the statement in the database file to the statement variable, using ";" as a separator to separate the database file into several database statements and storing them in the distinguishlog table, calling the database statement error correction module after identifying the database statement, passing the statement and appname variables as parameters; if there is no path record, it means that the version package of this application has no recognition experience, and it is necessary to traverse each layer of the path in the version package and each file under the path layer by layer, and when a file with a .sql or .txt suffix is ​​determined, the location of the version package where the application database file is located is recorded in the dbpath table, and then return to the recognition module for statement recognition.

[0053] In one embodiment of the present invention, the early warning strategy obtained by comparing the recognition result with the preset corresponding table may include: for statements that only have create statements but no create indexes, generate prompt information according to the preset period and output it to the preset location; for alter modification statements, when the table adds fields and assigns the default default value to the added fields and there is no not null non-empty setting, query the table level of the modified table in the production database; when the table level exceeds the preset threshold, prompt that the statement execution takes a long time, generate a modified version entity, and split the statement execution strategy; for alter statements that delete table fields and delete tables, and there is no backup statement, prompt to confirm whether a backup strategy is required in advance before execution. In actual work, the identification process of high-risk statements can be referred to. Figure 7As shown, it specifically includes: obtaining the statement variable and the application name appname variable whose values ​​are all statements in the current database file, dividing the statement variable with ";" as a delimiter, writing the separated database statements into a list and parsing them one by one, 1) When the judgment statement starts with "alter" and contains the "add" keyword, first further judge whether it contains the "default" keyword. If it contains the "default" keyword, focus on checking the Oracle database type statement. For statements containing "default" but not containing the "not null" non-empty setting, identify the table name assignment table variable, query the table size in the TableSize (appname, table, size) table, if it is greater than the set threshold, it means that there is a timeout risk in the statement execution, and the high-risk statement needs to be labeled in the result field of the distinguishlog table, and an email is sent to remind the application person in charge that the statement has an execution risk; if it does not contain the "default" keyword, for the table structure adjustment statement, if it is judged that there is no backup statement, a label is added to the result field of the distinguishlog table, and an email is sent to remind the application person in charge whether it is necessary to add a backup operation for rollback use. 2) When the judgment statement starts with "create", identify the table name and assign it to the table variable, and further determine whether the statement variable contains a statement to create an index for the table. If it does not contain a statement to create an index, there may be a problem of excessive retrieval time, which will affect the front-end function of the system. It is necessary to add a label to the result field of the distinguishlog table and send an email to remind the application manager that the creation statement is risky, understand the purpose of the table and regularly estimate the magnitude of the table. 3) When the judgment statement starts with "delete", determine whether the statement variable contains a statement to back up the contents of the deleted table. If it does not contain a backup statement, add a label to the result field of the distinguishlog table and send an email to remind the application manager that the deletion statement is risky and whether a backup operation is needed to prepare for rollback and retain data.

[0054] Please refer to Figure 8As shown, the present invention also provides a database version package detection device, which includes a database statement recognition module, a database statement error correction module, a high-risk statement recognition and warning module and a database statement release history archiving module; the database statement recognition module is used to obtain all downloaded file data in the download directory of the database target application, and identify the downloaded file data according to preset rules to obtain a version package file; and, analyze the version package file through a preset database statement recognition template to obtain a database release statement; the database statement error correction module is used to perform error correction verification on the database release statement according to preset statement rules to obtain a verification result; and, based on the verification result, perform risk identification on the database release statement through a preset risk statement identifier, and obtain a warning strategy based on the comparison of the identification result with a preset corresponding table; the high-risk statement recognition and warning module is used to associate the warning strategy with the database release statement corresponding to the identification result to generate warning information, and provide the warning information to the database statement release history archiving module.

[0055] In actual work, the database statement identification module is a program that determines and identifies the database version in the version package through certain rules. If the version package of an application is parsed and identified for the first time, the path of the version package where the file is located will be recorded in the dbpath table after the database version file is identified; if it is not the first time to parse and identify the version package of an application, the database release file will be directly located according to the experience recorded in the dbpath, and then the database statements will be split and recorded into the database, and the database statement error correction module will be called. The specific workflow can be referred to the aforementioned Figure 6 As shown, I will not describe them in detail here.

[0056] The database statement error correction module verifies the database statement after identifying it to determine whether there is an execution error or the statement cannot be effective. For detailed operation process, please refer to Figure 5As shown, for the identified database table-level operations, the types of errors that determine whether the current execution statement is inconsistent with the expected database include: 1) the create table already exists in the database; 2) the fields added by the alter table already exist in the database; 3) the fields deleted by the alter table do not exist in the database; 4) the fields where the indexes added by the alter table are located do not exist in the database; 5) the indexes added by the alter table already exist in the database; 6) the indexes deleted by the alter table do not exist in the database; 7) the delete table does not exist in the database. For Oracle databases, if the database itself is not modified to be automatically submitted, there is a problem that the statement cannot take effect. Therefore, it is additionally determined whether there is a problem that the statement cannot take effect. The method of judgment is whether there is a commit statement if there are update, insert, and delete statements, and there is no DML statement after the last commit statement.

[0057] The high-risk statement identification and early warning module identifies database mode definition statements in database statements. For statements that only have create statements but no create indexes, the person in charge of application installation is prompted to pay regular attention. For alter modification statements, when a field is added to a table and a default value is assigned to the field without a not null setting, the table level of the modified table in the production database is queried. If the table level exceeds the threshold, the person in charge of application installation is prompted that the statement execution takes a long time, and it is recommended to modify the version entity and split the statement execution. For alter deletion of table fields and delete table statements without backup statements, the person in charge of application installation is prompted to confirm in advance whether a backup is required before execution in case of version rollback. The detailed process can be found in the aforementioned Figure 7 shown.

[0058] The database statement release history archiving module records the release statements, as well as the errors and high-risk statements identified by the device in the database table. On the one hand, it serves as experience accumulation and facilitates subsequent tracking. On the other hand, it facilitates querying historical release status, which can be queried by multiple dimensions such as application, version number and database table. The archiving operation in this module is implemented in the database statement identification module, the database statement error correction module and the high-risk statement identification and warning module respectively.

[0059] The beneficial technical effects of the present invention are: before installing the version package, an automated static check is performed on the database versioning statements, reducing versioning errors and the problem of excessively long versioning time in the production environment, and improving the work efficiency of the test environment; database statements are automatically identified, and the goals of error correction and early warning are achieved, getting rid of the problem of relying on manual experience; the database statement versioning history is archived and stored in the database, making it easy to view historical change information and help analyze problems; identified erroneous statements and high-risk statements are archived and stored in the database, which can be used as experience accumulation and to facilitate problem tracking.

[0060] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the computer program.

[0061] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above method.

[0062] like Fig. 9 As shown, the electronic device 600 may further include: a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily have to include Fig. 9 In addition, the electronic device 600 may also include Fig. 9 For components not shown, reference may be made to the prior art.

[0063] like Fig. 9 As shown, the central processor 100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processor 100 receives inputs and controls the operations of various components of the electronic device 600.

[0064] The memory 140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 100 may execute the program stored in the memory 140 to implement information storage or processing.

[0065] The input unit 120 provides input to the CPU 100. The input unit 120 is, for example, a key or a touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.

[0066] The memory 140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 140 may also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 600 through the central processor 100.

[0067] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0068] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via an antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processor 100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0069] Based on different communication technologies, multiple communication modules 110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide an audio output via the speaker 131 and receive an audio input from the microphone 132, thereby realizing a common telecommunication function. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 130 is also coupled to the central processor 100, so that the sound can be recorded on the local machine through the microphone 132, and the sound stored on the local machine can be played through the speaker 131.

[0070] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0071] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0072] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0073] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0074] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A database version package detection method, characterized in that: The method comprises: Obtain all downloaded file data in the download directory of the target application in the database, and identify the downloaded file data according to preset rules to obtain a version package file; Analyze the version package file through a preset database statement identification template to obtain a database release statement; Performing error correction verification on the database release statement according to preset statement rules to obtain a verification result; According to the verification result, the risk of the database release statement is identified by using a preset risk statement identifier, and an early warning strategy is obtained by comparing the identification result with a preset corresponding table; Associating the warning strategy with the database release statement corresponding to the recognition result to generate warning information, and providing the warning information to a predetermined location; Performing error correction verification on the database release statement according to the preset statement rule to obtain a verification result includes: analyzing the consistency between the actual execution status of the database release statement and the predetermined execution status according to the preset statement rule; When the actual execution status is inconsistent with the predetermined execution status, a prompt message is generated and output to a predetermined location.

2. The database version package detection method according to claim 1, characterized in that: Analyzing the version package file by using a preset database statement identification template to identify and obtain a database release statement also includes: The version package file is parsed to obtain a database version file of the target application, and the path of the version package file where the database version file is located is recorded in a database path table.

3. The database version package detection method according to claim 1, characterized in that: Performing error correction verification on the database release statement according to the preset statement rule to obtain the verification result further comprises: Obtaining all statement information and application name information in the database release statement, and analyzing the database type and format information of the statement information; When the database type and the format information conform to a preset format, detecting a predetermined identifier in the statement information to obtain a detection result; The statement information is divided using semicolons as separators according to the detection result to obtain actual execution statements.

4. The database version package detection method according to claim 3, characterized in that: Performing error correction verification on the database release statement according to the preset statement rule to obtain the verification result further comprises: When the database type and the format information do not conform to a preset format, or the statement information does not contain a predetermined identifier, a prompt message is generated and output to a predetermined location.

5. The database version package detection method according to claim 1, characterized in that: Analyzing the consistency between the actual execution status of the database release statement and the predetermined execution status according to the preset statement rules includes: The types of inconsistency between the actual execution status and the planned execution status include: the create table already exists in the database, the fields added by the alter table already exist in the database, the fields deleted by the alter table do not exist in the database, the fields where the indexes added by the alter table are located do not exist in the database, the indexes added by the alter table already exist in the database, the indexes deleted by the alter table do not exist in the database, and the delete table does not exist in the database.

6. The database version package detection method according to claim 1, characterized in that: The early warning strategy obtained by comparing the recognition results with the preset correspondence table includes: For statements that only have create statements but no create indexes, prompt information is generated and output to the predetermined location according to the preset period; For alter modification statements, when adding fields to a table and assigning default values ​​to the added fields without not null settings, query the table level of the modified table in the production database; when the table level exceeds the preset threshold, prompt that the statement execution takes a long time, generate a modified version entity, and split the statement execution strategy; For alter statements to delete table fields and delete table statements without backup statements, you will be prompted to confirm whether a backup strategy is required before execution.

7. A database version package detection device, characterized in that: The device comprises a database statement recognition module, a database statement error correction module, a high-risk statement recognition and warning module and a database statement release history archiving module; The database statement recognition module is used to obtain all downloaded file data in the download directory of the database target application, and identify the downloaded file data according to preset rules to obtain the version package file; And, analyzing the version package file through a preset database statement identification template to identify and obtain a database release statement; The database statement error correction module is used to perform error correction verification on the database release statement according to the preset statement rule to obtain a verification result; and, according to the verification result, perform risk identification on the database release statement through the preset risk statement identifier, and obtain an early warning strategy according to the comparison between the identification result and the preset corresponding table; Performing error correction verification on the database release statement according to the preset statement rule to obtain a verification result includes: analyzing the consistency between the actual execution status of the database release statement and the predetermined execution status according to the preset statement rule; When the actual execution status is inconsistent with the predetermined execution status, a prompt message is generated and output to a predetermined location; The high-risk statement identification and warning module is used to associate the warning strategy with the database release statement corresponding to the identification result to generate warning information, and provide the warning information to the database statement release history archiving module.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for causing a computer to execute the method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method and device for detecting application program version

    CN103810105A

  • Database software upgrading detection method and apparatus

    CN106325902A