CN109032611A - Script dispositions method, device, computer equipment and storage medium - Google Patents

Script dispositions method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109032611A
CN109032611A CN201810573712.0A CN201810573712A CN109032611A CN 109032611 A CN109032611 A CN 109032611A CN 201810573712 A CN201810573712 A CN 201810573712A CN 109032611 A CN109032611 A CN 109032611A
Authority
CN
China
Prior art keywords
script
database
deployment
database script
disposed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810573712.0A
Other languages
Chinese (zh)
Other versions
CN109032611B (en
Inventor
黄锦伦
彭伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810573712.0A priority Critical patent/CN109032611B/en
Priority to PCT/CN2018/092591 priority patent/WO2019232828A1/en
Publication of CN109032611A publication Critical patent/CN109032611A/en
Application granted granted Critical
Publication of CN109032611B publication Critical patent/CN109032611B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of script dispositions method, device, computer equipment and storage mediums, which comprises receives the identification information of the object to be disposed and target application environment under original application environment;For each object to be disposed, preset conversion script creation database script corresponding with object to be disposed is somebody's turn to do is used;Legitimacy verifies are carried out to database script;After verification passes through, disposed in advance in simulated environment using database script;Target script is obtained according to the deployment result disposed in advance;Target script is deployed in target application environment.Technical solution of the present invention can effectively improve the rate of creation database script, save human resources, and by the checking and debugging to database script, raising is deployed to power, to improve development efficiency.

Description

Script dispositions method, device, computer equipment and storage medium
Technical field
The present invention relates to field of computer technology more particularly to a kind of script dispositions method, device, computer equipment and deposit Storage media.
Background technique
Developer is in project development process, it will usually create in each database developed under environment corresponding Table, and after being defined to table or modifying table structure, arrangement is corresponding to build table statement, regenerates database script, portion It affixes one's name to and is used in various application environments, tested for example, the database script developed in environment is deployed in test environment Work.
But developer is when disposing database script at present, needs by manually arranging to tables of data, and raw At database script, time-consuming for this mode for arranging database script, and is easy to appear mistake, while by database foot Originally it is published to after target application environment, there are the database scripts normally to execute in exploitation environment, and in target application The case where reporting an error is executed in environment, needs to carry out at this time manually to search error reason, and weight after modifying to database script It is new to transfer deployment, so that causing the working efficiency of exploitation reduces.
Summary of the invention
Based on this, it is necessary to which in view of the above technical problems, providing one kind can be with automatically generated data library script, and to data Library script carries out checking and debugging, improves script dispositions method, device, computer equipment and the storage medium of development efficiency.
A kind of script dispositions method, comprising:
Receive the identification information of the object to be disposed and target application environment under original application environment;
The configuration information of the target application environment is obtained according to the identification information, and using the configuration information to simulation Environment is configured;It is corresponding with object to be disposed is somebody's turn to do using the creation of preset conversion script for each object to be disposed Database script;
Legitimacy verifies are carried out to the database script, obtain check results;
If the check results are that verification passes through, pre- portion is carried out in the simulated environment using the database script Administration;
If the deployment result of the pre- deployment is successfully, the database script of pre- deployment success to be labeled as target foot This;
If the deployment result of the pre- deployment is failure, failure information is obtained, it is corresponding default according to the failure information Modification mode is adjusted the content of the database script of pre- deployment failure, and database script adjusted is labeled as The target script;
The target script is deployed in the target application environment.
A kind of script deployment device, comprising:
Information receiving module, the mark for receiving the object to be disposed under original application environment and target application environment are believed Breath;
Parameter configuration module for obtaining the configuration information of the target application environment according to the identification information, and makes Simulated environment is configured with the configuration information;
Database script creation module, for being created using preset conversion script for each object to be disposed Database script corresponding with the object to be disposed;
Database script correction verification module obtains check results for carrying out legitimacy verifies to the database script;
Pre- deployment module, if being that verification passes through for the check results, using the database script in the mould Near-ring is disposed in advance in border;
First mark module, if the deployment result for the pre- deployment is successfully, by the database of pre- deployment success Script markup is target script;
Second mark module obtains failure information, according to the mistake if the deployment result for the pre- deployment is failure The corresponding default modification mode of information is lost, the content of the database script of pre- deployment failure is adjusted, and will be adjusted Database script is labeled as the target script;
Target script deployment module, for the target script to be deployed in the target application environment.
A kind of computer equipment, including memory, processor and storage are in the memory and can be in the processing The computer program run on device, the processor realize the step of above-mentioned script dispositions method when executing the computer program Suddenly.
A kind of computer readable storage medium, the computer-readable recording medium storage have computer program, the meter The step of calculation machine program realizes above-mentioned script dispositions method when being executed by processor.
Above-mentioned script dispositions method, device, computer equipment and storage medium, by receive original application environment under to The identification information for disposing object and target application environment, for each object to be disposed, using the creation of preset conversion script and It is somebody's turn to do the corresponding database script of object to be disposed, the creation efficiency of database script is improved, reduces the repeated labor of developer It is dynamic, it is disposed in advance in simulated environment using the database script that verification passes through, and by the database script mark of deployment success It is denoted as target script, meanwhile, if database script executes deployment error, according to the configuration information of target application environment to the number It is adjusted according to library script, database script adjusted is labeled as target script, target script is deployed to target application Environment, to improve the success rate of database script deployment, it is consistent right with the object to be disposed under original application environment to obtain Image structures avoid disposing the case where database script reports an error in target application environment, save human resources, improve exploitation Working efficiency.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is an application environment schematic diagram of script dispositions method in one embodiment of the invention;
Fig. 2 is an implementation flow chart of script dispositions method in one embodiment of the invention;
Fig. 3 is a specific flow chart of step S3 in Fig. 2;
Fig. 4 is to be verified in the script dispositions method provided in the embodiment of the present invention to the filename of database script One specific flow chart;
Fig. 5 is specific to the one of the content authentication of database script in the script dispositions method provided in the embodiment of the present invention Flow chart;
Fig. 6 is a specific flow chart of step S5 in Fig. 2;
Fig. 7 is a schematic diagram of script deployment device in one embodiment of the invention;
Fig. 8 is a schematic diagram of computer equipment in one embodiment of the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
The method of script deployment provided by the present application, can be applicable in the application environment such as Fig. 1, which includes clothes Business end and client, wherein be attached between server-side and client by network, user is inputted by client wait dispose The identification information of object and target application environment, client send the identification information of object to be disposed and target application environment to Server-side, server-side are treated deployment object and are handled, and automatically generate corresponding database script according to the object to be disposed, and Checking and debugging is carried out to database script, is deployed in target application environment.Client specifically can be, but not limited to be various People's computer, laptop, smart phone, tablet computer and portable wearable device, server-side specifically can be with independently Server or multiple servers composition server cluster realize.Script dispositions method application provided in an embodiment of the present invention In server-side.
In one embodiment, Fig. 2 shows a flow chart of script dispositions method in the present embodiment, this method is applied in Fig. 1 In server-side.As shown in Fig. 2, the script dispositions method includes step S1 to step S8, details are as follows:
S1: the identification information of the object to be disposed and target application environment under original application environment is received.
In the present embodiment, original application environment is wait dispose the application environment where object, and original application environment is to open Hair ring border, test environment, transitional environment or production environment etc., target application environment are to need to dispose object to be disposed Application environment, target application environment is exploitation environment, test environment, transitional environment or production environment etc., target application ring The identification information in border is the identification information for unique identification application environment, and object to be disposed is to be replicated in database Or the database or table of backup, wherein database includes but is not limited to application library, form library storage and storage facility located at processing plant etc..
Specifically, server-side first verifies the identity information of user, which includes username and password, If server-side be matched in legal identity information bank with the consistent legal identity information of the username and password of the user, really Recognize verification to pass through, and receives user and pass through the identification information of the client object to be disposed inputted and target application environment, user The object to be disposed of input includes should database-name and table name where object be disposed.
It should be noted that user can select database as object to be disposed in client, it can also be in client It selects the table in database as object to be disposed, can specifically be selected according to the needs of practical application.
For example, user, which needs for the database A developed under environment to be deployed under test environment, to carry out in project development process Test, then developing environment is original application environment, and database A is object to be disposed, and test environment is target application environment.
S2: the configuration information of target application environment is obtained according to identification information, and using the configuration information to simulated environment It is configured.
In the present embodiment, target application environment is determined according to the identification information of target application environment, and is connected by network The target application environment is asked in receiving, inquires the configuration information of the target environment, and the configuration information of the target application environment specifically may be used Think the environmental variance parameter configured in target application environment, simulated environment is matched according to the configuration information that inquiry obtains It sets, so that the configuration information of simulated environment is identical as the configuration information of target application environment.
It should be noted that simulated environment can be an individual server, or server cluster, herein not It is limited, can specifically be configured according to the needs of practical application.
S3: for each object to be disposed, preset conversion script creation data corresponding with object to be disposed is somebody's turn to do are used Library script.
Specifically, the object to be disposed inputted according to user, server-side pass through the information and database-name of user, even It is connected to the database, obtains the particular content of object to be disposed, including database or table to be disposed, and according to object to be disposed Particular content, use preset conversion script to generate database script corresponding with the object to be disposed.
Wherein, the content of database script includes storing process, affairs and function etc., and but it is not limited to this, database foot This content can be according to specifically needing the particular content for the object to be disposed disposed to be created, according to preset conversion foot The characteristics of database script that this creation obtains has committed memory small, facilitates backup and transplanting.
S4: legitimacy verifies are carried out to database script, obtain check results.
Specifically, it is required according to preset project development, legitimacy verifies is carried out to the database script of creation, if data Library script meets preset project development requirement, then it represents that database script be it is legal, i.e., check results be verification pass through, it is no Then, if database script does not meet preset project development requirement, then it represents that database script is illegal, i.e. check results Do not pass through for verification.
It should be noted that the project development require be it is preset for unified standard development process, it is different Its project development of project requires possibility is identical may not also be identical, and specific project development requirement can be according to the need of actual items It is set.
Further, legitimacy verifies include filename verification and service attribute verification, and preset project development requires tool Body can be and carry out default naming method to database script name, and carry out pre-set business attribute to the data of exploitation.Text Part name verification specifically can be verified according to preset naming method the database script of creation name it is whether legal, business Attribute verification specifically can be verified according to preset service attribute the database script of creation content it is whether legal, so as to Determine whether database script is legal.
S5: it if check results are that verification passes through, is disposed in advance in simulated environment using database script.
Specifically, simulated environment is the application environment simulated according to the configuration information of target application environment, if The check results obtained according to step S4 are that verification passes through, then using the database script that passes through of verification, in simulated environment into The pre- deployment of row, the operation conditions of test database script, in order to verify under simulated environment after execution database script, if It can obtain and the consistent object structure of object to be disposed, wherein object structure includes the data of table and the structure of table.
It should be noted that if after executing database script under simulated environment, obtained object structure with wait dispose The object structure of object is consistent, it is determined that the deployment result disposed in advance is successfully, if executing database script under simulated environment Later, occur executing the case where failing, or the object structure of obtained object structure and object to be disposed is inconsistent, it is determined that The deployment result disposed in advance is failure.
S6: if the deployment result disposed in advance is successfully, the database script of pre- deployment success to be labeled as target script.
In the present embodiment, according to the obtained pre- deployment of step S5 as a result, if the deployment result disposed in advance is successfully table Show the database script also can successful deployment and target application environment, by the database script be labeled as target script, be used for It is deployed in target application environment.
S7: if the deployment result disposed in advance is failure, obtaining failure information, repairs according to corresponding preset of the failure information Change mode, the content of the database script of pre- deployment failure is adjusted, and database script adjusted is labeled as mesh Mark script.
In the present embodiment, if the deployment result disposed in advance is failure, according to the running log information under simulated environment, Obtaining the reason of executing failure, or the place inconsistent with the object structure of object to be disposed determines failure information, and according to The error identification code that the failure information includes, according to the corresponding default modification mode of the error identification code, to pre- deployment failure The content of database script is adjusted, and database script adjusted is labeled as target script, is answered for being deployed to target With in environment.
It should be noted that preset modification mode specifically can be according to database script in different application environment lower part The modification mode that the mistake being easy to appear when administration is configured in advance in server-side, each error identification code correspond to a kind of modification Mode, if detecting error identification code, call corresponding modification mode to the content of the database script of pre- deployment failure into Row adjustment.
Further, if without carrying error identification code, as the unknown mistake in failure information, then by database script The failure information for disposing failure in advance under simulated environment is output to client, and provides corresponding miscue, is carried out by user Confirmation and adjustment, and user's database script adjusted is received, database script adjusted is labeled as target script.
For example, original application environment under Linux environment, uses PL*SQL database management tools, target application Environment is also but to use SQL*Plus database management tools under Linux environment, is deployed to by database script After simulated environment identical with the configuration information of target application environment, database script executes completion in simulated environment, does not have There is the information to report an error, but wait dispose literary name section present in object, the literary name section does not have but actually in simulated environment Increase, the situation inconsistent with the object structure of object to be disposed occur, according to the error identification code returned in failure information, inspection Measuring the failure cause is since location of annotated information is improper and cause in database script, and there are statement terminators in database script After the phenomenon that increasing annotation, which includes fullstop, branch and annotation symbol etc., because of SQL*Plus data depositary management Science and engineering tool can not parse the subsequent content of statement terminator, cause SQL*Plus database management tools that can not identify the order class Type, according to the error identification code, calls corresponding modification mode, which is adjusted to the situation of deployment mistake occur Before statement terminator, by adjusting the position of annotation, enable database script successful execution in target application environment, Avoid the generation of error situation.
S8: target script is deployed in target application environment.
In the present embodiment, the target script of obtaining step S6 or step S7 label, sends target for target script and answers It with environment, and drives target application environment to start preset order line and executes the target script, so that target script is deployed to In target application environment, the object structure of object to be disposed is restored, carries out using, wherein preset life in target environments Enable the order for perform script file.
Since the configuration information of simulated environment and the configuration information of target application environment are identical, and the school by disposing in advance Adjustment is tested, can guarantee target script successful deployment in target application environment, target script is avoided to hold in target application environment The case where row failure, while also not needing to carry out retest to target script in target application environment, to improve exploitation The efficiency of work.
In the present embodiment, believed by receiving the mark of the object to be disposed under original application environment and target application environment Breath is mentioned for each object to be disposed using preset conversion script creation database script corresponding with object to be disposed is somebody's turn to do The creation efficiency of high database script, reduces the repeated labor of developer, and the database script passed through using verification is in mould Near-ring is disposed in advance in border, and the database script of deployment success is labeled as target script, meanwhile, if database script is held Row deployment error, then be adjusted the database script according to the configuration information of target application environment, by data adjusted Library script markup be target script, target script is deployed to target application environment, thus improve database script deployment at Power, obtain with the consistent object structure of object to be disposed under original application environment, avoid disposing in target application environment The case where database script reports an error saves human resources, improves development efficiency.
In one embodiment, as shown in figure 3, in step S3, i.e., for each object to be disposed, preset conversion foot is used This creation database script corresponding with object to be disposed is somebody's turn to do, specifically comprises the following steps:
S31: the object structure of each object to be disposed is obtained.
In the present embodiment, the object to be disposed inputted according to user in client passes through the information and data of user Library name is connected to wait dispose the database where object, and obtains the object structure of the object to be disposed, the object structure packet Include the structure of the data of table and table in database.
S32: structure according to each object generates the corresponding SQL statement of the object structure using preset conversion script.
In the present embodiment, structure according to each object is generated corresponding with the object structure using preset conversion script SQL (Structured Query Language, structured query language) sentence, wherein SQL statement includes but is not limited to Table statement is built, sentence is indexed, builds synonym sentence, table authorization sentence and build table note.
For example, building table statement using what the preset conversion script for building table statement generated according to the P table wait dispose in object Are as follows:
CREATE TABLE P(Id int,Name varchar(255),Sex char(20),City varchar (255));
This, which builds table statement, indicates one P table of creation, wherein P table includes four for arranging entitled Id, Name, Sex and City The data type of column, Id column is int, indicates integer data, and the data type of Sex column is char, indicates that fixed storage is 20 The data type of the character string of byte, Name column and City column is varchar, indicates the character string of variable-length, maximum length For 255 characters.
S33: the corresponding SQL statement of each object structure is integrated into the corresponding database script of object to be disposed.
In the present embodiment, the SQL statement generated according to step S32 will be corresponding according to the creation sequence of object structure SQL statement is integrated into the corresponding database script of object to be disposed in sequence, wherein each database script corresponding one is specific Object to be disposed.
In the present embodiment, by being connected to wait dispose in the database where object, the object knot of each object is obtained Structure, structure, generates the corresponding SQL statement of the object structure using preset conversion script, then will be each right according to each object The corresponding SQL statement of image structures is integrated into the corresponding database script of object to be disposed, and reduces the repeated labor of developer It starts building to make, human resources is saved, to improve the creation efficiency of database script.
In one embodiment, as shown in figure 4, when legitimacy verifies are that filename verifies, pair mentioned in step S4 Database script carries out legitimacy verifies, obtains check results, specifically comprises the following steps:
S411: according to preset naming method, the filename of database script is verified.
In the present embodiment, user is named it according to the database script of creation, carries out to database script During legitimacy verifies, when legitimacy verifies are that filename verifies, according to preset naming method, ergodic data library script Filename, and filename is verified, so that whether the filename of calibration database script legal, the preset name side Formula can be specifically configured according to the needs of practical application, herein with no restrictions.
It should be noted that target application environment needs to determine database SID according to the identification number of filename when deployment (System Identifier, system identifier), SID are the unique identifier of a database, the system when establishing database The initial ID assigned will appear the case where deployment reports an error if filename does not meet preset naming rule.
For example, specific naming method can be set are as follows: identification number _ user name _ type _ operation _ object oriented _ creation People .sql, server-side will be verified according to filename of the naming method to database script.
S412: if the filename of database script does not meet the requirement of preset naming method, the database foot is exported This filename and error message, so that user modifies to file name according to error message.
In the present embodiment, it carries out building table script if detecting in checking procedure in the filename to database script Filename does not meet preset naming method, then the filename of the database script is marked, and exports the database foot This filename and error message, wherein error message is that the filename of the database script does not meet preset naming method Information avoid not conforming to due to the name to database script so that user modifies to file name according to error message Method and cause deployment phase mistake occur.
S413: receiving and verifies modified filename, if the modified filename meets preset naming method It is required that then verification passes through.
In the present embodiment, server-side receives user and inputs modified filename in client, and modified to this Filename is verified, if the modified filename meets the requirement of preset naming method, then it represents that modified file Name be it is legal, the verification of the filename of database script passes through.
In the present embodiment, by being verified to the filename of database script using preset naming method as standard, If the filename of database script does not meet the requirement of preset naming method, the filename and mistake of the database script are exported False information, so that user modifies to file name according to error message, and receives modified filename and verified, directly Meet the requirement of preset naming method to modified filename to pass through for verification, avoid due to the name to database script It is illegal and deployment phase is caused mistake occur, improve the accuracy of database script.
In one embodiment, as shown in figure 5, when legitimacy verifies are that service attribute verifies, mentioned in step S4 Legitimacy verifies are carried out to database script, check results is obtained, specifically comprises the following steps:
S421: whether Test database script meets preset service attribute.
Specifically, the business demand of each project development is different, and each project has its corresponding business norms, preset Service attribute can be specifically configured according to the business norms of actual items, carry out legitimacy verifies mistake to database script Cheng Zhong, according to the preset service attribute, traverses the interior of calibration database script when legitimacy verifies are that service attribute is verified Whether hold legal.
For example, preset service attribute includes needing to create index, major key field on all external keys cannot be null value, own It needs to create index on external key, and the service attributes such as nologging option cannot be included, wherein nologging is non-log Mode, if in exploration project including nologging option, the calamity that will affect database is standby and restore, data calamity it is standby for data from The process of other storage mediums is copied in the hard disk or array of applied host machine.
S422: if the content of database script does not meet preset service attribute, according to preset service attribute logarithm It is updated according to the content of library script.
In the present embodiment, if the content of database script does not meet service attribute, according to preset service attribute pair The content of database script is updated, and is adjusted to the content for not meeting service attribute in database script to meet service attribute Content.
For example, preset service attribute is to build table index to need using 16 threads, if detecting in database script It builds table index and does not use 16 threads, then the content in the database script is adjusted, be updated to build table index generation The SQL statement of 16 threads.
It further, if the database script of creation does not meet service attribute, but is the unknown mistake, then by database foot The content that service attribute is not met in this is output to client, and provides corresponding miscue, is confirmed by user and is repaired Change, receive user re-enter it is updated after disposing object, according to identical with step of embodiment of the present invention S3 Treatment process regenerates database script as updated database script.
S423: verifying updated database script, if updated database script meets preset business Attribute, then verification passes through.
In the present embodiment, updated database script is obtained, and updated database script is verified, if The content of updated database script meets preset service attribute, then it represents that the content of updated database script is to close Method, the content authentication of database script passes through.
In the present embodiment, by being verified to the content of database script using preset service attribute as standard, if The content of database script does not meet preset service attribute, then according to preset service attribute to the content of database script into Row updates, or the content that preset service attribute is not met in database script is output to client, is carried out by user true The reason of fixed mistake, and updated database script is verified, until updated database script meet it is preset Service attribute is that verification passes through, and improves the accuracy of database script, reduces error or does not meet the exploitation feelings of service attribute Condition.
In one embodiment, as shown in fig. 6, what is referred in step S5 is carried out in advance using database script in simulated environment Deployment, specifically comprises the following steps:
S51: database script is imported into simulated environment.
In the present embodiment, database script is imported under the unified path in simulated environment, and by database script Filename, which summarizes generation and summarizes script, to be stored under the unified path.
For example, database script a.sql and b.sql are copied under unified path, and according to database script
A.sql and b.sql, summarizes generation for the filename of database script and summarizes script c.sql and be stored under the path, Wherein, the content of c.sql is@@a.sql;@@b.sql.
S52: carrying out operation test to database script in simulated environment, obtains the deployment result of pre- deployment.
In the present embodiment, summarize script according to what step S51 was obtained, execute this using script execution command and summarize foot This, for example, SQL >@c.sql, is disposed in advance in simulated environment, simulates the deployment process under target application environment, surveys The operation conditions for trying database script obtains the deployment object generated after database script executes, is used for and original application ring Object to be disposed under border compares, if the object structure for obtaining deployment object is consistent with the object structure of object to be disposed, Then determine that the deployment result disposed in advance is successfully, if there is the case where executing failure, or to obtain the object structure of deployment object It is inconsistent with the object structure of object to be disposed, it is determined that the deployment result disposed in advance is failure.
In the present embodiment, by importing database script in the unified path under simulated environment, by database script Batch is disposed in advance, is improved the efficiency of deployment, operation test is carried out to database script in simulated environment, according to data The practice condition of library script obtains the deployment of pre- deployment as a result, being sufficiently simulated to the deployment process of target application environment Operation avoids causing deployment to lose because of brings defect test leakages such as the othernesses of original application environment and target application environment It loses, unnecessary influence is caused on project development work.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
In one embodiment, a kind of script deployment device is provided, which disposes script portion in device and above-described embodiment Arranging method corresponds.As shown in fig. 7, script deployment device includes: information receiving module 71, parameter setting module 72, number According to library script creation module 73, database script correction verification module 74, pre- deployment module 75, the first mark module 76, second label Module 77 and target script deployment module 78.Detailed description are as follows for each functional module:
Information receiving module 71, for receiving the mark of the object to be disposed under original application environment and target application environment Information;
Parameter configuration module 72 for obtaining the configuration information of target application environment according to identification information, and is matched using this Confidence breath configures simulated environment;
Database script creation module 73, for for each object to be disposed, using the creation of preset conversion script and It is somebody's turn to do the corresponding database script of object to be disposed;
Database script correction verification module 74 obtains check results for carrying out legitimacy verifies to database script;
Pre- deployment module 75, if for check results be verification pass through, using database script in simulated environment into The pre- deployment of row, wherein the configuration information of simulated environment and the configuration information of target application environment are identical;
First mark module 76, if the deployment result for disposing in advance is successfully, by the database foot of pre- deployment success This is labeled as target script;
Second mark module 77 obtains failure information, according to the failure if the deployment result for disposing in advance is failure The corresponding default modification mode of information is adjusted the content of the database script of pre- deployment failure, and by number adjusted It is target script according to library script markup;
Target script deployment module 78, for target script to be deployed in target application environment.
Further, database script creation module 73 includes:
Object structure acquiring unit 731, for obtaining the object structure of each object to be disposed;
Script sentence generation unit 732 generates the object using preset conversion script for structure according to each object The corresponding SQL statement of structure;
Database script creating unit 733, for the corresponding SQL statement of each object structure to be integrated into object to be disposed Corresponding database script.
Further, legitimacy verifies include filename verification and service attribute verification.
Further, when legitimacy verifies are that filename verifies, database script correction verification module 74 includes:
Script name verification unit 7411, for being carried out to the filename of database script according to preset naming method Verification;
Script name modifies unit 7412, if the filename for database script does not meet wanting for preset naming method It asks, then exports filename and the error message of the database script, so that user repairs file name according to error message Change;
Script name receiving unit 7413, for receiving and verifying modified filename, if the modified filename Meet the requirement of preset naming method, then verification passes through.
Further, when legitimacy verifies are that service attribute verifies, database script correction verification module 74 includes:
Whether service attribute verification unit 7421 meets preset service attribute for Test database script;
Content update unit 7422, if the content for database script does not meet preset service attribute, according to pre- If service attribute the content of database script is updated;
More new script verification unit 7423, for being verified to updated database script, if updated data Library script meets preset service attribute, then verification passes through.
Further, pre- deployment module 75 includes:
Database script precedents 751, for database script to be imported simulated environment;
It runs test cell 752 and obtains pre- deployment for carrying out operation test to database script in simulated environment Dispose result.
Specific about script deployment device limits the restriction that may refer to above for script dispositions method, herein not It repeats again.Modules in above-mentioned script deployment device can be realized fully or partially through software, hardware and combinations thereof.On Stating each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also store in a software form In memory in computer equipment, the corresponding operation of the above modules is executed in order to which processor calls.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in Figure 8.The computer equipment include by system bus connect processor, memory, network interface and Database.Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory packet of the computer equipment Include non-volatile memory medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and data Library.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The network interface of machine equipment is used to communicate with external terminal by network connection.When the computer program is executed by processor with Realize a kind of script dispositions method.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor realize above-described embodiment script deployment side when executing computer program Step in method, such as step S1 shown in Fig. 2 to step S8, alternatively, processor realizes above-mentioned reality when executing computer program Apply the function of each module/unit of the deployment device of script in example, such as module 71 shown in Fig. 7 is to the function of module 78.To avoid It repeats, which is not described herein again.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program realizes the step in above-described embodiment script dispositions method when being executed by processor, such as step S1 shown in Fig. 2 is extremely Step S8, alternatively, processor realizes each module/unit of script deployment device in above-described embodiment when executing computer program Function, such as module 71 shown in Fig. 7 is to the function of module 78.To avoid repeating, which is not described herein again.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of script dispositions method, which is characterized in that the script dispositions method includes:
Receive the identification information of the object to be disposed and target application environment under original application environment;
The configuration information of the target application environment is obtained according to the identification information, and using the configuration information to simulated environment It is configured;
For each object to be disposed, preset conversion script creation database foot corresponding with object to be disposed is somebody's turn to do is used This;
Legitimacy verifies are carried out to the database script, obtain check results;
If the check results are that verification passes through, disposed in advance in the simulated environment using the database script;
If the deployment result of the pre- deployment is successfully, the database script of pre- deployment success to be labeled as target script;
If the deployment result of the pre- deployment is failure, failure information is obtained, according to the corresponding default modification of the failure information Mode is adjusted the content of the database script of pre- deployment failure, and by database script adjusted labeled as described Target script;
The target script is deployed in the target application environment.
2. script dispositions method as described in claim 1, which is characterized in that it is described for each object to be disposed, make Include: with preset conversion script creation database script corresponding with object to be disposed is somebody's turn to do
Obtain the object structure of each object to be disposed;
According to each object structure, the corresponding SQL statement of the object structure is generated using preset conversion script;
The corresponding SQL statement of each object structure is integrated into the corresponding database script of the object to be disposed.
3. script dispositions method as described in claim 1, which is characterized in that the legitimacy verifies include filename verification and Service attribute verification.
4. script dispositions method as claimed in claim 3, which is characterized in that when the legitimacy verifies are the file elite school When testing, described to carry out legitimacy verifies to the database script, obtaining check results includes:
According to preset naming method, the filename of the database script is verified;
If the filename of the database script does not meet the requirement of the preset naming method, the database script is exported Filename and error message so that user modifies to file name according to the error message;
Modified filename is received and verifies, if the modified filename meets the requirement of the preset naming method, Then verification passes through.
5. script dispositions method as claimed in claim 3, which is characterized in that when the legitimacy verifies are the service attribute When verification, described to carry out legitimacy verifies to the database script, obtaining check results includes:
Detect whether the database script meets preset service attribute;
If the content of the database script does not meet the preset service attribute, according to the preset service attribute pair The content of the database script is updated;
Updated database script is verified, if the updated database script meets the preset business category Property, then verification passes through.
6. such as script dispositions method described in any one of claim 1 to 5, which is characterized in that described to use the database foot This carries out pre- deployment in simulated environment
The database script is imported into simulated environment;
Operation test is carried out to the database script in the simulated environment, obtains the deployment result of the pre- deployment.
7. a kind of script disposes device, which is characterized in that the script disposes device and includes:
Information receiving module, for receiving the identification information of the object to be disposed under original application environment and target application environment;
Parameter configuration module, for obtaining the configuration information of the target application environment according to the identification information, and using should Configuration information configures simulated environment;Database script creation module, for using for each object to be disposed Preset conversion script creates database script corresponding with object to be disposed is somebody's turn to do;
Database script correction verification module obtains check results for carrying out legitimacy verifies to the database script;
Pre- deployment module, if being that verification passes through for the check results, using the database script in the analog loop It is disposed in advance in border;
First mark module, if the deployment result for the pre- deployment is successfully, by the database script of pre- deployment success Labeled as target script;
Second mark module obtains failure information, unsuccessfully believes according to this if the deployment result for the pre- deployment is failure Corresponding default modification mode is ceased, the content of the database script of pre- deployment failure is adjusted, and by data adjusted Library script markup is the target script;
Target script deployment module, for the target script to be deployed in the target application environment.
8. script as claimed in claim 7 disposes device, which is characterized in that the database script creation module includes:
Object structure acquiring unit, for obtaining the object structure of each object to be disposed;
Script sentence generation unit, for generating the object knot using preset conversion script according to each object structure The corresponding SQL statement of structure;
Database script creating unit, it is described wait dispose pair for the corresponding SQL statement of each object structure to be integrated into As corresponding database script.
9. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to The step of any one of 6 script dispositions method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In the step of realization script dispositions method as described in any one of claim 1 to 6 when the computer program is executed by processor Suddenly.
CN201810573712.0A 2018-06-06 2018-06-06 Script deployment method and device, computer equipment and storage medium Active CN109032611B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810573712.0A CN109032611B (en) 2018-06-06 2018-06-06 Script deployment method and device, computer equipment and storage medium
PCT/CN2018/092591 WO2019232828A1 (en) 2018-06-06 2018-06-25 Script deployment method and apparatus, and computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810573712.0A CN109032611B (en) 2018-06-06 2018-06-06 Script deployment method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109032611A true CN109032611A (en) 2018-12-18
CN109032611B CN109032611B (en) 2022-01-28

Family

ID=64612351

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810573712.0A Active CN109032611B (en) 2018-06-06 2018-06-06 Script deployment method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109032611B (en)
WO (1) WO2019232828A1 (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109977099A (en) * 2019-03-16 2019-07-05 平安城市建设科技(深圳)有限公司 Database portion arranging method, user equipment, storage medium and device
CN110047472A (en) * 2019-03-15 2019-07-23 平安科技(深圳)有限公司 Batch conversion method, apparatus, computer equipment and the storage medium of voice messaging
CN110231935A (en) * 2019-06-12 2019-09-13 上海达梦数据库有限公司 A kind of method, apparatus, equipment and the storage medium of script execution and update
CN110673859A (en) * 2019-08-30 2020-01-10 北京浪潮数据技术有限公司 Graphic database deployment method, device, equipment and readable storage medium
CN110750444A (en) * 2019-09-10 2020-02-04 中国平安财产保险股份有限公司 Application program handover method, application program handover device, computer device and storage medium
CN110908978A (en) * 2019-11-06 2020-03-24 中盈优创资讯科技有限公司 Database data structure verification method and device
CN111722853A (en) * 2020-06-12 2020-09-29 苏州浪潮智能科技有限公司 Method and equipment for deploying installation script
CN112163131A (en) * 2020-11-10 2021-01-01 平安普惠企业管理有限公司 Configuration method and device of business data query platform, computer equipment and medium
CN112416361A (en) * 2020-12-03 2021-02-26 平安普惠企业管理有限公司 Structured query language script examination method and related equipment
CN113190240A (en) * 2021-05-27 2021-07-30 深圳平安智汇企业信息管理有限公司 Version release method and device based on multi-environment deployment and computer equipment
CN114371853A (en) * 2022-01-10 2022-04-19 柏科数据技术(深圳)股份有限公司 Distributed system deployment method, device, terminal equipment and storage medium
WO2022095633A1 (en) * 2020-11-05 2022-05-12 浪潮电子信息产业股份有限公司 Application migration method and apparatus, device and medium

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045695A (en) * 2019-12-15 2020-04-21 北京浪潮数据技术有限公司 WebLogic middleware deployment device, method, equipment and medium
CN111258591B (en) * 2020-01-14 2023-07-25 广州极晟网络技术有限公司 Program deployment task execution method, device, computer equipment and storage medium
CN111309343B (en) * 2020-02-20 2023-02-21 中国建设银行股份有限公司 Development deployment method and device
CN111352843B (en) * 2020-02-29 2022-11-25 苏州浪潮智能科技有限公司 Method and system for realizing test script verification
CN111459911B (en) * 2020-03-30 2022-12-13 上海云砺信息科技有限公司 Service data processing method and device
CN113934146A (en) * 2020-06-29 2022-01-14 阿里巴巴集团控股有限公司 Method and device for controlling Internet of things equipment and electronic equipment
CN112000349B (en) * 2020-07-28 2024-02-09 山东浪潮易云在线科技有限公司 Data upgrading method, device and medium based on SaaS
CN112688804B (en) * 2020-12-18 2023-09-19 中国平安财产保险股份有限公司 Service platform deployment method, device, equipment and storage medium
CN112597131A (en) * 2020-12-25 2021-04-02 广州趣丸网络科技有限公司 Distributed script control method and related device
CN113204566B (en) * 2021-06-09 2024-01-26 中国银行股份有限公司 Execution method and device of SQL script
CN113535568B (en) * 2021-07-22 2023-09-05 工银科技有限公司 Verification method, device, equipment and medium for application deployment version
CN113568623A (en) * 2021-07-23 2021-10-29 上海淇玥信息技术有限公司 Application deployment method and device and electronic equipment
CN114531477B (en) * 2022-04-22 2022-08-30 深圳丰尚智慧农牧科技有限公司 Method and device for configuring functional components, computer equipment and storage medium
CN115658978B (en) * 2022-11-14 2023-04-07 杭州欧若数网科技有限公司 Graph database system multi-source data importing method and device
CN116893977B (en) * 2023-09-08 2024-01-16 中国空气动力研究与发展中心计算空气动力研究所 Automatic deployment method, device, equipment and medium for distributed simulation test environment
CN117369866A (en) * 2023-09-22 2024-01-09 中科驭数(北京)科技有限公司 Parameter verification method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117431A (en) * 2015-08-07 2015-12-02 北京思特奇信息技术股份有限公司 Dynamic configuration method and system for external imported data
CN105868204A (en) * 2015-01-21 2016-08-17 中国移动(深圳)有限公司 Method and apparatus for converting script language SQL of Oracle
CN107092557A (en) * 2017-03-24 2017-08-25 广东网金控股股份有限公司 A kind of database schema upgrade script verification method and device
CN107203400A (en) * 2017-06-21 2017-09-26 郑州云海信息技术有限公司 A kind of method and device of remote deployment component
US9971595B1 (en) * 2016-01-15 2018-05-15 Jpmorgan Chase Bank, N.A. Techniques for automated database deployment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9430505B2 (en) * 2011-04-18 2016-08-30 Infosys Limited Automated data warehouse migration
US9588749B2 (en) * 2014-10-14 2017-03-07 Microsoft Technology Licensing, Llc Configuration transform for application deployment
CN105577475B (en) * 2015-12-28 2019-07-05 上海瀚之友信息技术服务有限公司 Automated performance testing system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105868204A (en) * 2015-01-21 2016-08-17 中国移动(深圳)有限公司 Method and apparatus for converting script language SQL of Oracle
CN105117431A (en) * 2015-08-07 2015-12-02 北京思特奇信息技术股份有限公司 Dynamic configuration method and system for external imported data
US9971595B1 (en) * 2016-01-15 2018-05-15 Jpmorgan Chase Bank, N.A. Techniques for automated database deployment
CN107092557A (en) * 2017-03-24 2017-08-25 广东网金控股股份有限公司 A kind of database schema upgrade script verification method and device
CN107203400A (en) * 2017-06-21 2017-09-26 郑州云海信息技术有限公司 A kind of method and device of remote deployment component

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110047472A (en) * 2019-03-15 2019-07-23 平安科技(深圳)有限公司 Batch conversion method, apparatus, computer equipment and the storage medium of voice messaging
CN109977099A (en) * 2019-03-16 2019-07-05 平安城市建设科技(深圳)有限公司 Database portion arranging method, user equipment, storage medium and device
CN110231935A (en) * 2019-06-12 2019-09-13 上海达梦数据库有限公司 A kind of method, apparatus, equipment and the storage medium of script execution and update
CN110673859B (en) * 2019-08-30 2022-06-17 北京浪潮数据技术有限公司 Graphic database deployment method, device, equipment and readable storage medium
CN110673859A (en) * 2019-08-30 2020-01-10 北京浪潮数据技术有限公司 Graphic database deployment method, device, equipment and readable storage medium
CN110750444A (en) * 2019-09-10 2020-02-04 中国平安财产保险股份有限公司 Application program handover method, application program handover device, computer device and storage medium
CN110908978A (en) * 2019-11-06 2020-03-24 中盈优创资讯科技有限公司 Database data structure verification method and device
CN110908978B (en) * 2019-11-06 2022-09-13 中盈优创资讯科技有限公司 Database data structure verification method and device
CN111722853A (en) * 2020-06-12 2020-09-29 苏州浪潮智能科技有限公司 Method and equipment for deploying installation script
WO2022095633A1 (en) * 2020-11-05 2022-05-12 浪潮电子信息产业股份有限公司 Application migration method and apparatus, device and medium
CN112163131A (en) * 2020-11-10 2021-01-01 平安普惠企业管理有限公司 Configuration method and device of business data query platform, computer equipment and medium
CN112416361A (en) * 2020-12-03 2021-02-26 平安普惠企业管理有限公司 Structured query language script examination method and related equipment
CN113190240A (en) * 2021-05-27 2021-07-30 深圳平安智汇企业信息管理有限公司 Version release method and device based on multi-environment deployment and computer equipment
CN114371853A (en) * 2022-01-10 2022-04-19 柏科数据技术(深圳)股份有限公司 Distributed system deployment method, device, terminal equipment and storage medium
CN114371853B (en) * 2022-01-10 2022-09-20 柏科数据技术(深圳)股份有限公司 Distributed system deployment method, device, terminal equipment and storage medium

Also Published As

Publication number Publication date
WO2019232828A1 (en) 2019-12-12
CN109032611B (en) 2022-01-28

Similar Documents

Publication Publication Date Title
CN109032611A (en) Script dispositions method, device, computer equipment and storage medium
CN112286779B (en) Test task processing method and device, storage medium and computer equipment
CN108874644A (en) Data monitoring method, device, computer equipment and storage medium
CN109308285A (en) Database script management method, device, computer equipment and storage medium
CN106415480B (en) High-speed application for installation on a mobile device for enabling remote configuration of the mobile device
US20210248487A1 (en) Framework management method and apparatus
CN110941546A (en) Automatic test method, device, equipment and storage medium for WEB page case
CN109032824A (en) Database method of calibration, device, computer equipment and storage medium
CN109101415A (en) Interface test method, system, equipment and the storage medium compared based on database
US10489274B2 (en) Using emulation to disassociate verification from stimulus in functional test
CN109408357A (en) A kind of automatic interface testing method and device
CN104360920A (en) Automatic testing method and device for interface
CA3131079A1 (en) Test case generation method and device, computer equipment and storage medium
CN108920139B (en) Program generation method, device and system, electronic equipment and storage medium
US20210089436A1 (en) Automated web testing framework for generating and maintaining test scripts
CN109032631A (en) Application program service packs acquisition methods, device, computer equipment and storage medium
CN110347590A (en) The interface testing control method and device of operation system
CN107608902A (en) Routine interface method of testing and device
CN109284125A (en) Dependence packet configuration method, device, equipment and medium in big data platform
CN108563951A (en) Method for detecting virus and device
CN110764998A (en) Data comparison method, device and equipment based on Django framework and storage medium
CN112615759A (en) Full link voltage measurement assembly, full link voltage measurement method and device
US20090055331A1 (en) Method and apparatus for model-based testing of a graphical user interface
CN110727575A (en) Information processing method, system, device and storage medium
CN111914537A (en) Data verification method, device and equipment and readable storage medium

Legal Events

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