Data modification scheme detection method, device and electronic equipment

Through automatic detection of data modification plans and multi-level detection using dictionary variables and instantiated classes, the risk of missed modifications and incorrect modifications caused by manual inspection dependence in the existing technology is solved, and the integrity and correctness of the data modification plan are realized. .

CN114253989BActive Publication Date: 2024-09-27CHINA MOBILE GRP GUANGDONG CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011007406.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-23
Publication Date
2024-09-27
Estimated Expiration
2040-09-23

AI Technical Summary

Technical Problem

Existing data modification scheme detection methods rely on manual inspection, resulting in high potential risks of missed modifications and incorrect modifications, and cannot ensure the integrity, standardization and correctness of the scheme.

Method used

Load the SQL statement into the preset dictionary variable through the loading pre-verification process, execute the plan verification and test verification process, and use dictionary variables and instantiated classes to perform multi-level and multi-dimensional detection to ensure the integrity of the data modification plan. Normativity and correctness.

Benefits of technology

Automatic detection of data modification plans is realized, ensuring the integrity, standardization and correctness of data modification plans, and reducing the risk of missed or mistaken modifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114253989B
    Figure CN114253989B
Patent Text Reader

Abstract

The embodiment of the present invention provides a data modification scheme detection method, device and electronic device, the method comprising: performing a loading pre-verification process on the acquired data modification scheme, loading each SQL statement in the data modification scheme into a first dictionary variable; performing a scheme verification process on the first dictionary variable, obtaining a first instantiation class corresponding to each SQL statement, and a second instantiation class corresponding to each target library table of the data modification scheme, and constructing a second dictionary variable and a third dictionary variable; performing a test verification process on the second dictionary variable and the third dictionary variable, testing the execution process of the first instantiation class in turn according to the execution sequence number of the dictionary key of the second dictionary variable, and verifying the test result according to the second instantiation class of the third dictionary variable. Through the embodiment of the present invention, the data modification scheme is automatically detected, and the integrity, standardization and correctness of the data modification scheme are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile communication technology, and in particular to a data modification scheme detection method, device and electronic equipment. Background Art

[0002] In daily NGBOSS operation and maintenance work, ORACLE database record modifications are often involved, and the modification content is extensive. The modification plans written by various operation and maintenance personnel vary. Therefore, the modification plans need to be checked in advance before execution.

[0003] Currently, data modification plans are checked by manual inspection. Each data modification plan involves at least multiple people from writing to execution. Manual inspection cannot ensure that the syntax of each SQL statement in the plan is correct and the modification amount is in line with expectations. It cannot ensure that the plan has a complete backup, implementation, and rollback plan, nor can it avoid erroneous modifications or missed changes.

[0004] It can be seen that the existing detection methods for data modification schemes have great potential risks of missed modifications and erroneous modifications due to excessive reliance on manual inspection. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a data modification scheme detection method, device and electronic device to solve the problem that the existing data modification scheme detection method has a great potential risk of missed modification and erroneous modification due to excessive reliance on manual inspection.

[0006] In order to solve the above technical problems, the embodiment of the present invention is implemented as follows:

[0007] In a first aspect, an embodiment of the present invention provides a data modification scheme detection method, comprising:

[0008] Execute a preset loading pre-checking process on the acquired data modification plan, and load each SQL statement in the data modification plan into a preset first dictionary variable; wherein the first dictionary variable includes first dictionary values ​​corresponding to each SQL statement;

[0009] Execute a preset scheme verification process on the first dictionary variable to obtain a first instantiation class corresponding to each SQL statement and a second instantiation class corresponding to each target library table of the data modification scheme, and construct a second dictionary variable and a third dictionary variable; wherein each second dictionary value of the second dictionary variable corresponds to each first instantiation class, each second dictionary key of the second dictionary variable corresponds to an execution sequence number of each SQL statement, and each third dictionary value of the third dictionary variable corresponds to each second instantiation class;

[0010] A preset test and verification process is performed on the second dictionary variable and the third dictionary variable, and the execution process of the first instantiation class is tested in sequence according to the execution sequence number of the dictionary key of the second dictionary variable, and the test result is verified according to the second instantiation class of the third dictionary variable.

[0011] In a second aspect, an embodiment of the present invention provides a data modification scheme detection device, comprising:

[0012] A loading pre-verification module is used to perform a preset loading pre-verification process on the acquired data modification plan, and load each SQL statement in the data modification plan into a preset first dictionary variable; wherein the first dictionary variable includes first dictionary values ​​corresponding to each SQL statement;

[0013] A scheme verification module is used to execute a preset scheme verification process on the first dictionary variable, obtain a first instantiation class corresponding to each SQL statement, and a second instantiation class corresponding to each target library table of the data modification scheme, and construct a second dictionary variable and a third dictionary variable; wherein each second dictionary value of the second dictionary variable corresponds to each first instantiation class, each second dictionary key of the second dictionary variable corresponds to an execution sequence number of each SQL statement, and each third dictionary value of the third dictionary variable corresponds to each second instantiation class;

[0014] A test verification module is used to execute a preset test verification process on the second dictionary variable and the third dictionary variable, test the execution process of the first instantiation class in sequence according to the execution sequence number of the dictionary key of the second dictionary variable, and verify the test result according to the second instantiation class of the third dictionary variable.

[0015] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through a bus; the memory is used to store computer programs; and the processor is used to execute the programs stored in the memory to implement the steps of the data modification scheme detection method as described in the first aspect.

[0016] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data modification scheme detection method described in the first aspect are implemented.

[0017] It can be seen from the technical solution provided by the above embodiment of the present invention that the embodiment of the present invention performs a preset loading pre-verification process on the acquired data modification plan, and loads each SQL statement in the data modification plan into a preset first dictionary variable; performs a preset scheme verification process on the first dictionary variable, obtains a first instantiation class corresponding to each SQL statement, and a second instantiation class corresponding to each target library table of the data modification plan, and constructs a second dictionary variable and a third dictionary variable; performs a preset test verification process on the second dictionary variable and the third dictionary variable, and tests the execution process of the first instantiation class in turn according to the execution sequence number of the dictionary key of the second dictionary variable, and verifies the test result according to the second instantiation class of the third dictionary variable. Through the embodiment of the present invention, automatic detection of the data modification plan is realized, and the integrity, standardization and correctness of the data modification plan are guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0019] Figure 1 A schematic diagram of a first flow chart of a data modification scheme detection method provided by an embodiment of the present invention;

[0020] Figure 2 A schematic diagram of a module architecture for executing a data modification scheme detection method provided by an embodiment of the present invention;

[0021] Figure 3 A second flow chart of the data modification scheme detection method provided by an embodiment of the present invention;

[0022] Figure 4 A schematic diagram of the module composition of a data modification scheme detection device provided by an embodiment of the present invention;

[0023] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] Embodiments of the present invention provide a data modification scheme detection method, device and electronic device.

[0025] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0026] like Figure 1 As shown, an embodiment of the present invention provides a data modification scheme detection method, and the execution subject of the method can be a server, wherein the server can be an independent server or a server cluster composed of multiple servers, and the server can be a server capable of performing network operation processing, such as a server for configuring a certain network resource. The method can specifically include the following steps:

[0027] Step S01: perform a preset loading pre-checking process on the acquired data modification plan, and load each SQL statement in the data modification plan into a preset first dictionary variable; wherein the first dictionary variable includes first dictionary values ​​corresponding to each SQL statement.

[0028] After receiving the data modification plan, the embodiment of the present invention performs a preset detection process on the data modification plan, which mainly includes: loading pre-verification process, plan verification process and test verification process. The integrity, standardization and correctness of the data modification plan are respectively verified at multiple levels and in multiple dimensions. Figure 2 As shown, the technical solution of the embodiment of the present invention has the function of database identification and automatic routing, and logs in to different databases for detection according to the identifiers of each target library table in the data modification plan.

[0029] It should be understood that the language used for the detection process can be set according to actual needs. The embodiment of the present invention takes Python language as an example for illustration. By utilizing the powerful regular expression function of Python language, the SQL statements in the data modification scheme can be matched, searched, extracted, replaced, and other operations can be performed quickly and efficiently. In addition, the cx_oracle module in Python language is used to maintain a long connection with the database for interaction. Compared with traditional scripting languages, such as sqlplus used in shell scripting languages, it can greatly reduce the occupation of database resources and improve the execution efficiency of tool scripts.

[0030] The loading pre-checking process uses the regular expression function of the Python language to format each SQL statement in the solution file into a preset first dictionary variable. The first dictionary variable can be set according to actual needs. In the embodiment of the present invention, the original SQL statement dictionary variable SqlInfoSeq variable is used as an example for illustration. The first dictionary key of the SqlInfoSeq variable is the count number of the SQL statement, and the first dictionary value is the SQL statement.

[0031] Step S02: Execute a preset scheme verification process on the first dictionary variable to obtain a first instantiation class corresponding to each SQL statement and a second instantiation class corresponding to each target library table of the data modification scheme, and construct a second dictionary variable and a third dictionary variable; wherein each second dictionary value of the second dictionary variable corresponds to each first instantiation class, each second dictionary key of the second dictionary variable corresponds to an execution sequence number of each SQL statement, and each third dictionary value of the third dictionary variable corresponds to each second instantiation class.

[0032] The solution verification process mainly performs format specification check and interpretation on the SQL statements of each dictionary value in the first dictionary variable SqlInfoSeq variable, and constructs a second dictionary variable related to the execution process of the data modification solution and a third dictionary variable related to the target library table according to the interpretation results.

[0033] It should be understood that the second dictionary variable and the third dictionary variable can be set according to actual needs. The implementation of the present invention only takes the second dictionary variable as the test sequence dictionary TestSeqDic variable and the third dictionary as the library table basic related information dictionary TableInfoDic variable as an example for illustration.

[0034] The second dictionary key of the TestSeqDic variable is an execution sequence number used to characterize the execution order of each SQL statement in the data modification plan, and the second dictionary value is a first instance class corresponding to each SQL statement, and the first instance class contains relevant information about the SQL statement. The third dictionary key of the TableInfoDic variable is the name of each target library table of the data modification plan, and the third dictionary value is a second instantiation class corresponding to each target library table.

[0035] It should be understood that the first instantiation class and the second instantiation class can be set according to actual needs. The embodiment of the present invention only takes the first instantiation class as the SqlUnit class and the second instantiation class as the TableInfo class as an example for illustration. Each SQL statement corresponds to a SqlUnit class, and each target library table corresponds to a TableInfo class.

[0036] The specific design example of the SqlUnit class is as follows:

[0037]

[0038] The specific design example of the TableInfo class is as follows:

[0039]

[0040]

[0041] Based on the above SqlUnit class and TableInfo class, the key variables are explained respectively.

[0042] Description of key variables of the SqlUnit class: plansql is the data modification plan SQL statement; testsql is the test SQL statement. The key target library table involved in the test SQL statement will be replaced with a test temporary table during the test phase; tablename is the target library table.

[0043] TableInfo class key variables description: tablename is the target library table; testtable is the test temporary table corresponding to the target library table. All modifications to the target library table and the query operations after the modifications in the execution phase are based on this test temporary table. The test temporary table is named by the order number plus time to ensure the uniqueness of the temporary table name; testbacktable is the backup table created for testtable, which is mainly used to check whether the modification is out of bounds and whether the data is completely restored after rollback. For example, the database target original table, testtable, and testbacktable are used to calculate whether the modification exceeds the backup table range and whether the data is restored to the original state of the database target original table after rollback; createsubsql is a temporary table creation statement list variable, which contains the backup part table creation statement and implementation part modification statement for the target library table; backuptabletmp is the plan backup table list, which is used to check whether the implementation part of the modification to the target library table exceeds the backup table range.

[0044] When analyzing each SQL statement in the SqlInfoSeq variable during the solution verification process, read the information in each SQL statement, including: target library table, table alias, select clause, from clause, where clause, target library table primary key, notes and other key information, initialize a SqlUnit class corresponding to the SQL statement, and determine whether a TableInfo class corresponding to the same target library table already exists based on the relevant information of the target library table in the SQL statement. If not, initialize a TableInfo class corresponding to the target library table. If it exists, update the variable properties in the TableInfo class based on the SQL statement. In this process, if the interpretation of the key variables of any instance class fails, the detection process may be interrupted.

[0045] Step S03, execute a preset test verification process on the second dictionary variable and the third dictionary variable, test the execution process of the first instantiation class in sequence according to the execution sequence number of the dictionary key of the second dictionary variable, and verify the test result according to the second instantiation class of the third dictionary variable.

[0046] During the test verification process, the database connection pool object Dbclass class is first instantiated, which provides self-management functions such as database connection, query, modification, and release of connection. When the program is running, the identifier of the target library table specified by the data modification plan automatically connects to the corresponding database, and the corresponding SqlUnit class object testsql variable test SQL statement is executed in sequence according to the execution sequence number of the second dictionary key in the TestSeqDic variable. Among them, if the test SQL statement is a modification statement, the involved quantity statistics select statement is constructed according to the wheresubstr attribute variable of the SqlUnit class before the test. If the modification involved quantity counted by the execution statistics statement does not reach the configuration threshold, the processing continues. When the production library table is modified for the first time, the testtable test table and testbacktable test backup table of the TableInfo class instance object are created. All subsequent SQL statements of the target library table for this production table will be replaced with the testtable test table, that is, all subsequent operations of the production table are based on the testtable test table. After each test SQL statement is successfully executed, it will check whether the amount involved in the remarks is consistent with the amount involved in the test, and construct a unique constraint check SQL based on the primary key of the library table stored in the primarycols variable of the TableInfo class instance object to determine whether there is a primary key conflict. After the rollback part is executed, for each library table involved in the modification, the testbacktable test backup table construction is restored to the original data query SQL to determine whether the rollback SQL is correct.

[0047] It can be seen from the technical solution provided by the above embodiment of the present invention that the embodiment of the present invention performs a preset loading pre-verification process on the acquired data modification plan, and loads each SQL statement in the data modification plan into a preset first dictionary variable; performs a preset scheme verification process on the first dictionary variable, obtains a first instantiation class corresponding to each SQL statement, and a second instantiation class corresponding to each target library table of the data modification plan, and constructs a second dictionary variable and a third dictionary variable; performs a preset test verification process on the second dictionary variable and the third dictionary variable, and tests the execution process of the first instantiation class in turn according to the execution sequence number of the dictionary key of the second dictionary variable, and verifies the test result according to the second instantiation class of the third dictionary variable. Through the embodiment of the present invention, automatic detection of the data modification plan is realized, and the integrity, standardization and correctness of the data modification plan are guaranteed.

[0048] Further, such as Figure 3 As shown, after step S03, the method further includes:

[0049] Step S04: after verification is successful, convert the data modification scheme into an MD5 code for execution.

[0050] After the above detection process is executed on the data modification scheme and all verifications are successful, an MD5 code will be generated, and the data modification scheme will be specifically executed according to the MD5 code.

[0051] It can be seen from the technical solution provided by the above embodiments of the present invention that the embodiments of the present invention prevent the plan from being modified midway from approval to execution by converting the data modification plan into an MD5 code for execution, thereby ensuring the accuracy and success rate of execution.

[0052] Furthermore, the step S01 includes:

[0053] S011. Determine the execution phase of each SQL statement in the data modification scheme according to the comment line of each SQL statement;

[0054] S012. Verify the integrity of the SQL statement according to the execution phase, and load the dictionary value corresponding to the SQL statement into the first dictionary variable.

[0055] During the loading and verification process, the SQL statements in the data modification plan are formatted. The general logic is to first filter the comment lines, and divide the data modification plan into multiple execution stages according to the comment line keyword identification lines, which can include: pre-implementation check, backup, implementation, post-implementation check, and rollback. Then, the SQL statements of each part are extracted and checked for completeness, and then loaded into the SqlInfoSeq variable.

[0056] Furthermore, the step S01 further includes:

[0057] S013. If the MD5 switch flag of the data modification scheme is indicated as being on, determining whether an MD5 code corresponding to the data modification scheme already exists;

[0058] S014. If an MD5 code corresponding to the data modification scheme already exists, the detection is interrupted.

[0059] The key point verification of each execution stage in the data modification scheme detection method is shown in the following table.

[0060]

[0061]

[0062]

[0063] In practice, an automatic detection tool can be written based on the above detection method and run on the system, and support printing of detailed detection process and generating detection reports through interactive mode. Errors or exceptions that occur when the verification tool fails the detection process can be divided into three categories:

[0064] 1. Syntax problems of SQL statements in the data modification plan lead to database execution errors. When such errors occur, the verification tool will not continue to perform verification and will be forced to exit.

[0065] 2. The data modification plan is not perfect, such as missing where conditions, SQL statement analysis failure, the number of concurrency exceeds 4, lack of backup, check, rollback statements, the number of backup and modification records is greater than or equal to 100,000, etc. This type of error checking tool will not continue to perform the check.

[0066] 3. For scenarios where the number of records and comments involved in the SQL statement are inconsistent, the amount of backup data is less than the amount of modified data, there is a primary key conflict, and the number of modified records is greater than or equal to 20,000, the verification tool will prompt that the verification failed after the verification is completed, and no MD5 will be generated.

[0067] It can be seen from the technical solution provided by the above embodiment of the present invention that the embodiment of the present invention determines the execution stage of each SQL statement in the data modification scheme according to the comment line of each SQL statement; verifies the integrity of the SQL statement according to the execution stage, and loads the dictionary value corresponding to the SQL statement into the first dictionary variable; if the MD5 switch flag of the data modification scheme is represented as open, it is determined whether the MD5 code corresponding to the data modification scheme already exists; if the MD5 code corresponding to the data modification scheme already exists, the detection is interrupted. Through the embodiment of the present invention, the data modification scheme is automatically detected, and the integrity, standardization and correctness of the data modification scheme are guaranteed.

[0068] Corresponding to the data modification scheme detection method provided in the above embodiment, based on the same technical concept, the embodiment of the present invention also provides a data modification scheme detection device, Figure 4 A schematic diagram of the module composition of a data modification scheme detection device provided in an embodiment of the present invention, wherein the data modification scheme detection device is used to perform Figures 1 to 3 The data modification scheme detection method described in Figure 4 As shown, the data modification scheme detection device includes: a loading pre-verification module 401, a scheme verification module 402 and a test verification module 403.

[0069] The loading pre-verification module 401 is used to perform a preset loading pre-verification process on the acquired data modification plan, and load each SQL statement in the data modification plan into a preset first dictionary variable; wherein the first dictionary variable includes a first dictionary value corresponding to each SQL statement; the solution verification module 402 is used to perform a preset solution verification process on the first dictionary variable, obtain a first instantiation class corresponding to each SQL statement, and a second instantiation class corresponding to each target library table of the data modification plan, and construct a second dictionary variable and a third dictionary variable; wherein each second dictionary value of the second dictionary variable corresponds to each first instantiation class, each second dictionary key of the second dictionary variable corresponds to an execution sequence number of each SQL statement, and each third dictionary value of the third dictionary variable corresponds to each second instantiation class; the test verification module 403 is used to perform a preset test verification process on the second dictionary variable and the third dictionary variable, test the execution process of the first instantiation class in turn according to the execution sequence number of the dictionary key of the second dictionary variable, and verify the test result according to the second instantiation class of the third dictionary variable.

[0070] It can be seen from the technical solution provided by the above embodiment of the present invention that the embodiment of the present invention performs a preset loading pre-verification process on the acquired data modification plan, and loads each SQL statement in the data modification plan into a preset first dictionary variable; performs a preset scheme verification process on the first dictionary variable, obtains a first instantiation class corresponding to each SQL statement, and a second instantiation class corresponding to each target library table of the data modification plan, and constructs a second dictionary variable and a third dictionary variable; performs a preset test verification process on the second dictionary variable and the third dictionary variable, and tests the execution process of the first instantiation class in turn according to the execution sequence number of the dictionary key of the second dictionary variable, and verifies the test result according to the second instantiation class of the third dictionary variable. Through the embodiment of the present invention, automatic detection of the data modification plan is realized, and the integrity, standardization and correctness of the data modification plan are guaranteed.

[0071] Furthermore, the device also includes:

[0072] The scheme execution module is used to convert the data modification scheme into an MD5 code for execution after the verification is successful.

[0073] It can be seen from the technical solution provided by the above embodiments of the present invention that the embodiments of the present invention prevent the plan from being modified midway from approval to execution by converting the data modification plan into an MD5 code for execution, thereby ensuring the accuracy and success rate of execution.

[0074] Furthermore, the loading pre-check module includes:

[0075] A first pre-checking unit, used to determine the execution stage of each SQL statement in the data modification scheme according to the comment line of each SQL statement;

[0076] The second pre-verification unit is used to verify the integrity of the SQL statement according to the execution stage, and load the dictionary value corresponding to the SQL statement into the first dictionary variable.

[0077] Furthermore, the loading pre-verification module further includes:

[0078] A third pre-verification unit, configured to determine whether an MD5 code corresponding to the data modification scheme already exists if the MD5 switch flag of the data modification scheme is represented as being on;

[0079] The fourth pre-checking unit is used to interrupt the current detection if the MD5 code corresponding to the data modification scheme already exists.

[0080] It can be seen from the technical solution provided by the above embodiment of the present invention that the embodiment of the present invention determines the execution stage of each SQL statement in the data modification scheme according to the comment line of each SQL statement; verifies the integrity of the SQL statement according to the execution stage, and loads the dictionary value corresponding to the SQL statement into the first dictionary variable; if the MD5 switch flag of the data modification scheme is represented as open, it is determined whether the MD5 code corresponding to the data modification scheme already exists; if the MD5 code corresponding to the data modification scheme already exists, the detection is interrupted. Through the embodiment of the present invention, the data modification scheme is automatically detected, and the integrity, standardization and correctness of the data modification scheme are guaranteed.

[0081] The data modification scheme detection device provided in the embodiment of the present invention can implement each process in the embodiment corresponding to the above-mentioned data modification scheme detection method, and will not be described again here to avoid repetition.

[0082] It should be noted that the data modification scheme detection device provided in the embodiment of the present invention and the data modification scheme detection method provided in the embodiment of the present invention are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned data modification scheme detection method, and the repeated parts will not be repeated.

[0083] Corresponding to the data modification scheme detection method provided in the above embodiment, based on the same technical concept, an embodiment of the present invention further provides an electronic device, which is used to execute the above data modification scheme detection method. Figure 5 A schematic diagram of the structure of an electronic device for implementing various embodiments of the present invention is shown in FIG. Figure 5 As shown. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 501 and memory 502, and the memory 502 may store one or more storage applications or data. Among them, the memory 502 can be a temporary storage or a permanent storage. The application stored in the memory 502 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 501 can be configured to communicate with the memory 502 to execute a series of computer executable instructions in the memory 502 on the electronic device. The electronic device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input and output interfaces 505, and one or more keyboards 506.

[0084] Specifically in this embodiment, the electronic device includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store a computer program; the processor is used to execute the program stored in the memory to implement the following method steps:

[0085] Execute a preset loading pre-checking process on the acquired data modification plan, and load each SQL statement in the data modification plan into a preset first dictionary variable; wherein the first dictionary variable includes first dictionary values ​​corresponding to each SQL statement;

[0086] Execute a preset scheme verification process on the first dictionary variable to obtain a first instantiation class corresponding to each SQL statement and a second instantiation class corresponding to each target library table of the data modification scheme, and construct a second dictionary variable and a third dictionary variable; wherein each second dictionary value of the second dictionary variable corresponds to each first instantiation class, each second dictionary key of the second dictionary variable corresponds to an execution sequence number of each SQL statement, and each third dictionary value of the third dictionary variable corresponds to each second instantiation class;

[0087] A preset test and verification process is performed on the second dictionary variable and the third dictionary variable, and the execution process of the first instantiation class is tested in sequence according to the execution sequence number of the dictionary key of the second dictionary variable, and the test result is verified according to the second instantiation class of the third dictionary variable.

[0088] The present application also provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the following method steps are implemented:

[0089] Execute a preset loading pre-checking process on the acquired data modification plan, and load each SQL statement in the data modification plan into a preset first dictionary variable; wherein the first dictionary variable includes first dictionary values ​​corresponding to each SQL statement;

[0090] Execute a preset scheme verification process on the first dictionary variable to obtain a first instantiation class corresponding to each SQL statement and a second instantiation class corresponding to each target library table of the data modification scheme, and construct a second dictionary variable and a third dictionary variable; wherein each second dictionary value of the second dictionary variable corresponds to each first instantiation class, each second dictionary key of the second dictionary variable corresponds to an execution sequence number of each SQL statement, and each third dictionary value of the third dictionary variable corresponds to each second instantiation class;

[0091] A preset test and verification process is performed on the second dictionary variable and the third dictionary variable, and the execution process of the first instantiation class is tested in sequence according to the execution sequence number of the dictionary key of the second dictionary variable, and the test result is verified according to the second instantiation class of the third dictionary variable.

[0092] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, 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.

[0093] 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.

[0094] 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.

[0095] 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.

[0096] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0097] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0098] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0099] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0100] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt 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 codes.

[0101] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A data modification scheme detection method, characterized in that: The method comprises: Execute a preset loading pre-checking process on the acquired data modification plan, and load each SQL statement in the data modification plan into a preset first dictionary variable; wherein the first dictionary variable includes first dictionary values ​​corresponding to each SQL statement; A preset scheme verification process is executed on the first dictionary variable to obtain a first instantiation class corresponding to each SQL statement and a second instantiation class corresponding to each target library table of the data modification scheme, and a second dictionary variable and a third dictionary variable are constructed; wherein each second dictionary value of the second dictionary variable corresponds to each first instantiation class, each second dictionary key of the second dictionary variable corresponds to the execution sequence number of each SQL statement, and each third dictionary value of the third dictionary variable corresponds to each second instantiation class; A preset test and verification process is performed on the second dictionary variable and the third dictionary variable, and the execution process of the first instantiation class is tested in sequence according to the execution sequence number of the dictionary key of the second dictionary variable, and the test result is verified according to the second instantiation class of the third dictionary variable.

2. The data modification scheme detection method according to claim 1, characterized in that: After verifying the test result according to the second instantiation class of the third dictionary variable, the method further includes: After the verification is successful, the data modification scheme is converted into an MD5 code for execution.

3. The data modification scheme detection method according to claim 2, characterized in that: The step of performing a preset loading pre-checking process on the acquired data modification scheme includes: Determine, according to the comment line of each SQL statement, the execution stage of each SQL statement in the data modification scheme; The integrity of the SQL statement is verified according to the execution phase, and a dictionary value corresponding to the SQL statement is loaded into the first dictionary variable.

4. The data modification scheme detection method according to claim 3, characterized in that: The step of performing a preset loading pre-checking process on the acquired data modification scheme further includes: If the MD5 switch flag of the data modification scheme is indicated as on, determining whether an MD5 code corresponding to the data modification scheme already exists; If an MD5 code corresponding to the data modification scheme already exists, this detection is terminated.

5. A data modification scheme detection device, characterized in that: The device comprises: A loading pre-verification module is used to perform a preset loading pre-verification process on the acquired data modification plan, and load each SQL statement in the data modification plan into a preset first dictionary variable; wherein the first dictionary variable includes first dictionary values ​​corresponding to each SQL statement; A scheme verification module is used to execute a preset scheme verification process on the first dictionary variable, obtain a first instantiation class corresponding to each SQL statement, and a second instantiation class corresponding to each target library table of the data modification scheme, and construct a second dictionary variable and a third dictionary variable; wherein each second dictionary value of the second dictionary variable corresponds to each first instantiation class, each second dictionary key of the second dictionary variable corresponds to an execution sequence number of each SQL statement, and each third dictionary value of the third dictionary variable corresponds to each second instantiation class; A test verification module is used to execute a preset test verification process on the second dictionary variable and the third dictionary variable, test the execution process of the first instantiation class in sequence according to the execution sequence number of the dictionary key of the second dictionary variable, and verify the test result according to the second instantiation class of the third dictionary variable.

6. The data modification scheme detection device according to claim 5, characterized in that: The device also includes: The scheme execution module is used to convert the data modification scheme into an MD5 code for execution after the verification is successful.

7. The data modification scheme detection device according to claim 6, characterized in that: The loading pre-check module comprises: A first pre-checking unit, used to determine the execution stage of each SQL statement in the data modification scheme according to the comment line of each SQL statement; The second pre-verification unit is used to verify the integrity of the SQL statement according to the execution stage, and load the dictionary value corresponding to the SQL statement into the first dictionary variable.

8. The data modification scheme detection device according to claim 7, characterized in that: The loading pre-check module further includes: A third pre-verification unit, configured to determine whether an MD5 code corresponding to the data modification scheme already exists if the MD5 switch flag of the data modification scheme is represented as being on; The fourth pre-checking unit is used to interrupt the current detection if the MD5 code corresponding to the data modification scheme already exists.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the steps of the data modification scheme detection method as described in any one of claims 1-4.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data modification scheme detection method according to any one of claims 1 to 4 are implemented.