Summary of the invention
The technology for the production configuration reflux that this application involves a kind of in software issuing process.
According to a first aspect of the present application, a kind of method for producing configuration reflux is provided, comprising:
All production configurations are obtained from production configuration equipment;
Production configuration and being locally configured in the publication branch that is locally configured in equipment that will acquire be compared with
Check for difference, in which:
If there is difference, then by the differential synchronization into the publication branch described in be locally configured, then by institute
Described be locally configured stated in publication branch is merged into being locally configured in the main split being locally configured in equipment.
According to a second aspect of the present application, a kind of distribution platform for producing configuration reflux is provided, comprising:
Timed task processor, the timed task processor are configured as:
All production configurations are obtained from production configuration equipment;
Production configuration and being locally configured in the publication branch that is locally configured in equipment that will acquire be compared with
Check for difference, in which:
If there is difference, then by the differential synchronization into the publication branch described in be locally configured.
According to the third aspect of the application, provide it is a kind of produce configuration reflux equipment is locally configured, be configured as:
After the timed task processor as described in second aspect in distribution platform completes differential synchronization, it will issue
Being locally configured in branch is merged into being locally configured in main split.
According to the fourth aspect of the application, a kind of production configuration equipment for producing configuration reflux is provided, is configured as:
According to the request that the timed task processor come in distribution platform described in second aspect freely issues, by itself
All productions configuration be sent to the timed task processor, and
It is configured according to received from the being locally configured update production being locally configured in the main split that equipment is issued.
According to the fourth aspect of the application, a kind of computer readable storage medium for being stored with instruction is provided, when described
Instruction is performed so that machine executes method as described in relation to the first aspect.
According to the 5th of the application the aspect, a kind of computer system is provided, including for executing as described in relation to the first aspect
Method device.
Partial capability of this application " is being developed, subsequent to have partial function real in the project in environment " center " project
It is existing.
This general introduction is provided to introduce some concepts further described in detailed description below in simplified form.This
The key features or essential features for being not intended to mark claimed subject are summarized, are intended to be used to limit claimed
The range of theme.
Specific embodiment
Before the scheme of the application is commented in beginning face, involved several terms are introduced first to facilitate technology people
The understanding of member.
GIT: the system that a kind of pair of data carry out version management, it is the distributed version control system of an open source, can
With effective, high speed processing from very little to very big Item version management.
Configuration reflux: refer to and the configuration in production environment is written to the local operation stored.
Solve conflict: refer to the same configuration, changed in multiple branches respectively, artificial choosing is needed when merging
Select the situation that a version merges.
Production environment: refer to and is supplied to the true environment that user uses.
After the meaning for having understood above-mentioned term, to keep the objectives, technical solutions, and advantages of the present invention more clear bright
White, invention is further described in detail hereinafter, referring to the drawings and the embodiments,.
Firstly, the exemplary production environment of the application is shown in FIG. 1.As shown in Figure 1, the production environment packet
It includes distribution platform 110, equipment 120, production configuration 130 three parts of equipment composition is locally configured.The distribution platform 110, local
Configuration equipment 120, production configuration equipment 130 can calculate equipment, such as personal computer, server, client, mobile device
(such as mobile phone, personal digital assistant, plate etc.) and various other calculating equipment etc. are constituted.Between each equipment, lead to
Cross network carry out data communication, the network includes various types of wired and wireless networks, including but not limited to internet,
Local area network, WIFI, WLAN, cellular communications networks (GPRS, CDMA, 2G/3G/4G/5G cellular network), satellite communication network etc.
Deng.By the data communication network, distribution platform 110, be locally configured equipment 120, production configuration equipment 130 can mutually pass
Various data are sent to realize that configuration synchronizes.
Specifically, the major function of distribution platform 110 is to complete the merging of the configuration between the reflux of configuration, branch, match
Data between setting are synchronous and publication configures etc..The function that equipment 120 is locally configured is: it is locally stored and management objectives configures,
The configuration is stored in the library GIT of home environment in the context of this application, but it is understood that other databases can also
For in the scheme of the application.And produce configuration equipment 130 and can be one or more equipment, it is distributed in each of production environment
Place, is stored with the configuration of production environment operation, and each production configuration equipment 130 safeguards a corresponding configuration.
After having understood the example production environment of the application, the life of the application is discussed in detail in conjunction with the production environment
Produce the basic procedure of the scheme of configuration reflux.Firstly, those skilled in the art has bulking property understanding to scheme for convenience, it is right
Essential Environment configuration of the invention and basic procedure are summarized to facilitate technical staff to have a general conception.It is in this programme
It is easy to understand, is illustrated using GIT file system as example context, but it is understood that the file system is not
It is confined to GIT, other configurations file system can be used in the scheme of the application.In order to preferably be described, we will
It is stored in the configuration being locally configured in equipment 120 referred to as " to be locally configured ", and the configuration in production configuration equipment 130 will be stored in
Referred to as " production configuration ", to distinguish the two.Then, in the GIT file system being locally configured in equipment 120 respectively
Create the branch of for example entitled " publication (release_config) " and the branch of for example entitled " main (master) ".It is somebody's turn to do " publication "
The effect of branch is eternal synchronous with production configuration holding at each production configuration equipment 130.And the effect of " master " branch is
By by the productions configuration from multiple production branches be locally configured that be combined to keep to be locally configured be newest (namely real
The purpose of now production configuration reflux), and issue out described be locally configured completing to can choose after producing configuration reflux
It goes.It should be understood that the title of the branch can be changed according to the needs of developer, it is not limited to this.In addition, issuing
A timed task processor is provided on platform 110, and primary configuration reflux stream is executed with for example every 5 minutes frequencies triggering
Journey, to remain that it is newest for being locally configured.The timing can be adjusted according to business scenario.Also, when exploitation
When person needs to issue latest configuration at once, timed task processor described in manual actuation can also be provided to execute configuration reflux stream
The function of journey.
Presently in connection with Fig. 2, to the basic procedure for realizing production configuration reflux according to one embodiment of the application
It is described in detail.
Firstly, in step 1, by the timed task processor every five minutes automatic processes for executing primary production configuration reflux.
Certainly the process of production configuration reflux can also be initiated with manual actuation timed task processor when developer needs.
In step 2, the request of timed task processor obtains its production configuration from production configuration equipment 130.Acquired
The production configuration that production configuration can be whole production configurations or change.In step 2.1, the production configures equipment 130
Configuration, which is produced, according to request returns to timed task processor.
In a preferred embodiment, if having configuration data in the production configuration obtained in step 2 and being locally configured
The format being locally configured in equipment 120 is incompatible, then can first carry out according to the format being locally configured to production configuration
Format converts (step 3).
In step 4, timed task processor will be in the production configuration and the publication branch being locally configured in equipment 120
It is locally configured and is compared, the publication branch remains with the previous production obtained in the process that previous production configuration flows back
Configuration can be found that difference present in current production configuration and previously production configuration by the comparison, and by all differences
In the different configuration for being synchronized to publication branch.The differential synchronization, which refers to, configures production in the process that this produces configuration reflux
In change be synchronized to required newly-increased content, the content of update, the content of deletion in publication being locally configured of branch, with true
It is consistent always with the content of production configuration to protect being locally configured for publication branch.It is alternatively possible to provide step 4.1 to appoint to timing
Business processor feeds back whether the differential synchronization successfully indicates.In addition, if difference is not present in new and old two kinds of production configuration,
Without executing subsequent step 5-9, but execute reflux course as shown in Figure 3.
In step 5, after the completion of differential synchronization, being locally configured for publication is merged into being locally configured of main split,
It is middle to clash both scenes in the presence of production configuration change Lothrus apterus and production configuration change.When there are configuration conflicts for merging
When (step 7), after initiating to merge request (step 6), collision message is sent to the responsible person (owner) of configuration, is responsible for
People, which liquidates to advance by leaps and bounds to go, solves (step 7.1), initiates to merge request (step 7.2) again after having solved, finally merges and complete (step
8).And when production configuration is without change or configuration change Lothrus apterus is produced then after initiating to merge request (step 8.1), merge
(step 9 and 9) can be done directly.Specific reflux course about the scene will have in attached Figure 4 and 5 respectively respectively
Body description.So far, the reflux course for producing configuration has been completed.After terminating the reflux, developer can be begun preparing
Newest be locally configured of main split is published in production environment, process is as follows:
In step 10, begins preparing and carry out publication configuration.
In step 11, needing to check again for publication branch and current newest production configuration when preparing publication whether there is
Difference.Illustrate the production configuration produced during the execution of this configuration reflux configure in equipment 130 quilt again if variant
Therefore change terminates publication.It only can just continue following step when indifference.Main split is locally configured at this time
It is newest content, distribution platform 110 can obtain newest content when doing configuration publication in main split, then configure this
It is published in production environment.In this way, it is therefore prevented that the case where change has occurred again simultaneously in production configuration in issuing process.
In step 12, distribution platform 110 requests it to be locally configured to main split, and receives in step 12.1 from main split and send out
That send is locally configured.
In step 13, being locally configured for the main split comprising latest configuration content is published to production ring by distribution platform 110
In border.
So far, it in step 14, issues process and also completes.
The basic procedure for realizing production configuration reflux of the application is described in above-mentioned process.It will be appreciated that
The process is to comprehensive description of the scheme of production configuration reflux, and not all in the process are necessary.Such as when
When the processing speed of step 1-10 is sufficiently fast, a possibility that being changed, is minimum again for the production configuration in production configuration equipment 130, because
This, in step 11 check again for publication branch be locally configured with production configuration whether there is difference operation can be saved
Slightly.
On the other hand, as set forth above, it is possible to which there are multiple productions to configure equipment 130, in the case, in step 4,
Being locally configured in publication branch can be compared with each production configuration from multiple production configuration equipment 130 respectively,
And the difference compared is aggregated into total variances to be merged into main split.
After the basic procedure for describing the configuration reflux, flowing back with regard to the configuration referred in above-mentioned process, there are three kinds
Flow back scene, provides following method flow (note that the process is suitable by time order and function from left to right respectively in connection with attached drawing 3-4
Sequence occurs):
Production configuration is without change scene (see Fig. 3):
1. production environment does not change at this time, that is, production obtained is configured and being issued in step 4
Discovery is there is no change in the comparison being locally configured in branch, and at this moment, timed task processor does not need that reflux will be configured
Into publication branch;
2. main split in the process of development normally changes configuration, such as k=1 is become k=2;
3. can be operated by normal configuration publication process, the k=2 in being locally configured of main split is published to production
In environment, production configuration equipment according to received from be locally configured in the main split that equipment is issued being locally configured update its give birth to
Produce configuration;
4. timed task processor is then by being synchronized to publication branch for the production configuration in production environment, to guarantee
Being locally configured in publication branch is consistent with production configuration.
It produces configuration change Lothrus apterus scene (see Fig. 4):
1. the production configuration of such scene is changed, need that the change of production configuration is flowed back into and is locally configured.Than
There are two production configuration it is respectively k=1, v=2 as original, becomes k=2, v=2 after changing in production.
2. configuration change k=1, v=3 also occur for local main split, because the configuration content of modification is different, the change on both sides
It will not more occur to merge conflict.
3. timed task processor compares the configuration of publication branch and the difference triggering configuration reflux of production configuration at this time,
The configuration k=2, v=2 of production are synchronized to publication branch, therefore, the Configuration Values for issuing branch become k=2, v=2.
4. timed task processor initiates branch's merging request after completing configuration reflux, the configuration for issuing branch is merged into
Main split, thus, main split is newest to be locally configured as k=2, v=3.
5. being locally configured for main split is published to production environment when distribution platform 110 carries out configuration publication, production configuration
It is changed to k=2, v=3.
6. timed task processor finds that production configuration is changed again, difference change is flowed back into publication point
Branch, so that it, which is locally configured, also becomes k=2, v=3, to complete the work of entire configuration reflux.
Production configuration change has conflict scene (see Fig. 5):
1. there is the case where manually changing production configuration at production configuration equipment 130, k=1 is changed to k=2.
2. main split is changed to k=3 by k=1 for being locally configured also due to normal exploitation needs.
3. timed task processor is by production configuration with being locally configured in publication branch it was found that producing configuration hair
It changes more, k=2 is flowed back into publication branch by the reflux of triggering configuration at this time, is issued being locally configured for branch at this time and is changed to k=2.
4. distribution platform 110 is completed to initiate merging for publication branch and main split after configuration reflux, due to both this
K value in ground configuration is respectively 2 and 3, will occur to merge conflict at this time.After clashing, distribution platform 110 can be to configuration
Responsible person initiates message, and configuration responsible person is allowed to solve conflict.What configuration responsible person administered different regions respectively is locally configured equipment
120, when equipment 120 is locally configured in the presence of conflict is merged, associated configuration responsible person can be from the k=2 to conflict at present
Or value after as merging is chosen in k=3.After Conflict solving, configuration responsible person initiates to merge again, final to send out
Being locally configured for cloth branch is integrated into being locally configured for main split.
5. assuming that the value after this Conflict solving is k=3 (configuration responsible person has selected 3 values as k), then work as distribution platform
110 will be published to being locally configured for k=3 in production environment when doing the publication configured, and then, production configuration equipment is according to connecing
It receives to be locally configured certainly in the main split that equipment is issued and update its production configuration k=3 is locally configured, to complete entirely configuration
The process of reflux and publication.Specific descriptions based on above-mentioned process, it is possible to understand that this programme at least has following advantages:
1) it solves the fault due to human factor generation and the configuration of mistake is published in production environment and then is led
The problem of causing fault in production.In can guarantee that the configuration change of production environment is synchronized in time by this scheme and being locally configured.
2) by the Git version management ability being locally configured, accomplish the configuration for configuring and locally developing of production environment all
It is to merge well, so that reach main split is locally configured the target for saving newest most complete configuration.
3) mechanism that configure guarantee synchronous for one of Git system local publication branch and production has innovatively been used, it can be with
Effectively production is configured and carries out Code management.The merging between branch can be easily carried out by Code management,
The configuration for issuing branch can be can be used as production configuration by ground connection, be provided simultaneously with the ability of Code management.
4) it may determine that production configuration with the presence or absence of the row of change compared with producing configuration by the configuration of publication branch
For, and change is synchronized to local match by timed task processor every 5 minutes (time can be configured according to business scenario)
In setting.
5) after completing production configuration reflux and exploitation change is locally configured, distribution platform can be used will be newest
Configuration be published in production environment, it can configuration reflux basis on complete production environment configuration publication.
6) innovation has used a set of mechanism to solve to merge in configuration reflux course with being locally configured in normal development process
Scene gives the solution of three kinds of merging scenes.
Although the foregoing describe different embodiments, but it is to be understood that they are intended only as example rather than limit.
(all) those skilled in the relevant art will be appreciated that, without departing from spirit and model of the invention as defined in the appended claims
In the case where enclosing, it can be carry out various modifications in terms of form and details.Therefore, the width and model of the invention disclosed herein
Enclosing should not be limited by above-mentioned disclosed exemplary embodiment, and should be according only to the appended claims and its equivalent replacement
To define.