CN112527904B - Automatic synchronization method and device for associated script, computer equipment and storage medium - Google Patents
Automatic synchronization method and device for associated script, computer equipment and storage medium Download PDFInfo
- Publication number
- CN112527904B CN112527904B CN202011495921.1A CN202011495921A CN112527904B CN 112527904 B CN112527904 B CN 112527904B CN 202011495921 A CN202011495921 A CN 202011495921A CN 112527904 B CN112527904 B CN 112527904B
- Authority
- CN
- China
- Prior art keywords
- script
- target
- synchronization
- execution
- scripts
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention discloses an automatic synchronization method, a device, computer equipment and a storage medium of an association script, wherein the method comprises the following steps: obtaining script release logs from a production server and script synchronization logs from a test server, obtaining data processing scripts in the script release logs and correspondingly generating data table synchronization scripts, judging the synchronization time and release time of each time-consuming processing script to obtain a target script, carrying out association grouping on the target script to obtain a plurality of initial script groups, evenly distributing the data table synchronization scripts to the initial script groups to obtain a plurality of script groups, and carrying out batch parallel synchronization on the plurality of script groups. The invention is based on the issue process optimization technology, belongs to the technical field of operation and maintenance, can carry out association grouping on target scripts with association relation, and carries out batch parallel synchronization on the scripts contained in the script grouping, thereby ensuring orderly parallel synchronization of the scripts with association relation, and greatly improving the efficiency of synchronizing the association scripts.
Description
Technical Field
The present invention relates to the field of operation and maintenance technologies, and in particular, to an automatic synchronization method and apparatus for an association script, a computer device, and a storage medium.
Background
Large enterprises usually develop a large number of business applications, each application contains a plurality of scripts, and when the enterprises perform batch iterative updating on the large number of applications, the applications after iterative updating need to be synchronously updated in other servers. In the conventional technical method, the application programs are used as a whole for synchronous updating, and in the practical application, the scripts of different application programs have association relations, namely, the synchronization of the next script can be performed after the synchronization of the previous script is completed, the time required for the synchronization of different scripts is different, the conventional technical method ignores the association relations among the scripts, and adopts a synchronous unfolding mode to synchronize a large number of scripts contained in the application programs, so that a large number of scripts with a later synchronization sequence cannot complete the synchronization in time but still occupy system resources, and the server crashes when the consumption of the server resources is over, so that the efficiency of synchronous updating of the application programs is lower. Therefore, when the script included in the application program is synchronized by the prior art method, the problem of low synchronization efficiency exists.
Disclosure of Invention
The embodiment of the invention provides an automatic synchronization method, an automatic synchronization device, computer equipment and a storage medium for associated scripts, which aim to solve the problem of low synchronization efficiency when scripts contained in an application program are synchronized by the prior art method.
In a first aspect, an embodiment of the present invention provides an automatic synchronization method for an association script, including:
If a script synchronization instruction input by an administrator is received, acquiring a script release log from the production server and acquiring a script synchronization log from the test server;
Acquiring a data processing script in the script release log and generating a corresponding data table synchronization script;
Judging whether the synchronous time of the same non-data processing script in the script synchronous log is not more than the release time of the script release log, and acquiring the non-data processing script with the synchronous time not more than the release time as a target script;
Performing association grouping on the target script in the script release log according to a preset grouping rule to obtain a plurality of initial script groups;
equally distributing the data table synchronization script to the plurality of initial script packets to obtain the plurality of script packets;
and carrying out batch parallel synchronization on a plurality of script groups, and synchronizing data information corresponding to each script group to the test server.
In a second aspect, an embodiment of the present invention provides an automatic synchronization apparatus for an association script, including:
the log acquisition unit is used for acquiring a script release log from the production server and acquiring a script synchronization log from the test server if a script synchronization instruction input by an administrator is received;
the data table synchronization script generation unit is used for acquiring the data processing script in the script release log and generating a corresponding data table synchronization script;
the target script acquisition unit is used for judging whether the synchronous time of the same non-data processing script in the script synchronous log is not more than the release time of the script release log or not, and acquiring the non-data processing script with the synchronous time not more than the release time as a target script;
the initial script grouping acquisition unit is used for carrying out association grouping on the target script in the script release log according to a preset grouping rule to obtain a plurality of initial script groupings;
A script packet obtaining unit, configured to evenly distribute the data table synchronization script to the plurality of initial script packets to obtain the plurality of script packets;
And the script grouping parallel synchronization unit is used for carrying out batch parallel synchronization on a plurality of script groupings and synchronizing data information corresponding to each script grouping to the test server.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the method for automatically synchronizing an association script according to the first aspect when the processor executes the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program when executed by a processor causes the processor to perform the method for automatically synchronizing an association script according to the first aspect.
The embodiment of the invention provides an automatic synchronization method and device for an associated script, computer equipment and a storage medium. Obtaining script release logs from a production server and script synchronization logs from a test server, obtaining data processing scripts in the script release logs and correspondingly generating data table synchronization scripts, judging the synchronization time and release time of each time-consuming processing script to obtain a target script, carrying out association grouping on the target script to obtain a plurality of initial script groups, evenly distributing the data table synchronization scripts to the initial script groups to obtain a plurality of script groups, and carrying out batch parallel synchronization on the plurality of script groups to realize synchronization on the scripts. Through the method, the target scripts with the association relation can be associated and grouped, the scripts contained in the script group are synchronized in batches and in parallel, the orderly and parallel synchronization of the scripts with the association relation can be ensured, and the efficiency of synchronizing the association scripts is greatly improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an automatic synchronization method of an association script according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an application scenario of an automatic synchronization method of an association script according to an embodiment of the present invention;
FIG. 3 is a schematic sub-flowchart of an automatic synchronization method for an associated script according to an embodiment of the present invention;
FIG. 4 is another schematic sub-flowchart of an automatic synchronization method for associated scripts according to an embodiment of the present invention;
FIG. 5 is another schematic sub-flowchart of an automatic synchronization method for associated scripts according to an embodiment of the present invention;
FIG. 6 is another schematic flow chart of an automatic synchronization method of an associated script according to an embodiment of the present invention;
FIG. 7 is another flow chart of an automatic synchronization method for associated scripts according to an embodiment of the present invention;
FIG. 8 is another schematic flow chart of an automatic synchronization method of an associated script according to an embodiment of the present invention;
FIG. 9 is a schematic block diagram of an association script automatic synchronizing device provided by an embodiment of the present invention;
fig. 10 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic flow chart of an automatic synchronization method for an associated script provided by an embodiment of the present invention, fig. 2 is a schematic application scenario of the automatic synchronization method for an associated script provided by an embodiment of the present invention, the automatic synchronization method for an associated script is applied to a management server 10, the method is executed by application software installed in the management server 10, the management server 10 is respectively in communication connection with at least one production server 20 and at least one test server 30 to realize transmission of data information, wherein the management server 10 is a server side configured in an enterprise and used for synchronizing non-data processing scripts and data table information issued in the production server 20 to the test server 30, and a user of the management server 10 is an administrator of the enterprise. As shown in fig. 1, the method includes steps S110 to S160.
S110, if a script synchronization instruction input by an administrator is received, a script issue log is obtained from the production server, and a script synchronization log is obtained from the test server.
And if a script synchronization instruction input by an administrator is received, acquiring a script release log from the production server and acquiring a script synchronization log from the test server. The administrator can input a script synchronization instruction to the management server, and the management server starts script synchronization operation; or the manager presets the synchronization period to reach the synchronization time point in the synchronization period, and the management server automatically performs script synchronization. Specifically, the management server acquires a script release log from the production server, after a program developer finishes application program development, a script corresponding to the application program is released to the production server, the script release log is log information obtained by recording the process of releasing the script to the production server, and each time the program developer releases a new version of application program to the production server, the script release log is updated once according to the script contained in the released application program; the method comprises the steps of synchronously updating an application program, namely correspondingly and synchronously updating a published script in a production server to a test server, wherein a script synchronous log is log information obtained by recording the process of synchronously updating the script to the test server, and the script in the test server is synchronously updated once, namely the script synchronous log is updated once according to the script contained in the synchronous processing process.
S120, acquiring a data processing script in the script release log and generating a corresponding data table synchronization script.
And acquiring the data processing script in the script release log and generating a corresponding data table synchronization script. The data processing script is used for processing the data information in the data table, the data processing script in the script release log is obtained, the data table synchronization script is correspondingly generated, and the data information in the data table processed by the data table synchronization script can be processed more efficiently by executing the data table synchronization script.
In one embodiment, as shown in FIG. 3, step S120 includes sub-steps S121 and S122.
S121, acquiring data table information contained in the data processing script; s122, generating a corresponding data table synchronization script according to the data table information.
Specifically, the data processing script includes data table information, which is information such as a name, a number, and a type of a data table processed by the data processing script. For example, the specific information included in the data table information is tablename _123.sql. The data table synchronization script capable of carrying out data information parallel synchronization can be generated based on the data table information, specifically, one data table synchronization script can be generated based on a plurality of data tables with the same name, the same type and different numbers of the data tables, for example, the data table synchronization script can be correspondingly generated based on three data tables of tablename _123.Sql, tablename _124.Sql and tablename _125.Sql, and then the data table synchronization script can be executed to carry out parallel synchronization on the data information contained in the corresponding plurality of data tables, so that the database service resources can be utilized to carry out data information synchronization to the greatest extent, and the efficiency of synchronous processing on the data information in the data tables can be greatly improved.
S130, judging whether the synchronous time of the same non-data processing script in the script synchronous log is not more than the release time of the script release log, and acquiring the non-data processing script with the synchronous time not more than the release time as a target script.
Judging whether the synchronous time of the same non-data processing script in the script synchronous log is not more than the release time of the script release log, and acquiring the non-data processing script with the synchronous time not more than the release time as a target script. The non-data processing script contained in the test server corresponds to the non-data processing script contained in the production server, and if the corresponding non-data processing script in the production server is not updated, synchronous updating of the corresponding non-data processing script in the test server is not needed. Specifically, the same non-data processing script includes a synchronization time in a script synchronization log, and the script release log includes a release time, where the synchronization time may be a termination time of the test server for synchronizing the non-data processing script, and the release time may be a time for completing release of the non-data processing script in the production server, that is, an execution end time point of an execution duration of the release of the non-data processing script in the production server. The synchronous time and the release time of the same non-data processing script can be compared and judged, and if the synchronous time is not greater than the release time, the non-data processing script is the target script which needs to be synchronized; if the synchronization time is greater than the release time, the non-data processing script is indicated that synchronization is not currently required.
S140, carrying out association grouping on the target script in the script release log according to a preset grouping rule to obtain a plurality of initial script groups.
And carrying out association grouping on the target script in the script release log according to a preset grouping rule to obtain a plurality of initial script groups. The script release log contains related information for releasing the target scripts, the target scripts have association relation with each other, and in order to ensure that the target scripts can be synchronized in batch concurrency without completely exhausting server resources, the target scripts can be grouped in association according to grouping rules and the script release log, so as to obtain a plurality of initial script groups.
In an embodiment, the number of packets is included in the packet rule, and as shown in fig. 4, step S140 includes sub-steps S141 and S142.
S141, acquiring the associated execution sequence of the target script according to the deployment time of each production library in the script release log and the execution time of each target script.
When the non-data processing script is released to the production server, one or more production libraries are required to be correspondingly deployed in the production server, the corresponding non-data processing script is released to the deployed production libraries, the script release log comprises the deployment time of each production library and related information for releasing the non-data processing script contained in each production library, the deployment time is the time point for starting to deploy the production libraries, the corresponding associated execution sequence can be obtained according to the deployment time of each production library in the script release log and the execution time of each target script, the execution time comprises the execution start time point and the execution end time point, the execution time is the time spent in releasing and executing the non-data processing script, the execution start time point is the time point for starting to release and execute the non-data processing script, and the execution end time point is the time point for completing the release and execution of the non-data processing script.
In one embodiment, as shown in FIG. 6, step S141 includes sub-steps S1411, S1412, S1413, S1414, S1415, and S1416.
S1411, judging whether the execution starting time point of each target script is consistent with the deployment time of a production library to which the target script belongs;
Firstly judging whether the execution starting time point of the target script is consistent with the deployment time point of the production library to which the target script belongs, if the execution starting time point of the target script is consistent with the deployment time point of the production library to which the target script belongs, indicating that the execution of the target script is started to be issued and executed while the deployment of the production library is completed, and if the execution starting time point of the target script is consistent with the deployment time point of the production library to which the target script belongs, the execution sequence of the target script is at the forefront.
S1412, if the execution start time point of the target script is inconsistent with the deployment time of the affiliated production library, judging whether the execution start time point of the target script is consistent with the execution end time point of another target script; s1413, if the execution starting time point of the target script is consistent with the execution ending time point of another target script, determining that the execution sequence of the target script is positioned behind the other target script.
If the execution starting time point of the target script is inconsistent with the deployment time of the belonging production library, the target script is indicated to be not issued and executed at the first time after the corresponding production library is deployed, whether the target script is issued and executed after other target scripts can be further judged, namely, whether the execution starting time point of the target script is consistent with the execution ending time point of another target script is judged, if so, the target script is indicated to be issued and executed after the execution of the other target script is indeed completed, and the execution sequence of the target script is determined to be positioned after the other target script.
S1414, if the execution starting time point of the target script is inconsistent with the execution ending time point of any target script, determining that the execution sequence of the target script is at the last; s1415, if the execution starting time point of the target script is consistent with the deployment time of the affiliated production library, determining that the execution sequence of the target script is positioned at the forefront.
If the starting execution time point of the target script is inconsistent with the execution ending time point of any target script, the target script can be independently executed, and the execution sequence of the target script is determined to be positioned at the last.
S1416, sorting the plurality of target scripts with the same execution sequence according to the execution time of the target scripts to obtain corresponding associated execution sequences.
After the execution sequences of all the target scripts are ordered, the plurality of target scripts with the same execution sequence can be ordered again, and specifically, the plurality of target scripts with the same execution sequence can be ordered from small to large according to the execution time length of the target scripts to obtain an associated execution sequence; the script release log also comprises the data volume of each non-data processing script, and a plurality of target scripts with the same execution sequence can be sequenced from small to large according to the data volume of the target scripts to obtain the associated execution sequence. The obtained associated execution sequence contains the ordering information of each target script.
S142, sequentially grouping the target scripts according to the grouping number and the associated execution sequence to obtain a plurality of initial script groups.
The target scripts can be sequentially grouped according to the number of the groups and the obtained associated execution sequence to obtain a plurality of initial script groups, a plurality of target scripts which are equal to the number of the groups in the associated execution sequence can be correspondingly obtained according to the number of the groups to serve as one initial script group, the number of the target scripts contained in the last initial script group is less than or equal to the number of the groups, the number of the target scripts contained in other initial script groups except the last initial script group is equal to the number of the groups, and the initial script groups can be numbered to determine the execution batch of the initial script groups.
For example, if the number of the packets is 12, 12 target scripts are sequentially acquired from the associated execution sequence to form an initial script packet, until all the target scripts in the associated execution sequence are grouped into corresponding initial script packets.
In an embodiment, the grouping rule includes a data amount threshold, and step S140 includes substeps S141 and S143, as shown in fig. 5.
S141, acquiring an associated execution sequence of each target script according to the deployment time of each production library in the script release log and the execution time of each target script; s143, sequentially grouping the target scripts according to the data quantity threshold value and the associated execution sequence to obtain a plurality of initial script groups.
The target scripts can be sequentially grouped according to the data quantity threshold and the obtained associated execution sequence to obtain a plurality of initial script groups, a plurality of target scripts with the data quantity not larger than the data quantity threshold in the associated execution sequence can be correspondingly obtained according to the data quantity threshold to serve as an initial script group, the data quantity of each obtained initial script group is not larger than the data quantity threshold, and the initial script groups can be numbered to determine the execution batch of the initial script group.
For example, if the data amount threshold is 2Mb, sequentially acquiring a plurality of target scripts with data amount not greater than 2Mb from the associated execution sequence to form an initial script packet, until all target scripts in the associated execution sequence are grouped into corresponding initial script packets.
S150, the data table synchronization scripts are evenly distributed to the plurality of initial script groups to obtain the plurality of script groups.
And evenly distributing the data table synchronization scripts to the plurality of initial script groups to obtain the plurality of script groups. The data table synchronization scripts can be evenly distributed to a plurality of initial script groups to obtain a plurality of corresponding script groups, and when the non-data processing scripts in the script groups are synchronized, the data table synchronization scripts in the script groups are synchronously executed, so that the efficiency of synchronizing the non-data processing scripts and the data information in the data table can be improved on the premise of maximally utilizing server resources.
And S160, carrying out batch parallel synchronization on a plurality of script groups, and synchronizing data information corresponding to each script group to the test server.
And carrying out batch parallel synchronization on a plurality of script groups, and synchronizing data information corresponding to each script group to the test server. Specifically, the obtained plurality of script groups may be synchronized in parallel in batches, so that each batch only performs parallel synchronization on the scripts included in one script group, or may be synchronized in parallel in batches according to a preset execution interval time, so that each interval one execution interval time starts to execute the scripts included in the next script group. The script packet includes a non-data processing script and a data processing script, when the script packet is synchronized, all scripts included in the script packet need to be executed in parallel, the synchronized non-data processing script is to synchronize corresponding non-data processing scripts in the production server to the test server, the same non-data synchronization script respectively has two matched safety identifiers (Security Identifiers, SID) in a production library of the production server and a test library of the test server, the safety identifier of a target script in the test server can be correspondingly obtained according to the safety identifier of the target script in the production server, and the target script is correspondingly synchronized to the test library matched with the corresponding safety identifier in the test server. For example, the security identifier of a certain target script in the production server is: s \APP1\system\001.Tmp, the security identifier corresponding to the target script in the test server is: c \APP1\system\001.Tmp. And synchronously executing the data processing script, namely firstly synchronizing the data processing script into the test server, and then executing the data processing script to synchronize the data information contained in the data table corresponding to the data processing script into the test server in parallel so as to realize the synchronization of the data information in the data table.
In one embodiment, as shown in fig. 7, step S160 is further followed by steps S170, S180, and S190.
S170, monitoring the synchronous execution process of the scripts in each script packet to obtain script monitoring information; s180, judging whether the script monitoring information meets preset judging conditions or not; and S190, unlocking a database corresponding to the script of the script monitoring information if the script monitoring information meets the preset judging condition.
In the process of synchronously executing the scripts included in the script packet, the synchronous executing process of each script can be monitored to obtain script monitoring information, and the obtained script monitoring information can comprise specific information such as script executing time, script type and the like. Judging whether the script monitoring information meets preset judging conditions or not, if the judging conditions are met, the script corresponding to the script monitoring information cannot be successfully and synchronously executed due to the fact that the script is problematic, and unlocking a database corresponding to the script of the script monitoring information is needed, wherein the judging conditions comprise a time threshold and a target type keyword.
In one embodiment, as shown in FIG. 8, step S170 includes sub-steps S171, S172 and S173.
S171, judging whether script execution time in the script monitoring information exceeds the time threshold; s172, if the script execution duration exceeds the time threshold, judging whether the script type in the script monitoring information is matched with the target type keyword; and S173, if the script type is matched with the target type keyword, judging that the script monitoring information meets the judging condition.
The monitoring information comprises information such as script execution time length, script type and the like, whether the script execution time length exceeds a time threshold in a judging condition or not can be judged, for example, the configurable time threshold is 20 minutes, and if the time threshold is not exceeded, the synchronous execution process of the script is continuously monitored; if the script type is matched with any keyword in the target type keywords, judging whether the script type is matched with the target type keywords. If the script type is matched with the target type keyword, indicating that the script corresponding to the script monitoring information has the problem of resource lock in the synchronous execution process; if the script type is not matched with the target type keyword, the script corresponding to the script monitoring information is indicated to have no problem of resource lock.
In the synchronous execution process of part of scripts, data information in a database is required to be accessed, the database is prevented from generating a data lock when a plurality of scripts access the database at the same time, and when the data lock is added when one script accesses the database, other scripts are prevented from accessing the database at the moment. If the script has the problem of the resource lock, the data lock is added to the database which is required to be accessed by the script, a corresponding data lock unlocking script can be generated according to the script, the data lock unlocking script is executed in the database of the script to unlock the resource lock, and after the resource lock of the database is unlocked, the corresponding script can access the data information in the unlocked database and perform synchronous execution smoothly.
In the related script automatic synchronization method provided by the embodiment of the invention, a script release log is obtained from a production server, a script synchronization log is obtained from a test server, a data processing script in the script release log is obtained, a data table synchronization script is correspondingly generated, the synchronization time and the release time of each time-consuming processing script are judged to obtain a target script, the target script is associated with a group to obtain a plurality of initial script groups, the data table synchronization script is evenly distributed to the initial script groups to obtain a plurality of script groups, and batch parallel synchronization is carried out on the plurality of script groups to realize script synchronization. Through the method, the target scripts with the association relation can be associated and grouped, the scripts contained in the script group are synchronized in batches and in parallel, the orderly and parallel synchronization of the scripts with the association relation can be ensured, and the efficiency of synchronizing the association scripts is greatly improved.
The embodiment of the invention also provides an automatic synchronization device of the association script, which is used for executing any embodiment of the automatic synchronization method of the association script. Specifically, referring to fig. 9, fig. 9 is a schematic block diagram of an automatic synchronization apparatus for association script according to an embodiment of the present invention. The association script automatic synchronization means may be configured in the management server 10.
As shown in fig. 9, the related script automatic synchronizing apparatus 100 includes a log obtaining unit 110, a data table synchronization script generating unit 120, a target script obtaining unit 130, an initial script packet obtaining unit 140, a script packet obtaining unit 150, and a script packet parallel synchronizing unit 160.
The log obtaining unit 110 is configured to obtain a script issue log from the production server and obtain a script synchronization log from the test server if a script synchronization instruction input by an administrator is received.
And the data table synchronization script generating unit 120 is configured to obtain a data processing script in the script release log and generate a corresponding data table synchronization script.
In an embodiment, the data table synchronization script generating unit 120 includes a subunit: a data table information acquisition unit and a script generation unit.
A data table information acquisition unit for acquiring data table information contained in the data processing script; and the script generating unit is used for generating a corresponding data table synchronization script according to the data table information.
And the target script acquisition unit 130 is configured to determine whether the synchronization time of the same non-data processing script in the script synchronization log is not greater than the release time of the script release log, and acquire the non-data processing script with the synchronization time not greater than the release time as the target script.
And the initial script packet obtaining unit 140 is configured to perform association packet on the target script in the script issue log according to a preset packet rule to obtain a plurality of initial script packets.
In an embodiment, the initial script packet acquisition unit 140 includes a subunit: an execution sequence acquisition unit and a first grouping unit are associated.
The associated execution sequence acquisition unit is used for carrying out associated grouping on the target script in the script release log according to a preset grouping rule to obtain a plurality of initial script groups; and the first grouping unit is used for sequentially grouping the target scripts according to the grouping number and the associated execution sequence to obtain a plurality of initial script groups.
In an embodiment, the initial script packet acquisition unit 140 includes a subunit: an execution sequence acquisition unit and a second packet unit are associated.
The associated execution sequence acquisition unit is used for acquiring the associated execution sequence of the target script according to the deployment time of each production library in the script release log and the execution time of each target script; and the second grouping unit is used for sequentially grouping the target scripts according to the data quantity threshold and the associated execution sequence to obtain a plurality of initial script groups.
In an embodiment, the association execution order acquisition unit includes a subunit: the device comprises a first judging unit, a second judging unit, a first execution sequence determining unit, a second execution sequence determining unit, a third execution sequence determining unit and a sequencing processing unit.
The first judging unit is used for judging whether the execution starting time point of each target script is consistent with the deployment time of the production library to which the target script belongs; a second judging unit, configured to judge whether an execution start time point of the target script is consistent with an execution end time point of another target script if the execution start time point of the target script is inconsistent with a deployment time of the belonging production library; a first execution sequence determining unit, configured to determine that an execution sequence of the target script is located after another target script if an execution start time point of the target script is consistent with an execution end time point of the other target script; a second execution sequence determining unit, configured to determine that the execution sequence of the target script is located at the last if the execution start time point of the target script is inconsistent with the execution end time point of any one of the target scripts; a third execution sequence determining unit, configured to determine that the execution sequence of the target script is located at the forefront if the execution start time point of the target script is consistent with the deployment time of the affiliated production library; and the sequencing processing unit is used for sequencing the plurality of target scripts with the same execution sequence according to the execution time of the target scripts to obtain the corresponding associated execution sequence.
And a script packet obtaining unit 150, configured to evenly distribute the data table synchronization script to the plurality of initial script packets to obtain the plurality of script packets.
And a script packet parallel synchronization unit 160, configured to perform batch parallel synchronization on a plurality of script packets, and synchronize data information corresponding to each script packet to the test server.
In an embodiment, the association script automatic synchronization device further comprises a subunit: the device comprises a script monitoring information acquisition unit, a script monitoring information judgment unit and a database unlocking unit.
The script monitoring information acquisition unit is used for monitoring the synchronous execution process of the script in each script packet to obtain script monitoring information; the script monitoring information judging unit is used for judging whether the script monitoring information meets preset judging conditions or not; and the database unlocking unit is used for unlocking the database corresponding to the script of the script monitoring information if the script monitoring information meets the preset judging condition.
In an embodiment, the script monitoring information judging unit includes a subunit: script execution duration judging unit, script type judging unit and judging unit.
The script execution time length judging unit is used for judging whether the script execution time length in the script monitoring information exceeds the time threshold value; the script type judging unit is used for judging whether the script type in the script monitoring information is matched with the target type keyword or not if the script execution time exceeds the time threshold; and the judging unit is used for judging that the script monitoring information meets the judging condition if the script type is matched with the target type keyword.
The automatic associated script synchronization device provided by the embodiment of the invention applies the automatic associated script synchronization method, obtains the script release log from the production server and obtains the script synchronization log from the test server, obtains the data processing scripts in the script release log and correspondingly generates the data table synchronization scripts, judges the synchronization time and the release time of each time-consuming processing script to obtain a target script, carries out associated grouping on the target script to obtain a plurality of initial script groups, distributes the data table synchronization scripts to the initial script groups to obtain a plurality of script groups, and carries out batch parallel synchronization on the plurality of script groups so as to realize script synchronization. Through the method, the target scripts with the association relation can be associated and grouped, the scripts contained in the script group are synchronized in batches and in parallel, the orderly and parallel synchronization of the scripts with the association relation can be ensured, and the efficiency of synchronizing the association scripts is greatly improved.
The above-described association script automatic synchronizing apparatus may be implemented in the form of a computer program which can be run on a computer device as shown in fig. 10.
Referring to fig. 10, fig. 10 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device may be an association server 10 for performing an association script automatic synchronization method to automatically synchronize an association script.
Referring to fig. 10, the computer device 500 includes a processor 502, a memory, and a network interface 505, which are connected by a system bus 501, wherein the memory may include a storage medium 503 and an internal memory 504, wherein the storage medium may be a volatile storage medium or a non-volatile storage medium.
The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform an associated script auto-synchronization method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform an associated script auto-synchronization method.
The network interface 505 is used for network communication, such as providing for transmission of data information, etc. It will be appreciated by those skilled in the art that the structure shown in FIG. 10 is merely a block diagram of some of the structures associated with the present inventive arrangements and does not constitute a limitation of the computer device 500 to which the present inventive arrangements may be applied, and that a particular computer device 500 may include more or fewer components than shown, or may combine certain components, or may have a different arrangement of components.
The processor 502 is configured to execute a computer program 5032 stored in a memory, so as to implement the corresponding functions in the above-mentioned association script automatic synchronization method.
Those skilled in the art will appreciate that the embodiment of the computer device shown in fig. 10 is not limiting of the specific construction of the computer device, and in other embodiments, the computer device may include more or less components than those shown, or certain components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may include only a memory and a processor, and in such embodiments, the structure and function of the memory and the processor are consistent with the embodiment shown in fig. 10, and will not be described again.
It should be appreciated that in embodiments of the present invention, the Processor 502 may be a central processing unit (Central Processing Unit, CPU), the Processor 502 may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSPs), application SPECIFIC INTEGRATED Circuits (ASICs), off-the-shelf Programmable gate arrays (Field-Programmable GATEARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a non-volatile or volatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program when executed by a processor implements the steps included in the association script automatic synchronization method described above.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus, device and unit described above may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein. Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units is merely a logical function division, there may be another division manner in actual implementation, or units having the same function may be integrated into one unit, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or part of what contributes to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a computer-readable storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.
Claims (7)
1. An automatic synchronization method of association script is applied to a management server, the management server is connected with at least one production server and at least one test server through a network to transmit data information, and the method is characterized by comprising the following steps:
If a script synchronization instruction input by an administrator is received, acquiring a script release log from the production server and acquiring a script synchronization log from the test server;
Acquiring a data processing script in the script release log and generating a corresponding data table synchronization script;
Judging whether the synchronous time of the same non-data processing script in the script synchronous log is not more than the release time of the script release log, and acquiring the non-data processing script with the synchronous time not more than the release time as a target script;
Performing association grouping on the target script in the script release log according to a preset grouping rule to obtain a plurality of initial script groups;
The data table synchronization scripts are distributed to the plurality of initial script groups in an average mode to obtain a plurality of script groups;
carrying out batch parallel synchronization on a plurality of script groups, and synchronizing data information corresponding to each script group to the test server;
The grouping rule includes the grouping number, and the performing association grouping on the target script in the script issuing log according to the preset grouping rule to obtain a plurality of initial script groups includes:
acquiring an associated execution sequence of each target script according to the deployment time of each production library in the script release log and the execution time of each target script;
sequentially grouping the target scripts according to the grouping number and the associated execution sequence to obtain a plurality of initial script groups;
The grouping rule includes a data amount threshold, and the grouping the association script and the data table synchronization script included in each production library in the script release log according to the preset grouping rule to obtain a plurality of script groups includes:
acquiring an associated execution sequence of each target script according to the deployment time of each production library in the script release log and the execution time of each target script;
sequentially grouping the target scripts according to the data quantity threshold value and the associated execution sequence to obtain a plurality of initial script groups;
The execution duration includes an execution start time point and an execution end time point, and the acquiring the associated execution sequence of the target script according to the deployment time of each production library in the script release log and the execution duration of each target script includes:
Judging whether the execution starting time point of each target script is consistent with the deployment time of the production library to which the target script belongs;
If the execution starting time point of the target script is inconsistent with the deployment time of the production library, judging whether the execution starting time point of the target script is consistent with the execution ending time point of another target script;
if the execution starting time point of the target script is consistent with the execution ending time point of another target script, determining that the execution sequence of the target script is positioned behind the other target script;
if the execution starting time point of the target script is inconsistent with the execution ending time point of any target script, determining that the execution sequence of the target script is positioned at the last;
If the execution starting time point of the target script is consistent with the deployment time of the production library, determining that the execution sequence of the target script is at the forefront;
And sequencing the plurality of target scripts with the same execution sequence according to the execution time length of the target scripts to obtain the corresponding associated execution sequence.
2. The method for automatically synchronizing associated scripts according to claim 1, wherein the steps of obtaining the data processing scripts in the script issue log and generating the corresponding data table synchronization scripts include:
acquiring data table information contained in the data processing script;
and generating a corresponding data table synchronization script according to the data table information.
3. The automatic synchronization method of associated scripts according to claim 1, wherein after performing batch parallel synchronization on scripts included in the plurality of script packets and synchronizing data information corresponding to each script packet to the test server, the method further comprises:
monitoring the synchronous execution process of the script in each script packet to obtain script monitoring information;
Judging whether the script monitoring information meets preset judging conditions or not;
and if the script monitoring information meets the preset judging condition, unlocking a database corresponding to the script of the script monitoring information.
4. The automatic synchronization method of associated scripts according to claim 3, wherein the judging conditions include a time threshold and a target type keyword, and the judging whether the script monitoring information satisfies a preset judging condition includes:
judging whether script execution time length in the script monitoring information exceeds the time threshold;
If the script execution duration exceeds the time threshold, judging whether the script type in the script monitoring information is matched with the target type keyword;
and if the script type is matched with the target type keyword, judging that the script monitoring information meets the judging condition.
5. An association script automatic synchronisation device, characterized in that it is adapted to perform the method of any of claims 1-4, the device comprising:
the log acquisition unit is used for acquiring a script release log from the production server and acquiring a script synchronization log from the test server if a script synchronization instruction input by an administrator is received;
the data table synchronization script generation unit is used for acquiring the data processing script in the script release log and generating a corresponding data table synchronization script;
the target script acquisition unit is used for judging whether the synchronous time of the same non-data processing script in the script synchronous log is not more than the release time of the script release log or not, and acquiring the non-data processing script with the synchronous time not more than the release time as a target script;
the initial script grouping acquisition unit is used for carrying out association grouping on the target script in the script release log according to a preset grouping rule to obtain a plurality of initial script groupings;
a script packet obtaining unit, configured to evenly distribute the data table synchronization script to the plurality of initial script packets to obtain a plurality of script packets;
And the script grouping parallel synchronization unit is used for carrying out batch parallel synchronization on a plurality of script groupings and synchronizing data information corresponding to each script grouping to the test server.
6. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the association script automatic synchronization method of any of claims 1 to 4 when the computer program is executed by the processor.
7. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, causes the processor to perform the associated script automatic synchronization method of any of claims 1 to 4.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011495921.1A CN112527904B (en) | 2020-12-17 | 2020-12-17 | Automatic synchronization method and device for associated script, computer equipment and storage medium |
PCT/CN2021/083757 WO2022126918A1 (en) | 2020-12-17 | 2021-03-30 | Method and apparatus for automatically synchronizing associated scripts, and computer device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011495921.1A CN112527904B (en) | 2020-12-17 | 2020-12-17 | Automatic synchronization method and device for associated script, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112527904A CN112527904A (en) | 2021-03-19 |
CN112527904B true CN112527904B (en) | 2024-08-02 |
Family
ID=75001030
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011495921.1A Active CN112527904B (en) | 2020-12-17 | 2020-12-17 | Automatic synchronization method and device for associated script, computer equipment and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112527904B (en) |
WO (1) | WO2022126918A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112527904B (en) * | 2020-12-17 | 2024-08-02 | 平安科技(深圳)有限公司 | Automatic synchronization method and device for associated script, computer equipment and storage medium |
TWI864454B (en) * | 2022-10-14 | 2024-12-01 | 英業達股份有限公司 | System for batched updating test flow script |
CN115860968A (en) * | 2022-12-14 | 2023-03-28 | 中电金信软件(上海)有限公司 | Batch processing method and device of accounting tasks, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101932999A (en) * | 2007-12-20 | 2010-12-29 | 汇丰技术股份有限公司 | Automated methods and systems for developing and deploying projects in parallel |
CN106951362A (en) * | 2015-09-18 | 2017-07-14 | Fmr有限责任公司 | To the real-time monitoring of computer system processor and affairs performance during ongoing performance test |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9430506B2 (en) * | 2012-12-19 | 2016-08-30 | Accenture Global Services Limited | Enterprise migration planning information repository |
CN103617176B (en) * | 2013-11-04 | 2017-03-15 | 广东电子工业研究院有限公司 | One kind realizes the autosynchronous method of multi-source heterogeneous data resource |
CN105787077B (en) * | 2016-03-02 | 2020-05-15 | 百度在线网络技术(北京)有限公司 | Data synchronization method and device |
US10289409B2 (en) * | 2017-03-29 | 2019-05-14 | The Travelers Indemnity Company | Systems, methods, and apparatus for migrating code to a target environment |
CN107908631B (en) * | 2017-07-25 | 2021-04-20 | 平安科技(深圳)有限公司 | Data processing method, data processing device, storage medium and computer equipment |
CN111367883A (en) * | 2020-02-25 | 2020-07-03 | 平安科技(深圳)有限公司 | Data synchronization method, apparatus, device, and computer-readable storage medium |
CN111611009A (en) * | 2020-05-26 | 2020-09-01 | 深圳壹账通智能科技有限公司 | Database script management method and device, computer equipment and storage medium |
CN112527904B (en) * | 2020-12-17 | 2024-08-02 | 平安科技(深圳)有限公司 | Automatic synchronization method and device for associated script, computer equipment and storage medium |
-
2020
- 2020-12-17 CN CN202011495921.1A patent/CN112527904B/en active Active
-
2021
- 2021-03-30 WO PCT/CN2021/083757 patent/WO2022126918A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101932999A (en) * | 2007-12-20 | 2010-12-29 | 汇丰技术股份有限公司 | Automated methods and systems for developing and deploying projects in parallel |
CN106951362A (en) * | 2015-09-18 | 2017-07-14 | Fmr有限责任公司 | To the real-time monitoring of computer system processor and affairs performance during ongoing performance test |
Also Published As
Publication number | Publication date |
---|---|
CN112527904A (en) | 2021-03-19 |
WO2022126918A1 (en) | 2022-06-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112527904B (en) | Automatic synchronization method and device for associated script, computer equipment and storage medium | |
EP3678346B1 (en) | Blockchain smart contract verification method and apparatus, and storage medium | |
CN108874552B (en) | Distributed lock execution method, device and system, application server and storage medium | |
US10635473B2 (en) | Setting support program, setting support method, and setting support device | |
US10225145B2 (en) | Method and device for updating client | |
US9189357B2 (en) | Generating machine state verification using number of installed package objects | |
CN104461693B (en) | Virtual machine update method and system under a kind of desktop cloud computing environment | |
KR20060079078A (en) | Server Queuing Systems and Methods | |
CN109218401B (en) | Log collection method, system, computer device and storage medium | |
CN110263048B (en) | Method and device for processing large-batch data, computer equipment and storage medium | |
CN106648994B (en) | Method, equipment and system for backing up operation log | |
CN110581887B (en) | Data processing method, device, block chain node and storage medium | |
US20180225147A1 (en) | Resource allocation method and apparatus | |
CN110968478A (en) | Log collection method, server and computer storage medium | |
US7752399B2 (en) | Exclusion control method and information processing apparatus | |
CN111026711A (en) | Block chain based data storage method and device, computer equipment and storage medium | |
CN110263551A (en) | A kind of test method and device | |
CN109791541A (en) | Log serial number generation method, device and readable storage medium storing program for executing | |
CN105791350B (en) | Project data processing method and system | |
CN108650320B (en) | Method for synchronizing configuration files of isomorphic cascading equipment in cluster environment | |
CN108958967A (en) | A kind of method and server of data processing | |
US10318207B1 (en) | Apparatus and methods for inter-version replication checking | |
CN116578247B (en) | Metadata-based data access method and system | |
CN113297263A (en) | Data processing method, device, system, electronic equipment and storage medium | |
CN116244089A (en) | Deadlock risk detection method, deadlock risk detection device, computer 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 |