CN106371881A - Method and system for updating program versions in servers - Google Patents

Method and system for updating program versions in servers Download PDF

Info

Publication number
CN106371881A
CN106371881A CN201610810259.1A CN201610810259A CN106371881A CN 106371881 A CN106371881 A CN 106371881A CN 201610810259 A CN201610810259 A CN 201610810259A CN 106371881 A CN106371881 A CN 106371881A
Authority
CN
China
Prior art keywords
server
program
code library
files
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610810259.1A
Other languages
Chinese (zh)
Other versions
CN106371881B (en
Inventor
张利平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yangtze River Collaborative Innovation Technology Research Institute (Suzhou) Co.,Ltd.
Original Assignee
Wuhan Douyu Network Technology 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201610810259.1A priority Critical patent/CN106371881B/en
Publication of CN106371881A publication Critical patent/CN106371881A/en
Application granted granted Critical
Publication of CN106371881B publication Critical patent/CN106371881B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the field of Internet, and discloses a method for updating program versions in servers. The method comprises the following steps: S1, acquiring branches of a code library, and acquiring configuration items associated with the branches; S2, establishing connections with one or more servers in the code library according to the addresses of the servers in the acquired configuration items; S3, traversing files in the servers which are connected with the code library, judging whether a single server includes feature files for indicating version number information of a current version of a program in the server or not, and updating all or a part of latest version files to file uploading lists corresponding to the servers; S4, deploying the files in the file uploading lists into the corresponding servers. The invention further discloses a system for updating the program versions in the servers. The method and the system have high program updating processes, and support simultaneous program updating of a plurality of servers.

Description

A kind of method and system for server internal program version updating
Technical field
The present invention relates to Internet field and in particular to a kind of method for server internal program version updating and A kind of system for server internal program version updating.
Background technology
Developing rapidly with Internet technology, All Around The World is connected by the server of the various places that spread all over the world, and people pass through Various smart machines access the program of different servers, thus enjoying convenient intelligent life, meanwhile, many in order to meet people The demand of sample and the needs of test research and development, programming personnel needs periodically the version of server Program to be upgraded, will The program code writing in code library is deployed in server, thus completing to server Program version and function more Newly.Existing server Program version updating mode, is that the program of the latest edition having editted in code library is all The whole code of file is deployed in server, and whole deployment speed is slow, and single code library cannot be simultaneously to multiple servers Carry out code deployment, edition upgrading cannot be carried out to the program in multiple servers simultaneously.
Content of the invention
For defect present in prior art, it is an object of the invention to provide a kind of be used for server internal program version The method updating and a kind of system for server internal program version updating, whole renewal process speed is fast, and supports simultaneously Multiple servers are entered with line program update.
For reaching object above, the present invention adopts the technical scheme that: the method comprises the following steps:
Step s1: obtain the branch of code library, and obtain the configuration item associated by branch, at least one, described branch, And each branch associates a configuration item, each configuration item includes at least a server address, each server address corresponding Server;
Step s2: according to the address of server in the configuration item obtaining, build between code library and one or more server Vertical connection;
Step s3: traversal sets up the file in the server being connected with code library, judges whether contain in individual server In order to show the tag file of the version number information of server internal program current version, if not containing tag file in server, Then the All Files of latest edition program in code library is loaded in this server corresponding upload listed files, if server In contain tag file, then by the institute of current version program in the All Files of latest edition program in code library and this server There is file to be contrasted, obtain differential file, and differential file is loaded in this server corresponding upload listed files;
Step s4: be deployed to uploading the file in listed files in corresponding server.
On the basis of technique scheme, described code library and server pass through distributed version control software and set up even Connect.
On the basis of technique scheme, in described step s1: obtain code by calling the interface of libgit2 instrument The branch in storehouse, described libgit2 instrument is used for providing application programming interface to distributed version control software.
On the basis of technique scheme, if containing tag file in server, call connecing of libgit2 instrument Mouthful, it is right that the All Files of the All Files of latest edition program in code library and current version program in this server is carried out Ratio obtains differential file.
On the basis of technique scheme, described differential file is the All Files phase of latest edition program in code library The file increasing newly and changing compared with the All Files of current version program in server.
On the basis of technique scheme, described step s4 particularly as follows:
The compressing file in list will be uploaded, call secure copy function, by the files passe after compression to corresponding with service In device and decompress.
On the basis of technique scheme, the method also includes: is deployed to correspondence when uploading the file in listed files Server in after, obtain in code library and show the version number information of latest edition program, and upload to after generating tag file In server.
The present invention also provides a kind of system for server version renewal, and this system includes: code library, at least one service Device and control end;
Contain latest edition program in described code library, and described code library includes at least one branch, each customs station Join a configuration item, each configuration item includes at least a server address, each server address corresponds to a server;
Described server is contained within current version program;
Described control end is used for obtaining the configuration item corresponding to the branch of code library and code library, and according in configuration item Server address, code library is connected with one or more servers, then judge whether to contain in individual server in order to Show the tag file of the version number information of server internal program current version, if not containing tag file in server, will In code library, the All Files of latest edition program is deployed in this server, if containing tag file in server, will generation In code storehouse, the All Files of latest edition program is contrasted with the All Files of current version program in this server, poor Different article part, and differential file is deployed in server.
On the basis of technique scheme, described control end be additionally operable to by code library in order to show latest edition program The tag file of version number information be deployed in server.
Compared with prior art, a kind of advantage of method for server internal program version updating of the present invention is: Because of a configuration item associated by each branch of code library, switch different branches, different configuration items can be corresponded to, and configuration item is equal To there being specific server, so that code library can be attached with multiple servers simultaneously, thus give multiple simultaneously Program in server carries out version updating, effectively shortens program and updates the time, simultaneously for the service containing tag file Device, then it is right to carry out the All Files of the All Files of latest edition program in code library and current version program in this server Ratio only file that is newly-increased and changing is deployed in server, reduces the transmission quantity of data, shortens server internal program further The renewal time.Can also support to discharge certain according to the demand of configuration item, when carrying out version updating to the program in server A little files and fixed packet contain some files.
A kind of advantage of system for server internal program version updating of the present invention is: for working as in server Front version program, by comparing with the latest edition program in code library, only updates discrepant file, whole renewal process letter List and renewal speed is fast.
Brief description
Fig. 1 is a kind of flow chart of the method for server internal program version updating of the present invention.
Specific embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail.
The present invention provides a kind of method for server internal program version updating, will latest edition journey in code library Sequence is deployed in server, current version program in server is updated or upgrades, and the update method of the present invention is passed through to divide Cloth Version Control software completes, and in the present embodiment, distributed version control software is git.Shown in Figure 1, the method has Body comprises the following steps:
Step s1: call the interface of libgit2 instrument, obtain the branch of code library, and obtain the configuration associated by branch , at least one, the branch of code library, and each branch associates a configuration item, each configuration item includes at least a server Address, each server address corresponds to a server.Libgit2 instrument is generally used for providing to distributed version control software answers Use Program Interfaces.Configuration item specifically includes: the user name of server, server address (or the deployment road of server Footpath), previous task, rearmounted task, discharge listed files, comprise listed files and server list, server list is The number of the server corresponding to this configuration item, if corresponding multiple servers, the user name server of corresponding server Address number is also multiple, and the user name of all corresponding server of each server, a server address, a previous task, One rearmounted task, a discharge listed files and comprise listed files.Previous task be in server program update before, right The preprocessing process of latest edition program in code library, such as to the inspection of program file, check and correction etc..Rearmounted task is ought be After redaction program is deployed in server, to work such as the debugging of program.Discharge listed files and be deployed to certain clothes for program It is impossible to the file that is deployed in this server when in business device.When comprising listed files and being deployed in certain server for program, must The file in this server need be deployed to.
Step s2: according to the configuration item obtaining, judging whether be configured with previous task in configuration item, if having, first carrying out Previous task, the then user name according to the address server of server in the configuration item obtaining, in distributed version control Under the control of software, set up between code library and corresponding server and be connected, specifically, code library is entered with one or more servers Row connect, thus reach the purpose that multiple servers are carried out with program version renewal simultaneously, simultaneously because each configuration item all with divide It is incidence relation, that is, correspond, so also achieve that corresponding server carries out version updating to different branches simultaneously Purpose.
Step s3: traversal sets up the file in the server being connected with code library, judges whether contain in individual server In order to show server internal program current version version number information tag file it is generally the case that tag file is present in At the path position of server, that is, server is used at the deployment path that is connected with code library, and the form of tag file is 40 The character string of letter or number composition, if not containing tag file in server, does not have program before illustrating in this server, because And need the All Files of latest edition program in code library is loaded in this server corresponding upload listed files, if clothes Business device in contain tag file, then call the interface of libgit2 instrument, by the All Files of latest edition program in code library with In this server, the All Files of current version program is contrasted, and obtains differential file, and differential file is up-to-date in code library The file that the All Files of version program increases newly and changes compared to the All Files of current version program in server, then will Differential file is loaded in this server corresponding upload listed files.Each server is all to should have a upload listed files.
Step s3: for the file uploading in listed files, the configuration item according to corresponding server requires, in upper transmitting file Add the file comprising to require in listed files in list and reject the file discharging requirement in listed files, then will upload File in listed files is compressed, and calls scp function, by the files passe after compression in corresponding server, will The files passe uploading in listed files after compression, to this corresponding individual server of upload listed files, and uses Ssh order decompresses, and scp function is a safe transmission function based on safety data transmission agreement, can be in different computers Or between server, replicating file and catalogue, ssh is a security protocol creating on the basis of application layer and transport layer, permissible Safe executes various orders for server.After having decompressed, call the interface of libgit2 instrument again, obtain table in code library The version number information of bright latest edition program, and upload onto the server after being generated tag file, if the joining of this server Put and in item, be configured with rearmounted task, then execute rearmounted task.For multiple servers, each of which uploads listed files and server Between upload listed files in file upload mode, all carry out by this step s3.
The server internal program method for updating edition of the present invention, the configuration item according to associated by branch is so that code library energy Enough it is attached with multiple servers, thus carry out version updating to the program in multiple servers simultaneously, effectively shorten program The renewal time, simultaneously for the server containing tag file, then by the All Files of latest edition program in code library with should In server, the All Files of current version program is contrasted, and only file that is newly-increased and changing is deployed in server, enters One step shortens the renewal time of program.
The present invention also provides a kind of system updating for server version of employing said method, and this system includes code Storehouse, at least one server and control end;
Contain latest edition program in code library, and code library also includes at least one branch, each branch association one is joined Put item, each configuration item includes at least a server address, each server address corresponds to a server;Server is contained within Current version program;Control end is used for obtaining the configuration item corresponding to the branch of code library and code library, and according to configuration item In server address, code library is connected with one or more servers, whether then judges in individual server containing useful To show the tag file of the version number information of server internal program current version, if not containing tag file in server, The All Files of latest edition program in code library is deployed in this server, if containing tag file in server, will In code library, the All Files of latest edition program and the All Files of current version program in this server are contrasted, and obtain Differential file, and differential file is deployed in server, finally again by code library in order to show the version of latest edition program The tag file of this number information is deployed in server.Latest edition program file, before being deployed to server, also needs basis The configuration item of corresponding server requires, and adds the file comprising to require in listed files and rejecting to discharge in listed files and require File, be then deployed in server again, thus completing the version updating to one or more server internal programs simultaneously.
The present invention is not limited to above-mentioned embodiment, for those skilled in the art, without departing from On the premise of the principle of the invention, some improvements and modifications can also be made, these improvements and modifications are also considered as the protection of the present invention Within the scope of.The content not being described in detail in this specification belongs to prior art known to professional and technical personnel in the field.

Claims (9)

1. a kind of method for server internal program version updating is it is characterised in that the method comprises the following steps:
Step s1: obtain the branch of code library, and obtain the configuration item associated by branch, at least one, described branch, and often Individual branch associates a configuration item, and each configuration item includes at least a server address, the corresponding service of each server address Device;
Step s2: according to the address of server in the configuration item obtaining, the company of foundation between code library and one or more server Connect;
Step s3: traversal and the file in the code library server that is connected of foundation, judge whether to contain in individual server in order to Show the tag file of the version number information of server internal program current version, if not containing tag file in server, will In code library, the All Files of latest edition program is loaded in this server corresponding upload listed files, if containing in server There is tag file, then by all literary compositions of the All Files of latest edition program in code library and current version program in this server Part is contrasted, and obtains differential file, and differential file is loaded in this server corresponding upload listed files;
Step s4: be deployed to uploading the file in listed files in corresponding server.
2. as claimed in claim 1 a kind of method for server internal program version updating it is characterised in that: described code Storehouse is passed through the foundation of distributed version control software with server and is connected.
3. as claimed in claim 2 a kind of method for server internal program version updating it is characterised in that described step In s1: obtain the branch of code library by calling the interface of libgit2 instrument, described libgit2 instrument is used for distributed version This control software provides application programming interface.
4. as claimed in claim 2 a kind of method for server internal program version updating it is characterised in that: if server In contain tag file, then call the interface of libgit2 instrument, by the All Files of latest edition program in code library and this clothes In business device, the All Files of current version program is contrasted, and obtains differential file.
5. as claimed in claim 1 a kind of method for server internal program version updating it is characterised in that: described difference File is that the All Files of latest edition program in code library increases newly compared to the All Files of current version program in server File with modification.
6. as claimed in claim 1 a kind of method for server internal program version updating it is characterised in that described step S4 particularly as follows:
The compressing file in list will be uploaded, call secure copy function, by the files passe after compression in corresponding server And decompress.
7. as claimed in claim 1 a kind of method for server internal program version updating it is characterised in that the method also Including: after the file in upload listed files is deployed in corresponding server, obtains in code library and show latest edition journey The version number information of sequence, and upload onto the server after generating tag file.
8. a kind of based on claim 1 methods described for the system of server internal program version updating it is characterised in that should System includes: code library, at least one server and control end;
Contain latest edition program in described code library, and described code library includes at least one branch, each branch association one Configuration item, each configuration item includes at least a server address, and each server address corresponds to a server;
Described server is contained within current version program;
Described control end is used for obtaining the configuration item corresponding to the branch of code library and code library, and according to the clothes in configuration item Business device address, code library is connected with one or more servers, then judges whether contain in individual server to show The tag file of the version number information of server internal program current version, if not containing tag file in server, by code In storehouse, the All Files of latest edition program is deployed in this server, if containing tag file in server, by code library The All Files of middle latest edition program is contrasted with the All Files of current version program in this server, obtains difference literary composition Part, and differential file is deployed in server.
9. as claimed in claim 8 a kind of system for server version renewal it is characterised in that: described control end is also used In will be deployed in server in order to show the tag file of the version number information of latest edition program in code library.
CN201610810259.1A 2016-09-08 2016-09-08 Method and system for updating program version in server Active CN106371881B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610810259.1A CN106371881B (en) 2016-09-08 2016-09-08 Method and system for updating program version in server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610810259.1A CN106371881B (en) 2016-09-08 2016-09-08 Method and system for updating program version in server

Publications (2)

Publication Number Publication Date
CN106371881A true CN106371881A (en) 2017-02-01
CN106371881B CN106371881B (en) 2020-01-03

Family

ID=57899006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610810259.1A Active CN106371881B (en) 2016-09-08 2016-09-08 Method and system for updating program version in server

Country Status (1)

Country Link
CN (1) CN106371881B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107193607A (en) * 2017-05-26 2017-09-22 网易(杭州)网络有限公司 Method and apparatus, storage medium, processor and terminal for updating code file
CN108345467A (en) * 2017-03-14 2018-07-31 平安科技(深圳)有限公司 The update method and device of edition tree file
CN108376082A (en) * 2018-01-10 2018-08-07 链家网(北京)科技有限公司 A kind of reference library method for updating edition and system
CN108984413A (en) * 2018-07-24 2018-12-11 浙江数链科技有限公司 Branch code management method and device
CN109032641A (en) * 2018-07-24 2018-12-18 杭州安恒信息技术股份有限公司 Application version update method and device
CN109460252A (en) * 2018-09-25 2019-03-12 中国平安人寿保险股份有限公司 Configuration file processing method, device and computer equipment based on git
CN109753301A (en) * 2018-12-06 2019-05-14 东软集团股份有限公司 Application system dispositions method, device, storage medium and electronic equipment
CN110365809A (en) * 2019-07-23 2019-10-22 中南民族大学 Distributed server address configuration system and method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6801617B1 (en) * 1999-09-16 2004-10-05 Mci, Inc. Method and apparatus for providing data to switching elements in a communications system
CN103763354A (en) * 2014-01-06 2014-04-30 北京奇虎科技有限公司 Method and device for downloading upgrading data
CN104216727A (en) * 2013-06-04 2014-12-17 腾讯科技(深圳)有限公司 Application upgrading method and system
CN104991790A (en) * 2015-06-09 2015-10-21 北京奇虎科技有限公司 Upgrade release method and apparatus of file
CN105224344A (en) * 2014-05-28 2016-01-06 济南政和科技有限公司 A kind of software upgrading file configuration method realized based on XML
CN105743680A (en) * 2014-12-11 2016-07-06 深圳云之家网络有限公司 Cluster disposition method and disposition device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6801617B1 (en) * 1999-09-16 2004-10-05 Mci, Inc. Method and apparatus for providing data to switching elements in a communications system
CN104216727A (en) * 2013-06-04 2014-12-17 腾讯科技(深圳)有限公司 Application upgrading method and system
CN103763354A (en) * 2014-01-06 2014-04-30 北京奇虎科技有限公司 Method and device for downloading upgrading data
CN105224344A (en) * 2014-05-28 2016-01-06 济南政和科技有限公司 A kind of software upgrading file configuration method realized based on XML
CN105743680A (en) * 2014-12-11 2016-07-06 深圳云之家网络有限公司 Cluster disposition method and disposition device
CN104991790A (en) * 2015-06-09 2015-10-21 北京奇虎科技有限公司 Upgrade release method and apparatus of file

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108345467A (en) * 2017-03-14 2018-07-31 平安科技(深圳)有限公司 The update method and device of edition tree file
CN108345467B (en) * 2017-03-14 2021-04-16 平安科技(深圳)有限公司 Version tree file updating method and device
CN107193607A (en) * 2017-05-26 2017-09-22 网易(杭州)网络有限公司 Method and apparatus, storage medium, processor and terminal for updating code file
CN107193607B (en) * 2017-05-26 2021-06-22 网易(杭州)网络有限公司 Method and apparatus for updating code file, storage medium, processor, and terminal
CN108376082A (en) * 2018-01-10 2018-08-07 链家网(北京)科技有限公司 A kind of reference library method for updating edition and system
CN108376082B (en) * 2018-01-10 2021-09-17 贝壳找房(北京)科技有限公司 Reference library version updating method and system
CN108984413A (en) * 2018-07-24 2018-12-11 浙江数链科技有限公司 Branch code management method and device
CN109032641A (en) * 2018-07-24 2018-12-18 杭州安恒信息技术股份有限公司 Application version update method and device
CN109460252A (en) * 2018-09-25 2019-03-12 中国平安人寿保险股份有限公司 Configuration file processing method, device and computer equipment based on git
CN109460252B (en) * 2018-09-25 2023-10-20 中国平安人寿保险股份有限公司 Configuration file processing method and device based on git and computer equipment
CN109753301A (en) * 2018-12-06 2019-05-14 东软集团股份有限公司 Application system dispositions method, device, storage medium and electronic equipment
CN110365809A (en) * 2019-07-23 2019-10-22 中南民族大学 Distributed server address configuration system and method

Also Published As

Publication number Publication date
CN106371881B (en) 2020-01-03

Similar Documents

Publication Publication Date Title
CN106371881A (en) Method and system for updating program versions in servers
CN102622241B (en) A kind of method for upgrading software and device
CN103298016B (en) the test system of mobile terminal
CN105760184B (en) A kind of method and apparatus of charging assembly
CN112270149B (en) Verification platform automatic integration method and system, electronic equipment and storage medium
CN104750528B (en) A kind of assembly management method and apparatus in Android program
CN107193607B (en) Method and apparatus for updating code file, storage medium, processor, and terminal
CN106227605A (en) The dynamic micro services expansion method of a kind of multilingual cloud compiling and device
CN106557339A (en) The upgrade method and device of equipment firmware
CN104615462B (en) Cross-platform Mobile solution generation service end and system
CN104836843A (en) Client application program updating method and device
CN108279922A (en) Differential file generation method, upgrade method and system based on the differential file
CN107025108B (en) Exporting hierarchical data from a Source Code Management (SCM) system to a Product Lifecycle Management (PLM) system
CN107038519B (en) Method and system for bidirectional data synchronization between systems
CN105468373A (en) Branch merging method and device
CN106921731A (en) Leak restorative procedure and device
CN106503158A (en) Method of data synchronization and device
CN109814877A (en) Project dispositions method and its device based on environmental management
CN103955429B (en) Determine the method and device of regression test scope
CN108776592A (en) A kind of method, apparatus of page makeup, equipment and storage medium
CN109002314A (en) Oftware updating method, device, electronic equipment and storage medium
CN106294099A (en) A kind of method of testing and equipment
CN106919426A (en) A kind of method of multipath server FPGA version synchronizations
KR101599471B1 (en) Apparatus, system, method and readable recording medium of managing a project file
CN107193582B (en) Publishing method and system

Legal Events

Date Code Title Description
C06 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231030

Address after: No. 280, Huangpujiang Road, Southeast Street, Changshu City, Suzhou City, Jiangsu Province, 215500

Patentee after: Yangtze River Collaborative Innovation Technology Research Institute (Suzhou) Co.,Ltd.

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.