CN109213748A - A kind of update method, server and the medium of database script file - Google Patents

A kind of update method, server and the medium of database script file Download PDF

Info

Publication number
CN109213748A
CN109213748A CN201810915165.XA CN201810915165A CN109213748A CN 109213748 A CN109213748 A CN 109213748A CN 201810915165 A CN201810915165 A CN 201810915165A CN 109213748 A CN109213748 A CN 109213748A
Authority
CN
China
Prior art keywords
database
script
file
script file
target
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
CN201810915165.XA
Other languages
Chinese (zh)
Other versions
CN109213748B (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 Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN201810915165.XA priority Critical patent/CN109213748B/en
Publication of CN109213748A publication Critical patent/CN109213748A/en
Application granted granted Critical
Publication of CN109213748B publication Critical patent/CN109213748B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention is suitable for field of computer technology, provides update method, server and the medium of a kind of database script file, comprising: receives file more new command;Obtain the database script in target database script file;Unique identification based on the target database script file that file more new command carries, the determining first object database to match with target database script file from the database disposed;The database object and preset database script generation strategy for including based on first object database generate first database script file corresponding with first object database;Data analysis is carried out to the database script in database script file, if the database script in target database script file is identical with the database script in first database script file, then target database script file is stored into script bank, ensure that the target database script file finally stored in script bank and the corresponding database disposed are corresponding.

Description

A kind of update method, server and the medium of database script file
Technical field
The invention belongs to field of computer technology more particularly to a kind of update methods of database script file, server And computer readable storage medium.
Background technique
Database is essential a part in system building, and database script is the language for creating database object The set of sentence.In general, needing first when being updated to the database created to for creating the wide area information server foot Originally it is updated.After being updated database script, need to hand over to the database script of new version in test environment Carry out the test of creation database, after test passes through, could according to the database script of new version to the database created into Row updates.Meanwhile after database script updates every time and passes through test, database script synchronization means all can be by latest edition Database script be synchronized in script bank, for replacing the database script of legacy version.
Often there is delay in existing database script synchronization mechanism, the database script that will lead to new version in this way is first It is synchronized to script bank in the database script of legacy version, in this way, the database script of new version will be synchronized to script bank by after In legacy version database script covering, lead to the database script finally stored in script bank and the number based on latest edition It is not corresponded to according to the database that library script creates.
Summary of the invention
In view of this, the embodiment of the invention provides update method, server and the calculating of a kind of database script file There is delay to solve existing database script synchronization mechanism in machine readable storage medium storing program for executing, cause finally to store in script bank The database script problem not corresponding with the database of the database script creation based on latest edition.
The first aspect of the embodiment of the present invention provides a kind of update method of database script file, comprising:
Receive the file more new command for being updated to the database script file in script bank;The file updates Instruction carries the unique identification of the target database script file in the script bank;
Obtain the database script in the target database script file;
Based on the unique identification of the target database script file, determined from each database disposed with it is described The first object database that target database script file matches;
The database object and preset database script generation strategy for including based on the first object database generate First database script file corresponding with the first object database;
If the number in database script and the first database script file in the target database script file It is identical according to library script, then the target database script file is stored into the script bank.
The second aspect of the embodiment of the present invention provides a kind of server, including memory, processor and is stored in institute The computer program that can be run in memory and on the processor is stated, the processor executes real when the computer program Existing following steps:
Receive the file more new command for being updated to the database script file in script bank;The file updates Instruction carries the unique identification of the target database script file in the script bank;
Obtain the database script in the target database script file;
Based on the unique identification of the target database script file, determined from each database disposed with it is described The first object database that target database script file matches;
The database object and preset database script generation strategy for including based on the first object database generate First database script file corresponding with the first object database;
If the number in database script and the first database script file in the target database script file It is identical according to library script, then the target database script file is stored into the script bank.
The third aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the computer program realizes following steps when being executed by processor:
Receive the file more new command for being updated to the database script file in script bank;The file updates Instruction carries the unique identification of the target database script file in the script bank;
Obtain the database script in the target database script file;
Based on the unique identification of the target database script file, determined from each database disposed with it is described The first object database that target database script file matches;
The database object and preset database script generation strategy for including based on the first object database generate First database script file corresponding with the first object database;
If the number in database script and the first database script file in the target database script file It is identical according to library script, then the target database script file is stored into the script bank.
Implement the update method of database script file provided in an embodiment of the present invention a kind of, server and computer-readable Storage medium has the advantages that
The embodiment of the present invention is receiving the file update for being updated to the database script file in script bank When instruction, determination matches with the target database script file to be updated into script bank from each database disposed First object database, converted first object database to based on preset database script generation strategy corresponding First database script file carries out data analysis to the database script in database script file, when target database foot When database script in this document is identical with the database script in first database script file, illustrate target data Library script file is corresponding with the first object database disposed, at this point, storing target database script file to foot In this library, to ensure that the target database script file finally stored in script bank and the corresponding database phase disposed It is corresponding.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation flow chart of the update method for database script file that first embodiment of the invention provides;
Fig. 2 is a kind of implementation flow chart of the update method for database script file that second embodiment of the invention provides;
Fig. 3 is the specific reality of S16 in a kind of update method for database script file that third embodiment of the invention provides Existing flow chart;
Fig. 4 is a kind of implementation flow chart of the update method for database script file that fourth embodiment of the invention provides;
Fig. 5 is a kind of implementation flow chart of the update method for database script file that fifth embodiment of the invention provides;
Fig. 6 is a kind of structural block diagram of server provided in an embodiment of the present invention;
Fig. 7 be another embodiment of the present invention provides a kind of server structural block diagram.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Referring to Fig. 1, Fig. 1 is a kind of reality of the update method for database script file that first embodiment of the invention provides Existing flow chart.In the present embodiment, the executing subject of the update method of database script file is server.Number as shown in Figure 1 According to library script file update method the following steps are included:
S11: the file more new command for being updated to the database script file in script bank is received;The file More new command carries the unique identification of the target database script file in the script bank.
In the embodiment of the present invention, script bank library script file for storing data.Database script file is for storing number According to library script, i.e., the content in database script file is database script.Database script is for creating database pair The set of the sentence of elephant, i.e. server generate corresponding database after executing database script.Wherein, database object includes But it is not limited to: database, tables of data, index, view, trigger, function etc..Therefore, database script generally includes but unlimited In the sentence for establishing database, tables of data, storing process, trigger, and for data query and custom function Sentence.It should be noted that in practical applications, database script file is the file of text formatting.Different types of data The format of the corresponding database script file in library is different, for example, for SQL Server database, database script file is File expands the text file of entitled " sql ".
In practical application, before disposing database to each database environment, need to the number for creating database The test of creation database is carried out according to library script, after only test passes through, just can dispose database based on database script, together When, the database script file for being used to store the database script that test passes through can be stored and be put on record into script bank.Number It is correct based on the database that the database script is created and can operates normally by i.e. expression according to the test of library script.It needs It is noted that being stored in script bank multiple for the database script file of disparate databases to be respectively created.For creating The database script file of disparate databases has different unique identifications, the number of the different editions for creating same database It, can for creating the database script file of different editions of same database according to library script file unique identification having the same To be distinguished by version information.In practical application, the unique identification of database script file be can be based on the database The title for the database that database script in script file is created.For example, if based in a certain database script file Entitled " the product information library " for the database that database script is created, then the unique identification of the database script file can be with It is " product information library ", it can be named based on " product information library " to database script file.
Database script test in a certain database script file passes through, and based on the number in the database file After creating according to library script or have updated associated databases, need to store the database script file into script bank.Work as needs When a certain database script file is stored into script bank, developer can be triggered for the database foot in script bank The file that this document is updated more new command.Wherein, file more new command carries the target data to be updated into script bank The unique identification of library script file.If server detects user's triggering for carrying out to the database script file in script bank The file of update more new command then extracts the target database script text to be updated into script bank from this document more new command The unique identification of part.
Specifically, if server detects that user adds new file into script bank or detects user to certain in script bank The content of database script file is updated, then is identified as detecting for carrying out the database script file in script bank The file of update more new command.Wherein, it includes but is not limited to following that server, which detects that user adds new file into script bank, Situation: detect that user triggers file in script bank and pastes instruction;Or it detects that user triggers and pulls file into script bank Operation.
Server extracts the unique of the target database script file to be updated into script bank from file more new command Mark includes but is not limited to following several situations:
If server detects that user triggers file in script bank and pastes instruction, file is pasted into the text that instruction is directed to The title of part is determined as the unique identification of the target database script file to be updated into script bank.
If server detects that user triggers the file drag operation for pulling file into script bank, file is pulled and is grasped The title for making the file being directed to is determined as the unique identification of the target database script file to be updated into script bank.
If server detects that user is updated operation to the content of certain database script file in script bank, will more The unique identification for newly operating the database script file being directed to is determined as the unique identification of target database script file.
S12: the database script in the target database script file is obtained.
In the present embodiment, server receives the file for being updated to the database script file in script bank more After new command, database script is obtained from the target database script file to be updated to script bank.
Specifically, server obtain target database script file in database script can include but is not limited to it is following Several situations:
If server detect user triggered in script bank file paste instruction, by file paste instruction be directed to It pastes file and is determined as target database script file, and obtain the content of file to be pasted, the file to be pasted that will acquire Content be determined as the database script in target database script file.
If server detects that user triggers the file drag operation for pulling file into script bank, file is pulled and is grasped The file (i.e. dragged file) for making to be directed to is determined as target database script file, and obtains the content of dragged file, will The content of the dragged file got is determined as the database script in target database script file.
If server detects that user is updated operation to the content of certain database script file in script bank, should It updates the database script file that operation is directed to and is determined as target database script file, and obtain and update the data that operation is directed to The updated content of library script file, the updated content of database script file that the update operation that will acquire is directed to determine For the database script in target database script file.
S13: the unique identification based on the target database script file, from each database disposed determine with The first object database that the target database script file matches.
In the embodiment of the present invention, server gets the target data to be updated into script bank from file more new command After the unique identification of library script file, based on the unique identification of target database script file, from each database disposed The first object database that middle determination and target database script file match.
In practical application, it will usually be deployed in same database in multiple and different database environments.Wherein, different Database environment can be distinguished by carrying the server of database environment.For carrying the server of different data lab environment With different addresses Internet protocol (Internet Protocol, IP).The each database disposed has unique mark Know, the unique identification of disparate databases is different.The unique identification of database can be the title of database.It should be noted that The unique identification of database and the unique identification for creating the database script file where the wide area information server script Between have incidence relation.For example, in practical application, the unique identification of database with for creating the wide area information server foot The unique identification of database script file where this can identical or database unique identification with for creating the data The unique identification of database script file where the database script in library may include identical character string.
Server unique identification based on target database script file and can be deployed in each database environment The unique identification of each database, determining the to match with target database script file from all databases disposed One target database.Specifically, server can by the unique identification of target database script file respectively be deployed in it is each The unique identification of each database in database environment compares, if the unique identification of certain database and target database foot The unique identification of this document is identical or the unique identification of certain database and the unique identification of target database script file include phase Same character string, then be determined as the first object database to match with target database script file for the database.
S14: the database object and preset database script generation strategy for including based on the first object database, Generate first database script file corresponding with the first object database.
In the embodiment of the present invention, server has determined the first object database to match with target database script file Afterwards, first object wide area information server object is obtained, and the database object that includes based on first object database and default Database script generation strategy, generate corresponding with first object database first database script file.Wherein, database It is corresponding database script that script generation strategy, which is used for the database object for including based on database for database reverse transformation,.
In practical application, preset database script generation strategy can be according to first object wide area information server type It determines.For example, preset database script generation strategy can be by if first object database is SQL Server database The transfer class that SQL Server database provides is constituted.
After server generates first database script file corresponding with first object database, first database foot is obtained Database script in this document.It will be in the database script and target database script file in first database script file Database script compare.If in the database script and first database script file in target database script file Database script it is identical, then execute S15.
S15: if in database script in the target database script file and the first database script file Database script it is identical, then the target database script file is stored into the script bank.
In the embodiment of the present invention, if server detects database script and the first number in target database script file It is identical according to the database script in the script file of library, then illustrate the target database script file to be updated into script bank For the database script file for the corresponding latest edition of first object database disposed, at this point, server is by target data Library script file is stored into script bank.
It includes but is not limited to following several situations that server, which stores target database script file into script bank:
If file more new command is triggered and triggering file in script bank and pasting instruction by user, server File is pasted the file to be pasted that instruction is directed to affix in script bank.
If file more new command is to be triggered from user by triggering the file drag operation of the dragging file into script bank , then server control script bank, which receives, is drawn to its internal file.
If file more new command is to be updated behaviour by the content to certain database script file in script bank by user Make and trigger, then server will update updated content in the database script file that is directed to of operation and save.
Above as can be seen that a kind of update method of database script file provided in this embodiment receive for pair When the file more new command that the database script file in script bank is updated, from each database disposed determine with The first object database that target database script file to be updated into script bank matches is based on preset database foot This generation strategy converts first object database to corresponding first database script file, to database script file In database script carry out data analysis, when in target database script file database script and first database script When database script in file is identical, illustrate that target database script file is with the first object database disposed It is corresponding, at this point, target database script file is stored into script bank, to ensure that the mesh finally stored in script bank It marks database script file and the corresponding database disposed is corresponding.
Referring to Fig. 2, Fig. 2 is a kind of reality of the update method for database script file that second embodiment of the invention provides Existing flow chart.Relative to the corresponding embodiment of Fig. 1, a kind of update method of database script file provided in this embodiment exists Further include S16, details are as follows after S14:
S16: if in database script in the target database script file and the first database script file Database script it is identical, then the target database script file is stored into the script bank.
In the present embodiment, if server detects database script and first database in target database script file Database script in script file is not exactly the same, then illustrates the target database script file to be updated into script bank not It is the database script file of the corresponding latest edition of first object database, at this point, in order to avoid to be updated into script bank Target database script file the database script file of the corresponding latest edition of first object database is covered, and then lead Causing the database script file corresponding with first object database finally stored in script bank is not first object database pair The database script file for the latest edition answered, server are not responding to for carrying out more to the database script file in script bank New file more new command.I.e. server will not store target database script file into script bank.
Above as can be seen that a kind of update method of database script file provided in this embodiment is detecting number of targets When not exactly the same according to the database script in the database script and first database script file in the script file of library, do not ring Applied to the file more new command being updated to the database script file in script bank, so as to avoid being stored in script bank The corresponding latest edition of first object database database script file by the target database to be updated into script bank Script file covering ensure that the database script file corresponding with first object database finally stored in script bank is the The database script file of the corresponding latest edition of one target database.
Referring to Fig. 3, Fig. 3 is in a kind of update method for database script file that third embodiment of the invention provides The specific implementation flow chart of S16.
As an embodiment of the present invention, when the database script and first database script in target database script file When database script in file is not exactly the same, there are still the following situations: target database script file is first object number According to the database script file of the corresponding latest edition in library, but based on the database script wound in target database script file Occur mistake during building database, or first database foot is being generated based on preset database script generation strategy Occur mistake during this document, leads to database script and target in the first database script file ultimately generated Database script in database script file is not identical.At this point, in order to determine whether to have occurred above situation, server can be with Obtain the database to match with target database script file respectively from different database environments, and will be from disparate databases The corresponding database script file of each database that matches with target database script file got in environment carries out Comparison, so further determine that target database script file whether be the corresponding latest edition of first object database data Library script file.
Therefore, in the present embodiment, S13 can specifically include following steps:
Based on the unique identification of the target database script file, from each number being deployed in first database environment According to the first object database to match with the target database script file determining in library.
In the present embodiment, server gets the target database foot to be updated into script bank from file more new command After the unique identification of this document, based on the unique identification of target database script file, from being deployed in first database environment Each database in the determining first object database to match with target database script file.Wherein, first database Environment is any data lab environment for disposing in multiple database environments of database built in advance, and first database The database to match with target database script file is deployed in environment.
Specifically, server can be based on the unique identification of target database script file, detection is built each in advance Whether the database that with target database script file matches is deployed in database environment, if detecting at least two data The database to match with target database script file is deployed in lab environment, then from least two database environment with Machine selects a database environment as first database environment, obtains and target database foot from the first database environment The first object database that this document matches.
In the present embodiment, S16 can realize that details are as follows by S161~S163 as shown in Figure 3:
S161: if in database script in the target database script file and the first database script file Database script it is not exactly the same, then it is determining with the target from each database being deployed in the second database environment The second target database that database script file matches.
In the present embodiment, if server detects database script and first database in target database script file Database script in script file is not exactly the same, then server is from each database being deployed in the second database environment The second target database that middle determination and target database script file match.
Wherein, the second database environment is any in the multiple database environments for disposing database built in advance Database environment deploys the database to match with target database script file, and the second number in the second database environment It is different from first database environment according to lab environment.
If being deployed at least two database environments and target database script file phase specifically, server detects Matched database then removes selected first database environment from least two database environment, from removing first A database environment is randomly choosed in remainder data lab environment after database environment as the second database environment, from this The second target database to match with target database script file is obtained in second database environment.
S162: the database object for including based on second target database and preset database script generate plan Slightly, the second database script file corresponding with second target database is generated.
In the present embodiment, server is got from the second database environment to match with target database script file The database object for including based on the second target database after second target database and preset database script generate plan Slightly, the second database script file corresponding with the second target database is generated.Wherein, database script generation strategy is used for base In the database object that database includes by database reverse transformation be corresponding database script.It is preset in practical application Database script generation strategy can be determined according to the type of database of the second target database.For example, if the second target data Library is SQL Server database, then preset database script generation strategy can be provided by SQL Server database Transfer class is constituted.
After server generates the second database script file corresponding with the second target database, the second database foot is obtained Database script in this document.It will be in the database script and first database script file in the second database script file Database script compare.If in the database script and first database script file in the second database script file Database script it is identical, then execute S163.
S163: if in database script in the second database script file and the first database script file Database script it is identical, then be not responding to the file more new command.
In the present embodiment, if server detects database script and first database in the second database script file Database script in script file is identical, then further determines that the target database script text to be updated into script bank Part is not the database script file of the corresponding latest edition of first object database, at this point, server is not responding to for foot The file more new command that database script file in this library is updated.I.e. server will not be by target database script file It stores into script bank.
Above as can be seen that a kind of update method of database script file provided in this embodiment, is detecting target Database script in database script file in the first database script file being deployed in first database environment It whether is first object database pair in order to further determine target database script file when database script is not exactly the same The database script file for the latest edition answered, server obtain and target database script file from the second database environment The second target database to match, and the second database script file corresponding with the second target database is generated, if second Database script in database script file is identical with the database script in first database script file, it is determined that Target database script file is not the database script file of the corresponding latest edition of first object database, at this point, service Device is not responding to file more new command, thus further ensure the target database script file that is finally stored in script bank with The corresponding database of deployment is corresponding, improves the accuracy updated to database script file in script bank.
Referring to Fig. 4, Fig. 4 is a kind of reality of the update method for database script file that fourth embodiment of the invention provides Existing flow chart.Relative to the corresponding embodiment of Fig. 3, a kind of update method of database script file provided in this embodiment exists Further include S164~S165, details are as follows after S162:
S164: if in database script in the second database script file and the first database script file Database script it is not exactly the same, then by the second database script file database script and the target data Database foot in the script file of library compares.
In the present embodiment, in the database script and first database script file in target database script file Database script is not exactly the same, and in the database script in the second database script file and first database script file Database script it is also not exactly the same in the case where, server is by the database script and mesh in the second database script file Database script in mark database script file compares.Specifically, if server detects the second database script text Database script in part is identical with the database script in target database script file, then executes S165.
S165: if in database script in the second database script file and the target database script file Database script it is identical, then the target database script file is stored into the script bank.
In the present embodiment, if server detects database script and target database in the second database script file Database script in script file is identical, then illustrates the first mesh to match in creation with target database script file There is mistake during mark database, or in the process that first object database is converted to first database script file In there is mistake, and target database script file is the database script file of the corresponding latest edition of associated databases, At this point, server stores target database script file into script bank.
Above as can be seen that a kind of update method of database script file provided in this embodiment, is detecting second Database script the first number corresponding with first object database in the corresponding second database script file of target database When not exactly the same according to the database script in the script file of library, further by the database foot in the second database script file This is compared with the database script in target database script file, if the database foot in the second database script file This is identical with the database script in target database script file, then illustrates that target database script file is respective counts According to the database script file of the corresponding latest edition in library, at this point, server stores target database script file to script In library, to ensure that the target database script file finally stored in script bank is opposite with the corresponding database disposed It answers.
Referring to Fig. 5, Fig. 5 is a kind of reality of the update method for database script file that fifth embodiment of the invention provides Existing flow chart.Relative to the corresponding embodiment of Fig. 1 to Fig. 4, a kind of update side of database script file provided in this embodiment It is described that the target database script file is stored into the step into the script bank in method, S51~S52 reality can be passed through Existing, details are as follows:
S51: if identical as the unique identification of the target database script file comprising unique identification in the script bank Database script file, then with target database script file replacement unique identification and target database script text The identical database script file of the unique identification of part.
S52: if not including the unique identification phase of unique identification and the target database script file in the script bank Same database script file, then store the target database script file into the script bank.
Since the unique identification of the database script file of the corresponding different editions of same database is all the same, and script bank In the only corresponding latest edition in storing data library database script file, therefore, in the present embodiment, server is to script bank When middle storage target database script file, whether first detect in script bank comprising unique identification and target database script file The identical database script file of unique identification.
If server detects identical as the unique identification of target database script file comprising unique identification in script bank Database script file, then server target database script file replacement script bank in include unique identification and target The identical database script file of the unique identification of database script file.
If server, which detects, does not include data identical with the unique identification of target database script file in script bank Library script file, then target database script file is directly stored in script bank by server.
So that as can be seen that a kind of update method of database script file provided in this embodiment, when detecting script In library when database script file identical with the unique identification of target database script file comprising unique identification, number of targets is used According to the unique identification number identical with the unique identification of target database script file for including in library script file replacement script bank According to library script file, to save the memory space of script bank.
Fig. 6 show be a kind of server provided in an embodiment of the present invention structural block diagram, each unit which includes uses Each step in the corresponding embodiment of execution Fig. 1 to Fig. 5.Referring specifically to reality corresponding to Fig. 1 to Fig. 5 and Fig. 1 to Fig. 5 Apply the associated description in example.For ease of description, only the parts related to this embodiment are shown.Referring to Fig. 6, server 600 It include: instruction receiving unit 61, first acquisition unit 62, the first determination unit 63, the first generation unit 64 and synchronization unit 65. Wherein:
Instruction receiving unit 61 is used to receive the file for being updated to the database script file in script bank more New command;The file more new command carries unique mark of the target database script file in the script bank Know.
First acquisition unit 62 is used to obtain the database script in the target database script file.
First determination unit 63 is used for the unique identification based on the target database script file, each from what is disposed The determining first object database to match with the target database script file in database.
First generation unit 64 is used for the database object for including based on the first object database and preset data Library script generation strategy generates first database script file corresponding with the first object database.
If synchronization unit 65 is used for database script and the first database in the target database script file Database script in script file is identical, then stores the target database script file into the script bank.
As an embodiment of the present invention, server 600 further includes the first instruction process unit.
If the first instruction process unit is for the database script and described first in the target database script file Database script in database script file is not exactly the same, then is not responding to the file more new command.
As an embodiment of the present invention, the first determination unit 63 is specifically used for based on the target database script file Unique identification determines and the target database script file phase from each database being deployed in first database environment Matched first object database.
First instruction process unit specifically includes the second determination unit, the second generation unit and the second instruction process unit. Wherein:
If the second determination unit is used for database script and first data in the target database script file Database script in the script file of library is not exactly the same, then from each database being deployed in the second database environment really Fixed the second target database to match with the target database script file.
Second generation unit is used for the database object and preset database that include based on second target database Script generation strategy generates the second database script file corresponding with second target database.
If the second instruction process unit is for the database script and described first in the second database script file Database script in database script file is identical, then is not responding to the file more new command.
As an embodiment of the present invention, server 600 further includes comparison unit.
If comparison unit is for the database script and the first database foot in the second database script file Database script in this document is not exactly the same, then by the second database script file database script with it is described Database foot in target database script file compares.
If synchronization unit 65 is also used to database script and the target data in the second database script file Database script in the script file of library is identical, then stores the target database script file to the script bank In.
As an embodiment of the present invention, synchronization unit 65 specifically includes replacement unit and storage unit.Wherein:
If replacement unit is for unique comprising unique identification and the target database script file in the script bank Identical database script file is identified, then with target database script file replacement unique identification and the target data The identical database script file of the unique identification of library script file.
If storage unit is not for including unique identification and the target database script file only in the script bank The identical database script file of one mark, then store the target database script file into the script bank.
Above as can be seen that a kind of server provided in this embodiment is being received for the database foot in script bank It is determining and to be updated into script bank from each database disposed when the file that this document is updated more new command The first object database that target database script file matches is based on preset database script generation strategy for the first mesh Mark database is converted into corresponding first database script file, carries out to the database script in database script file Data analysis, the database script in the database script and first database script file in target database script file When identical, illustrate that target database script file with the first object database disposed is corresponding, at this point, by target Database script file is stored into script bank, thus ensure that the target database script file that is finally stored in script bank with The corresponding database disposed is corresponding.
Fig. 7 be another embodiment of the present invention provides a kind of server structural block diagram.As shown in fig. 7, the embodiment Server 7 includes: processor 70, memory 71 and is stored in the memory 71 and can run on the processor 70 Computer program 72, such as database script file update method program.Processor 70 executes the computer program The step in each embodiment of update method of above-mentioned each database script file is realized when 72, such as S11 shown in FIG. 1 is extremely S15.Alternatively, the processor 70 realizes each unit in the corresponding embodiment of above-mentioned Fig. 6 when executing the computer program 72 Function, for example, the function of unit 61 to 65 shown in fig. 6, referring specifically to the associated description in the corresponding embodiment of Fig. 6, this Place does not repeat.
Illustratively, the computer program 72 can be divided into one or more units, one or more of Unit is stored in the memory 71, and is executed by the processor 70, to complete the present invention.One or more of lists Member can be the series of computation machine program instruction section that can complete specific function, and the instruction segment is for describing the computer journey Implementation procedure of the sequence 72 in the server 7.For example, the computer program 72 can be divided into instruction receiving unit, First acquisition unit, the first determination unit, the first generation unit and synchronization unit, each unit concrete function are as described above.
The server may include, but be not limited only to, processor 70, memory 71.It will be understood by those skilled in the art that Fig. 7 is only the example of server 7, does not constitute the restriction to server 7, may include than illustrating more or fewer portions Part perhaps combines certain components or different components, such as the server can also include input-output equipment, network Access device, bus etc..
Alleged processor 70 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 71 can be the internal storage unit of the server 7, such as the hard disk or memory of server 7. The memory 71 is also possible to the External memory equipment of the server 7, such as the plug-in type being equipped on the server 7 is hard Disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Further, the memory 71 can also both include the internal storage unit of the server 7 or wrap Include External memory equipment.The memory 71 is for other programs needed for storing the computer program and the server And data.The memory 71 can be also used for temporarily storing the data that has exported or will export.
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 update method of database script file characterized by comprising
Receive the file more new command for being updated to the database script file in script bank;The file more new command Carry the unique identification of the target database script file in the script bank;
Obtain the database script in the target database script file;
Based on the unique identification of the target database script file, the determining and target from each database disposed The first object database that database script file matches;
The database object and preset database script generation strategy for including based on the first object database, generation and institute State the corresponding first database script file of first object database;
If the database in database script and the first database script file in the target database script file Script is identical, then stores the target database script file into the script bank.
2. the update method of database script file according to claim 1, which is characterized in that described to be based on described first The database object and preset database script generation strategy that target database includes generate and the first object database After corresponding first database script file, further includes:
If the database in database script and the first database script file in the target database script file Script is not exactly the same, then is not responding to the file more new command.
3. the update method of database script file according to claim 2, which is characterized in that
The unique identification based on the target database script file, from each database disposed determine with it is described The first object database that target database script file matches, comprising:
Based on the unique identification of the target database script file, from each database being deployed in first database environment The first object database that middle determination and the target database script file match;
If the number in database script and the first database script file in the target database script file It is not exactly the same according to library script, then it is not responding to the file more new command, comprising:
If the database in database script and the first database script file in the target database script file Script is not exactly the same, then the determining and target database foot from each database being deployed in the second database environment The second target database that this document matches;
The database object and preset database script generation strategy for including based on second target database, generation and institute State the corresponding second database script file of the second target database;
If the database in database script and the first database script file in the second database script file Script is identical, then is not responding to the file more new command.
4. the update method of database script file according to claim 3, which is characterized in that described to be based on described second The database object and preset database script generation strategy that target database includes generate and second target database After corresponding second database script file, further includes:
If the database in database script and the first database script file in the second database script file Script is not exactly the same, then by the database script and target database script text in the second database script file Database foot in part compares;
If the database in database script and the target database script file in the second database script file Script is identical, then stores the target database script file into the script bank.
5. the update method of database script file according to claim 1-4, which is characterized in that described by institute Target database script file is stated to store into the script bank, comprising:
If in the script bank including unique identification database identical with the unique identification of the target database script file Script file, then it is unique with the target database script file replacement unique identification and the target database script file Identify the identical database script file;
If not including unique identification data identical with the unique identification of the target database script file in the script bank Library script file then stores the target database script file into the script bank.
6. a kind of server, which is characterized in that the server includes memory, processor and stores in the memory And the computer program that can be run on the processor, the processor realize following step when executing the computer program It is rapid:
Receive the file more new command for being updated to the database script file in script bank;The file more new command Carry the unique identification of the target database script file in the script bank;
Obtain the database script in the target database script file;
Based on the unique identification of the target database script file, the determining and target from each database disposed The first object database that database script file matches;
The database object and preset database script generation strategy for including based on the first object database, generation and institute State the corresponding first database script file of first object database;
If the database in database script and the first database script file in the target database script file Script is identical, then stores the target database script file into the script bank.
7. server according to claim 6, which is characterized in that the number for including based on the first object database According to library object and preset database script generation strategy, first database foot corresponding with the first object database is generated After this document, further includes:
If the database in database script and the first database script file in the target database script file Script is not exactly the same, then is not responding to the file more new command.
8. server according to claim 7, which is characterized in that it is characterized in that,
The unique identification based on the target database script file, from each database disposed determine with it is described The first object database that target database script file matches, comprising:
Based on the unique identification of the target database script file, from each database being deployed in first database environment The first object database that middle determination and the target database script file match;
If the number in database script and the first database script file in the target database script file It is not exactly the same according to library script, then it is not responding to the file more new command, comprising:
If the database in database script and the first database script file in the target database script file Script is not exactly the same, then the determining and target database foot from each database being deployed in the second database environment The second target database that this document matches;
The database object and preset database script generation strategy for including based on second target database, generation and institute State the corresponding second database script file of the second target database;
If the database in database script and the first database script file in the second database script file Script is identical, then is not responding to the file more new command.
9. server according to claim 7, which is characterized in that the number for including based on second target database According to library object and preset database script generation strategy, the second database foot corresponding with second target database is generated After this document, further includes:
If the database in database script and the first database script file in the second database script file Script is not exactly the same, then by the database script and target database script text in the second database script file Database foot in part compares;
If the database in database script and the target database script file in the second database script file Script is identical, then stores the target database script file into the script bank.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 5 of realization the method.
CN201810915165.XA 2018-08-13 2018-08-13 Database script file updating method, server and medium Active CN109213748B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810915165.XA CN109213748B (en) 2018-08-13 2018-08-13 Database script file updating method, server and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810915165.XA CN109213748B (en) 2018-08-13 2018-08-13 Database script file updating method, server and medium

Publications (2)

Publication Number Publication Date
CN109213748A true CN109213748A (en) 2019-01-15
CN109213748B CN109213748B (en) 2023-10-27

Family

ID=64987807

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810915165.XA Active CN109213748B (en) 2018-08-13 2018-08-13 Database script file updating method, server and medium

Country Status (1)

Country Link
CN (1) CN109213748B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632159A (en) * 2020-12-01 2021-04-09 腾讯科技(深圳)有限公司 Database access control method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004030689A (en) * 1998-11-20 2004-01-29 Fujitsu Ltd Device and method of operation management using guidance script, and operation management program recording medium
CN104572644A (en) * 2013-10-10 2015-04-29 北京大学 Database updating device and database updating method
US20170052776A1 (en) * 2015-08-21 2017-02-23 Tata Consultancy Services Limited Computer implemented method and system for automatically deploying and versioning scripts in a computing environment
CN106708740A (en) * 2017-01-10 2017-05-24 网易(杭州)网络有限公司 Script testing method and device
CN107844485A (en) * 2016-09-18 2018-03-27 平安科技(深圳)有限公司 The update method and device of test script file

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004030689A (en) * 1998-11-20 2004-01-29 Fujitsu Ltd Device and method of operation management using guidance script, and operation management program recording medium
CN104572644A (en) * 2013-10-10 2015-04-29 北京大学 Database updating device and database updating method
US20170052776A1 (en) * 2015-08-21 2017-02-23 Tata Consultancy Services Limited Computer implemented method and system for automatically deploying and versioning scripts in a computing environment
CN107844485A (en) * 2016-09-18 2018-03-27 平安科技(深圳)有限公司 The update method and device of test script file
CN106708740A (en) * 2017-01-10 2017-05-24 网易(杭州)网络有限公司 Script testing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632159A (en) * 2020-12-01 2021-04-09 腾讯科技(深圳)有限公司 Database access control method and device, electronic equipment and storage medium
CN112632159B (en) * 2020-12-01 2021-09-28 腾讯科技(深圳)有限公司 Database access control method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN109213748B (en) 2023-10-27

Similar Documents

Publication Publication Date Title
CN111026470B (en) System and method for verification and conversion of input data
CN105765528B (en) Method, system and medium with the application execution path trace that configurable origin defines
US8839107B2 (en) Context based script generation
US9031920B2 (en) Objects in a storage environment for connected applications
US8352913B2 (en) Generating and resolving component names in an integrated development environment
CN109542412A (en) Interface message generation method, device, computer equipment and storage medium
US20160364283A1 (en) Hierarchical fault determination in an application performance management system
US20150089415A1 (en) Method of processing big data, apparatus performing the same and storage media storing the same
CN110007906B (en) Script file processing method and device and server
CN105022694A (en) Test case generation method and system for mobile terminal test
CN111198852A (en) Knowledge graph driven metadata relation reasoning method under micro-service architecture
CN111651196B (en) Document issuing method, device and server
WO2023087721A1 (en) Service processing model generation method and apparatus, and electronic device and storage medium
CN112269588A (en) Algorithm upgrading method, device, terminal and computer readable storage medium
US9411618B2 (en) Metadata-based class loading using a content repository
CN114237754B (en) Data loading method and device, electronic equipment and storage medium
CN115794064A (en) Configuration method and device of task processing flow, electronic equipment and storage medium
US7100039B2 (en) Systems and methods for a bootstrap mechanism for software execution
CN109213748A (en) A kind of update method, server and the medium of database script file
US20240231810A9 (en) Symbol-matching between software versions
CN108108300A (en) The resource configuration detection method and device of a kind of operating system
Le Zou et al. On synchronizing with web service evolution
CN114610516A (en) Application program repairing method and device, computer equipment and storage medium
WO2021074922A1 (en) System and method for identification of web elements used in automation test case
WO2021044222A1 (en) Method and system for generating a response to an unstructured natural language (nl) query

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