CN112527904A - Automatic synchronization method and device for associated scripts, computer equipment and storage medium - Google Patents

Automatic synchronization method and device for associated scripts, computer equipment and storage medium Download PDF

Info

Publication number
CN112527904A
CN112527904A CN202011495921.1A CN202011495921A CN112527904A CN 112527904 A CN112527904 A CN 112527904A CN 202011495921 A CN202011495921 A CN 202011495921A CN 112527904 A CN112527904 A CN 112527904A
Authority
CN
China
Prior art keywords
script
target
synchronization
scripts
execution
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.)
Pending
Application number
CN202011495921.1A
Other languages
Chinese (zh)
Inventor
张延中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202011495921.1A priority Critical patent/CN112527904A/en
Publication of CN112527904A publication Critical patent/CN112527904A/en
Priority to PCT/CN2021/083757 priority patent/WO2022126918A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention discloses an automatic synchronization method and device of associated scripts, computer equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps of 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 the release time of each time consuming processing script to obtain a target script, performing 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 performing batch parallel synchronization on the plurality of script groups. The invention is based on the release process optimization technology, belongs to the technical field of operation and maintenance, can perform association grouping on target scripts with association relation, and perform batch parallel synchronization on the scripts contained in the script grouping, can ensure sequential, ordered and parallel synchronization of the scripts storing the association relation, and greatly improves the efficiency of synchronizing the association scripts.

Description

Automatic synchronization method and device for associated scripts, computer equipment and storage medium
Technical Field
The invention relates to the technical field of operation and maintenance, in particular to an automatic synchronization method and device for associated scripts, computer equipment and a storage medium.
Background
A large enterprise usually develops a large number of business applications, each application includes a plurality of scripts, and after the enterprise performs batch iterative update on a large number of applications, the application after iterative update needs to be updated synchronously in other servers. In the conventional technical method, application programs are used as a whole for synchronous updating, incidence relations exist among scripts of different application programs in practical application, namely, synchronization of a next script can be performed only after a previous script is synchronized, and the time required for synchronization of different scripts is different. Therefore, the prior art method has the problem of low synchronization efficiency when the script contained in the application program is synchronized.
Disclosure of Invention
The embodiment of the invention provides an automatic synchronization method and device of associated scripts, computer equipment and a storage medium, and aims to solve the problem of low synchronization efficiency when scripts contained in an application program are synchronized by the method in the prior art.
In a first aspect, an embodiment of the present invention provides an automatic synchronization method for associated scripts, 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 synchronization time of the same non-data processing script in the script synchronization log is not more than the release time in the script release log, and acquiring the non-data processing script of which the synchronization time is not more than the release time as a target script;
performing associated grouping on the target scripts in the script release log according to a preset grouping rule to obtain a plurality of initial script groups;
evenly distribute the spreadsheet synchronization script to the plurality of initial script packets to obtain the plurality of script packets;
and performing batch parallel synchronization on the script groups, and synchronizing the 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 associated script, including:
the log obtaining unit is used for obtaining a script issuing log from the production server and obtaining a script synchronization log from the test server if a script synchronization instruction input by an administrator is received;
the data table synchronization script generating 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 obtaining unit is used for judging whether the synchronization time of the same non-data processing script in the script synchronization log is not more than the release time in the script release log, and obtaining the non-data processing script of which the synchronization time is not more than the release time as the target script;
the initial script grouping acquisition unit is used for performing associated grouping on the target scripts in the script release log according to a preset grouping rule to obtain a plurality of initial script groups;
a script packet obtaining unit, configured to equally distribute the spreadsheet 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 the 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 on the memory and executable on the processor, where the processor, when executing the computer program, implements the method for automatically synchronizing associated scripts according to the first aspect.
In a fourth aspect, the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the method for automatically synchronizing associated scripts according to the first aspect.
The embodiment of the invention provides an automatic synchronization method and device of associated scripts, computer equipment and a storage medium. The method comprises the steps of 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 the release time of each time consuming processing script to obtain a target script, performing association grouping on the target scripts 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 performing batch parallel synchronization on the plurality of script groups to achieve synchronization of the scripts. By the method, the target scripts with the association relation can be associated and grouped, the scripts contained in the script groups are subjected to parallel synchronization in batches, the scripts for storing and verifying the association relation can be sequentially and sequentially synchronized in parallel, and the efficiency of synchronizing the associated scripts is greatly improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart illustrating an automatic synchronization method for associated scripts according to an embodiment of the present invention;
fig. 2 is a schematic view of an application scenario of an automatic synchronization method for associated scripts according to an embodiment of the present invention;
FIG. 3 is a sub-flow diagram of an automatic synchronization method for associated scripts according to an embodiment of the present invention;
FIG. 4 is a schematic view of another sub-flow of an automatic synchronization method for associated scripts according to an embodiment of the present invention;
FIG. 5 is a schematic view of another sub-flow of an associated script automatic synchronization method according to an embodiment of the present invention;
FIG. 6 is a schematic sub-flow chart of an automatic synchronization method for associated scripts according to an embodiment of the present invention;
FIG. 7 is a schematic flowchart of another method for automatically synchronizing associated scripts according to an embodiment of the present invention;
FIG. 8 is a schematic view of another sub-flow chart of an automatic synchronization method for associated scripts according to an embodiment of the present invention;
FIG. 9 is a schematic block diagram of an associated script automatic synchronization apparatus provided by an embodiment of the present invention;
FIG. 10 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "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 the specification of the present invention 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 this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic flowchart of an automatic synchronization method for an associated script according to an embodiment of the present invention, and fig. 2 is a schematic diagram of an application scenario of the automatic synchronization method for an associated script according to an embodiment of the present invention, where 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, and the management server 10 is respectively in communication connection with at least one production server 20 and at least one test server 30 to implement transmission of data information, where the management server 10 is a server side configured inside an enterprise and used for synchronizing a non-data processing script 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.
And S110, if receiving a script synchronization instruction input by an administrator, acquiring a script release log from the production server and acquiring a script synchronization log 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 administrator sets a synchronization period in advance, and the management server automatically performs script synchronization when the synchronization time point in the synchronization period is reached. Specifically, the management server acquires a script release log from the production server, and after the program developer completes application program development, the script corresponding to the application program is released to the production server, wherein the script release log is log information obtained by recording the process of releasing the script to the production server, and when the program developer releases a new version of the application program to the production server, the script release log is updated once according to the script contained in the released application program; the synchronous updating of the application program is that the issued scripts in the production server are correspondingly and synchronously updated to the test server, the script synchronous logs are log information obtained by recording the process of synchronously updating the scripts to the test server, and the scripts in the test server are synchronized once, namely the script synchronous logs are updated once according to the scripts included in the synchronous processing process.
And S120, acquiring the 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 script publishing log records the publishing process of a data processing script and a non-data processing script, the data processing script is a script for processing data information in a data table, the data processing script in the script publishing log is obtained, a data table synchronization script is correspondingly generated, and the data information in the data table processed by the data processing script can be synchronously processed more efficiently by executing the data table synchronization script.
In an embodiment, as shown in fig. 3, step S120 includes substeps S121 and S122.
S121, obtaining data table information contained in the data processing script; and 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 name, number, and type of the data table processed by the data processing script. For example, the specific information included in the data table information is table _123. sql. The data table synchronization script 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, for example, the data table synchronization script can be generated based on three data tables, namely, tabramee _123.sql, tabramee _124.sql and tabramee _125.sql, and correspondingly, the data table synchronization script is executed, so that the data information contained in the corresponding plurality of data tables can be synchronized in parallel, the database service resources can be utilized to the maximum extent to synchronize the data information, and the efficiency of synchronizing the data information in the data tables can be greatly improved.
S130, judging whether the synchronization time of the same non-data processing script in the script synchronization log is not more than the release time in the script release log, and acquiring the non-data processing script of which the synchronization time is not more than the release time as a target script.
And judging whether the synchronization time of the same non-data processing script in the script synchronization log is not more than the release time in the script release log, and acquiring the non-data processing script of which the synchronization time is not more than the release time as a target script. The non-data processing scripts contained in the test server correspond to the non-data processing scripts contained in the production server, and if the corresponding non-data processing scripts in the production server are not updated, the corresponding non-data processing scripts in the test server do not need to be updated synchronously. Specifically, the same non-data processing script includes a synchronization time in the script synchronization log, and includes an issue time in the script issue log, where the synchronization time may be a termination time for the test server to synchronize the non-data processing script, and the issue time may be a time for completing the issue of the non-data processing script in the production server, and the issue time is also an execution end time point of an execution duration for the non-data processing script to issue 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 more than the release time, the non-data processing script is a target script needing to be synchronized; if the synchronization time is greater than the release time, it indicates that the non-data processing script does not need to be synchronized currently.
S140, performing associated grouping on the target scripts in the script release log according to a preset grouping rule to obtain a plurality of initial script groups.
And performing associated grouping on the target scripts in the script release log according to a preset grouping rule to obtain a plurality of initial script groups. The script publishing log comprises related information for publishing the target scripts, the target scripts have an association relationship with each other, and in order to ensure that the target scripts can be synchronized in a batch concurrent manner without completely exhausting server resources, the target scripts can be grouped in an association manner according to a grouping rule and the script publishing log to obtain a plurality of initial script groups.
In an embodiment, the number of packets is included in the grouping rule, and as shown in fig. 4, step S140 includes sub-steps S141 and S142.
S141, obtaining 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.
When the non-data processing script is issued to the production server, one or more production libraries need to be correspondingly deployed in the production server, and the corresponding non-data processing script is issued to the deployed production libraries, the script issue log comprises the deployment time of each production library and relevant information for issuing the non-data processing script contained in each production library, the deployment time is the time point for starting the deployment of the production libraries, the corresponding associated execution sequence can be obtained according to the deployment time of each production library in the script issue log and the execution time of each target script, the execution time comprises an execution starting time point and an execution ending time point, the execution time is the time consumed in the issuing and executing process of the non-data processing script, and the execution starting time point is the time point for starting the issuing and executing of the non-data processing script, the execution ending time point is the time point at which the non-data processing script is released and executed.
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 the 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 of the production library to which the target script belongs, if so, indicating that the target script is released and executed while the production library is deployed, and then, the execution sequence of the target script is positioned at the forefront.
S1412, 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; 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 another target script.
If the execution starting time point of the target script is not consistent with the deployment time of the production library, it indicates that the target script is not issued and executed at the first time after the corresponding production library is deployed, and it may be further determined whether the target script is issued and executed after other target scripts, that is, it is determined whether the execution starting time point of the target script is consistent with the execution ending time point of another target script, if so, it indicates that the target script is actually issued and executed after the other target script is executed, and it is determined that the execution sequence of the target script is located behind the other target script.
S1414, if the execution starting time point of the target script is not consistent with the execution ending time point of any target script, determining that the execution sequence of the target script is positioned at the last; s1415, 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 positioned at the top.
If the starting execution time point of the target script is not consistent 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 at the last.
S1416, sequencing a plurality of target scripts with the same execution sequence according to the execution duration of the target scripts to obtain a corresponding associated execution sequence.
After finishing sequencing the execution sequences of all the target scripts, sequencing a plurality of target scripts with the same execution sequence again, specifically sequencing the plurality of target scripts with the same execution sequence from small to large according to the execution duration of the target scripts to obtain an associated execution sequence; the script release log also comprises the data size 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 size of the target scripts to obtain the associated execution sequence. The obtained associated execution sequence includes the sequencing information of each target script.
And 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, then a plurality of target scripts 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 batches of the initial script groups.
For example, if the number of the packets is 12, 12 target scripts are sequentially obtained 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, as shown in fig. 5, and step S140 includes sub-steps S141 and S143.
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 duration of each target script; and S143, sequentially grouping the target scripts according to the data volume threshold and the correlation execution sequence to obtain a plurality of initial script groups.
The target scripts can be sequentially grouped according to the data volume threshold and the obtained associated execution sequence to obtain a plurality of initial script groups, then a plurality of target scripts of which the data volume is not greater than the data volume threshold in the associated execution sequence can be correspondingly obtained according to the data volume threshold to serve as one initial script group, the data volume of each obtained initial script group is not greater than the data volume threshold, and the initial script groups can be numbered to determine the execution batches of the initial script groups.
For example, if the data amount threshold is 2Mb, a plurality of target scripts with data amounts not greater than 2Mb are sequentially obtained from the associated execution sequence to form an initial script group, until all the target scripts in the associated execution sequence are grouped into corresponding initial script groups.
S150, the data table synchronization script is evenly distributed to the initial script groups to obtain the script groups.
Evenly distributing the spreadsheet synchronization script to the plurality of initial script packets to obtain the plurality of script packets. The data table synchronization scripts can be evenly distributed into 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 are synchronously executed, so that the efficiency of synchronizing the non-data processing scripts and synchronizing 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 the script groups, and synchronizing the data information corresponding to each script group to the test server.
And performing batch parallel synchronization on the script groups, and synchronizing the data information corresponding to each script group to the test server. Specifically, the obtained multiple script packets may be subjected to parallel synchronization in batches, each batch only performs parallel synchronous execution on the script included in one script packet, and the multiple script packets may also be subjected to parallel synchronization in batches according to a preset execution interval time, and each interval time starts execution of the script included in the next script packet. The script groups comprise non-data processing scripts and data processing scripts, when the script groups are synchronized, all scripts contained in the script groups need to be executed synchronously and parallelly, the synchronous non-data processing scripts are used for synchronizing corresponding non-data processing scripts in the production server to the test server, the same non-data synchronous script respectively has two matched Security Identifiers (SIDs) in a production library of the production server and a test library of the test server, the Security identifier of the target script in the test server can be correspondingly obtained according to the Security identifier of the target script in the production server, and the target script is correspondingly synchronized to the test library of the test server matched with the corresponding Security identifier. For example, the security identifier of a target script in the production server is: s, APP1, system, 001.tmp, the corresponding security identifier of 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 followed by steps S170, S180, and S190.
S170, monitoring the synchronous execution process of the scripts in each script group to obtain script monitoring information; s180, judging whether the script monitoring information meets preset judgment conditions or not; and S190, if the script monitoring information meets the preset judgment condition, unlocking the database corresponding to the script of the script monitoring information.
In the process of synchronously executing the scripts included in the script packet, the synchronous execution process of each script can be monitored to obtain script monitoring information, and the obtained script monitoring information can include specific information such as script execution duration, script type and the like. And judging whether the script monitoring information meets preset judgment conditions or not, if so, indicating that the script corresponding to the script monitoring information cannot be smoothly and synchronously executed due to the problem, and unlocking a database corresponding to the script of the script monitoring information, wherein the judgment 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 the script execution time length in the script monitoring information exceeds the time threshold value; 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 judgment condition.
The monitoring information includes information such as script execution duration and script type, and can judge whether the script execution duration exceeds a time threshold in a judgment condition, for example, the configurable time threshold is 20 minutes, and if not, the synchronous execution process of the script is continuously monitored; if the result is that the script execution time length is too long, it is further determined whether the script type matches the target type keyword, for example, the target type keywords may be configured as ddl and pkg, and if the script type matches any keyword in the target type keywords, it is determined that the script type matches the target type keyword. If the script type is matched with the target type keyword, the problem that the script corresponding to the script monitoring information has resource lock in the synchronous execution process is indicated; and if the script type is not matched with the target type keyword, indicating that the script corresponding to the script monitoring information does not have the problem of resource lock.
In the synchronous execution process of part of scripts, data information in a database needs to be accessed, in order to avoid the situation that a plurality of scripts access the database at the same time, a data lock is generated in the database, and when a certain script accesses the database, the data lock is added, other scripts are forbidden to access the database at the moment. If the script has the problem of the resource lock, the script indicates that the database to be accessed by the script is added with the data lock, 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 complete the unlocking of 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 smoothly perform synchronous execution.
In the method for automatically synchronizing the associated scripts 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 and 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 subjected to associated grouping to obtain a plurality of initial script groups, the data table synchronization script is averagely distributed to the initial script groups to obtain a plurality of script groups, and the plurality of script groups are subjected to batch parallel synchronization so as to realize script synchronization. By the method, the target scripts with the association relation can be associated and grouped, the scripts contained in the script groups are subjected to parallel synchronization in batches, the scripts for storing and verifying the association relation can be sequentially and sequentially synchronized in parallel, and the efficiency of synchronizing the associated scripts is greatly improved.
The embodiment of the invention also provides an automatic synchronization device of the associated script, which is used for executing any embodiment of the automatic synchronization method of the associated script. Specifically, referring to fig. 9, fig. 9 is a schematic block diagram of an associated script automatic synchronization apparatus according to an embodiment of the present invention. The associated script automatic synchronizing means may be configured in the management server 10.
As shown in fig. 9, the associated script automatic synchronization 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 synchronization unit 160.
And a log obtaining unit 110, configured to, if a script synchronization instruction input by an administrator is received, obtain a script release log from the production server and obtain a script synchronization log from the test server.
And the data table synchronization script generating unit 120 is configured to acquire the data processing script in the script release log and generate a corresponding data table synchronization script.
In one embodiment, the data table synchronization script generating unit 120 includes sub-units: a data table information acquisition unit and a script generation unit.
A data table information acquisition unit configured to acquire data table information included in the data processing script; and the script generating unit is used for generating a corresponding data table synchronous script according to the data table information.
And the target script obtaining unit 130 is configured to determine whether a synchronization time of the same non-data processing script in the script synchronization log is not greater than an issue time in the script issue log, and obtain the non-data processing script of which the synchronization time is not greater than the issue time as the target script.
An initial script grouping obtaining unit 140, configured to perform association grouping on the target scripts in the script release log according to a preset grouping rule to obtain a plurality of initial script groups.
In one embodiment, the initial script packet obtaining unit 140 includes sub-units: and associating the execution sequence acquisition unit with the first grouping unit.
The association execution sequence acquisition unit is used for performing association grouping on the target scripts 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 quantity and the associated execution sequence to obtain a plurality of initial script groups.
In one embodiment, the initial script packet obtaining unit 140 includes sub-units: and the association execution order acquisition unit and the second grouping unit.
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 duration of each target script; and the second grouping unit is used for sequentially grouping the target scripts according to the data volume threshold and the correlation execution sequence to obtain a plurality of initial script groups.
In an embodiment, the associated execution order obtaining unit includes a sub-unit: 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 sorting processing unit.
The first judgment 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 the deployment time of the production library to which the target script belongs; a first execution sequence determining unit, configured to determine that an execution sequence of the target script is located behind another target script if an execution start time point of the target script coincides with an execution end time point of the another 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 not consistent 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 top if the execution start time point of the target script is consistent with the deployment time of the production library to which the target script belongs; and the sequencing processing unit is used for sequencing a plurality of target scripts with the same execution sequence according to the execution duration of the target scripts to obtain a corresponding associated execution sequence.
A script packet obtaining unit 150, configured to equally distribute the spreadsheet 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 one embodiment, the associated script automatic synchronization apparatus further includes 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 scripts in each script group 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 judgment condition.
In an embodiment, the script monitoring information determining unit includes a sub-unit: a script execution time length judging unit, a script type judging unit and a judging unit.
A script execution duration judging unit, configured to judge whether a script execution duration in the script monitoring information exceeds the time threshold; a script type judging unit, configured to judge whether a script type in the script monitoring information matches the target type keyword if the script execution duration 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 associated script automatic synchronization device provided by the embodiment of the invention is applied to the associated script automatic synchronization method, the script release log is obtained from the production server, the script synchronization log is obtained from the test server, the data processing script in the script release log is obtained and the data table synchronization script is correspondingly generated, the synchronization time and the release time of each time consuming processing script are judged to obtain the target script, the target script is subjected to associated grouping to obtain a plurality of initial script groups, the data table synchronization script is averagely distributed to the initial script groups to obtain a plurality of script groups, and the plurality of script groups are subjected to batch parallel synchronization so as to realize the synchronization of the scripts. By the method, the target scripts with the association relation can be associated and grouped, the scripts contained in the script groups are subjected to parallel synchronization in batches, the scripts for storing and verifying the association relation can be sequentially and sequentially synchronized in parallel, and the efficiency of synchronizing the associated scripts is greatly improved.
The above-described associated script automatic synchronization means may be implemented in the form of a computer program that 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 executing an association script automatic synchronization method for automatically synchronizing association scripts.
Referring to fig. 10, the computer device 500 includes a processor 502, a memory and a network interface 505 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 that support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of the computer program 5032 in the storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to execute the associated script automatic synchronization method.
The network interface 505 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 10 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 500 to which aspects of the present invention may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The processor 502 is configured to run the computer program 5032 stored in the memory to implement the corresponding functions of the associated script automatic synchronization method.
Those skilled in the art will appreciate that the embodiment of a computer device illustrated in fig. 10 does not constitute a limitation on the specific construction of the computer device, and that in other embodiments a computer device may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are consistent with those of the embodiment shown in fig. 10, and are not described herein again.
It should be understood that, in the embodiment of the present invention, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Wherein a 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 above-described associated script automatic synchronization method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly 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 implementation. 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 embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only a logical division, and there may be other divisions when the actual implementation is performed, or units having the same function may be grouped into one unit, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a computer-readable storage medium, which includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage media comprise: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. An automatic synchronization method of associated scripts 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 synchronization time of the same non-data processing script in the script synchronization log is not more than the release time in the script release log, and acquiring the non-data processing script of which the synchronization time is not more than the release time as a target script;
performing associated grouping on the target scripts in the script release log according to a preset grouping rule to obtain a plurality of initial script groups;
evenly distribute the spreadsheet synchronization script to the plurality of initial script packets to obtain the plurality of script packets;
and performing batch parallel synchronization on the script groups, and synchronizing the data information corresponding to each script group to the test server.
2. The method for automatically synchronizing associated scripts according to claim 1, wherein the step of acquiring the data processing scripts in the script release log and generating the corresponding data table synchronization scripts comprises the steps of:
acquiring data table information contained in the data processing script;
and generating a corresponding data table synchronous script according to the data table information.
3. The method for automatically synchronizing associated scripts according to claim 1, wherein the grouping rule includes a number of groups, and the performing associated grouping on the target scripts in the script release log according to a preset grouping rule to obtain a plurality of initial script groups includes:
acquiring the associated execution sequence of the target scripts according to the deployment time of each production library in the script release log and the execution duration of each target script;
and sequentially grouping the target scripts according to the grouping number and the associated execution sequence to obtain a plurality of initial script groups.
4. The method for automatically synchronizing associated scripts according to claim 1, wherein the grouping rule includes a data amount threshold, and the grouping of the associated scripts and the data table synchronization scripts included in each production library in the script release log according to a preset grouping rule to obtain a plurality of script groups includes:
acquiring the associated execution sequence of the target scripts according to the deployment time of each production library in the script release log and the execution duration of each target script;
and sequentially grouping the target scripts according to the data volume threshold and the associated execution sequence to obtain a plurality of initial script groups.
5. The method for automatically synchronizing associated scripts according to claim 3 or 4, wherein the execution duration comprises an execution start time point and an execution end time point, and the obtaining of the associated execution sequence of the target scripts according to the deployment time of each production library in the script release log and the execution duration of each target script comprises:
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 another 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 positioned at the forefront;
and sequencing a plurality of target scripts with the same execution sequence according to the execution duration of the target scripts to obtain a corresponding associated execution sequence.
6. The method for automatically synchronizing associated scripts according to claim 1, wherein the step of performing batch parallel synchronization on the scripts included in the plurality of script packets and synchronizing the data information corresponding to each script packet to the test server further comprises:
monitoring the synchronous execution process of the scripts in each script group to obtain script monitoring information;
judging whether the script monitoring information meets preset judgment conditions or not;
and if the script monitoring information meets the preset judgment condition, unlocking the database corresponding to the script of the script monitoring information.
7. The method for automatically synchronizing associated scripts according to claim 6, wherein the judgment conditions include a time threshold and a target type keyword, and the judgment of whether the script monitoring information meets preset judgment conditions includes:
judging whether the script execution duration 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 judgment condition.
8. An automatic synchronization apparatus for associated scripts, comprising:
the log obtaining unit is used for obtaining a script issuing log from the production server and obtaining a script synchronization log from the test server if a script synchronization instruction input by an administrator is received;
the data table synchronization script generating 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 obtaining unit is used for judging whether the synchronization time of the same non-data processing script in the script synchronization log is not more than the release time in the script release log, and obtaining the non-data processing script of which the synchronization time is not more than the release time as the target script;
the initial script grouping acquisition unit is used for performing associated grouping on the target scripts in the script release log according to a preset grouping rule to obtain a plurality of initial script groups;
a script packet obtaining unit, configured to equally distribute the spreadsheet 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 the data information corresponding to each script grouping to the test server.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the associated script automatic synchronization method according to any one of claims 1 to 7 when executing the computer program.
10. 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 execute the associated script automatic synchronization method of any one of claims 1 to 7.
CN202011495921.1A 2020-12-17 2020-12-17 Automatic synchronization method and device for associated scripts, computer equipment and storage medium Pending CN112527904A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011495921.1A CN112527904A (en) 2020-12-17 2020-12-17 Automatic synchronization method and device for associated scripts, 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 CN112527904A (en) 2020-12-17 2020-12-17 Automatic synchronization method and device for associated scripts, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112527904A true CN112527904A (en) 2021-03-19

Family

ID=75001030

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011495921.1A Pending CN112527904A (en) 2020-12-17 2020-12-17 Automatic synchronization method and device for associated scripts, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112527904A (en)
WO (1) WO2022126918A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022126918A1 (en) * 2020-12-17 2022-06-23 平安科技(深圳)有限公司 Method and apparatus for automatically synchronizing associated scripts, and computer device and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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, device, equipment and computer readable storage medium
CN111611009A (en) * 2020-05-26 2020-09-01 深圳壹账通智能科技有限公司 Database script management method and device, computer equipment and storage medium
CN112527904A (en) * 2020-12-17 2021-03-19 平安科技(深圳)有限公司 Automatic synchronization method and device for associated scripts, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022126918A1 (en) * 2020-12-17 2022-06-23 平安科技(深圳)有限公司 Method and apparatus for automatically synchronizing associated scripts, and computer device and storage medium

Also Published As

Publication number Publication date
WO2022126918A1 (en) 2022-06-23

Similar Documents

Publication Publication Date Title
EP3678346B1 (en) Blockchain smart contract verification method and apparatus, and storage medium
CN107391628B (en) Data synchronization method and device
CN109766349B (en) Task duplicate prevention method, device, computer equipment and storage medium
CN109255056B (en) Data reference processing method, device, equipment and storage medium of block chain
CN107391634B (en) Data migration method and device
CN108228799B (en) Object index information storage method and device
US20140059000A1 (en) Computer system and parallel distributed processing method
US20130031532A1 (en) Method, computer, and device for validating execution of tasks in adaptable computer systems
CN110968478A (en) Log collection method, server and computer storage medium
CN112395157A (en) Audit log obtaining method and device, computer equipment and storage medium
CN114490375A (en) Method, device and equipment for testing performance of application program and storage medium
CN110781061B (en) Method and device for recording user behavior link
US7752399B2 (en) Exclusion control method and information processing apparatus
CN112527904A (en) Automatic synchronization method and device for associated scripts, computer equipment and storage medium
CN114490554A (en) Data synchronization method and device, electronic equipment and storage medium
CN110908780B (en) Task combing method, device, equipment and storage medium of dispatching platform
US20150347402A1 (en) System and method for enabling a client system to generate file system operations on a file system data set using a virtual namespace
CN115994124A (en) File scanning method, device, electronic equipment and computer readable storage medium
CN111290700A (en) Distributed data reading and writing method and system
CN108984101B (en) Method and device for determining relationship between events in distributed storage system
CN110543459A (en) Method, system, terminal and storage medium for acquiring file lock state under NFS
CN109492422A (en) A kind of data processing method and system based on user behavior information
US20220382660A1 (en) Method and computing device for generating action history data of application and computer-readable non-transitory recording medium
CN116578247B (en) Metadata-based data access method and system
CN113553320B (en) Data quality monitoring method and device

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